Fluted Glass
Installation
npm i @paper-design/shaders-react
Code
import { FlutedGlass } from '@paper-design/shaders-react'; <FlutedGlass size={0.8} shadows={0.24} highlights={0} distortionShape="cascade" distortion={0.21} blur={0.12} edges={0} margin={0.2} > <div className="demo"> <style>{`.demo { display: grid; align-content: center; justify-items: start; gap: 48px; height: 100%; padding: 0 8%; color: #222 } .demo p { margin: 0; font: 300 120px/1.1 Matter, system-ui; font-feature-settings: "ss01"; word-spacing: 0.1em; text-transform: lowercase } .demo button { display: flex; align-items: center; height: 128px; padding: 0 40px; border: 3px solid rgb(0 0 0 / 20%); border-radius: 24px; font: 44px 'Paper Mono', ui-monospace, monospace; color: #222; background: #fff; transition: background-color 150ms cubic-bezier(0.685, 0.89, 0.315, 0.995) } .demo button:hover { background: #f0efe4 } .demo button:active { background: #e9e8e0 } .demo .logos { display: flex; align-items: center; gap: 40px } .demo .logos img { height: 80px; width: auto }`}</style> <p>Select this text</p> <div className="logos"> <img src="/images/logos/paper-logo-only.svg" alt="Paper logo" /> <img src="/apple-touch-icon.png" alt="Paper icon" /> </div> <button onClick={(event) => { const clicks = Number(event.currentTarget.dataset.clicks ?? 0) + 1; event.currentTarget.dataset.clicks = String(clicks); event.currentTarget.textContent = `clicked ${clicks} time${clicks === 1 ? '' : 's'}`; }} > hover and click me </button> </div> </FlutedGlass>
Shader Props
Common Props
Description
Fluted glass image filter transforms an image into streaked, ribbed distortions, giving a mix of clarity and obscurity.