This commit is contained in:
Belle 2024-08-23 16:19:09 +08:00
parent 06a63dec56
commit 59dbce2f94
4 changed files with 9842 additions and 13433 deletions

View file

@ -53,6 +53,7 @@
"js-confetti": "^0.12.0",
"jszip": "^3.10.1",
"jszip-utils": "^0.1.0",
"leaflet": "^1.9.4",
"lodash": "^4.17.21",
"million": "^2.6.4",
"next": "^12.3.1",

View file

@ -0,0 +1,66 @@
import AirtablePlus from 'airtable-plus'
const airtable = new AirtablePlus({
apiKey: process.env.AIRTABLE_API_KEY,
baseID: 'app4kCWulfB02bV8Q',
tableName: 'Users'
})
const locations = [
{ city: 'New York', country: 'USA' },
{ city: 'Paris', country: 'France' }
// Add more locations...
]
// Work around a node v20.0.0, v20.1.0, and v20.2.0 bug. The issue was fixed
// in v20.3.0.
// https://github.com/nodejs/node/issues/47822#issuecomment-1564708870
// Safe to remove once support for Node v20 is dropped.
if (
// !process.env.IS_BROWSER && // uncomment this line if you use a bundler that sets env.IS_BROWSER during build time
process.versions &&
// check for `node` in case we want to use this in "exotic" JS envs
process.versions.node &&
process.versions.node.match(/20\.[0-2]\.0/)
) {
require("net").setDefaultAutoSelectFamily(false);
}
// Function to get coordinates using OpenCage API
async function getCoordinates(city, country) {
const apiKey = process.env.GEO_API_KEY
const url = `https://api.opencagedata.com/geocode/v1/json?q=${encodeURIComponent(city)},${encodeURIComponent(country)}&key=${apiKey}`
const response = await fetch(url)
const data = await response.json()
if (data.results.length > 0) {
const { lat, lng } = data.results[0].geometry
console.log(lat)
return { lat, lng }
} else {
throw new Error('Location not found')
}
}
// const getUsers = async function () {
// const records = await airtable.read({
// filterByFormula: `{Total Earned (Hours)} > 3`,
// fields: [
// 'Name',
// 'Description',
// 'Slack Link',
// 'Code Link',
// 'Play Link',
// 'ScreenshotLink',
// 'color',
// 'textColor'
// ]
// })
// return records
// }
export default async function handler(req, res) {
let coordinates = getCoordinates('New York', 'USA')
return res.status(200).json({ coordinates })
}

122
pages/arcade/review.js Normal file
View file

@ -0,0 +1,122 @@
import { useEffect, useState, useRef } from 'react'
import { Button, Heading, Text, Box, Close } from 'theme-ui'
import Icon from '@hackclub/icons'
import { Balancer } from 'react-wrap-balancer'
import Fade from 'react-reveal/Fade'
/** @jsxImportSource theme-ui */
const styled = `
@import url('https://fonts.googleapis.com/css2?family=Slackey&family=Emblema+One&family=Gaegu&display=swap');
body, html {
overflow-x: hidden;
}
.slackey {
font-family: "Slackey", sans-serif;
}
.emblema {
font-family: "Emblema One", system-ui;
}
.gaegu {
font-family: "Gaegu", sans-serif;
}
body {
background-color: #FAEFD6;
min-height: 100vh;
}
@keyframes float {
from,
to {
transform: translate(0%, -37%) rotate(-2deg);
}
25% {
transform: translate(-2%, -40%) rotate(2deg);
}
50% {
transform: translate(0%, -43%) rotate(-1deg);
}
75% {
transform: translate(-1%, -40%) rotate(-1deg);
}
}
a {
color: inherit;
}
`
const Review = () => {
return (
<body className="gaegu">
<div
sx={{
display: 'grid',
gridTemplateColumns: ['1fr', '2fr 1fr', '3fr 1fr']
}}
>
<div sx={{ px: 5, py: 4 }}>
<Fade>
<Text
as="h3"
variant="subtitle"
className="slackey"
sx={{ color: '#FF5C00' }}
>
Hack Club x GitHub
</Text>
</Fade>
<Fade delay={100}>
<img
src="https://cloud-677i45opw-hack-club-bot.vercel.app/0arcade_1.png"
sx={{
width: ['90vw', '60vw', '40vw'],
maxWidth: '400px',
display: 'block',
mt: 3
}}
/>
</Fade>
<Fade delay={200}>
<Balancer>
<Text
as="p"
variant="subtitle"
sx={{ color: '#09AFB4', maxWidth: '400px' }}
>
One Summer. 10,000 students. The ultimate hackathon.
</Text>
</Balancer>
</Fade>
<Fade>
<Button
as="a"
sx={{
backgroundColor: '#FF5C00',
color: '#ebebeb',
textSizeAdjust: '16px',
borderRadius: '10px'
}}
href="/arcade/showcase"
target="_blank"
rel="noopener"
>
See all projects
</Button>
</Fade>
</div>
<div id="projects"></div>
</div>
<style>{styled}</style>
</body>
)
}
export default Review

23086
yarn.lock

File diff suppressed because it is too large Load diff