Skip to content

Commit

Permalink
Merge pull request #7 from anushkaj-01/main
Browse files Browse the repository at this point in the history
Responsive navbar and timer
  • Loading branch information
bhaskar1001101 authored May 15, 2024
2 parents 84623cd + 5355e26 commit f31f5a7
Show file tree
Hide file tree
Showing 16 changed files with 1,150 additions and 60 deletions.
890 changes: 864 additions & 26 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^5.15.17",
"@mui/material": "^5.15.17",
"@mui/styled-engine-sc": "^6.0.0-alpha.18",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.1",
"react-scroll": "^1.9.0"
"react-scroll": "^1.9.0",
"styled-components": "^6.1.11"
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand Down
File renamed without changes
3 changes: 3 additions & 0 deletions src/assets/images/Navbar/Vector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/images/Navbar/iiit_kalyani_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 5 additions & 5 deletions src/components/CountdownTimer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const DateTimeDisplay = ({ value, type, isDanger }) => {
return (
<div className='countdown flex flex-col items-center font-vt323 font-[400] text-[#D9D9D9] '>
<div className='mr-[10px] '>
<p className='text-[60px] h-[4rem] ' >{type !== 'Days' && <span className="text-[60px] ml-[1rem]">:</span>} {value.toString()}</p>
<p className='xl:text-[85px] xl:h-[6rem] md:text-[60px] h-[4rem] max-[400px]:text-[30px] max-[400px]:h-[2.5rem] max-[640px]:text-[40px] max-[768px]:text-[45px] max-[768px]:h-[3rem] max-[640px]:h-[3rem] ' >{type !== 'Days' && <span className="xl:text-[85px] max-[400px]:text-[30px] max-[768px]:text-[45px] max-[640px]:text-[40px] max-[640px]:h-[4rem] max-[640px]:ml-[0.5rem] text-[60px] ml-[1rem]">:</span>} {value.toString()}</p>
</div>
{type == 'Days' && <span className="text-[25px] ml-[0.5rem]">{type}</span>}
{type == 'Hours' && <span className="text-[25px] ml-[2.9rem]">{type}</span>}
{type == 'Minutes' && <span className="text-[25px] ml-[3rem]">{type}</span>}
{type == 'Minutes' || type=='Seconds' && <span className="text-[25px] ml-[3rem]">{type}</span>}
{type == 'Days' && <span className="xl:text-[35px] text-[25px] max-[400px]:text-[20px] max-[640px]:text-[22px] ml-[0.5rem] max-[768px]:ml-0 max-[640px]:ml-[0rem]">{type}</span>}
{type == 'Hours' && <span className="xl:text-[35px] xl:ml-[4rem] text-[25px] max-[400px]:text-[20px] max-[640px]:text-[22px] ml-[2.9rem] max-[768px]:ml-[2.5rem] max-[640px]:ml-[2rem]">{type}</span>}
{type == 'Minutes' && <span className="xl:text-[35px] xl:ml-[4.5rem] text-[25px] max-[400px]:text-[20px] max-[640px]:text-[22px] ml-[3rem] max-[768px]:ml-[2.2rem] max-[640px]:ml-[2rem]">{type}</span>}
{type == 'Minutes' || type=='Seconds' && <span className="xl:text-[35px] xl:ml-[4rem] text-[25px] max-[400px]:text-[20px] max-[640px]:text-[22px] ml-[3rem] max-[768px]:ml-[2rem] max-[640px]:ml-[1.5rem]">{type}</span>}
{/* <span className='text-[25px] ml-[1.5rem]'>{type}</span> */}

</div>
Expand Down
92 changes: 92 additions & 0 deletions src/components/HamburgerMenu.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import SwipeableDrawer from '@mui/material/SwipeableDrawer';
import Button from '@mui/material/Button';
import List from '@mui/material/List';
import Divider from '@mui/material/Divider';
import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import InboxIcon from '@mui/icons-material/MoveToInbox';
import MailIcon from '@mui/icons-material/Mail';
import MenuIcon from '@mui/icons-material/Menu';
import hamburger from '../assets/images/Navbar/Vector.svg';
export default function SwipeableTemporaryDrawer() {
const [state, setState] = React.useState({
top: false,
});

const toggleDrawer = (open) => (event) => {
if (
event &&
event.type === 'keydown' &&
(event.key === 'Tab' || event.key === 'Shift')
) {
return;
}

setState({ ...state, top: open }); // Spread previous state
};

const list = (
<Box id="box"
// bgcolor={'slateblue'}
//sx={{color:'white', width: '100%', background: 'linear-gradient(#040842, #040842)',fontFamily: 'vt323'}}
sx={{
color: 'white',
width: '100%',
background: 'linear-gradient(#040842, #040842)',
opacity: '10',
fontFamily: 'vt323,', // Apply the 'vt323' font here
}}
role="presentation"
onClick={toggleDrawer(false)}
onKeyDown={toggleDrawer(false)}
>
<List>
{['SHEDULE', 'TRACKS', 'PRIZES', 'MORE'].map((text, index) => (
<ListItem key={text} disablePadding>
<ListItemButton>
{/* <ListItemIcon>
{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
</ListItemIcon> */}
<ListItemText primary={text} />
</ListItemButton>
</ListItem>
))}
</List>
{/* <Divider />
<List>
{['All mail', 'Trash', 'Spam'].map((text, index) => (
<ListItem key={text} disablePadding>
<ListItemButton>
<ListItemIcon>
{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
</ListItemIcon>
<ListItemText primary={text} />
</ListItemButton>
</ListItem>
))}
</List> */}
</Box>
);

return (
<div className='min-[540px]:hidden w-[70px] h-[60px]' >
{/* Conditionally render hamburger menu icon */}
{/* <Button className='w-[20%] pr-0 pt-0' onClick={toggleDrawer(!state.top)} style={{ zIndex: state.top ? 9999 : 1 }}>
<img className="min-[450px]:hidden min-[320px]:w-[30%] min-[320px]:pr-[0] min-[320px]:h-[18%] min-[320px]:mt-[40%] min-[320px]:mr-[30%]" src="./images/Vector.svg" ></img>
</Button> */}
<button onClick={toggleDrawer(!state.top)} style={{ zIndex: 9999,position: 'absolute', }}><img className="min-[540px]:hidden min-[320px]:w-[100%] min-[320px]:pr-[0] min-[320px]:h-[40%] min-[320px]:mt-[110%] min-[320px]:mr-[50%] ml-0" src={hamburger} ></img></button>
<SwipeableDrawer
anchor="top"
open={state.top}
onClose={toggleDrawer(false)}
onOpen={toggleDrawer(true)}
>
{list}
</SwipeableDrawer>
</div>
);
}
25 changes: 16 additions & 9 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import SwipeableTemporaryDrawer from "./HamburgerMenu";
import iiit_logo from '../assets/images/Navbar/IIITlogo.svg';
import iiit_logo_mobile from '../assets/images/Navbar/iiit_kalyani_logo.svg';
import sc1_logo from '../assets/images/Navbar/logo.svg';
export default function Navbar(){
const scrollToSchedule = () => {
const scheduleSection = document.getElementById('schedule');
Expand All @@ -13,18 +17,21 @@ export default function Navbar(){
};
return(
<>
<nav className="flex bg-gradient-to-b from-[#040842] to-[#040842] justify-between w-[100vw] h-[100px] mt-0 bg-blue-800 font-vt323">
<img className="ml-[2%] pt-[1%]" src="./public/images/logo.svg"></img>
<nav className="flex bg-gradient-to-b from-[#040842] to-[#040842] justify-between w-full h-[100px] mt-0 bg-blue-800 font-vt323 ">
<img className=" xl:ml-[0] xl:mt-[1%] lg:w-[10%] lg:h-[62%] sm:w-[12%] min-[540px]:w-[13%] min-[900px]:h-[55%] min-[900px]:mt-[2%] sm:ml-[1.7%] min-[540px]:ml-[1.7%] lg:ml-[1.5%] lg:mt-[1.5%] mt-[1%] max-[540px]:h-[38%] max-[540px]:ml-[4%] max-[540px]:mt-[4%]" src={sc1_logo}></img>

<ul className="flex space-x-[3rem] text-[2rem] text-white items-center">
<a onClick={scrollToSchedule} style={{ cursor: 'pointer' }}><li>SCHEDULE</li></a>
<li style={{ cursor: 'pointer' }}>TRACKS</li>
<li style={{ cursor: 'pointer' }}>PRIZES</li>
<a onClick={scrollToFooter} style={{ cursor: 'pointer' }}><li>MORE</li></a>
<ul className=" flex xl:space-x-[5rem] lg:space-x-[4rem] sm:space-x-[1.6rem] sm:text-[22px] min-[540px]:space-x-[1.6rem] min-[540px]:text-[22px] md:space-x-[2.2rem] md:text-[25px] min-[900px]:space-x-[2.4rem] min-[900px]:text-[1.8rem] lg:text-[2rem] text-white items-center max-[540px]:hidden ">
<a onClick={scrollToSchedule} style={{ cursor: 'pointer' }}><li className="hover:text-[#c3c3c3]">SCHEDULE</li></a>
<li className="hover:text-[#c3c3c3]" style={{ cursor: 'pointer' }}>TRACKS</li>
<li className="hover:text-[#c3c3c3]" style={{ cursor: 'pointer' }}>PRIZES</li>
<a onClick={scrollToFooter} style={{ cursor: 'pointer' }}><li className="hover:text-[#c3c3c3]">MORE</li></a>
</ul>
<img className="mr-[3%] pt-[1%]" src="./public/images/IIITlogo.svg"></img>

<img className="xl:w-[14%] xl:mr-[1%] lg:w-[15%] sm:w-[17%] sm:mr-[1.7%] min-[540px]:w-[17%] min-[540px]:mr-[1.7%] lg:mr-[1.2%] lg:mt-[1%] mt-[1%] max-[540px]:hidden" src={iiit_logo}></img>
<img className="min-[540px]:hidden max-[540px]:h-[45%] min-[450px]:mr-[55%] max-[540px]:mt-[3%] min-[320px]:mr-[35%] min-[350px]:mr-[42%]" src={iiit_logo_mobile}></img>
{/* <img className="min-[540px]:hidden w-[10%] h-[18%] mt-[7%] mr-[5%]" src="./images/Vector.svg" ></img> */}
<SwipeableTemporaryDrawer/>
</nav>
</>
)
}
// max-[540px]:h-[40%] max-[540px]:mr-[4%] max-[540px]:mt-[4%]
93 changes: 93 additions & 0 deletions src/font/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2011, The VT323 Project Authors ([email protected])

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added src/font/VT323-Regular.ttf
Binary file not shown.
7 changes: 7 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
scrollbar-width: none; /* Firefox */
}
}

/* #box {
color: white;
width: 100%;
font-family: 'vt323';
background: linear-gradient(to bottom, #040842, #040842);
} */
11 changes: 8 additions & 3 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import { BrowserRouter } from 'react-router-dom'

import CssBaseline from '@mui/material/CssBaseline';
import { ThemeProvider } from '@mui/material/styles';
import theme from './theme.jsx';
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<BrowserRouter>
<ThemeProvider theme={theme}>
<CssBaseline />
<App />
</BrowserRouter>
</ThemeProvider>,
</React.StrictMode>,
)


8 changes: 4 additions & 4 deletions src/pages/LandingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ function LandingPage() {
</h3>
</div>
<div className="flex text-center justify-center mt-5 ml-5 mr-5">
<div className="bg-top bg-no-repeat h-screen flex items-end flex-col justify-center "style={{
<div className="bg-top bg-no-repeat flex items-end flex-col justify-center h-[90%] "style={{
backgroundImage: `url(${HomeMascot})`,
backgroundSize: "15%",
}}
>
<div className="text-center justify-center gap-2">
<div className="text-center justify-center gap-2 mt-[21%]">
<div className="bg-no-repeat bg-center text-center justify-center flex flex-row" style={{
backgroundImage: `url(${DevfolioBtn})`,
backgroundSize: "contain",
Expand Down Expand Up @@ -65,12 +65,12 @@ function LandingPage() {
</section>

{/* Timer section */}
<section id="timer" className="mb-10">
<section id="timer" className="mt-[4%] mb-10">
<TimerSection/>
</section>

{/* Schedule section */}
<section id="schedule" className=""></section>
<section id="schedule" className="mt-[12%]"></section>
<Schedule/>
</div>
</>
Expand Down
23 changes: 11 additions & 12 deletions src/pages/TimerSection.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import CountdownTimer from "../components/CountdownTimer";
export default function TimerSection() {
return (
<>
<section className="width-[100vh] flex flex-col justify-center font-[vt323]">
<p className="text-[#F21212] text-[60px] mb-0">Hurry Up</p>
<p className="text-[36px] text-[#9D44C0]">Hacking ends in</p>
<CountdownTimer targetDate={"aug 24, 2024 02:01:00"} />
</section>
</>
);
import CountdownTimer from "../components/CountdownTimer"
export default function TimerSection(){
return(
<>
<section className="width-[100vh] flex flex-col justify-center font-[vt323]">
<p className="text-[#F21212] text-[375%] max-[900px]:text-[55px] max-[768px]:text-[52px] max-[540px]:text-[50px] max-[450px]:text-[48px] max-[360px]:text-[40px] md:text-[76px] mb-0">Hurry Up</p>
<p className="text-[225%] text-[#9D44C0] max-[900px]:text-[30px] max-[768px]:text-[28px] max-[360px]:text-[28px] md:text-[40px] ">Hacking ends in</p>
<CountdownTimer targetDate={"aug 24, 2024 02:01:00"}/>
</section>
</>
)
}

31 changes: 31 additions & 0 deletions src/theme.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createTheme } from '@mui/material/styles';
import VT323Regular from './font/VT323-Regular.ttf';

const vt323 = {
fontFamily: 'VT323',
fontStyle: 'normal',
fontDisplay: 'swap',
fontWeight: 400,
src: `
local('VT323'),
local('VT323-Regular'),
url(${VT323Regular}) format('ttf')
`,
unicodeRange:
'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF',
};

const theme = createTheme({
typography: {
fontFamily: ['"Open Sans"', 'VT323', 'Roboto'].join(','),
},
overrides: {
MuiCssBaseline: {
'@global': {
'@font-face': [vt323],
},
},
},
});

export default theme;

0 comments on commit f31f5a7

Please sign in to comment.