Thoughts & Musings

Device Posture API: Detect Foldable Screen Posture on Web
The Device Posture API helps web apps adapt to foldable devices by detecting whether a screen is continuous or folded and reacting to posture changes.

Device Orientation Events: Turning Phone Tilt into UI (A Tiny Demo Walkthrough)
Device Orientation Events let web apps read a phone’s real-world tilt and rotation. This demo streams alpha/beta/gamma values, smooths jitter, and maps motion to a 3D box—while handling HTTPS requirements and iOS permission prompts.

Right‑sizing experiences with the Device Memory API
Use the Device Memory API to bucket users by RAM and serve right‑sized images and effects. It’s a coarse, privacy‑friendly hint for progressive enhancement.

A Friendly Introduction to the Document Object Model (DOM) API
The Document Object Model (DOM) is the browser’s in-memory representation of your HTML, letting JavaScript select elements (querySelector), listen to events (addEventListener), update content (textContent), toggle styles (classList), and create/insert nodes (createElement, insertAdjacentElement). With it, a button can change a box’s text, toggle a highlight class, set a data attribute, or insert a new paragraph right after the box—no page reload required—illustrating the simple flow: select, listen, update.

A gentle intro to the Credential Management API
The Credential Management API lets your site securely store and retrieve user credentials through the browser’s built‑in manager—no brittle autofill hacks required. In our demo, a successful login stores a PasswordCredential, and a single click later retrieves and auto-fills it for returning users. It’s a progressive enhancement: your form still works everywhere, but supported browsers deliver a faster, lower-friction sign-in. Pair it with proper autocomplete attributes today, and plan for WebAuthn/passkeys to level up tomorrow.

Modern Cookies, Minus the Mess: A Quick Guide to the Cookie Store API
The Cookie Store API modernizes web cookies with async methods, typed objects, and change events—simplifying auth, prefs, and multi-tab sync.