[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111101":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":35,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":15,"starSnapshotCount":15,"syncStatus":39,"lastSyncTime":40,"discoverSource":41},111101,"glasswork","kubai087\u002Fglasswork","kubai087","A liquid glass material you can take apart, tune and copy as CSS: a refracting thick rim, wallpaper-adaptive ink and live wallpapers, in a playground.","https:\u002F\u002Fwww.kubai.design\u002Fglasswork\u002F",null,"JavaScript",106,6,53,0,4,25,43,16,67.34,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33,34],"backdrop-filter","css","design-engineering","glassmorphism","liquid-glass","playground","refraction","svg-filters","webgl","2026-11-05 17:03:52","2026-11-23 20:00:46","# Glasswork\n\n**English** · [简体中文](README.zh-CN.md)\n\nGlasswork is a standalone playground for the liquid glass material used on [Lumno](https:\u002F\u002Flumno.kubai.design)'s New Tab page. Tint, blur, rim refraction, rim light and text color can each be adjusted from the panel, and **Copy CSS** exports the resulting code.\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](LICENSE)\n[![No build step](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fbuild-none-brightgreen.svg)](#running-locally)\n[![Refraction: Chromium and WebGL](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frefraction-Chromium%20%7C%20WebGL-4285f4.svg)](#browser-support)\n[![Live demo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdemo-live-black.svg)](https:\u002F\u002Fwww.kubai.design\u002Fglasswork\u002F)\n\n![Glass search bar, player, tint slider and toolbar over the Dunes wallpaper, with the settings panel on the right](media\u002Fpreview.jpg)\n\n**[Open the playground](https:\u002F\u002Fwww.kubai.design\u002Fglasswork\u002F)** · [Announcement on X](https:\u002F\u002Fx.com\u002FKubai087\u002Fstatus\u002F2117782193108082923) · [Installation](#using-it-in-your-project)\n\n## Features\n\n- Independent settings for light and dark glass: tint color and strength, blur, saturation, brightness, contrast, rim light, bevel and shadow.\n- Adjustable rim refraction: width, edge offset, falloff and dispersion. Corner smoothing is also adjustable, and the refraction follows the corner shape.\n- Adaptive glass: the busier the wallpaper behind a surface, the denser its tint, while text contrast stays at 4.5:1 or above.\n- A range of built-in backgrounds: five generations of macOS abstract wallpapers (Tahoe, Sonoma, Ventura, Monterey and Big Sur, with light and dark versions that follow the theme; Tahoe and Sonoma are animated), six animated wallpapers rendered in WebGL (each in a light and a dark version), and random photos from Unsplash.\n- Custom images and videos, added by uploading, dragging onto the page, pasting a file or pasting a link. Local files are opened in the browser only and never uploaded. A notice at the top of the page indicates when a background is loading.\n- The search bar, player and tint slider can be dragged across the wallpaper; double-click to return one to its original position.\n- Five presets: Lumno, Clear glass, Frosted, Thick slab and Vivid. Presets change only the material and refraction, so adjusted colors, theme and other settings are preserved.\n- All settings are stored in the URL, so a shared link reproduces the same result.\n\n![The six animated wallpapers, light and dark](media\u002Fwallpapers.jpg)\n\n## How it works\n\nThe component structure is left unchanged; only four declarations are replaced: `background`, `backdrop-filter`, `box-shadow` and `color`. The material consists of six layers:\n\n1. **Shadow**, which gives the card its sense of volume.\n2. **Blur and lift.** The background is blurred by only 2px, with saturation and brightness raised so the glass stays clear rather than milky. Dark glass lowers the brightness instead, which avoids a gray cast.\n3. **Rim refraction.** An SVG displacement map shifts the background near the edge inward, most strongly at the edge and not at all in the middle. Red is shifted slightly more than blue, which produces dispersion.\n4. **Tint**, a translucent layer of color whose opacity adjusts to how busy the background is.\n5. **Rim light**: one highlight at the top left, one at the bottom right, and a softer one inset from the edge to suggest thickness.\n6. **Text color.** Text is multiplied onto light glass and added onto dark glass, so it carries some of the background's color instead of a flat fill.\n\nEach surface also samples 15 points of the wallpaper behind it and averages their brightness. When ink is set to Auto, an average below 0.5 switches the surface to dark glass with light text.\n\n![The player card over the Rings wallpaper, its edge refracting the stripes inward with a colored fringe](media\u002Frefraction.jpg)\n\nThe values currently used by [Lumno](https:\u002F\u002Flumno.kubai.design):\n\n| | Tint | Blur | Saturation | Brightness |\n| --- | --- | --- | --- | --- |\n| Light | white, 6%–22% | 2px | 180% | 1.06 |\n| Dark | rgb(30 30 34), 16%–38% | 2px | 160% | 0.8 |\n\nRefraction: a 40–44px rim, an edge offset of 1.1× the rim width, a falloff of 2.6 and ±15% dispersion.\n\n## Using it in your project\n\n### Installing with an AI coding tool\n\nPaste the following prompt into Claude Code, Cursor or another AI coding tool:\n\n```text\nRead https:\u002F\u002Fraw.githubusercontent.com\u002Fkubai087\u002Fglasswork\u002Fmain\u002FINSTALL.md and follow it to add Glasswork's liquid glass to my project.\n```\n\nFollowing the steps in [INSTALL.md](INSTALL.md), the tool applies this repository's material to your existing components without changing their layout, including the compatibility fixes for Safari and iOS.\n\n### Manual setup\n\nAdjust the glass in the playground, then press `\u003C\u002F>` in the toolbar to get CSS for light glass (`.glass`) and dark glass (`.glass.is-dark`) with the current values. `glass.css` in this repository is the same material expressed as variables.\n\nThe rim refraction requires one additional script with no dependencies:\n\n```html\n\u003Cscript type=\"module\">\n  import { liquidGlass } from 'https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002Fkubai087\u002Fglasswork@v1.1.0\u002Flens.js';\n  for (const el of document.querySelectorAll('.glass')) {\n    liquidGlass(el, { rim: 40, edge: 1.1, power: 2.6, dispersion: 0.15 });\n  }\n\u003C\u002Fscript>\n```\n\nThe element's `backdrop-filter` must end with `var(--glass-lens,)`. The script writes the refraction into that variable and updates it when the element is resized.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `rim` | `40` | Maximum rim width in px. Smaller elements reduce it to 1\u002F3.5 of their shorter side |\n| `edge` | `1.1` | Inward offset of the outer edge, in rim widths |\n| `power` | `2.6` | How quickly the refraction falls off toward the middle |\n| `dispersion` | `0.15` | Additional offset of red relative to blue; `0` disables dispersion |\n| `radius`, `corner` | read from CSS | Corner radius and shape; usually omitted |\n| `enabled` | `true` | Whether the refraction is active |\n\nThe function returns `update(options)`, `refresh()` and `destroy()`. To have the glass switch tone and adjust its density based on the background, see `adapt.js`.\n\n## URL parameters\n\nThe URL records only values that differ from the current preset. Parameters can also be written by hand, for example `?wallpaper=aurora&theme=dark&rim=56`.\n\n| Parameter | Values | Description |\n| --- | --- | --- |\n| `preset` | `lumno`, `clear-glass`, `frosted`, `thick-slab`, `vivid` | Preset |\n| `theme` | `light` (default), `dark` | Theme |\n| `wallpaper` | `tahoe` (default), `sonoma`, `ventura`, `monterey`, `bigsur`, `mesh`, `dunes`, `aurora`, `lava`, `lines`, `bokeh`, `photo` | Wallpaper |\n| `photo` | a Picsum photo id | A specific random photo |\n| `speed`, `paused` | `0`–`3`; `0` \u002F `1` | Wallpaper playback speed; paused state |\n| `ink` | `theme` (default), `auto`, `dark`, `light` | Text color; `auto` follows the wallpaper |\n| `autoDensity`, `density` | `0` \u002F `1`; `0`–`1` | Automatic or manual tint density |\n| `legible`, `threshold` | `0` \u002F `1`; `0.2`–`0.8` | Legibility guarantee; brightness threshold for automatic switching |\n| `lens`, `rim`, `edge`, `power`, `dispersion` | `0` \u002F `1`; `4`–`96`; `0`–`2.5`; `1`–`6`; `0`–`0.4` | Rim refraction |\n| `radius`, `smoothing` | `0`–`60`; `0.5`–`3` | Corner radius and smoothing |\n| `l.\u003Ckey>`, `d.\u003Ckey>` | | Individual values for light or dark glass: `tint`, `opacity`, `thin`, `dense`, `blur`, `saturation`, `brightness`, `contrast`, `rimLight`, `bevel`, `shadow` |\n| `lang`, `ui` | `zh`; `0` \u002F `1` | Chinese interface; panel collapsed on load |\n\nKeyboard shortcuts: `H` toggles the panel, `T` switches between light and dark, `W` moves to the next wallpaper, and Space pauses. Toolbar buttons also show their shortcuts on hover.\n\n## Running locally\n\nThe project has no dependencies and no build step. Any static server will run it:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fkubai087\u002Fglasswork.git\ncd glasswork\npython3 -m http.server 8000\n```\n\nThen open \u003Chttp:\u002F\u002Flocalhost:8000>. `window.__glass` is available in the console for inspecting state while debugging.\n\nMain files: `glass.css` defines the material, `lens.js` the rim refraction, `refract.js` the WebGL refraction used in Safari and Firefox, `adapt.js` the wallpaper sampling, `wallpapers.js` the six animated wallpapers, and `playground.js` the panel and page interaction.\n\n## Browser support\n\nChromium-based browsers such as Chrome, Edge and Arc render the rim refraction with an SVG filter inside `backdrop-filter` (`lens.js`). Safari, all browsers on iOS and Firefox do not support this, so the playground renders the layer behind the glass in WebGL instead (`refract.js`), with the same rim refraction, dispersion, blur and tone, beneath the glass's tint and rim light. When used on its own, `lens.js` produces refraction in Chromium only.\n\nCorner smoothing requires Chromium 139 or later. In Safari the glass uses standard rounded corners, because iOS 27 fails to render elements that combine a superellipse corner with a backdrop blur.\n\nIf a pasted link points to a site that does not allow cross-origin reads, the background still displays, but the glass cannot sample it and falls back to the theme's ink and a denser tint.\n\nIssues and pull requests are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License and credits\n\n- The code is released under the [MIT](LICENSE) license, as are the images in `media\u002F` rendered by this project.\n- **The macOS wallpapers are not covered by the MIT license.** The `tahoe-*`, `sonoma-*`, `ventura-*`, `monterey-*` and `bigsur-*` files in `media\u002F` are cropped or converted from macOS system wallpapers, © Apple Inc., and are included solely to demonstrate the glass over them in the live demo. Please do not reuse them, and remove them from any project built on this code. They will be removed promptly at the rights holder's request. See [NOTICE](NOTICE).\n- This is a personal project and is not affiliated with Apple. Apple, macOS, macOS Tahoe and Liquid Glass are trademarks of Apple Inc.; \"liquid glass\" here refers to [Lumno](https:\u002F\u002Flumno.kubai.design)'s own material.\n- Random photos are provided by [Lorem Picsum](https:\u002F\u002Fpicsum.photos), sourced from Unsplash under the Unsplash License; the photographer is credited in the lower-left corner.\n- The settings panel uses [Tweakpane](https:\u002F\u002Ftweakpane.github.io\u002Fdocs\u002F), MIT licensed, loaded from jsDelivr.\n","Glasswork 是一个用于实时设计与导出液态玻璃材质 CSS 样式的交互式网页工具。它支持独立调节明\u002F暗主题下的玻璃着色、模糊强度、边缘折射（含宽度、色散、衰减等参数）、边缘高光及文本对比度，并实现壁纸自适应着色（背景越复杂，玻璃着色越浓，同时保障文字可访问性≥4.5:1）。基于 backdrop-filter、SVG 滤镜与 WebGL 渲染，无需构建步骤，所有配置通过 URL 持久化。适用于 UI 设计师和前端开发者快速探索玻璃拟态（glassmorphism）效果，尤其适合新标签页、控制面板、媒体播放器等需要透明质感与动态背景融合的 Web 界面场景。",2,"2026-11-24 04:40:09","CREATED_QUERY"]