Web Worker Heavy Task Demo - Online Non‑Blocking
Run a CPU‑heavy calculation (e.g., prime numbers) in a Web Worker and see the UI stay responsive. Code snippet provided.
UD5 Toolkit
Experience the difference between blocking and non-blocking computation in the browser.
Real-time Animation MonitorClick "Main Thread" to compute Fibonacci on the main thread.
Click "Web Worker" to compute Fibonacci without blocking the UI.
postMessage() and onmessage event handlers. Since workers run in a separate global context, they cannot directly access the DOM, window, or document objects.
requestAnimationFrame callbacks. This causes the animation ball to freeze, timers to stop, and the page to become unresponsive. This demo makes that invisible bottleneck visible.
window, or document. (2) Data is passed via structured cloning (copy, not share), which has overhead for large objects. (3) Each worker has memory overhead (~2-5MB+). (4) Workers cannot access localStorage or sessionStorage directly. (5) Debugging workers can be more challenging. For shared memory scenarios, SharedArrayBuffer can be used, but it requires specific security headers (COOP/COEP).
worker.terminate(). This stops the worker's execution instantly without allowing it to finish or clean up. There's no way to "gracefully" cancel a worker from the outside—the worker must cooperatively check a flag if you need graceful cancellation. In this demo, the Cancel button calls terminate() to abort an ongoing computation. This is one advantage workers have over main-thread computations, which cannot be interrupted once started.
BigInt serialization via structured cloning (used in this demo for large Fibonacci numbers) is supported in Chrome 67+, Firefox 68+, Safari 14+, and Edge 79+. For older browsers, you can serialize BigInt results as strings for compatibility.
Run a CPU‑heavy calculation (e.g., prime numbers) in a Web Worker and see the UI stay responsive. Code snippet provided.
Place multiple grid items into the same cells to create overlapping layouts. Learn the technique visually. Copy code.
Render 1000 styled elements using inline styles vs. CSS classes and compare time. Understand CSS‑in‑JS trade‑offs.
Control image‑orientation: from-image vs none. See how the browser interprets EXIF rotation. Fix portrait photos.
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
Build a horizontal scroll‑snap container with configurable snap‑type and alignment. Perfect for image galleries.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Drop files onto a zone and see a preview with name, size, and type. Copy the JavaScript pattern for your site.
Demonstrate how to add custom headers and POST‑like functionality to EventSource using a polyfill. Code and example.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
See how overflow: visible, hidden, scroll, and auto behave with real content. Clone to test with your text.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
Adjust page characteristics (image size, server delay, layout shift) and see the simulated Core Web Vitals scores. Understand what impacts performance.
Render the classic Stanford Bunny with a basic WebGPU pipeline. Rotate and zoom. Check if your browser supports WebGPU.
See how scroll‑padding and scroll‑margin affect the position of elements when using anchor links or scroll‑snap. Visual.
Test a regex against long strings and measure execution time. Detect catastrophic backtracking patterns. Visual warning if slow.
Test the experimental Translation API to translate text between languages directly in the browser, without cloud calls. Check support and copy the JavaScript starter.
Apply a convolution filter (blur, sharpen) using a Web Worker. See the UI stay responsive while processing. Learn multithreading in the browser.
Measure your browser's GPU compute power using a simple WebGPU matrix multiplication. See raw FLOPS and compare with peers. Fully client‑side.
Paste a raster image and an SVG, see the file size and rendering time. Understand when to use vector. Local.
Apply will‑change to any element and see its effect on compositing. Learn best practices for smooth animations.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Enter a URL and get a one‑page report of titles, description, headings, image alts, and broken links. All from browser.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.