From d37a2480e91ad3b5a55da1194d13e541941d8cef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:43:09 +0000 Subject: [PATCH 1/4] Initial plan From c614f6c4cd571089ec05a355e34fd5ac3250eccf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:52:34 +0000 Subject: [PATCH 2/4] Optimize scroll performance and CSS transitions Co-authored-by: adrianmg <589285+adrianmg@users.noreply.github.com> --- _includes/head.html | 5 +++-- _sass/_base.scss | 4 ++-- _sass/_layout.scss | 21 +++++++++++---------- assets/js/s.js | 15 ++++++++++----- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index be1b0a9..7b192f0 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -20,9 +20,10 @@ - + - + + diff --git a/_sass/_base.scss b/_sass/_base.scss index 8e63ba0..90ad5e7 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -127,8 +127,8 @@ ul{ a { color: var(--brand-color); text-decoration: none; - -webkit-transition: none; - transition: none; + -webkit-transition: color 0s, text-decoration 0s; + transition: color 0s, text-decoration 0s; &:visited { color: var(--brand-color); diff --git a/_sass/_layout.scss b/_sass/_layout.scss index 59f91e3..329a826 100644 --- a/_sass/_layout.scss +++ b/_sass/_layout.scss @@ -7,12 +7,16 @@ body { padding: 0 var(--body-padding); animation: body-animation 1.6s; + will-change: opacity; } @keyframes body-animation { from { opacity: 0; } + to { + opacity: 1; + } } img { @@ -94,7 +98,7 @@ pre { text-decoration: none; padding: 2rem 1.4rem; position: relative; - transition: all var(--base-trans-slow) ease-in-out; + transition: color var(--base-trans-slow) ease-in-out; } .home-navigation a:hover { @@ -114,11 +118,12 @@ pre { fill: var(--text-color); visibility: hidden; opacity: 0; - transition: all var(--base-trans) ease-in-out; + transition: opacity var(--base-trans) ease-in-out, visibility var(--base-trans) ease-in-out; position: fixed; bottom: 5.2rem; right: 4.8rem; z-index: 2; + will-change: transform; } .home-intro-scroll.visible { @@ -131,8 +136,6 @@ pre { } @keyframes home-intro-scroll { - 20% { - } 45% { transform: translateY(0); } @@ -142,8 +145,6 @@ pre { 65% { transform: translateY(0); } - 75% { - } } @keyframes navigation-animation { @@ -189,7 +190,7 @@ pre { color: var(--title-color); text-decoration: none; outline: none; - transition: all var(--base-trans-slow) ease-in-out; + transition: color var(--base-trans-slow) ease-in-out; } } @@ -262,7 +263,7 @@ pre { position: relative; text-decoration: none; font-weight: 500; - transition: all var(--base-trans) ease-in-out; + transition: color var(--base-trans) ease-in-out; } .post a:before { @@ -272,7 +273,7 @@ pre { bottom: 0; left: 0; right: 0; - transition: all var(--base-trans) ease-in-out; + transition: background-color var(--base-trans) ease-in-out; } .post a:hover:before { @@ -426,7 +427,7 @@ pre { padding: 1.6rem 0; overflow: hidden; text-overflow: ellipsis; - transition: all var(--base-trans-mid) ease-in-out; + transition: padding-left var(--base-trans-mid) ease-in-out, color var(--base-trans-mid) ease-in-out; } .blog-list-item a:before { diff --git a/assets/js/s.js b/assets/js/s.js index dbd33f9..6472c84 100644 --- a/assets/js/s.js +++ b/assets/js/s.js @@ -19,8 +19,8 @@ } } - // scrolling event - document.addEventListener("scroll", scrollHandler); + // scrolling event with passive listener for better performance + document.addEventListener("scroll", scrollHandler, { passive: true }); function scrollHandler() { // scroll hint @@ -43,6 +43,7 @@ const start = window.pageYOffset; const startTime = "now" in window.performance ? performance.now() : new Date().getTime(); + // Cache document height calculations const documentHeight = Math.max( document.body.scrollHeight, document.body.offsetHeight, @@ -60,7 +61,8 @@ documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset - ) + ); + if (start >= destinationOffsetToScroll) { // going up destinationOffsetToScroll -= extraPadding; } @@ -81,13 +83,16 @@ Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start) ); + const currentPosition = Math.round(window.pageYOffset); + const targetPosition = Math.ceil(destinationOffsetToScroll); + if (start >= destinationOffsetToScroll) { // going up - if (Math.round(window.pageYOffset) <= Math.ceil(destinationOffsetToScroll)) { + if (currentPosition <= targetPosition) { return; } } else { // going down - if (Math.round(window.pageYOffset) >= Math.ceil(destinationOffsetToScroll)) { + if (currentPosition >= targetPosition) { return; } } From cc85217918f51d99ef635c34b5304e7f7308e2b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:56:10 +0000 Subject: [PATCH 3/4] Defer JavaScript loading for better page performance Co-authored-by: adrianmg <589285+adrianmg@users.noreply.github.com> --- _layouts/home.html | 4 ++-- pewpew.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_layouts/home.html b/_layouts/home.html index aad54ed..d421a28 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -26,7 +26,7 @@