diff --git a/package.json b/package.json index c9528de3..3f1d7857 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@emotion/styled": "^11.14.0", "@fillout/react": "^1.1.6", "@github/time-elements": "^4.0.0", - "@hackclub/icons": "^0.0.14", + "@hackclub/icons": "^0.0.15", "@hackclub/markdown": "^0.0.43", "@hackclub/meta": "1.1.32", "@hackclub/theme": "^0.3.3", diff --git a/pages/arcade/index.js b/pages/arcade/index.js index f8bb3640..e27831d6 100644 --- a/pages/arcade/index.js +++ b/pages/arcade/index.js @@ -1906,31 +1906,42 @@ export async function getStaticProps() { .readdirSync(stickersDir) .filter(sticker => sticker !== 'hero.jpg') - const items = await shopParts() + let carousel = [] + let highlightedItems = [] - const carousel = items - .map(record => ({ - hours: record['Cost Hours'] || 0, - imageURL: record['Image URL'] || '', - enabledCarousel: record['Enabled Carousel'] || false - })) - .filter(item => item.enabledCarousel) - .filter(item => item.imageURL !== '') + // Only fetch shop data if API key is available + if (process.env.AIRTABLE_API_KEY) { + try { + const items = await shopParts() - const highlightedItems = items - .filter(item => item['Enabled Highlight']) - .sort((_a, _b) => Math.random() - 0.5 > 0) - .map(record => ({ - // id: record['ID'], - 'Image URL': record['Image URL'] || null, - Name: record['Name'] || null, - 'Small Name': record['Small Name'] || null, - 'Full Name': record['Full Name'] || null, - 'Cost Hours': record['Cost Hours'] || null, - Description: record['Description'] || null, - 'Fulfillment Description': record['Fulfillment Description'] || null, - 'Extra tags': record['Extra tags'] || [] - })) + carousel = items + .map(record => ({ + hours: record['Cost Hours'] || 0, + imageURL: record['Image URL'] || '', + enabledCarousel: record['Enabled Carousel'] || false + })) + .filter(item => item.enabledCarousel) + .filter(item => item.imageURL !== '') + + highlightedItems = items + .filter(item => item['Enabled Highlight']) + .sort((_a, _b) => Math.random() - 0.5 > 0) + .map(record => ({ + 'Image URL': record['Image URL'] || null, + Name: record['Name'] || null, + 'Small Name': record['Small Name'] || null, + 'Full Name': record['Full Name'] || null, + 'Cost Hours': record['Cost Hours'] || null, + Description: record['Description'] || null, + 'Fulfillment Description': record['Fulfillment Description'] || null, + 'Extra tags': record['Extra tags'] || [] + })) + } catch (error) { + console.error('Airtable fetch failed:', error) + } + } else { + console.log('AIRTABLE_API_KEY not defined, using empty shop data') + } return { props: { diff --git a/pages/arcade/shop.js b/pages/arcade/shop.js index e67072a2..353bc4ff 100644 --- a/pages/arcade/shop.js +++ b/pages/arcade/shop.js @@ -331,27 +331,37 @@ export default function Shop({ } export async function getStaticProps() { - const props = {} + const props = { + availableItems: [] // Default to empty array + } - await Promise.all([ - shopParts().then(items => { - const availableItems = items.filter((item) => item['Enabled']).map(item => ({ - 'Name': item['Name'] || null, - 'Small Name': item['Small Name'] || null, - 'Full Name': item['Full Name'] || null, - 'Description': item['Description'] || null, - 'Fulfillment Description': item['Fulfillment Description'] || null, - 'Cost Hours': item['Cost Hours'] || 0, - id: item.id, - 'Image URL': item['Image URL'] || null, - 'Max Order Quantity': item['Max Order Quantity'] || 1, - Stock: item['Stock'] >= 0 ? item['Stock'] : null, - Category: item['Category'] || '' - })) - - props.availableItems = availableItems - }) - ]) + // Only fetch shop data if API key is available + if (process.env.AIRTABLE_API_KEY) { + try { + const items = await shopParts() + + props.availableItems = items + .filter((item) => item['Enabled']) + .map(item => ({ + 'Name': item['Name'] || null, + 'Small Name': item['Small Name'] || null, + 'Full Name': item['Full Name'] || null, + 'Description': item['Description'] || null, + 'Fulfillment Description': item['Fulfillment Description'] || null, + 'Cost Hours': item['Cost Hours'] || 0, + id: item.id, + 'Image URL': item['Image URL'] || null, + 'Max Order Quantity': item['Max Order Quantity'] || 1, + Stock: item['Stock'] >= 0 ? item['Stock'] : null, + Category: item['Category'] || '' + })) + } catch (error) { + console.error('Airtable fetch failed:', error) + // availableItems remains empty array + } + } else { + console.log('AIRTABLE_API_KEY not defined, using empty shop data') + } return { props, revalidate: 10 } -} +} \ No newline at end of file diff --git a/pages/fiscal-sponsorship/index.js b/pages/fiscal-sponsorship/index.js index 81fa89be..2037cde4 100644 --- a/pages/fiscal-sponsorship/index.js +++ b/pages/fiscal-sponsorship/index.js @@ -312,6 +312,19 @@ export default function Page() { Apply now + + + Join SharkBank! + + + {/* First Section */} +
+ Buildings + + {/* Billboard */} + +
+ Billboard +
+ + Welcome to SharkBank! + + + The Sharks (aka HCB) are ready to invest in YOUR nonprofit. Proposals are officially open to try and earn a spot + pitching your nonprofit mission to our panel of judges. Win up to $1000 in funds to propel your mission forward. + +
+
+
+
+ + {/* Second Section */} +
+ {/* Banners */} + + Banner-1 + + + Banner-2 + +
+ + {/* Third Section */} +
+ {/* Text */} + + + + HCB is hosting its first ever competition, SharkBank! Win up to $1000 in funding to propel your mission out to sea! + + + Get ready for an exciting opportunity to pitch your organization’s + mission to a panel of HCB teen judges. + + + Win up to $1000 in funding to propel your mission out to sea! + + + + +
+
+ Shark +
+
+ Sign + + Sign up now! + + + + +
+
+
+ + Shark + +
+ + ) +} + +// Tablet Mode +function TabletMode() { + const [isSmallScreen, setIsSmallScreen] = useState(false) + + useEffect(() => { + const handleResize = () => { + setIsSmallScreen(window.innerWidth < 815) + } + handleResize() + window.addEventListener('resize', handleResize) + return () => window.removeEventListener('resize', handleResize) + }, []) + + return ( + <> +
+ +
+ Billboard +
+ + Welcome to SharkBank! + + + The Sharks (aka HCB) are ready to invest in YOUR nonprofit. Proposals are officially open to try and earn a spot + pitching your nonprofit mission to our panel of judges. Win up to $1000 in funds to propel your mission forward. + +
+
+
+
+ +
+ + Banner-1 + + + Banner-1 + +
+ +
+ {/* Text */} + + + + HCB is hosting its first ever competition, SharkBank! Win up to $1000 in funding to propel your mission out to sea! + + + Get ready for an exciting opportunity to pitch your organization’s + mission to a panel of HCB teen judges. + + + Win up to $1000 in funding to propel your mission out to sea! + + + + +
+
+ Shark +
+
+ Sign + + Sign up now! + + + + +
+
+
+ + Shark + +
+ + ) +} + +function MobileMode() { + const [isSmallScreen, setIsSmallScreen] = useState(false) + + useEffect(() => { + const checkScreen = () => setIsSmallScreen(window.innerWidth < 472) + checkScreen() // run on mount + window.addEventListener('resize', checkScreen) + return () => window.removeEventListener('resize', checkScreen) + }, []) + + // Sizes based on screen width + const imgWidth = isSmallScreen ? 220 : 275 + const imgHeight = isSmallScreen ? 640 : 800 + + return ( + <> +
+ +
+ Billboard +
+ + Welcome to SharkBank! + + + The Sharks (aka HCB) are ready to invest in YOUR nonprofit. Proposals are officially open to try and earn a spot + pitching your nonprofit mission to our panel of judges. Win up to $1000 in funds to propel your mission forward. + +
+
+
+
+
+ + Banner-1 + + + Banner-2 + +
+
+ {/* Text */} + + + + HCB is hosting its first ever competition, SharkBank! Win up to $1000 in funding to propel your mission out to sea! + + + Get ready for an exciting opportunity to pitch your organization’s + mission to a panel of HCB teen judges. + + + Win up to $1000 in funding to propel your mission out to sea! + + + + +
+
+ Shark +
+
+ Sign + + Sign up now! + + + + +
+
+
+ + Shark + +
+ + ) +} + +// Section Component +function Section({ bg, minHeight, minWidth, children }) { + return ( +
+ + Section background + {children} + +
+ ) +} + +// Main +export default function SharkBank() { + const [windowWidth, setWindowWidth] = useState(0) + + useEffect(() => { + const handleResize = () => setWindowWidth(window.innerWidth) + handleResize() + window.addEventListener('resize', handleResize) + return () => window.removeEventListener('resize', handleResize) + }, []) + + const isMobile = windowWidth <= 570 + const isTablet = windowWidth > 570 && windowWidth <= 914 + const isDesktop = windowWidth > 914 + const billboardBottom = windowWidth > 1200 ? -80 : windowWidth > 800 ? 0 : 100 + + return ( +
+
+ ) +} diff --git a/public/sharkbank/BANNER_1.PNG b/public/sharkbank/BANNER_1.PNG new file mode 100644 index 00000000..64380f2a Binary files /dev/null and b/public/sharkbank/BANNER_1.PNG differ diff --git a/public/sharkbank/BANNER_2.PNG b/public/sharkbank/BANNER_2.PNG new file mode 100644 index 00000000..3fa7625b Binary files /dev/null and b/public/sharkbank/BANNER_2.PNG differ diff --git a/public/sharkbank/BILLBOARD_1.PNG b/public/sharkbank/BILLBOARD_1.PNG new file mode 100644 index 00000000..cde7a292 Binary files /dev/null and b/public/sharkbank/BILLBOARD_1.PNG differ diff --git a/public/sharkbank/BUILDINGS.PNG b/public/sharkbank/BUILDINGS.PNG new file mode 100644 index 00000000..019e9f17 Binary files /dev/null and b/public/sharkbank/BUILDINGS.PNG differ diff --git a/public/sharkbank/HAND_SHARK_1.PNG b/public/sharkbank/HAND_SHARK_1.PNG new file mode 100644 index 00000000..2be90e43 Binary files /dev/null and b/public/sharkbank/HAND_SHARK_1.PNG differ diff --git a/public/sharkbank/SIGN.PNG b/public/sharkbank/SIGN.PNG new file mode 100644 index 00000000..aa74b3b7 Binary files /dev/null and b/public/sharkbank/SIGN.PNG differ diff --git a/public/sharkbank/SKY_BACKGROUND.PNG b/public/sharkbank/SKY_BACKGROUND.PNG new file mode 100644 index 00000000..5924eb69 Binary files /dev/null and b/public/sharkbank/SKY_BACKGROUND.PNG differ diff --git a/public/sharkbank/banner-1-mobile.PNG b/public/sharkbank/banner-1-mobile.PNG new file mode 100644 index 00000000..62fd8c35 Binary files /dev/null and b/public/sharkbank/banner-1-mobile.PNG differ diff --git a/public/sharkbank/banner-2-mobile.PNG b/public/sharkbank/banner-2-mobile.PNG new file mode 100644 index 00000000..33d69e10 Binary files /dev/null and b/public/sharkbank/banner-2-mobile.PNG differ diff --git a/public/sharkbank/bgBuildingsFirstSection.png b/public/sharkbank/bgBuildingsFirstSection.png new file mode 100644 index 00000000..bd3cd940 Binary files /dev/null and b/public/sharkbank/bgBuildingsFirstSection.png differ diff --git a/public/sharkbank/bgBuildingsMobileFinal.png b/public/sharkbank/bgBuildingsMobileFinal.png new file mode 100644 index 00000000..f4451bdc Binary files /dev/null and b/public/sharkbank/bgBuildingsMobileFinal.png differ diff --git a/public/sharkbank/bgBuildingsMobileFirstSection1.png b/public/sharkbank/bgBuildingsMobileFirstSection1.png new file mode 100644 index 00000000..8be263d8 Binary files /dev/null and b/public/sharkbank/bgBuildingsMobileFirstSection1.png differ diff --git a/public/sharkbank/billboardMobile.PNG b/public/sharkbank/billboardMobile.PNG new file mode 100644 index 00000000..3d0a3163 Binary files /dev/null and b/public/sharkbank/billboardMobile.PNG differ diff --git a/public/sharkbank/billboardMobile2.png b/public/sharkbank/billboardMobile2.png new file mode 100644 index 00000000..8ea5315e Binary files /dev/null and b/public/sharkbank/billboardMobile2.png differ diff --git a/public/sharkbank/buildingsTransparent1.png b/public/sharkbank/buildingsTransparent1.png new file mode 100644 index 00000000..f6ed5a38 Binary files /dev/null and b/public/sharkbank/buildingsTransparent1.png differ diff --git a/public/sharkbank/buildingsTransparent2.png b/public/sharkbank/buildingsTransparent2.png new file mode 100644 index 00000000..578fd705 Binary files /dev/null and b/public/sharkbank/buildingsTransparent2.png differ diff --git a/public/sharkbank/buildingsTransparent3.png b/public/sharkbank/buildingsTransparent3.png new file mode 100644 index 00000000..47da2a9e Binary files /dev/null and b/public/sharkbank/buildingsTransparent3.png differ diff --git a/public/sharkbank/cardboardTexture.jpg b/public/sharkbank/cardboardTexture.jpg new file mode 100644 index 00000000..637554a0 Binary files /dev/null and b/public/sharkbank/cardboardTexture.jpg differ diff --git a/public/sharkbank/firstSectionBG.png b/public/sharkbank/firstSectionBG.png new file mode 100644 index 00000000..7d9ef0c9 Binary files /dev/null and b/public/sharkbank/firstSectionBG.png differ diff --git a/public/sharkbank/firstSectionBG1.png b/public/sharkbank/firstSectionBG1.png new file mode 100644 index 00000000..c070fa99 Binary files /dev/null and b/public/sharkbank/firstSectionBG1.png differ diff --git a/public/sharkbank/firstSectionBGMobile.png b/public/sharkbank/firstSectionBGMobile.png new file mode 100644 index 00000000..466465b5 Binary files /dev/null and b/public/sharkbank/firstSectionBGMobile.png differ diff --git a/public/sharkbank/row-1-column-1-tab.png b/public/sharkbank/row-1-column-1-tab.png new file mode 100644 index 00000000..898c530b Binary files /dev/null and b/public/sharkbank/row-1-column-1-tab.png differ diff --git a/public/sharkbank/row-1-column-1.png b/public/sharkbank/row-1-column-1.png new file mode 100644 index 00000000..592ab8e4 Binary files /dev/null and b/public/sharkbank/row-1-column-1.png differ diff --git a/public/sharkbank/row-2-column-1-tab.png b/public/sharkbank/row-2-column-1-tab.png new file mode 100644 index 00000000..4bc283ee Binary files /dev/null and b/public/sharkbank/row-2-column-1-tab.png differ diff --git a/public/sharkbank/row-2-column-1.png b/public/sharkbank/row-2-column-1.png new file mode 100644 index 00000000..989c62ad Binary files /dev/null and b/public/sharkbank/row-2-column-1.png differ diff --git a/public/sharkbank/row-3-column-1-tab.png b/public/sharkbank/row-3-column-1-tab.png new file mode 100644 index 00000000..cd25323e Binary files /dev/null and b/public/sharkbank/row-3-column-1-tab.png differ diff --git a/public/sharkbank/row-3-column-1.png b/public/sharkbank/row-3-column-1.png new file mode 100644 index 00000000..be555fc2 Binary files /dev/null and b/public/sharkbank/row-3-column-1.png differ diff --git a/public/sharkbank/secondSectionBG.png b/public/sharkbank/secondSectionBG.png new file mode 100644 index 00000000..e0499b0f Binary files /dev/null and b/public/sharkbank/secondSectionBG.png differ diff --git a/public/sharkbank/secondSectionBGMobile.png b/public/sharkbank/secondSectionBGMobile.png new file mode 100644 index 00000000..cfb752a1 Binary files /dev/null and b/public/sharkbank/secondSectionBGMobile.png differ diff --git a/public/sharkbank/shark1.PNG b/public/sharkbank/shark1.PNG new file mode 100644 index 00000000..62360a11 Binary files /dev/null and b/public/sharkbank/shark1.PNG differ diff --git a/public/sharkbank/shark2.PNG b/public/sharkbank/shark2.PNG new file mode 100644 index 00000000..0190fcb6 Binary files /dev/null and b/public/sharkbank/shark2.PNG differ diff --git a/public/sharkbank/sign-up-button.PNG b/public/sharkbank/sign-up-button.PNG new file mode 100644 index 00000000..0102f96b Binary files /dev/null and b/public/sharkbank/sign-up-button.PNG differ diff --git a/public/sharkbank/thirdSectionBG.png b/public/sharkbank/thirdSectionBG.png new file mode 100644 index 00000000..60800456 Binary files /dev/null and b/public/sharkbank/thirdSectionBG.png differ diff --git a/public/sharkbank/thirdSectionBGMobile.png b/public/sharkbank/thirdSectionBGMobile.png new file mode 100644 index 00000000..911770b4 Binary files /dev/null and b/public/sharkbank/thirdSectionBGMobile.png differ diff --git a/yarn.lock b/yarn.lock index 4c040016..e03df4b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1226,10 +1226,10 @@ resolved "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== -"@hackclub/icons@^0.0.14": - version "0.0.14" - resolved "https://registry.npmjs.org/@hackclub/icons/-/icons-0.0.14.tgz" - integrity sha512-xH/DV6TxlsvLuNGeBIausfKlH4eyp6CYXCckAxcYahL2NOdcZTZoJWKZBG38BzM5WfWnhfFkud/mQ5bqeFQK3g== +"@hackclub/icons@^0.0.15": + version "0.0.15" + resolved "https://registry.yarnpkg.com/@hackclub/icons/-/icons-0.0.15.tgz#612b9e107d9eabb44e0eeb1f8ebfcdc6b88c2e28" + integrity sha512-IKJ5JQhRhlkYINv9pxzT//fn3aYwsGBeyNNBcw7eU+J0lfs0wGrq9lh7CGcXUUGXaKFxDPRlWhTxaAVaRdZVRA== "@hackclub/markdown@^0.0.43": version "0.0.43"