11---
2- import { Client } from ' @notionhq/client' ;
3- import {
4- getSecret
5- } from ' astro:env/server'
6- const databaseId = getSecret (' NOTION_MEMBERS_DATABASE_ID' );
7- const apiKey = getSecret (' NOTION_TOKEN' );
8- console .log (databaseId , apiKey );
9- if (databaseId && apiKey ) {
10- const notion = new Client ({
11- auth: apiKey ,
12- })
13- try {
14- const data = await notion .dataSources .query ({
15- data_source_id: databaseId ,
16- });
17- console .log (" [Notion] Members DB query result:" , data );
18- } catch (error ) {
19- console .error (" [Notion] Query failed" , error );
20- }
21- } else {
22- console .warn (" [Notion] Missing NOTION_MEMBERS_DATABASE_ID or API key env var" );
2+ interface Logo {
3+ name: string ;
4+ logo: string ;
5+ website: string ;
236}
7+
8+ const logos: Logo [] = (await import (" ../data/logos.json" )).default ;
249---
2510
2611<section class =" pb-12 md:pb-16 lg:pb-20" >
@@ -37,25 +22,43 @@ if (databaseId && apiKey) {
3722 class =" absolute top-0 right-0 bottom-0 z-10 w-20 bg-gradient-to-l from-accent-lightest-2 to-transparent"
3823 >
3924 </div >
40- <div class =" flex shrink-0 animate-marquee items-center" >
41- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo1.svg" />
42- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo2.svg" />
43- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo3.svg" />
44- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo4.svg" />
45- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo5.svg" />
46- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo6.svg" />
47- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo7.svg" />
48- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo8.svg" />
25+ <div class =" flex shrink-0 animate-marquee items-center gap-12" >
26+ {
27+ logos .map ((logo ) => (
28+ <a
29+ href = { ` //${logo .website .replace (/ ^ https? :\/\/ / , ' ' ).replace (/ ^ www\. / , ' ' )} ` }
30+ target = " _blank"
31+ rel = " noopener noreferrer"
32+ class = " mx-6 flex h-12 w-32 shrink-0 items-center justify-center md:h-14 md:w-40"
33+ >
34+ <img
35+ class = " max-h-full max-w-full object-contain"
36+ src = { logo .logo }
37+ alt = { logo .name }
38+ loading = " lazy"
39+ />
40+ </a >
41+ ))
42+ }
4943 </div >
50- <div class =" flex shrink-0 animate-marquee items-center" >
51- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo1.svg" />
52- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo2.svg" />
53- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo3.svg" />
54- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo4.svg" />
55- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo5.svg" />
56- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo6.svg" />
57- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo7.svg" />
58- <img class =" mx-6 max-h-12 shrink-0 md:max-h-14" src =" /assets/logo8.svg" />
44+ <div class =" flex shrink-0 animate-marquee items-center gap-12" >
45+ {
46+ logos .map ((logo ) => (
47+ <a
48+ href = { ` //${logo .website .replace (/ ^ https? :\/\/ / , ' ' ).replace (/ ^ www\. / , ' ' )} ` }
49+ target = " _blank"
50+ rel = " noopener noreferrer"
51+ class = " mx-6 flex h-12 w-32 shrink-0 items-center justify-center md:h-14 md:w-40"
52+ >
53+ <img
54+ class = " max-h-full max-w-full object-contain"
55+ src = { logo .logo }
56+ alt = { logo .name }
57+ loading = " lazy"
58+ />
59+ </a >
60+ ))
61+ }
5962 </div >
6063 </div >
6164 </div >
0 commit comments