-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from UR-dandyhacks/dev
Intelligent navbar, space before about section, and particlesJS
- Loading branch information
Showing
5 changed files
with
227 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"particles": { | ||
"number": { | ||
"value": 50, | ||
"density": { | ||
"enable": true, | ||
"value_area": 500 | ||
} | ||
}, | ||
"color": { | ||
"value": "#fed936" | ||
}, | ||
"shape": { | ||
"type": "circle", | ||
"stroke": { | ||
"width": 0, | ||
"color": "#000000" | ||
}, | ||
"polygon": { | ||
"nb_sides": 5 | ||
}, | ||
"image": { | ||
"src": "img/github.svg", | ||
"width": 100, | ||
"height": 100 | ||
} | ||
}, | ||
"opacity": { | ||
"value": 1, | ||
"random": true, | ||
"anim": { | ||
"enable": true, | ||
"speed": 1, | ||
"opacity_min": 0.1, | ||
"sync": true | ||
} | ||
}, | ||
"size": { | ||
"value": 8, | ||
"random": true, | ||
"anim": { | ||
"enable": true, | ||
"speed": 4.794898228285104, | ||
"size_min": 0.1, | ||
"sync": true | ||
} | ||
}, | ||
"line_linked": { | ||
"enable": false, | ||
"distance": 150, | ||
"color": "#ffffff", | ||
"opacity": 0.4, | ||
"width": 1 | ||
}, | ||
"move": { | ||
"enable": true, | ||
"speed": 3, | ||
"direction": "none", | ||
"random": true, | ||
"straight": false, | ||
"out_mode": "out", | ||
"bounce": false, | ||
"attract": { | ||
"enable": false, | ||
"rotateX": 600, | ||
"rotateY": 1200 | ||
} | ||
} | ||
}, | ||
"interactivity": { | ||
"detect_on": "canvas", | ||
"events": { | ||
"onhover": { | ||
"enable": true, | ||
"mode": "repulse" | ||
}, | ||
"onclick": { | ||
"enable": false, | ||
"mode": "push" | ||
}, | ||
"resize": true | ||
}, | ||
"modes": { | ||
"grab": { | ||
"distance": 400, | ||
"line_linked": { | ||
"opacity": 1 | ||
} | ||
}, | ||
"bubble": { | ||
"distance": 400, | ||
"size": 40, | ||
"duration": 2, | ||
"opacity": 8, | ||
"speed": 3 | ||
}, | ||
"repulse": { | ||
"distance": 200, | ||
"duration": 0.4 | ||
}, | ||
"push": { | ||
"particles_nb": 4 | ||
}, | ||
"remove": { | ||
"particles_nb": 2 | ||
} | ||
} | ||
}, | ||
"retina_detect": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,12 @@ | |
</head> | ||
|
||
<body class="font-sans text-lavender bg-deep-purple"> | ||
<nav class="absolute flex flex-row items-center justify-between flex-none w-full px-5 py-5 lg:px-12 bg-deep-purple"> | ||
<nav class="fixed z-10 flex flex-row items-center justify-between flex-none w-full px-5 py-5 transition-transform ease-in-out lg:px-12 bg-deep-purple translate-y-0"> | ||
<h3 class="text-2xl">DandyHacks ‘23</h3> | ||
<div> | ||
<input class="absolute z-20 w-8 h-8 opacity-0 peer lg:hidden" type="checkbox" /> | ||
<img class="lg:hidden" src="img/icons/hamburger.png" /> | ||
<ul class="fixed top-0 right-0 z-10 flex flex-col h-full pt-16 text-3xl font-bold transition-transform ease-in-out gap-8 lg:flex-row lg:text-xl px-9 lg:p-0 w-72 bg-violet peer-checked:translate-x-0 translate-x-72 lg:bg-deep-purple lg:translate-x-0 lg:w-fit lg:h-fit lg:relative lg:gap-16 lg:transition-none"> | ||
<ul class="fixed top-0 right-0 z-10 flex flex-col h-screen pt-16 text-3xl font-bold transition-transform ease-in-out gap-8 lg:flex-row lg:text-xl px-9 lg:p-0 w-72 bg-violet peer-checked:translate-x-0 translate-x-72 lg:bg-deep-purple lg:translate-x-0 lg:w-fit lg:h-fit lg:relative lg:gap-16 lg:transition-none"> | ||
<li class="text-right"><a href="#about">About</a></li> | ||
<li class="text-right"><a href="#faq">FAQ</a></li> | ||
<li class="hidden text-right lg:block"><a href="#sponsoring">Sponsoring</a></li> | ||
|
@@ -49,7 +49,8 @@ <h2 class="text-2xl lg:text-4xl text-purple">November 3-5</h2> | |
</div> | ||
</div> | ||
</div> | ||
<div id="about" class="flex flex-row items-center justify-center bg-violet gap-[77px]"> | ||
<div class="flex flex-row items-center justify-center bg-violet gap-[77px]"> | ||
<div id="about" class="absolute bottom-16 lg:bottom-[150px]"></div> | ||
<img class="hidden lg:self-start lg:block" src="img/sticker2.png" /> | ||
<div class="px-9 lg:px-0 lg:flex-[0_0_454px] flex flex-col gap-7 lg:gap-14 mb-16 lg:mb-[150px]"> | ||
<h2 class="text-2xl lg:text-5xl">What is DandyHacks?</h2> | ||
|
@@ -70,12 +71,12 @@ <h2 class="text-2xl lg:text-5xl">What is DandyHacks?</h2> | |
</p> | ||
</div> | ||
</div> | ||
<img class="hidden lg:block lg:relative b-[150px]" src="img/sticker1.png" /> | ||
<img class="hidden lg:block lg:relative lg:b-[150px]" src="img/sticker1.png" /> | ||
</div> | ||
<div id="faq" class="px-5 lg:bg-repeat-y lg:bg-center-top lg:bg-fireflies lg:px-0"> | ||
<div id="faq" class="relative px-5"> | ||
<div class="flex flex-col items-center py-24 box-border gap-12 lg:gap-20"> | ||
<h2 class="text-5xl">FAQS</h2> | ||
<div class="flex flex-col px-10 py-4 lg:py-0 gap-5 lg:px-0"> | ||
<div class="flex flex-col px-10 py-4 pointer-events-none lg:py-0 gap-5 lg:px-0"> | ||
<details> | ||
<summary> | ||
What is a hackathon? | ||
|
@@ -212,16 +213,8 @@ <h3 class="text-3xl text-center pb-7">Why sponsor?</h3> | |
<span>© 2023 DandyHacks</span> | ||
</div> | ||
</footer> | ||
<script> | ||
let navigationLinks = document.querySelectorAll('nav li'); | ||
let hamburgerCheckbox = document.querySelector('nav .peer'); | ||
|
||
navigationLinks.forEach(navigationLink => { | ||
navigationLink.addEventListener('click', e => { | ||
hamburgerCheckbox.checked = false; | ||
}); | ||
}); | ||
</script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/particles.min.js"></script> | ||
<script src="script.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const navBar = document.querySelector('nav'); | ||
const navigationLinks = navBar.querySelectorAll('li'); | ||
const hamburgerCheckbox = navBar.querySelector('.peer'); | ||
|
||
// Hamburger navigation | ||
|
||
navigationLinks.forEach(navigationLink => { | ||
navigationLink.addEventListener('click', () => { | ||
document.body.classList.remove('overflow-hidden'); | ||
hamburgerCheckbox.checked = false; | ||
}); | ||
}); | ||
|
||
// Navbar appears on scroll down and hides on scroll up | ||
|
||
let lastScrollY = window.scrollY; | ||
|
||
window.addEventListener('scroll', () => { | ||
window.scrollY - lastScrollY > 0 ? hideNavBar() : showNavBar(); | ||
lastScrollY = window.scrollY; | ||
}); | ||
|
||
function hideNavBar() { | ||
navBar.classList.add('-translate-y-full'); | ||
navBar.classList.remove('translate-y-0'); | ||
} | ||
|
||
function showNavBar() { | ||
navBar.classList.add('translate-y-0'); | ||
navBar.classList.remove('-translate-y-full'); | ||
} | ||
|
||
// Disable scrolling when navigation menu is visible | ||
|
||
hamburgerCheckbox.addEventListener('change', (e) => { | ||
if (e.target.checked) { | ||
document.body.classList.add('overflow-hidden'); | ||
} | ||
}); | ||
|
||
// particles.js | ||
|
||
particlesJS.load('faq', 'assets/particlesjs-config.json'); | ||
}); |
Oops, something went wrong.