Skip to content
Open
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 src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,15 @@ const learningLoops = [
</section>

<script>
let hasPlayedHeroScan = false;

const playHeroScan = () => {
const hero = document.querySelector('[data-hero-neon]');
if (!hero) return;
if (hasPlayedHeroScan) return;
if (document.documentElement.dataset.animations === 'off') return;
if (hero.classList.contains('hero-neon-text--active')) return;
hasPlayedHeroScan = true;
hero.classList.add('hero-neon-text--active');
};

Expand Down Expand Up @@ -420,8 +424,6 @@ const learningLoops = [
window.setTimeout(playHeroScan, 420);

document.querySelectorAll('[data-hero-neon]').forEach((hero) => {
hero.addEventListener('pointerenter', playHeroScan);

hero.addEventListener('animationend', () => {
hero.classList.remove('hero-neon-text--active');
});
Expand Down
13 changes: 7 additions & 6 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ main {
.hero-neon-text {
position: relative;
overflow: visible;
line-height: 0.98;
padding-bottom: 0.08em;
line-height: 1.06;
background-image: linear-gradient(
100deg,
#0f172a 0%,
Expand All @@ -248,7 +249,7 @@ main {
#0f172a 100%
);
background-size: 240% 100%;
background-position: 120% 0;
background-position: -120% 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop the scan background from repeating

Since .hero-neon-text does not set background-repeat, the default repeat still applies here. With background-size: 240% 100%, background-position: -120% 0 does not put the gradient off the left edge; a repeated tile covers the headline and leaves the green band around the middle at rest, so the scan wraps instead of starting as a single left-to-right sweep. Add background-repeat: no-repeat or use positions that account for repeating.

Useful? React with 👍 / 👎.

color: transparent;
background-clip: text;
filter: drop-shadow(0 0 0 rgba(57, 255, 20, 0));
Expand All @@ -257,7 +258,7 @@ main {
}

.hero-neon-text--active {
animation: hero-neon-scan 1.6s var(--ease-out) 1;
animation: hero-neon-scan 1s var(--ease-out) 1;
will-change: background-position, filter;
}

Expand Down Expand Up @@ -954,7 +955,7 @@ html.dark .metric-card__stat {

@keyframes hero-neon-scan {
from {
background-position: 120% 0;
background-position: -120% 0;
filter: drop-shadow(0 0 0 rgba(57, 255, 20, 0));
}

Expand All @@ -963,7 +964,7 @@ html.dark .metric-card__stat {
}

to {
background-position: -120% 0;
background-position: 120% 0;
filter: drop-shadow(0 0 0 rgba(57, 255, 20, 0));
}
}
Expand Down Expand Up @@ -1013,7 +1014,7 @@ html.dark .metric-card__stat {
}

.hero-neon-text {
line-height: 1.02;
line-height: 1.08;
}

.bio-orbit {
Expand Down