Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

<link rel="preload" as="style" href="{{ " /assets/css/style.css" | relative_url }}">
<link rel="stylesheet" href="{{ " /assets/css/style.css" | relative_url }}">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="dns-prefetch" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preload" as="style" href='https://fonts.googleapis.com/css2?family=EB+Garamond&display=swap'>
<link href="https://fonts.googleapis.com/css2?family=EB+Garamond&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=EB+Garamond&display=swap" rel="stylesheet" media="print" onload="this.media='all'">
<noscript><link href="https://fonts.googleapis.com/css2?family=EB+Garamond&display=swap" rel="stylesheet"></noscript>
<link
href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAMAAAD3eH5ZAAACqVBMVEUAAAAYGCQSEhwSEhoTExoTExoSEhoSEhsSEhsSEhoUFB4SEhsSEhsSEhoUFCcUFBsTExogICAUFBwSEhv///8SEhoTExoaGiISEhoWFh4TExoSEhpVVVUUFBsTExs5LiqWb1DXnGrzsHb/uHoXFhybclH9t3rBjWGPkJjZ2uIvLzcUFBzg4Ony8/t1dX1HSFC7u8OOj5bw8fkjJCvU1d1nZ285OUKtrraBgorp6vMbGyLHyM9ZWmEuLjafoKhzc3vh4uoVFR25usJLS1MjIyvv8PiRkpplZW3W19+rq7Q9PUaDg4tXV1/Ky9KcnaWIiJDb3OQwMDjh4eo4OEGkpa12dn5ISVHk5e1sbXW8vMSOj5eys7s1Nj0kJSzV1t5+f4ff4OhoaHA6OkNKSlKoqLGur7eCg4txcXnq6/McHCPIydDExc1aW2KQkZni4+ugoal0d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8XfCIO8cx9JK8rMHyT8EjTmL5V/KyFMtLBY9Yi+Edyc88TP+lVyM979KINCKNSCPSiDQijUgj0og0oqi7uyaAKAaAILrhz8zkX+ZVx9xlMw6eguELEb8hguNHOFh+hIXhRxhofoSG4kcoSH6EhMjZDbkIYVQZyjKUf94ayEaXf2gczlqaf/LNv1sPaXyPbmI1TB0ujQunYRlx0xwxGqIZd62MiBUP7XyGHY9tB5vh2PCs2LkM+4ZXrREPIVrxpnlhMSwz3jZOHIZpxIe6fvCfMPQdPlc3rd+EtqnxvaKs/CVUZYEfS9Is9w+QZ2mCvxJSaWNdFHtQ5KzRSgq86QQV8UUzmeCE7wAAAABJRU5ErkJggg=="
rel="icon" type="image/x-icon" />
Expand Down
4 changes: 2 additions & 2 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>Design Director at GitHub Copilot <span class="ampersand">&amp;</span> start
{% include home-navigation.html %}
{% include home-work.html %}

<script type="text/javascript" src="/assets/js/ios.js"></script>
<script type="text/javascript" src="/assets/js/s.js"></script>
<script defer src="/assets/js/ios.js"></script>
<script defer src="/assets/js/s.js"></script>
</body>
</html>
7 changes: 6 additions & 1 deletion _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@

html {
font-size: 62.5%;
scroll-behavior: smooth;
}

@media (prefers-reduced-motion: no-preference) {
html {
scroll-behavior: smooth;
}
}

body, h1, h2, h3, h4, h5, h6,
Expand Down
43 changes: 25 additions & 18 deletions assets/js/s.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
if (isHome) {
let arrow = document.querySelector('.home-intro-scroll');
const arrowTreshold = 100; // when stops being visible
let ticking = false;

// scroll hint
function showScrollHint(seconds) {
Expand All @@ -19,10 +20,20 @@
}
}

// scrolling event
document.addEventListener("scroll", scrollHandler);
// scrolling event with requestAnimationFrame throttling
document.addEventListener("scroll", scrollHandler, { passive: true });

function scrollHandler() {
if (!ticking) {
window.requestAnimationFrame(function() {
updateScrollPosition();
ticking = false;
});
ticking = true;
}
}

function updateScrollPosition() {
// scroll hint
let scroll = document.scrollingElement.scrollTop;

Expand All @@ -41,21 +52,19 @@
// HELPERS: scrolling function from A -> B (modified from: https://bit.ly/2H3JKMV)
function scrollToItem(destination, duration = 500, extraPadding) {
const start = window.pageYOffset;
const startTime = "now" in window.performance ? performance.now() : new Date().getTime();
const startTime = performance.now();
const documentElement = document.documentElement;
const body = document.body;

const documentHeight = Math.max(
document.body.scrollHeight,
document.body.offsetHeight,
document.documentElement.clientHeight,
document.documentElement.scrollHeight,
document.documentElement.offsetHeight
body.scrollHeight,
body.offsetHeight,
documentElement.clientHeight,
documentElement.scrollHeight,
documentElement.offsetHeight
);
const windowHeight =
window.innerHeight ||
document.documentElement.clientHeight ||
document.getElementsByTagName("body")[0].clientHeight;
const destinationOffset =
typeof destination === "number" ? destination : destination.offsetTop;
const windowHeight = window.innerHeight || documentElement.clientHeight || body.clientHeight;
const destinationOffset = typeof destination === "number" ? destination : destination.offsetTop;
let destinationOffsetToScroll = Math.round(
documentHeight - destinationOffset < windowHeight
? documentHeight - windowHeight
Expand All @@ -65,15 +74,13 @@
destinationOffsetToScroll -= extraPadding;
}

if ("requestAnimationFrame" in window === false) {
if (!window.requestAnimationFrame) {
window.scroll(0, destinationOffsetToScroll);
return;
}

function scroll() {
const now =
"now" in window.performance ? performance.now() : new Date().getTime();

const now = performance.now();
const time = Math.min(1, (now - startTime) / duration);
const timeFunction = 0.5 * (1 - Math.cos(Math.PI * time));
window.scroll(
Expand Down