Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Astro homepage to reduce CPU-heavy effects by removing some JS-driven animations/behaviors and shifting to CSS/markup-based equivalents, plus replaces an inlined base64 hero image with a static WebP asset.
Changes:
- Replace inlined base64 hero background with
public/hero.webp. - Remove JS-driven smooth scrolling, shooting stars, and scroll listeners; use CSS
scroll-behaviorand anchor links instead. - Refactor starfield/sparkle creation to use DOM templates and add a new sticky “back to top” wrapper/link.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| telescopetest-io/src/pages/index.astro | Refactors homepage styling/animations, back-to-top behavior, and star/sparkle generation logic. |
| telescopetest-io/public/hero.webp | Adds a static hero background image asset referenced by the homepage CSS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
telescopetest-io/src/pages/index.astro:1741
- With
prefers-reduced-motion,createStars()is never called, so the.starscontainer stays empty and users who request reduced motion lose the starfield entirely (even though the CSS already neutralizes animations in reduced-motion mode). Consider still generating the stars and just disabling their animation/twinkle when reduced motion is enabled.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
telescopetest-io/src/pages/index.astro:1654
- In reduced-motion mode, the script still creates
IntersectionObserverinstances (including the top-levelobserver) and registers themousemovelistener (even though it returns immediately). If the intent is to minimize work for reduced-motion users, consider short-circuiting initialization earlier (skip creating observers/listeners, and optionally skipcreateStars()as well) whenprefersReducedMotionis true.
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// Generate starfield
function createStars() {
const starTemplate = document.getElementById('star-template');
starTemplate.removeAttribute('id');
const starsContainer = document.getElementById('stars');
const starCount = 100;
for (let i = 0; i < starCount; i++) {
const star = starTemplate.cloneNode();
star.style.display = 'block';
star.style.left = Math.random() * 100 + '%';
star.style.top = Math.random() * 100 + '%';
star.style.animationDelay = Math.random() * 3 + 's';
starsContainer.appendChild(star);
}
}
// Intersection Observer for scroll animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -100px 0px',
};
const observer = new IntersectionObserver(entries => {
entries.forEach((entry, index) => {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replaced some JavaScript with CSS, fixed some excessive CPU consumption.
Disabled all the page wiggles when user prefers reduced motion.
This PR were created with 🔵 AI-assistance from Gemini and Copilot.