mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
perf(website): fix startup forced reflow and adjust AVIF compression quality to 65
This commit is contained in:
@@ -129,7 +129,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
};
|
||||
|
||||
const scheduleHeroMascotAnchor = () => requestAnimationFrame(syncHeroMascotAnchor);
|
||||
scheduleHeroMascotAnchor();
|
||||
window.addEventListener('load', scheduleHeroMascotAnchor, { once: true });
|
||||
window.addEventListener('resize', scheduleHeroMascotAnchor, { passive: true });
|
||||
if ('ResizeObserver' in window) {
|
||||
|
||||
+2
-2
@@ -428,7 +428,7 @@ async function compile() {
|
||||
console.log(' ✓ Apple touch icons copied to www root.');
|
||||
}
|
||||
|
||||
// ── 7. Convert all WebP to AVIF (quality 70) ──
|
||||
// ── 7. Convert all WebP to AVIF (quality 65) ──
|
||||
console.log('Converting WebP → AVIF...');
|
||||
let avifCount = 0;
|
||||
const webpFiles = fs.readdirSync(destAssets).filter(f => f.endsWith('.webp'));
|
||||
@@ -438,7 +438,7 @@ async function compile() {
|
||||
if (stat.size < MIN_AVIF_KB * 1024) continue;
|
||||
const dest = path.join(destAssets, f.replace(/\.webp$/, '.avif'));
|
||||
if (fs.existsSync(dest) && fs.statSync(dest).mtimeMs >= stat.mtimeMs) continue;
|
||||
await sharp(src).avif({ quality: 80, speed: 4 }).toFile(dest);
|
||||
await sharp(src).avif({ quality: 65, speed: 4 }).toFile(dest);
|
||||
avifCount++;
|
||||
}
|
||||
console.log(` ${avifCount} AVIF files generated.`);
|
||||
|
||||
Reference in New Issue
Block a user