mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Remove jquery dependency in favor of css smooth scroll (#660)
This commit is contained in:
parent
8b2ac23974
commit
354bd91beb
3 changed files with 6 additions and 28 deletions
|
|
@ -35,7 +35,6 @@
|
|||
"globby": "^11.0.4",
|
||||
"graphql": "^16.6.0",
|
||||
"gsap": "^3.11.3",
|
||||
"jquery": "^3.6.1",
|
||||
"lodash": "^4.17.21",
|
||||
"next": "^12.3.1",
|
||||
"next-compose-plugins": "^2.2.1",
|
||||
|
|
|
|||
|
|
@ -13,29 +13,12 @@ import Apply from '../../components/hackathons/grant/apply'
|
|||
|
||||
import Zoom from 'react-reveal/Zoom'
|
||||
/** @jsxImportSource theme-ui */
|
||||
if (typeof window !== 'undefined') {
|
||||
window.$ = window.jQuery = require('jquery')
|
||||
|
||||
$(document).ready(function () {
|
||||
// Add smooth scrolling to all links (source: w3schools)
|
||||
$('a').on('click', function (event) {
|
||||
if (this.hash !== '') {
|
||||
event.preventDefault()
|
||||
var hash = this.hash
|
||||
|
||||
$('html, body').animate(
|
||||
{
|
||||
scrollTop: $(hash).offset().top
|
||||
},
|
||||
800,
|
||||
function () {
|
||||
window.location.hash = hash
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
const styles = `
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
`
|
||||
|
||||
const Requirement = ({ title, children, checkmark, background, size }) => {
|
||||
return (
|
||||
|
|
@ -84,6 +67,7 @@ const HackathonGrant = () => {
|
|||
description="Hack Club is partnering with FIRST to provide $500 grants to in-person high school hackathons happening until June 30th, 2023."
|
||||
image="https://cloud-7yw9f6xnv-hack-club-bot.vercel.app/0grant.png"
|
||||
/>
|
||||
<style>{styles}</style>
|
||||
<Box as="main" key="main">
|
||||
<Nav dark />
|
||||
<ForceTheme theme="dark" />
|
||||
|
|
|
|||
|
|
@ -3082,11 +3082,6 @@ isstream@~0.1.2:
|
|||
resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
jquery@^3.6.1:
|
||||
version "3.6.1"
|
||||
resolved "https://registry.npmjs.org/jquery/-/jquery-3.6.1.tgz"
|
||||
integrity sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==
|
||||
|
||||
js-sdsl@^4.1.4:
|
||||
version "4.1.4"
|
||||
resolved "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.4.tgz"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue