Merge branch 'arcade-gallery' into add-project-loading

This commit is contained in:
Clay Nicholson 2024-08-16 12:13:00 -04:00 committed by GitHub
commit 6ccba86e08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 199 additions and 81 deletions

View file

@ -3,27 +3,19 @@ import { Box, Card, Heading, Link, Text } from 'theme-ui'
import styles from './cohort-card.module.css'
const CohortCard = ({project: {
id,
title,
desc,
codeLink,
slackLink,
playLink,
images,
githubProf
}}) => {
const CohortCard = ({ id, title, desc, slack, scrapbook, playable, images, githubProf, draggable = false}) => {
console.log(images)
return (
<>
<a href="https://www.google.com" className={styles.linkWrapper} target="_blank" rel="noopener noreferrer">
<div className={styles.card}>
<img src={images ? (images[0]) : ("https://via.placeholder.com/150")} alt="Project Image" className={styles.card_img}/>
<h1 className={styles.card_title}>{title}</h1>
<p className={styles.card_description}>{desc}</p>
<Link target="_blank" href={codeLink}>Code</Link>{' '}
<Link target="_blank" href={slackLink}>Slack</Link>{' '}
<Link target="_blank" href={playLink}>Play</Link>
<img src={images ? (images[0].url) : ("https://img.buzzfeed.com/buzzfeed-static/static/2020-05/21/17/asset/19f3032de0de/sub-buzz-1010-1590082675-7.png")} alt="Project Image" className={styles.card_img}/>
<h1 className={styles.card_title}>{title}</h1>
<p className={styles.card_description}>{desc}</p>
</div>
</a>
</>

View file

@ -1,17 +1,50 @@
.card{
flex: 1;
break-inside: avoid;
background-color: rgb(217, 217, 217); /* Equivalent to bg-white/20 */
background-clip: padding-box; /* Equivalent to bg-clip-padding */
padding: 1.5rem 1.5rem 1rem 1.5rem; /* Equivalent to p-6 pb-4 */
/* cursor: pointer; */
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Equivalent to shadow-lg */
height: fit-content; /* Equivalent to h-fit */
min-height: 400px;
position: relative;
background-size: cover;
background-position: center;
overflow: hidden;
min-width: 100px;
outline: black 1px solid;
display: flex;
flex-direction: column;
align-items: left;
justify-content: flex-start;
}
.card_img{
width: 100%;
height: auto;
max-height: 100%;
object-fit: cover;
aspect-ratio: 1 / 1;
}
.card_title{
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 0;
}
.card_description{
font-size: 1rem;
color: #333;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
max-height: 3em;
}
.linkWrapper{
display: block;
text-decoration: none;
color: inherit;
}

View file

@ -1,25 +1,29 @@
.feed{
min-height: 1000px;
padding-top: 32px;
padding-bottom: 32px;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
align-self: center;
column-gap: 0px;
.feed {
width: 100%;
overflow-y: auto;
overflow-x: hidden;
align-self: center;
display: grid;
grid-gap: 0px;
background-color: rgb(214, 214, 214);
padding: 10px;
@media (min-width: 640px) {
column-count: 2;
}
/* Medium screens */
@media (min-width: 768px) {
column-count: 3;
}
/* Large screens */
@media (min-width: 1024px) {
column-count: 4;
}
}
/* Small screens */
@media (min-width: 640px) {
grid-template-columns: repeat(4, 1fr); /* 4 equal-width columns */
}
/* Medium screens */
@media (min-width: 768px) {
grid-template-columns: repeat(5, 1fr); /* 5 equal-width columns */
}
/* Large screens */
@media (min-width: 1024px) {
grid-template-columns: repeat(6, 1fr); /* 6 equal-width columns */
}
}
.title{
margin-top: 200px;
}

View file

@ -1,18 +1,53 @@
import { useEffect, useState } from 'react'
const sample = arr => arr[Math.floor(Math.random() * arr.length)]
const languages = "Python Rust COBOL Wasm tailwind ".split(" ")
const tinyEyes = [
"if you can see this, you're too close",
"what are you looking at, tiny-eyes?",
"I see you",
"What is this, a website for ants?",
"plz help, my font size has fallen and it can't get up",
"*small loading sounds*"
]
const flavorText = [
`I would've been faster written in ${sample(languages)}`,
'Wait your turn!',
'Form an orderly queue!',
"I'm a teapo WAIT WRONG ENDPOINT",
"GET outta here with that request!",
"PUT that request back where it came from or so help me",
"POST haste!",
"TODO: Delete this message",
<p style={{fontSize: "3px"}}>{sample(tinyEyes)}</p>,
"Caution: objects in loading box are slower than they appear",
"Caution: wet pixels, do not touch",
"*Fax machine noises*",
]
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
const LoginPage = ({token}) => {
const [ status, setStatus ] = useState('loading')
const [ status, setStatus ] = useState('Loading...')
useEffect(async () => {
const response = await fetch(`/api/arcade/showcase/login/${token}`, {method: 'POST'})
const data = await response.json()
setStatus(data.error || data.authToken)
if (data.authToken) {
const minWaitTime = sleep(3 * 1000)
const response = fetch(`/api/arcade/showcase/login/${token}`, {method: 'POST'})
const data = response.json()
const [ _wait, _data ] = await Promise.all([minWaitTime, data])
if (data.error) {
setStatus(data.error)
} else {
setStatus("Redirecting!")
window.localStorage.setItem('arcade.authToken', data.authToken)
await sleep(250)
window.location.href = '/arcade/showcase/my'
}
}, [])
return (
<div>
<h1>{status}</h1>
<p>{status}</p>
<p><em>{sample(flavorText)}</em></p>
</div>
)
}

View file

@ -4,7 +4,7 @@ import ProjectView from '../../../components/arcade/showcase/project-view'
import Nav from '../../../components/Nav'
import Footer from '../../../components/arcade/Footer'
import BGImg from '../../../components/background-image'
import background from '../../../public/home/assemble.jpg'
import background from '../../../public/arcade/subtle-stripes.svg'
import { Button, Heading, Text } from 'theme-ui'
import SlideDown from '../../../components/slide-down'
import styles from '../../../components/arcade/showcase/my.module.css'
@ -50,35 +50,31 @@ const my = () => {
return (
<section>
<Nav />
{/*<BGImg
src={background}
alt="Arcade Gallery BG Img"
priority
/>*/}
<SlideDown duration={768}>
<Heading
as="h1"
variant="ultratitle"
sx={{
color: 'white',
textShadow: 'text',
filter: 'drop-shadow(0 -2px 4px rgba(0,0,0,0.5))',
WebkitFilter: 'drop-shadow(0 -2px 4px rgba(0,0,0,0.5))',
maxWidth: [null, 'copyUltra'],
my: [3, 4],
mx: 'auto',
zIndex: 1
}}
>
<Text
as="span"
<BGImg
src={background}
alt="Arcade Gallery BG Img"
priority
/>
<div className={styles.title}>
<SlideDown duration={768}>
<Heading
as="h1"
variant="ultratitle"
sx={{
WebkitTextStroke: 'currentColor',
WebkitTextStrokeWidth: ['2px', '3px'],
WebkitTextFillColor: 'transparent'
color: 'white',
textShadow: 'text',
filter: 'drop-shadow(0 -2px 4px rgba(0,0,0,0.5))',
WebkitFilter: 'drop-shadow(0 -2px 4px rgba(0,0,0,0.5))',
maxWidth: [null, 'copyUltra'],
my: [3, 4],
mx: 'auto',
zIndex: 1
}}
>
My Ships
</Text>
<br />
<Button
@ -103,6 +99,44 @@ const my = () => {
{
status == 'success' && <ProjectGallery projects={projects} />
}
<Text
as="span"
sx={{
WebkitTextStroke: 'currentColor',
WebkitTextStrokeWidth: ['2px', '3px'],
WebkitTextFillColor: 'transparent'
}}
>
My Ships
</Text>
<br />
<Button
as="a"
variant="ctaLg"
href="https://apply.hackclub.com"
target="_blank"
rel="noopener"
>
Add a Project
</Button>
</Heading>
</SlideDown>
</div>
<div className={styles.feed}>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
<CohortCard title="Here is my Project" desc="dasudyaskjhdkjahdlkjahsd asdnhasdkj as dkajhsd lk"/>
</div>
<Footer />
</section>
)

View file

@ -0,0 +1,9 @@
import React from 'react'
const Page = () => {
return (
<div>Page</div>
)
}
export default Page

View file

@ -0,0 +1,9 @@
import React from 'react'
const Page = () => {
return (
<div>Project</div>
)
}
export default Page

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1 @@
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2000 1500'><rect fill='#ffffff' width='2000' height='1500'/><defs><rect stroke='#ffffff' stroke-width='.5' width='1' height='1' id='s'/><pattern id='a' width='3' height='3' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><use fill='#fcfcfc' href='#s' y='2'/><use fill='#fcfcfc' href='#s' x='1' y='2'/><use fill='#fafafa' href='#s' x='2' y='2'/><use fill='#fafafa' href='#s'/><use fill='#f7f7f7' href='#s' x='2'/><use fill='#f7f7f7' href='#s' x='1' y='1'/></pattern><pattern id='b' width='7' height='11' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#f5f5f5'><use href='#s'/><use href='#s' y='5' /><use href='#s' x='1' y='10'/><use href='#s' x='2' y='1'/><use href='#s' x='2' y='4'/><use href='#s' x='3' y='8'/><use href='#s' x='4' y='3'/><use href='#s' x='4' y='7'/><use href='#s' x='5' y='2'/><use href='#s' x='5' y='6'/><use href='#s' x='6' y='9'/></g></pattern><pattern id='h' width='5' height='13' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#f5f5f5'><use href='#s' y='5'/><use href='#s' y='8'/><use href='#s' x='1' y='1'/><use href='#s' x='1' y='9'/><use href='#s' x='1' y='12'/><use href='#s' x='2'/><use href='#s' x='2' y='4'/><use href='#s' x='3' y='2'/><use href='#s' x='3' y='6'/><use href='#s' x='3' y='11'/><use href='#s' x='4' y='3'/><use href='#s' x='4' y='7'/><use href='#s' x='4' y='10'/></g></pattern><pattern id='c' width='17' height='13' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#f2f2f2'><use href='#s' y='11'/><use href='#s' x='2' y='9'/><use href='#s' x='5' y='12'/><use href='#s' x='9' y='4'/><use href='#s' x='12' y='1'/><use href='#s' x='16' y='6'/></g></pattern><pattern id='d' width='19' height='17' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#ffffff'><use href='#s' y='9'/><use href='#s' x='16' y='5'/><use href='#s' x='14' y='2'/><use href='#s' x='11' y='11'/><use href='#s' x='6' y='14'/></g><g fill='#efefef'><use href='#s' x='3' y='13'/><use href='#s' x='9' y='7'/><use href='#s' x='13' y='10'/><use href='#s' x='15' y='4'/><use href='#s' x='18' y='1'/></g></pattern><pattern id='e' width='47' height='53' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#00BA05'><use href='#s' x='2' y='5'/><use href='#s' x='16' y='38'/><use href='#s' x='46' y='42'/><use href='#s' x='29' y='20'/></g></pattern><pattern id='f' width='59' height='71' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#00BA05'><use href='#s' x='33' y='13'/><use href='#s' x='27' y='54'/><use href='#s' x='55' y='55'/></g></pattern><pattern id='g' width='139' height='97' patternUnits='userSpaceOnUse' patternTransform='scale(50) translate(-980 -735)'><g fill='#00BA05'><use href='#s' x='11' y='8'/><use href='#s' x='51' y='13'/><use href='#s' x='17' y='73'/><use href='#s' x='99' y='57'/></g></pattern></defs><rect fill='url(#a)' width='100%' height='100%'/><rect fill='url(#b)' width='100%' height='100%'/><rect fill='url(#h)' width='100%' height='100%'/><rect fill='url(#c)' width='100%' height='100%'/><rect fill='url(#d)' width='100%' height='100%'/><rect fill='url(#e)' width='100%' height='100%'/><rect fill='url(#f)' width='100%' height='100%'/><rect fill='url(#g)' width='100%' height='100%'/></svg>

View file

@ -0,0 +1 @@
<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><rect fill='#FFA34A' width='100' height='100'/><g stroke='#CCC' stroke-width='0' stroke-opacity='1'><rect fill='#F5F5F5' x='-60' y='-60' width='110' height='240'/></g></svg>