diff --git a/attached_assets/image_1762643101965.png b/attached_assets/image_1762643101965.png new file mode 100644 index 0000000..2e861f2 Binary files /dev/null and b/attached_assets/image_1762643101965.png differ diff --git a/static/css/styles.css b/static/css/styles.css index 109496d..4cfe3af 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -310,20 +310,21 @@ hr { position: relative; } -.home-info::before { - content: ''; +.home-info > * { + position: relative; + z-index: 2; +} + +.stars-container { position: absolute; top: 0; - left: -5%; - width: 110%; + left: 50%; + transform: translateX(-50%); + width: 100vw; height: 100%; pointer-events: none; z-index: 0; -} - -.home-info > * { - position: relative; - z-index: 1; + overflow: hidden; } .star { diff --git a/static/js/scripts.js b/static/js/scripts.js index 84440d1..b3e072e 100644 --- a/static/js/scripts.js +++ b/static/js/scripts.js @@ -395,9 +395,12 @@ function initStars() { const sections = document.querySelectorAll('.home-info'); sections.forEach(section => { + const starContainer = document.createElement('div'); + starContainer.className = 'stars-container'; + const sectionHeight = section.offsetHeight; - const sectionWidth = section.offsetWidth; - const numStars = Math.floor((sectionWidth * sectionHeight) / 15000); + const viewportWidth = window.innerWidth; + const numStars = Math.floor((viewportWidth * sectionHeight) / 15000); for (let i = 0; i < numStars; i++) { const star = document.createElement('div'); @@ -416,7 +419,9 @@ function initStars() { star.style.setProperty('--duration', duration + 's'); star.style.setProperty('--delay', delay + 's'); - section.appendChild(star); + starContainer.appendChild(star); } + + section.appendChild(starContainer); }); }