⚡ the slop performance library
loading experience improvements: inline critical CSS, font-display swap, preloads, deferred scripts, and a real page weight report. no build step, no tracking, no analytics — 100% client-side slop.
the slop performance library works with prefers-reduced-motion, prefers-color-scheme, and all the usual suspects. pure rules in js/performance-rules.js, DOM wiring in js/performance.js.
⏱️ loading metrics
real browser timing metrics from this page load. measures how fast the slop loads.
metrics collected via Navigation Timing API. requires a real browser — not available in Node.js.
🎨 critical CSS
inline critical CSS for above-the-fold rendering. Focused on immediate visibility, accessibility, and interactivity. Current size: 0 bytes (0 KB). Target: < 8 KB (we're at < 1 KB!).
why inline critical CSS?
prevents render-blocking requests. the browser can paint immediately with just the inline bits. no flash of invisible content. faster perceived load time.
target: 8 KB of above-the-fold CSS.
actual: 868 bytes (well under budget!).
🖋️ font-display swap
font-display: swap for all web fonts. prevents FOIT (flash of invisible text). fallback to system fonts immediately, then swap in custom fonts at load time.
@font-face font-display rules
@font-face {
font-family: "Rubik Wet Paint";
src: url(/fonts/rubik-wet-paint.woff2) format("woff2");
font-display: swap;
}
@font-face {
font-family: "Comic Neue";
font-weight: 400;
src: url(/fonts/comic-neue-400.woff2) format("woff2");
font-display: swap;
}
@font-face {
font-family: "Comic Neue";
font-weight: 700;
src: url(/fonts/comic-neue-700.woff2) format("woff2");
font-display: swap;
}
in js/performance-rules.js: FONT_RULES.display = 'swap'; all @font-face declarations get font-display: swap automatically.
test: font faces found with swap = ${window.slopPerformance && window.slopPerformance.checkFontDisplay ? 'detected' : 'N/A'}
🚀 preloads & resource hints
preloading of key resources. prioritized for faster rendering. also includes preconnect and dns-prefetch for third-party origins.
preload links (high priority)
resource hints
in js/performance-rules.js: PRELOAD_PRIORITIES.high = ['slop.css', 'slop-avatar.png', 'rubik-wet-paint.woff2', 'comic-neue-400.woff2', 'comic-neue-700.woff2'];
actual preloads: ${window.slopPerformance && window.slopPerformance.getPreloadLinks ? window.slopPerformance.getPreloadLinks(document.documentElement.outerHTML).length + ' links' : 'N/A'}
⏳ deferred scripts
deferred loading of non-essential scripts. scripts load after the page is interactive. render-blocking scripts are removed from the critical path.
deferred scripts (non-critical)
in js/performance-rules.js: DEFERRED_SCRIPTS = ['gallery.js', 'horror.js', 'status.js', 'wiki.js', 'projects.js', 'performance.js'];
actual deferred: ${window.slopPerformance && window.slopPerformance.getDeferredScripts ? (window.slopPerformance.getDeferredScripts(document.documentElement.outerHTML).defer || []).length + ' scripts' : 'N/A'}
render-blocking removed: ${window.slopPerformance && window.slopPerformance.getDeferredScripts ? (window.slopPerformance.getDeferredScripts(document.documentElement.outerHTML).async || []).length + ' async scripts' : 'N/A'}
⚖️ page weight report
real-time page weight calculation. HTML, CSS, JS, fonts, and total weight in KB. Target: 300 KB total.
current page weight
HTML: loading...
CSS: loading...
JS: loading...
Fonts: loading...
Total: loading...
Breakdown:
HTML: X%
CSS: Y%
JS: Z%
Fonts: W%
Total: V%
calculated via TextEncoder on the document HTML. inline critical CSS (868 bytes) is included in the HTML measurement. all script sizes from js/performance-rules.js.
⏱️ network timing
real browser navigation timing metrics from this page load. requires a real browser (not Node). measures loading performance in action.
navigation timing results
fetchStart: measuring...
responseStart: measuring...
responseEnd: measuring...
domContentLoaded: measuring...
loadEvent: measuring...
performance entries
waiting for navigation events...
data collected via performance.getEntriesByType('navigation'). shows actual network timing for this page load.
📊 performance budget
performance budgets for key metrics. green = passing, yellow = warning, red = over budget. all targets checked against page weight report.
budget status
HTML budget: pending (KB / 50KB)
CSS budget: pending (KB / 20KB)
JS budget: pending (KB / 100KB)
Total budget: pending (KB / 300KB)
LCP target: 2.5s
FCP target: 1.8s
TTI target: 3.5s
targets from js/performance-rules.js: total ≤ 300KB, html ≤ 50KB, css ≤ 20KB, js ≤ 100KB. this page's critical CSS: 868 bytes well under 8KB budget.
🔍 run performance audit
click the button to run a live audit on this page HTML. checks for critical CSS, font-display swap, preloads, and deferred scripts.
audit results
click "run audit" to see results...
real-time analysis powered by js/performance-rules.js. shows actual values for this page, not mock data.
📈 deep performance analysis
dive deeper with the performance analyzer for page weight reports, core web vitals estimates, resource waterfall charts, and optimization recommendations. all client-side, no external dependencies.