"use client";
import {
forwardRef,
useRef,
useState,
type ComponentPropsWithoutRef,
type PointerEvent as ReactPointerEvent,
} from "react";
import { cn } from "@/lib/cn";
import {ArrowRight,Check} from "lucide-react";
const PAD = 4;
const KNOB = 48;
export type SlideToConfirmButtonProps = Readonly<
{
label?: string;
confirmedLabel?: string;
onConfirm?: () => void;
} & Omit<ComponentPropsWithoutRef<"div">, "onConfirm">
>;
// Slide-to-confirm — drag the knob across the track to commit an action.
export const SlideToConfirmButton = forwardRef<
HTMLDivElement,
SlideToConfirmButtonProps
>(
(
{
className,
label = "Slide to confirm",
confirmedLabel = "Confirmed",
onConfirm,
...props
},
ref,
) => {
const trackRef = useRef<HTMLDivElement>(null);
const draggingRef = useRef(false);
const [x, setX] = useState(0);
const [confirmed, setConfirmed] = useState(false);
const maxX = () => {
const track = trackRef.current;
if (!track) return 0;
return track.offsetWidth - KNOB - PAD * 2;
};
const handleDown = (event: ReactPointerEvent<HTMLButtonElement>) => {
if (confirmed) return;
draggingRef.current = true;
event.currentTarget.setPointerCapture(event.pointerId);
};
const handleMove = (event: ReactPointerEvent<HTMLButtonElement>) => {
if (!draggingRef.current || confirmed) return;
const track = trackRef.current;
if (!track) return;
const rect = track.getBoundingClientRect();
const next = Math.min(
Math.max(event.clientX - rect.left - PAD - KNOB / 2, 0),
maxX(),
);
setX(next);
};
const handleUp = () => {
if (!draggingRef.current) return;
draggingRef.current = false;
if (x >= maxX() - 4) {
setX(maxX());
setConfirmed(true);
onConfirm?.();
} else {
setX(0);
}
};
const progress = maxX() > 0 ? x / maxX() : 0;
return (
<div
ref={ref}
data-slot="slide-to-confirm-button"
className="font-sans select-none"
{...props}
>
<div
ref={trackRef}
className={cn(
// transform-gpu + isolate promote the track to its own compositor
// layer so the knob's moving shadow can't leave stale ghost pixels.
"relative isolate h-14 w-72 transform-gpu overflow-hidden rounded-full p-1 transition-[background-color,box-shadow] duration-300",
"shadow-[inset_0_1px_2px_rgba(0,0,0,0.08),inset_0_2px_4px_rgba(0,0,0,0.05),inset_0_-2px_3px_rgba(0,0,0,0.06),0_1px_0_rgba(255,255,255,0.9)]",
confirmed
? "bg-emerald-600 shadow-[inset_0_1px_3px_rgba(0,0,0,0.2),inset_0_-2px_3px_rgba(0,0,0,0.12),0_1px_0_rgba(255,255,255,0.9)]"
: "bg-neutral-100",
className,
)}
>
<span
aria-hidden
className={cn(
"absolute inset-0 flex items-center justify-center text-sm font-medium transition-colors duration-200",
confirmed
? "text-white [text-shadow:0_1px_1px_rgba(0,0,0,0.25)]"
: "text-neutral-500 [text-shadow:0_1px_0_rgba(255,255,255,0.8)]",
)}
style={{ opacity: confirmed ? 1 : 1 - progress * 1.4 }}
>
{confirmed ? confirmedLabel : label}
</span>
<button
type="button"
aria-label={label}
disabled={confirmed}
onPointerDown={handleDown}
onPointerMove={handleMove}
onPointerUp={handleUp}
onPointerCancel={handleUp}
className={cn(
// will-change keeps the knob on its own compositor layer so the
// moving box-shadow doesn't leave stale ghost pixels on the track.
"absolute top-1 left-1 flex size-12 touch-none items-center justify-center rounded-full bg-neutral-50 text-neutral-700 will-change-transform",
// Keycap material like the quantity stepper, but with a tight,
// downward-only shadow so the knob sits in the groove instead of
// floating in a soft halo.
"shadow-[0_1px_1px_rgba(0,0,0,0.12),0_2px_3px_rgba(0,0,0,0.12),inset_0_1.5px_0_rgba(255,255,255,1),inset_0_-2px_3px_rgba(0,0,0,0.1)]",
confirmed
? "cursor-default"
: "cursor-grab active:cursor-grabbing active:bg-neutral-100 active:shadow-[0_1px_1px_rgba(0,0,0,0.06),inset_0_1px_1px_rgba(0,0,0,0.06),inset_0_2px_3px_rgba(0,0,0,0.03),inset_0_-2px_3px_rgba(0,0,0,0.05)]",
draggingRef.current
? "transition-[box-shadow,background-color] duration-200 ease-out"
: "transition-[transform,box-shadow,background-color] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
)}
style={{ transform: `translate3d(${x}px, 0, 0)` }}
>
{confirmed ? (
<Check
size={18}
strokeWidth={2.5}
aria-hidden
className="text-emerald-600 filter-[drop-shadow(0_1px_0_rgba(255,255,255,0.9))_drop-shadow(0_-1px_0.5px_rgba(0,0,0,0.12))]"
/>
) : (
<ArrowRight
size={18}
strokeWidth={2.5}
aria-hidden
className="filter-[drop-shadow(0_1px_0_rgba(255,255,255,0.9))_drop-shadow(0_-1px_0.5px_rgba(0,0,0,0.12))]"
/>
)}
</button>
</div>
</div>
);
},
);
SlideToConfirmButton.displayName = "SlideToConfirmButton";
Slide To Confirm Button
By Bidyut
Try the interaction, copy the React source files, or download the complete example.
About Slide To Confirm Button
Slide To Confirm Button is an animated React and Tailwind CSS button by Bidyut. Try the interaction, copy the React source, or download the example with creator credit.
- Effects and categories
- Hover effects, Animated
- Using this example
- Copy a TSX file or download the original source and standalone demo. Test keyboard focus, motion and contrast in your own project.
Usage, Tailwind and licensing questions
Read the source files
import-examples/slide-to-confirm-button.tsx
import {SlideToConfirmButton} from "@/components/buttons/slide-to-confirm-button";
export default function Demo(){return (<SlideToConfirmButton />);}components/buttons/slide-to-confirm-button.tsx
"use client";
import {
forwardRef,
useRef,
useState,
type ComponentPropsWithoutRef,
type PointerEvent as ReactPointerEvent,
} from "react";
import { cn } from "@/lib/cn";
import {ArrowRight,Check} from "lucide-react";
const PAD = 4;
const KNOB = 48;
export type SlideToConfirmButtonProps = Readonly<
{
label?: string;
confirmedLabel?: string;
onConfirm?: () => void;
} & Omit<ComponentPropsWithoutRef<"div">, "onConfirm">
>;
// Slide-to-confirm — drag the knob across the track to commit an action.
export const SlideToConfirmButton = forwardRef<
HTMLDivElement,
SlideToConfirmButtonProps
>(
(
{
className,
label = "Slide to confirm",
confirmedLabel = "Confirmed",
onConfirm,
...props
},
ref,
) => {
const trackRef = useRef<HTMLDivElement>(null);
const draggingRef = useRef(false);
const [x, setX] = useState(0);
const [confirmed, setConfirmed] = useState(false);
const maxX = () => {
const track = trackRef.current;
if (!track) return 0;
return track.offsetWidth - KNOB - PAD * 2;
};
const handleDown = (event: ReactPointerEvent<HTMLButtonElement>) => {
if (confirmed) return;
draggingRef.current = true;
event.currentTarget.setPointerCapture(event.pointerId);
};
const handleMove = (event: ReactPointerEvent<HTMLButtonElement>) => {
if (!draggingRef.current || confirmed) return;
const track = trackRef.current;
if (!track) return;
const rect = track.getBoundingClientRect();
const next = Math.min(
Math.max(event.clientX - rect.left - PAD - KNOB / 2, 0),
maxX(),
);
setX(next);
};
const handleUp = () => {
if (!draggingRef.current) return;
draggingRef.current = false;
if (x >= maxX() - 4) {
setX(maxX());
setConfirmed(true);
onConfirm?.();
} else {
setX(0);
}
};
const progress = maxX() > 0 ? x / maxX() : 0;
return (
<div
ref={ref}
data-slot="slide-to-confirm-button"
className="font-sans select-none"
{...props}
>
<div
ref={trackRef}
className={cn(
// transform-gpu + isolate promote the track to its own compositor
// layer so the knob's moving shadow can't leave stale ghost pixels.
"relative isolate h-14 w-72 transform-gpu overflow-hidden rounded-full p-1 transition-[background-color,box-shadow] duration-300",
"shadow-[inset_0_1px_2px_rgba(0,0,0,0.08),inset_0_2px_4px_rgba(0,0,0,0.05),inset_0_-2px_3px_rgba(0,0,0,0.06),0_1px_0_rgba(255,255,255,0.9)]",
confirmed
? "bg-emerald-600 shadow-[inset_0_1px_3px_rgba(0,0,0,0.2),inset_0_-2px_3px_rgba(0,0,0,0.12),0_1px_0_rgba(255,255,255,0.9)]"
: "bg-neutral-100",
className,
)}
>
<span
aria-hidden
className={cn(
"absolute inset-0 flex items-center justify-center text-sm font-medium transition-colors duration-200",
confirmed
? "text-white [text-shadow:0_1px_1px_rgba(0,0,0,0.25)]"
: "text-neutral-500 [text-shadow:0_1px_0_rgba(255,255,255,0.8)]",
)}
style={{ opacity: confirmed ? 1 : 1 - progress * 1.4 }}
>
{confirmed ? confirmedLabel : label}
</span>
<button
type="button"
aria-label={label}
disabled={confirmed}
onPointerDown={handleDown}
onPointerMove={handleMove}
onPointerUp={handleUp}
onPointerCancel={handleUp}
className={cn(
// will-change keeps the knob on its own compositor layer so the
// moving box-shadow doesn't leave stale ghost pixels on the track.
"absolute top-1 left-1 flex size-12 touch-none items-center justify-center rounded-full bg-neutral-50 text-neutral-700 will-change-transform",
// Keycap material like the quantity stepper, but with a tight,
// downward-only shadow so the knob sits in the groove instead of
// floating in a soft halo.
"shadow-[0_1px_1px_rgba(0,0,0,0.12),0_2px_3px_rgba(0,0,0,0.12),inset_0_1.5px_0_rgba(255,255,255,1),inset_0_-2px_3px_rgba(0,0,0,0.1)]",
confirmed
? "cursor-default"
: "cursor-grab active:cursor-grabbing active:bg-neutral-100 active:shadow-[0_1px_1px_rgba(0,0,0,0.06),inset_0_1px_1px_rgba(0,0,0,0.06),inset_0_2px_3px_rgba(0,0,0,0.03),inset_0_-2px_3px_rgba(0,0,0,0.05)]",
draggingRef.current
? "transition-[box-shadow,background-color] duration-200 ease-out"
: "transition-[transform,box-shadow,background-color] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
)}
style={{ transform: `translate3d(${x}px, 0, 0)` }}
>
{confirmed ? (
<Check
size={18}
strokeWidth={2.5}
aria-hidden
className="text-emerald-600 filter-[drop-shadow(0_1px_0_rgba(255,255,255,0.9))_drop-shadow(0_-1px_0.5px_rgba(0,0,0,0.12))]"
/>
) : (
<ArrowRight
size={18}
strokeWidth={2.5}
aria-hidden
className="filter-[drop-shadow(0_1px_0_rgba(255,255,255,0.9))_drop-shadow(0_-1px_0.5px_rgba(0,0,0,0.12))]"
/>
)}
</button>
</div>
</div>
);
},
);
SlideToConfirmButton.displayName = "SlideToConfirmButton";
lib/cn.ts
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
demo.tsx
export { default as default } from "@/import-examples/slide-to-confirm-button";CSS
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
:root, :host {
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, Monaco,
Consolas, monospace;
--color-emerald-600: oklch(59.6% 0.145 163.225);
--color-neutral-50: oklch(98.5% 0 none);
--color-neutral-100: oklch(97% 0 none);
--color-neutral-500: oklch(55.6% 0 none);
--color-neutral-700: oklch(37.1% 0 none);
--color-white: #fff;
--spacing: 0.25rem;
--text-sm: 0.875rem;
--text-sm--line-height: calc(1.25 / 0.875);
--font-weight-medium: 500;
--ease-out: cubic-bezier(0, 0, 0.2, 1);
--default-transition-duration: 150ms;
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
--default-font-family: var(--font-sans);
--default-mono-font-family: var(--font-mono);
}
}
@layer base {
*, ::after, ::before, ::backdrop, ::file-selector-button {
box-sizing: border-box;
margin: 0;
padding: 0;
border: 0 solid;
}
html, :host {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
tab-size: 4;
font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
font-feature-settings: var(--default-font-feature-settings, normal);
font-variation-settings: var(--default-font-variation-settings, normal);
-webkit-tap-highlight-color: transparent;
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
h1, h2, h3, h4, h5, h6 {
font-size: inherit;
font-weight: inherit;
}
a {
color: inherit;
-webkit-text-decoration: inherit;
text-decoration: inherit;
}
b, strong {
font-weight: bolder;
}
code, kbd, samp, pre {
font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
font-feature-settings: var(--default-mono-font-feature-settings, normal);
font-variation-settings: var(--default-mono-font-variation-settings, normal);
font-size: 1em;
}
small {
font-size: 80%;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
:-moz-focusring:where(:not(iframe)) {
outline: auto;
}
progress {
vertical-align: baseline;
}
summary {
display: list-item;
}
ol, ul, menu {
list-style: none;
}
img, svg, video, canvas, audio, iframe, embed, object {
display: block;
vertical-align: middle;
}
img, video {
max-width: 100%;
height: auto;
}
button, input, select, optgroup, textarea, ::file-selector-button {
font: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
letter-spacing: inherit;
color: inherit;
border-radius: 0;
background-color: transparent;
opacity: 1;
}
:where(select:is([multiple], [size])) optgroup {
font-weight: bolder;
}
:where(select:is([multiple], [size])) optgroup option {
padding-inline-start: 20px;
}
::file-selector-button {
margin-inline-end: 4px;
}
::placeholder {
opacity: 1;
}
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
::placeholder {
color: currentcolor;
@supports (color: color-mix(in lab, red, red)) {
color: color-mix(in oklab, currentcolor 50%, transparent);
}
}
}
textarea {
resize: vertical;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-date-and-time-value {
min-height: 1lh;
text-align: inherit;
}
::-webkit-datetime-edit {
display: inline-flex;
}
::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
padding-block: 0;
}
::-webkit-calendar-picker-indicator {
line-height: 1;
}
:-moz-ui-invalid {
box-shadow: none;
}
button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
appearance: button;
}
::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
height: auto;
}
[hidden]:where(:not([hidden="until-found"])) {
display: none !important;
}
}
@layer utilities {
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.inset-0 {
inset: 0px;
}
.top-1 {
top: var(--spacing);
}
.left-1 {
left: var(--spacing);
}
.isolate {
isolation: isolate;
}
.flex {
display: flex;
}
.size-12 {
width: calc(var(--spacing) * 12);
height: calc(var(--spacing) * 12);
}
.h-14 {
height: calc(var(--spacing) * 14);
}
.w-72 {
width: calc(var(--spacing) * 72);
}
.transform {
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
}
.transform-gpu {
transform: translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
}
.cursor-default {
cursor: default;
}
.cursor-grab {
cursor: grab;
}
.touch-none {
touch-action: none;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.overflow-hidden {
overflow: hidden;
}
.rounded-full {
border-radius: calc(infinity * 1px);
}
.bg-emerald-600 {
background-color: var(--color-emerald-600);
}
.bg-neutral-50 {
background-color: var(--color-neutral-50);
}
.bg-neutral-100 {
background-color: var(--color-neutral-100);
}
.p-1 {
padding: var(--spacing);
}
.font-sans {
font-family: var(--font-sans);
}
.text-sm {
font-size: var(--text-sm);
line-height: var(--tw-leading, var(--text-sm--line-height));
}
.font-medium {
--tw-font-weight: var(--font-weight-medium);
font-weight: var(--font-weight-medium);
}
.text-emerald-600 {
color: var(--color-emerald-600);
}
.text-neutral-500 {
color: var(--color-neutral-500);
}
.text-neutral-700 {
color: var(--color-neutral-700);
}
.text-white {
color: var(--color-white);
}
.shadow {
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
.shadow-\[0_1px_1px_rgba\(0\,0\,0\,0\.12\)\,0_2px_3px_rgba\(0\,0\,0\,0\.12\)\,inset_0_1\.5px_0_rgba\(255\,255\,255\,1\)\,inset_0_-2px_3px_rgba\(0\,0\,0\,0\.1\)\] {
--tw-shadow: 0 1px 1px var(--tw-shadow-color, rgba(0,0,0,0.12)), 0 2px 3px var(--tw-shadow-color, rgba(0,0,0,0.12)), inset 0 1.5px 0 var(--tw-shadow-color, rgba(255,255,255,1)), inset 0 -2px 3px var(--tw-shadow-color, rgba(0,0,0,0.1));
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
.shadow-\[inset_0_1px_2px_rgba\(0\,0\,0\,0\.08\)\,inset_0_2px_4px_rgba\(0\,0\,0\,0\.05\)\,inset_0_-2px_3px_rgba\(0\,0\,0\,0\.06\)\,0_1px_0_rgba\(255\,255\,255\,0\.9\)\] {
--tw-shadow: inset 0 1px 2px var(--tw-shadow-color, rgba(0,0,0,0.08)), inset 0 2px 4px var(--tw-shadow-color, rgba(0,0,0,0.05)), inset 0 -2px 3px var(--tw-shadow-color, rgba(0,0,0,0.06)), 0 1px 0 var(--tw-shadow-color, rgba(255,255,255,0.9));
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
.shadow-\[inset_0_1px_3px_rgba\(0\,0\,0\,0\.2\)\,inset_0_-2px_3px_rgba\(0\,0\,0\,0\.12\)\,0_1px_0_rgba\(255\,255\,255\,0\.9\)\] {
--tw-shadow: inset 0 1px 3px var(--tw-shadow-color, rgba(0,0,0,0.2)), inset 0 -2px 3px var(--tw-shadow-color, rgba(0,0,0,0.12)), 0 1px 0 var(--tw-shadow-color, rgba(255,255,255,0.9));
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
.filter-\[drop-shadow\(0_1px_0_rgba\(255\,255\,255\,0\.9\)\)_drop-shadow\(0_-1px_0\.5px_rgba\(0\,0\,0\,0\.12\)\)\] {
filter: drop-shadow(0 1px 0 rgba(255,255,255,0.9)) drop-shadow(0 -1px 0.5px rgba(0,0,0,0.12));
}
.transition-\[background-color\,box-shadow\] {
transition-property: background-color,box-shadow;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.transition-\[box-shadow\,background-color\] {
transition-property: box-shadow,background-color;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.transition-\[transform\,box-shadow\,background-color\] {
transition-property: transform,box-shadow,background-color;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.transition-colors {
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.duration-200 {
--tw-duration: 200ms;
transition-duration: 200ms;
}
.duration-300 {
--tw-duration: 300ms;
transition-duration: 300ms;
}
.ease-\[cubic-bezier\(0\.32\,0\.72\,0\,1\)\] {
--tw-ease: cubic-bezier(0.32,0.72,0,1);
transition-timing-function: cubic-bezier(0.32,0.72,0,1);
}
.ease-out {
--tw-ease: var(--ease-out);
transition-timing-function: var(--ease-out);
}
.will-change-transform {
will-change: transform;
}
.select-none {
-webkit-user-select: none;
user-select: none;
}
.\[text-shadow\:0_1px_0_rgba\(255\,255\,255\,0\.8\)\] {
text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
.\[text-shadow\:0_1px_1px_rgba\(0\,0\,0\,0\.25\)\] {
text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.active\:cursor-grabbing:active {
cursor: grabbing;
}
.active\:bg-neutral-100:active {
background-color: var(--color-neutral-100);
}
.active\:shadow-\[0_1px_1px_rgba\(0\,0\,0\,0\.06\)\,inset_0_1px_1px_rgba\(0\,0\,0\,0\.06\)\,inset_0_2px_3px_rgba\(0\,0\,0\,0\.03\)\,inset_0_-2px_3px_rgba\(0\,0\,0\,0\.05\)\]:active {
--tw-shadow: 0 1px 1px var(--tw-shadow-color, rgba(0,0,0,0.06)), inset 0 1px 1px var(--tw-shadow-color, rgba(0,0,0,0.06)), inset 0 2px 3px var(--tw-shadow-color, rgba(0,0,0,0.03)), inset 0 -2px 3px var(--tw-shadow-color, rgba(0,0,0,0.05));
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
}
:root {
--background: #fff;
--foreground: #111;
--primary: #171717;
--primary-foreground: #fff;
--secondary: #eee;
--secondary-foreground: #171717;
--muted: #eee;
--muted-foreground: #666;
--accent: #eee;
--accent-foreground: #171717;
--border: #ddd;
--input: #ddd;
--ring: #777;
--destructive: #dc2626;
--destructive-foreground: #fff;
--popover: #fff;
--popover-foreground: #111;
--success: #15803d;
--success-foreground: #fff;
--radius: .625rem;
--hairline: 1px;
}
.dark {
--background: #090909;
--foreground: #fafafa;
--primary: #fafafa;
--primary-foreground: #171717;
--secondary: #262626;
--secondary-foreground: #fafafa;
--muted: #262626;
--muted-foreground: #a3a3a3;
--accent: #262626;
--accent-foreground: #fafafa;
--border: #333;
--input: #333;
--popover: #171717;
--popover-foreground: #fafafa;
}
@keyframes code-panel-shift {
0%, 100% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
}
@keyframes caret-blink {
0%, 49% {
opacity: 1;
}
50%, 100% {
opacity: 0;
}
}
@keyframes wave-hand {
0%, 100% {
transform: rotate(0deg);
}
50% {
transform: rotate(-12deg);
}
}
@keyframes marketing-go-back-in {
from {
opacity: 0;
transform: translateX(-6px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes showcase-fade-in {
from {
opacity: 0;
transform: translateY(3px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes watch-ring-draw-outer {
from {
stroke-dasharray: 0 163;
}
to {
stroke-dasharray: 121 163;
}
}
@keyframes watch-ring-draw-middle {
from {
stroke-dasharray: 0 119;
}
to {
stroke-dasharray: 74 119;
}
}
@keyframes watch-ring-draw-inner {
from {
stroke-dasharray: 0 75;
}
to {
stroke-dasharray: 66 75;
}
}
@keyframes watch-brand-line {
from {
opacity: 0;
transform: translateY(5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes showcase-progress {
0% {
transform: scaleX(0.12);
}
100% {
transform: scaleX(0.96);
}
}
@keyframes showcase-art-zoom {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.07);
}
}
@keyframes ipod-bar {
0%, 100% {
transform: scaleY(0.28);
}
50% {
transform: scaleY(1);
}
}
@property --tw-rotate-x {
syntax: "*";
inherits: false;
}
@property --tw-rotate-y {
syntax: "*";
inherits: false;
}
@property --tw-rotate-z {
syntax: "*";
inherits: false;
}
@property --tw-skew-x {
syntax: "*";
inherits: false;
}
@property --tw-skew-y {
syntax: "*";
inherits: false;
}
@property --tw-font-weight {
syntax: "*";
inherits: false;
}
@property --tw-shadow {
syntax: "*";
inherits: false;
initial-value: 0 0 #0000;
}
@property --tw-shadow-color {
syntax: "*";
inherits: false;
}
@property --tw-shadow-alpha {
syntax: "<percentage>";
inherits: false;
initial-value: 100%;
}
@property --tw-inset-shadow {
syntax: "*";
inherits: false;
initial-value: 0 0 #0000;
}
@property --tw-inset-shadow-color {
syntax: "*";
inherits: false;
}
@property --tw-inset-shadow-alpha {
syntax: "<percentage>";
inherits: false;
initial-value: 100%;
}
@property --tw-ring-color {
syntax: "*";
inherits: false;
}
@property --tw-ring-shadow {
syntax: "*";
inherits: false;
initial-value: 0 0 #0000;
}
@property --tw-inset-ring-color {
syntax: "*";
inherits: false;
}
@property --tw-inset-ring-shadow {
syntax: "*";
inherits: false;
initial-value: 0 0 #0000;
}
@property --tw-ring-inset {
syntax: "*";
inherits: false;
}
@property --tw-ring-offset-width {
syntax: "<length>";
inherits: false;
initial-value: 0px;
}
@property --tw-ring-offset-color {
syntax: "*";
inherits: false;
initial-value: #fff;
}
@property --tw-ring-offset-shadow {
syntax: "*";
inherits: false;
initial-value: 0 0 #0000;
}
@property --tw-duration {
syntax: "*";
inherits: false;
}
@property --tw-ease {
syntax: "*";
inherits: false;
}
@layer properties {
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
*, ::before, ::after, ::backdrop {
--tw-rotate-x: initial;
--tw-rotate-y: initial;
--tw-rotate-z: initial;
--tw-skew-x: initial;
--tw-skew-y: initial;
--tw-font-weight: initial;
--tw-shadow: 0 0 #0000;
--tw-shadow-color: initial;
--tw-shadow-alpha: 100%;
--tw-inset-shadow: 0 0 #0000;
--tw-inset-shadow-color: initial;
--tw-inset-shadow-alpha: 100%;
--tw-ring-color: initial;
--tw-ring-shadow: 0 0 #0000;
--tw-inset-ring-color: initial;
--tw-inset-ring-shadow: 0 0 #0000;
--tw-ring-inset: initial;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-offset-shadow: 0 0 #0000;
--tw-duration: initial;
--tw-ease: initial;
}
}
}