-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update contact URL, homepage scroll (#47)
- Loading branch information
1 parent
787bc57
commit 66b2c4c
Showing
4 changed files
with
45 additions
and
21 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
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 |
---|---|---|
@@ -1,25 +1,42 @@ | ||
<script defer> | ||
|
||
// homepage: scroll to about on wheel down | ||
function scrollToAbout() { | ||
|
||
// handle wheel (allow click) | ||
if (event.type == "wheel") { | ||
|
||
// discontinue on wheel up | ||
if (event.deltaY < 0) return; | ||
|
||
// disable normal wheel | ||
else event.preventDefault(); | ||
} | ||
|
||
setTimeout(function () { | ||
|
||
// hide obsolete arrow navigation | ||
var arrowElement = document.getElementById('shift-nav'); | ||
arrowElement.style.display = 'none'; | ||
arrowElement.style.visibility = 'hidden'; | ||
|
||
// scroll to about information | ||
var aboutElement = document.getElementById('about-us'); | ||
aboutElement.style.display = "block"; | ||
aboutElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); | ||
}, 200); | ||
} | ||
|
||
function scrollToStart(id) { | ||
setTimeout(function () { | ||
var element = document.getElementById(id); | ||
element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); | ||
}, 200); | ||
} | ||
// homepage: scroll to splash on wheel up | ||
function scrollToSplash() { | ||
|
||
// discontinue on wheel down | ||
if (event.deltaY > 0) return; | ||
|
||
event.preventDefault(); | ||
|
||
function scrollToEnd(id) { | ||
setTimeout(function () { | ||
var element = document.getElementById(id); | ||
element.scrollIntoView({ behavior: 'smooth', block: 'end', inline: 'end' }); | ||
var element = document.getElementById('splash'); | ||
element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); | ||
}, 200); | ||
} | ||
</script> |
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