Skip to content

Commit

Permalink
migrate away from theme-ui, improve responsivity, add guide structure
Browse files Browse the repository at this point in the history
Co-authored-by: BRUHisbackbois <[email protected]>
Co-authored-by: Ryan <[email protected]>
  • Loading branch information
3 people committed Dec 17, 2024
1 parent 7474c6e commit 37ada4b
Show file tree
Hide file tree
Showing 11 changed files with 460 additions and 178 deletions.
49 changes: 35 additions & 14 deletions app/ModelViewer.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
import { useState, useEffect } from 'react';

const ModelViewer = () => {
return (
<model-viewer
src="https://cloud-4ij979j8m-hack-club-bot.vercel.app/0imagetostl.com_3d-hacky-holidays.glb" // Replace with your 3D model file
alt="A 3D model"
camera-controls
disable-zoom
camera-orbit="0deg 0deg 105%"
disable-pan
style={{ width: '25' ,height: '40vh'}}
></model-viewer>
);
};

export default ModelViewer;
const [dimensions, setDimensions] = useState({ width: '100%', height: '30vh' });

useEffect(() => {
const handleResize = () => {
if (window.innerWidth >= 832) {
setDimensions({ width: '50%', height: '40vh' });
} else if (window.innerWidth >= 640) {
setDimensions({ width: '75%', height: '40vh' });
} else {
setDimensions({ width: '100%', height: '20vh' });
}
};

window.addEventListener('resize', handleResize);
handleResize(); // Call the function initially to set the dimensions

return () => window.removeEventListener('resize', handleResize);
}, []);

return (
<model-viewer
src="https://cloud-if969vfbm-hack-club-bot.vercel.app/0imagetostl.com_hacky_holidays__3_.glb" // Replace with your 3D model file
alt="A 3D model"
camera-controls
disable-zoom
camera-orbit="0deg 0deg 105%"
disable-pan
style={{ width: '25', height: dimensions.height }}
></model-viewer>
);
};

export default ModelViewer;
227 changes: 104 additions & 123 deletions app/components/3box.tsx
Original file line number Diff line number Diff line change
@@ -1,127 +1,108 @@
import { Box, Image, Grid, Heading, Text } from 'theme-ui';
import {
Box,
Button,
Image,
Grid,
Heading,
Text,
} from 'theme-ui';

const Threebox = () => {
return (
<Grid columns={[1, 1, 1, 3]} gap={[20, 20, 20]} sx={{
mt: '3vh',
maxwidth: '20rem',
px: ['0.5rem', '1rem', '1.5rem'],
textAlign: 'center',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.31)',
borderRadius: '1rem',
mx: 'auto',
mb: '5vh',
padding: '2.5vh',
}}>
<Box sx={{
alignItems: 'center',
justifyContent: 'center',
display: 'flex',
flexDirection: 'column',
mx: '1vw',
paddingTop: ['1rem', '2rem'],
borderRadius: '20px',
backgroundColor: 'rgba(255, 255, 255, 0.1)',
padding: '1rem',
overflow: 'hidden',
}}>
<Heading as="h4" sx={{
fontFamily: 'var(--font-inter)',
fontWeight: 900,
fontSize: ['1rem', '1.5vw'],
paddingBottom: '1rem',
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>Design a PCB</Heading>
<Image sx={{
width: '100%',
height: '300px',
borderRadius: '10px',
paddingBottom: '1rem',
objectFit: 'contain',
}}
src="https://cloud-qonvrpxwd-hack-club-bot.vercel.app/0image.png"
/>
<Text sx={{
fontFamily: 'var(--font-inter)',
fontSize: ['0.8rem', '1rem'],
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>Create your own PCB design and bring it to life!</Text>
</Box>
<Box sx={{
alignItems: 'center',
justifyContent: 'center',
display: 'flex',
flexDirection: 'column',
mx: '1vw',
paddingTop: ['1rem', '2rem'],
borderRadius: '20px',
backgroundColor: 'rgba(255, 255, 255, 0.1)',
padding: '1rem',
overflow: 'hidden',
}}>
<Heading as="h4" sx={{
fontFamily: 'var(--font-inter)',
fontWeight: 900,
fontSize: ['1rem', '1.5vw'],
paddingBottom: '1rem',
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>Design Art</Heading>
<Image sx={{
width: '100%',
height: '300px',
borderRadius: '10px',
paddingBottom: '1rem',
objectFit: 'contain',
}} src="https://cloud-go1uacpkk-hack-club-bot.vercel.app/0image.png" />
<Text sx={{
fontFamily: 'var(--font-inter)',
fontSize: ['0.8rem', '1rem'],
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>Create stunning art for your PCB design!</Text>
</Box>
<Box sx={{
alignItems: 'center',
justifyContent: 'center',
display: 'flex',
flexDirection: 'column',
mx: '1vw',
paddingTop: ['1rem', '2rem'],
borderRadius: '20px',
backgroundColor: 'rgba(255, 255, 255, 0.1)',
padding: '1rem',
overflow: 'hidden',
}}>
<Heading as="h4" sx={{
fontFamily: 'var(--font-inter)',
fontWeight: 900,
fontSize: ['1rem', '1.5vw'],
paddingBottom: '1rem',
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>Create Firmware</Heading>
<Image sx={{
width: '100%',
height: '300px',
borderRadius: '10px',
paddingBottom: '1rem',
objectFit: 'contain',
}}
src="https://cloud-ix9a26xw1-hack-club-bot.vercel.app/0image.png"
/>
<Text sx={{
fontFamily: 'var(--font-inter)',
fontSize: ['0.8rem', '1rem'],
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>Develop firmware to control your PCB!</Text>
</Box>
</Grid>
)
return(
<Grid columns= {[1,1,1,3]}gap = {[50,5,20,0]} sx={{
mt: '5vh',
width: 'fit-content',
minheight: '40vh',
resize: 'both',
px: '3vw',
textAlign: 'center',
justifyContent: 'center',
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.31)',
borderRadius: '1rem',
mx: '32px',
mb: '5vh',
padding: '2vh',
}}>
<Box sx={{
alignItems: 'center',
justifyContent: 'center',
display: 'flex',
flexDirection: 'column',
mx: '1vw',
paddingTop: ['0rem', '2rem'],
borderRadius: '20px',
}}>
<Heading as="h4" sx={{
fontFamily: 'var(--font-inter)',
fontWeight: 900,
fontSize: ['1rem', '1.5vw'],
paddingBottom: '1.2rem',
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
} }>Design a PCB</Heading>
<Image sx={{
width:['28vh', '26vw'],
height:['32vh', '28vw'],
borderRadius: '10px',
paddingBottom: '2rem',
fill: 'true'
}}
src = "https://cloud-qonvrpxwd-hack-club-bot.vercel.app/0image.png"
></Image>
</Box>
<Box sx={{
alignItems: 'center',
justifyContent: 'center',
display: 'flex',
flexDirection: 'column',
paddingTop: ['1rem', '2rem'],
mx: '1vw',

textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
}}>
<Heading as="h4" sx={{
fontFamily: 'var(--font-inter)',
fontWeight: 900,
fontSize: ['1rem', '1.5vw'],
color: 'white',
paddingBottom: '1.2rem'
} }>Design Art</Heading>
<Image sx={{
width:['28vh', '26vw'],
height:['32vh', '28vw'],
borderRadius: '10px',
paddingBottom: '2rem'
}} src="https://cloud-go1uacpkk-hack-club-bot.vercel.app/0image.png"></Image>
</Box>
<Box sx={{
alignItems: 'center',
justifyContent: 'center',
display: 'flex',
mx: '1vw',

flexDirection: 'column',
paddingTop: ['0rem', '2rem'],
}}>
<Heading as="h4" sx={{
fontFamily: 'var(--font-inter)',
fontWeight: 900,
fontSize: ['1rem', '1.5vw'],
paddingBottom: '1.2rem',
color: 'white',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
} }>Create Firmware</Heading>
<Image sx={{
width:['28vh', '26vw'],
height:['32vh', '28vw'],
borderRadius: '10px',
paddingBottom: ['1rem', '2rem']
}}
src = "https://cloud-ix9a26xw1-hack-club-bot.vercel.app/0image.png"
></Image>
</Box>
</Grid>
)
}
export default Threebox;
29 changes: 5 additions & 24 deletions app/components/FAQcard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { Box, Heading, Text } from 'theme-ui';

interface CardProps {
question: string;
Expand All @@ -8,35 +7,17 @@ interface CardProps {

const FAQcard: React.FC<CardProps> = ({ question, answer }) => {
return (
<div className="">
<div className={styles.card}>
<h3 className={styles.question}>{question}</h3>
<p style={styles.answer}>{answer}</p>
<p className={styles.answer}>{answer}</p>
</div>
);
};

const styles = {
card: {
borderRadius: '20px',
padding: '16px',
margin: '16px',
backgroundColor: 'rgba(201, 227, 255, 0.73)',
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
width: ['90vw', '60vw', '26vw'],
border: '5px solid rgba(39, 114, 193, 0.42)',
overflow: 'hidden',
},
question: {
"insert tailwind"
},
answer: {
fontSize: ['1rem', 'calc(0.6vw + 0.6vh)'],
color: '#003180',
marginTop: '15px',
textShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)',
fontWeight: 600,
paddingLeft: '2%',
},
card: "rounded-[20px] p-[16px] my-[16px] bg-[rgba(201,227,255,0.73)] shadow-[0_2px_4px_rgba(0,0,0,0.1)] w-[90vw] sm:w-auto md:w-auto lg:w-[26vw] sm:h-[auto] lg:h-[26vh] border-[5px] border-[rgba(39,114,193,0.42)] overflow-hidden",
question: "text-[1.2rem] md:text-[calc(1.2vw+1.2vh)] font-[790] text-white pl-[2%] [text-shadow:_0_4px_4px_rgb(0_0_0_/_25%)] text-left",
answer: "text-[1rem] md:text-[calc(0.6vw+0.6vh)] text-[#003180] mt-[15px] font-[700] pl-[2%] text-left"
};

export default FAQcard;
2 changes: 1 addition & 1 deletion app/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const footer = ()=> {
)
}

export default Footer;
export default footer;
13 changes: 5 additions & 8 deletions app/components/top.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import dynamic from 'next/dynamic';

const ModelViewer = dynamic(() => import('../ModelViewer'), { ssr: false });
const ModelViewer = dynamic(() => import('../ModelViewer'), { ssr: false });

const tipitytopity = ()=> {
return (
<div className="flex flex-col md:flex-row items-center justify-center gap-4 pr-0 md:pr-12 w-full mx-auto mt-[10vh] md:mt-0 bg-[url('../public/background2.png')] bg-no-repeat bg-cover h-[2vh] md:h-[95vh]"
>
<div className="flex flex-col mb-8 md:flex-row items-center justify-center gap-4 pr-0 md:pr-12 w-full mx-auto mt-[10vh] md:mt-0 bg-[url('https://cloud-dhj4yjv42-hack-club-bot.vercel.app/0backgroundhh.png')] bg-no-repeat bg-center bg-cover sm:h-[120vh] md:h-[95vh]">
{typeof window !== 'undefined' && <ModelViewer />}
{/*
<Image
Expand All @@ -25,19 +23,18 @@ const ModelViewer = dynamic(() => import('../ModelViewer'), { ssr: false });
}}
/> */}
<div className="flex flex-col items-start ml-0 md:ml-[2vw] max-w-full">
<h1 className="font-[var(--font-inter)] text-[2rem] md:text-[7rem] font-extrabold text-center md:text-left text-white ">
<h1 className="font-[var(--font-inter)] text-[2.8rem] md:text-[7rem] font-bold text-center md:text-left text-white [text-shadow:_0_4px_4px_rgb(0_0_0_/_25%)]">
Hacky Holidays!
</h1>
<h2 className="font-[var(--font-inter)] text-[0.5rem] md:text-[2.2rem] font-bold text-white">
Design a PCB holiday decoration this winter, get one shipped
<h2 className="font-[var(--font-inter)] text-[0.7rem] md:text-[1.9rem] font-bold text-white [text-shadow:_0_4px_4px_rgb(0_0_0_/_25%)] md:-mt-4">
Design a PCB holiday decoration this winter, get one shipped!
</h2>
<a href = "/guide">
<button className="mx-auto md:mx-0 font-[var(--font-inter)] text-[0.4rem] md:text-[calc(0.6vw+0.6vh)] font-bold text-white bg-[#f90b0b] rounded-[2rem] px-[0.6rem] py-[0.6rem] md:px-[2rem] md:py-[1rem] mt-4">
<button className="mx-auto mb-10 md:mx-0 font-[var(--font-inter)] text-[0.4rem] md:text-[calc(0.6vw+0.6vh)] font-bold text-white bg-[#f76f63] rounded-[2rem] px-[0.6rem] py-[0.6rem] md:px-[2rem] md:py-[1rem] mt-4 [text-shadow:_0_4px_4px_rgb(0_0_0_/_25%)]">
<b>&nbsp;Learn to Make a Decoration &nbsp; ➜</b>
</button>
</a>


</div>
</div>

Expand Down
Empty file.
Loading

0 comments on commit 37ada4b

Please sign in to comment.