效能
未檢測未檢測
Number TickerMIT文字特效GodUI
由 Lucas Bassetti 製作的文字特效 React 元件。依據 MIT 授權從 GodUI 原樣收錄,此處為即時預覽。
品質報告
等級和分數來自建置或測試時跑過的自動檢查。沒跑過的項目會標成「未檢測」,不會填假資料。
未檢測
未檢測
未檢測
未檢測
資料來自自動腳本,不是手工填寫。
以實際尺寸顯示。
複製內容以授權聲明開頭,使用程式碼時請保留。
<div id="root"></div>:root{--bg:#f6f4f0;--ink:#17181a;--background:40 20% 96%;--foreground:24 10% 8%;--card:0 0% 100%}html,body{min-height:100%;margin:0;background:var(--bg);color:var(--ink)}html,body{height:100%;overflow:hidden}body{display:grid;place-items:center}#root{display:grid;place-items:center;max-width:100%;max-height:100%;box-sizing:border-box;padding:16px;color:hsl(var(--foreground))}#root.full{width:100%;height:100%;padding:0}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-play-state:paused!important;transition-duration:0s!important}}
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--shadow-2xs:var(--shadow-2xs);--shadow-xs:var(--shadow-xs);--shadow-sm:var(--shadow-sm);--shadow-md:var(--shadow-md);--shadow-lg:var(--shadow-lg);--shadow-xl:var(--shadow-xl);--shadow-2xl:var(--shadow-2xl);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow:var(--shadow)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;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;-webkit-text-decoration: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{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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)){::placeholder{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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.inline-block{display:inline-block}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-foreground{color:var(--foreground)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}}:root,.light,:root[data-theme=light]{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--font-sans:var(--font-geist-sans,"Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif);--font-serif:var(--font-geist-sans,"Geist", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif);--font-mono:var(--font-geist-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);--radius:.625rem;--shadow-2xs:0 1px 2px #00000005;--shadow-xs:0 1px 3px #0000000a;--shadow-sm:0 2px 6px #0000000d;--shadow:0 4px 12px #0000000f;--shadow-md:0 8px 20px #00000014;--shadow-lg:0 16px 32px #0000001a;--shadow-xl:0 24px 48px #0000001f;--shadow-2xl:0 40px 80px #00000029;--syntax-plain:oklch(20% .036 266);--syntax-punctuation:oklch(54% .022 266);--syntax-keyword:oklch(52% .19 302);--syntax-property:oklch(56% .11 90);--syntax-string:oklch(52% .106 168);--syntax-comment:oklch(63% .016 266);--syntax-number:oklch(54% .115 235);--inline-code-bg:var(--muted);--inline-code-fg:var(--foreground);--inline-code-border:var(--border);--code-block:oklch(97.8% 0 0);--code-block-foreground:oklch(20.5% 0 0);--code-block-border:oklch(92.2% 0 0);--search-bg:var(--card);--search-fg:var(--muted-foreground);--search-border:var(--border);--search-kbd-bg:var(--muted);--search-kbd-fg:var(--muted-foreground);--search-placeholder:var(--muted-foreground);--search-highlight-bg:var(--primary);--search-highlight-fg:var(--primary-foreground);--theme-panel-bg:var(--card);--theme-panel-border:var(--border);--theme-panel-fg:var(--muted-foreground);--theme-panel-active-bg:var(--muted);--theme-panel-active-fg:var(--foreground);--z-base:0;--z-raised:10;--z-overlay:20;--z-sticky:30;--z-popover:40;--z-modal:50;--z-toast:60;--color-bg:var(--background);--color-fg:var(--foreground);--color-border:var(--border);--color-primary:var(--primary);--color-primary-fg:var(--primary-foreground);--color-secondary-bg:var(--secondary);--color-secondary-fg:var(--secondary-foreground);--color-destructive:var(--destructive);--color-destructive-fg:oklch(100% 0 0);--glow-highlight:61, 102, 223;--color-primary-rgb:61, 102, 223;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--god-gradient:linear-gradient(135deg, oklch(55% .19 266) 0%, oklch(100% 0 0) 50%, oklch(85% .12 90) 100%);--god-glow:0 0 24px oklch(55% .19 266/.14), 0 0 80px oklch(85% .12 90/.06);--rainbow-1:oklch(55% .19 266);--rainbow-2:oklch(68% .16 305);--rainbow-3:oklch(82% .1 185);--rainbow-4:oklch(78% .12 14);--rainbow-5:oklch(80% .13 90);--rainbow-speed:2s}@media (color-gamut:p3){:root,.light{--syntax-string:oklch(52% .13 168);--syntax-number:oklch(54% .13 235)}}@media (prefers-color-scheme:dark){:root:not(.light){--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--syntax-plain:oklch(93.5% .01 266);--syntax-punctuation:oklch(65% .02 266);--syntax-keyword:oklch(78% .135 302);--syntax-property:oklch(83% .12 90);--syntax-string:oklch(80% .13 168);--syntax-comment:oklch(58% .02 266);--syntax-number:oklch(80% .12 224);--code-block:oklch(18.5% 0 0);--code-block-foreground:oklch(98.5% 0 0);--code-block-border:oklch(27% 0 0);--inline-code-bg:var(--muted);--inline-code-fg:var(--foreground);--inline-code-border:var(--border);--search-bg:var(--card);--search-fg:var(--muted-foreground);--search-border:var(--border);--search-kbd-bg:var(--muted);--search-kbd-fg:var(--muted-foreground);--search-placeholder:var(--muted-foreground);--search-highlight-bg:var(--primary);--search-highlight-fg:var(--primary-foreground);--theme-panel-bg:var(--card);--theme-panel-border:var(--border);--theme-panel-fg:var(--muted-foreground);--theme-panel-active-bg:var(--muted);--theme-panel-active-fg:var(--foreground);--shadow-2xs:0 1px 2px #0000001f;--shadow-xs:0 1px 3px #00000026;--shadow-sm:0 2px 6px #0003;--shadow:0 4px 12px #00000040;--shadow-md:0 8px 20px #0000004d;--shadow-lg:0 16px 32px #00000059;--shadow-xl:0 24px 48px #0006;--shadow-2xl:0 40px 80px #00000080;--color-bg:var(--background);--color-fg:var(--foreground);--color-border:var(--border);--color-primary:var(--primary);--color-primary-fg:var(--primary-foreground);--color-secondary-bg:var(--secondary);--color-secondary-fg:var(--secondary-foreground);--color-destructive:var(--destructive);--color-destructive-fg:oklch(100% 0 0);--glow-highlight:66, 108, 229;--color-primary-rgb:66, 108, 229;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--god-gradient:linear-gradient(135deg, oklch(57% .19 266) 0%, oklch(100% 0 0) 50%, oklch(86% .12 90) 100%);--god-glow:0 0 24px oklch(57% .19 266/.28), 0 0 80px oklch(86% .12 90/.12);--rainbow-1:oklch(72% .145 266);--rainbow-2:oklch(74% .16 305);--rainbow-3:oklch(84% .1 185);--rainbow-4:oklch(80% .116 14);--rainbow-5:oklch(84% .13 90);--rainbow-speed:2s}}:root[data-theme=dark],.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--syntax-plain:oklch(93.5% .01 266);--syntax-punctuation:oklch(65% .02 266);--syntax-keyword:oklch(78% .135 302);--syntax-property:oklch(83% .12 90);--syntax-string:oklch(80% .13 168);--syntax-comment:oklch(58% .02 266);--syntax-number:oklch(80% .12 224);--code-block:oklch(18.5% 0 0);--code-block-foreground:oklch(98.5% 0 0);--code-block-border:oklch(27% 0 0);--inline-code-bg:var(--muted);--inline-code-fg:var(--foreground);--inline-code-border:var(--border);--search-bg:var(--card);--search-fg:var(--muted-foreground);--search-border:var(--border);--search-kbd-bg:var(--muted);--search-kbd-fg:var(--muted-foreground);--search-placeholder:var(--muted-foreground);--search-highlight-bg:var(--primary);--search-highlight-fg:var(--primary-foreground);--theme-panel-bg:var(--card);--theme-panel-border:var(--border);--theme-panel-fg:var(--muted-foreground);--theme-panel-active-bg:var(--muted);--theme-panel-active-fg:var(--foreground);--shadow-2xs:0 1px 2px #0000001f;--shadow-xs:0 1px 3px #00000026;--shadow-sm:0 2px 6px #0003;--shadow:0 4px 12px #00000040;--shadow-md:0 8px 20px #0000004d;--shadow-lg:0 16px 32px #00000059;--shadow-xl:0 24px 48px #0006;--shadow-2xl:0 40px 80px #00000080;--color-bg:var(--background);--color-fg:var(--foreground);--color-border:var(--border);--color-primary:var(--primary);--color-primary-fg:var(--primary-foreground);--color-secondary-bg:var(--secondary);--color-secondary-fg:var(--secondary-foreground);--color-destructive:var(--destructive);--color-destructive-fg:oklch(100% 0 0);--glow-highlight:66, 108, 229;--color-primary-rgb:66, 108, 229;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--god-gradient:linear-gradient(135deg, oklch(57% .19 266) 0%, oklch(100% 0 0) 50%, oklch(86% .12 90) 100%);--god-glow:0 0 24px oklch(57% .19 266/.28), 0 0 80px oklch(86% .12 90/.12);--rainbow-1:oklch(72% .145 266);--rainbow-2:oklch(74% .16 305);--rainbow-3:oklch(84% .1 185);--rainbow-4:oklch(80% .116 14);--rainbow-5:oklch(84% .13 90);--rainbow-speed:2s}@media (color-gamut:p3){@media (prefers-color-scheme:dark){:root:not(.light){--syntax-keyword:oklch(78% .14 302);--rainbow-1:oklch(72% .15 266);--rainbow-4:oklch(80% .12 14)}}.dark{--syntax-keyword:oklch(78% .14 302);--rainbow-1:oklch(72% .15 266);--rainbow-4:oklch(80% .12 14)}}@keyframes magic-rainbow{0%{background-position:0%}to{background-position:200%}}@keyframes magic-input-indeterminate{0%{background-position:110%}to{background-position:-10%}}@keyframes magic-input-sweep{0%{background-size:0% 100%}to{background-size:100% 100%}}@keyframes magic-input-spin{to{transform:rotate(360deg)}}@keyframes shimmer-slide{to{transform:translate(calc(100cqw - 100%))}}@keyframes spin-around{0%{transform:translateZ(0)rotate(0)}15%,35%{transform:translateZ(0)rotate(90deg)}65%,85%{transform:translateZ(0)rotate(270deg)}to{transform:translateZ(0)rotate(360deg)}}@keyframes progress-fold-indeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}@keyframes mask-button-in{0%{-webkit-mask-position:0 0;mask-position:0 0}to{-webkit-mask-position:100% 0;mask-position:100% 0}}@keyframes mask-button-out{0%{-webkit-mask-position:100% 0;mask-position:100% 0}to{-webkit-mask-position:0 0;mask-position:0 0}}@keyframes aurora-text{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}@keyframes marquee{0%{transform:translate(0)}to{transform:translateX(calc(-100% - var(--gap)))}}@keyframes marquee-vertical{0%{transform:translateY(0)}to{transform:translateY(calc(-100% - var(--gap)))}}@keyframes split-flap-fall{0%{transform:rotateX(0)}to{transform:rotateX(-90deg)}}@keyframes split-flap-rise{0%{transform:rotateX(90deg)}to{transform:rotateX(0)}}@keyframes blueprint-sweep{0%{transform:translate(-50%, -50%) rotate(var(--blueprint-angle,25deg));opacity:0}15%,85%{opacity:1}to{transform:translate(150%, 150%) rotate(var(--blueprint-angle,25deg));opacity:0}}@keyframes light-rays-sweep{0%{transform:rotate(calc(var(--rays-angle,0deg) - 6deg)) scale(1);opacity:calc(var(--rays-intensity,.6) * .7)}to{transform:rotate(calc(var(--rays-angle,0deg) + 6deg)) scale(1.08);opacity:var(--rays-intensity,.6)}}@keyframes voice-orb-spin{to{transform:rotate(360deg)}}@keyframes voice-orb-breathe{0%,to{transform:scale(1)}50%{transform:scale(1.04)}}@keyframes voice-orb-ring{0%{opacity:.6;transform:scale(.85)}to{opacity:0;transform:scale(1.4)}}@keyframes app-showcase-scroll{0%{transform:translateY(0)}to{transform:translateY(-50%)}}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}// godui source (MIT). npm i motion react · Tailwind CSS v4
// ── number-ticker/index.ts (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/number-ticker/index.ts)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Additional notice: this component is derived from Magic UI (MIT):
MIT License
Copyright (c) Magic UI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
export { NumberTicker, type NumberTickerProps } from "./number-ticker";
// ── number-ticker/number-ticker.tsx (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/number-ticker/number-ticker.tsx)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Additional notice: this component is derived from Magic UI (MIT):
MIT License
Copyright (c) Magic UI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
"use client";
import {
useInView,
useMotionValue,
useReducedMotion,
useSpring,
} from "motion/react";
import * as React from "react";
export type NumberTickerProps = Omit<
React.HTMLAttributes<HTMLSpanElement>,
"children"
> & {
/** Target value the ticker animates to (or from, when `direction` is `"down"`). */
value: number;
/** Value the counter starts at. Defaults to `0`. */
startValue?: number;
/** `"up"` counts toward `value`, `"down"` counts from `value` to `startValue`. */
direction?: "up" | "down";
/** Delay in seconds before the animation begins once in view. */
delay?: number;
/** Number of decimal places to render. */
decimalPlaces?: number;
/** Spring damping — higher is less bouncy. */
damping?: number;
/** Spring stiffness — higher is faster. */
stiffness?: number;
};
const NumberTicker = React.forwardRef<HTMLSpanElement, NumberTickerProps>(
(
{
value,
startValue = 0,
direction = "up",
delay = 0,
decimalPlaces = 0,
damping = 60,
stiffness = 100,
className,
...props
},
forwardedRef,
) => {
const ref = React.useRef<HTMLSpanElement>(null);
const reduceMotion = useReducedMotion();
const motionValue = useMotionValue(
direction === "down" ? value : startValue,
);
const springValue = useSpring(motionValue, { damping, stiffness });
const isInView = useInView(ref, { once: true, margin: "0px" });
React.useImperativeHandle(
forwardedRef,
() => ref.current as HTMLSpanElement,
);
React.useEffect(() => {
if (!isInView) return;
const target = direction === "down" ? startValue : value;
const timer = setTimeout(() => {
motionValue.set(target);
// Reduced motion: land on the final value instead of springing to it.
if (reduceMotion) springValue.jump(target);
}, delay * 1000);
return () => clearTimeout(timer);
}, [
motionValue,
springValue,
isInView,
delay,
value,
direction,
startValue,
reduceMotion,
]);
React.useEffect(
() =>
springValue.on("change", (latest) => {
if (ref.current) {
ref.current.textContent = Intl.NumberFormat("en-US", {
minimumFractionDigits: decimalPlaces,
maximumFractionDigits: decimalPlaces,
}).format(Number(latest.toFixed(decimalPlaces)));
}
}),
[springValue, decimalPlaces],
);
return (
<span
ref={ref}
data-slot="number-ticker"
className={`inline-block tabular-nums tracking-wider text-foreground ${className ?? ""}`}
{...props}
>
{Intl.NumberFormat("en-US", {
minimumFractionDigits: decimalPlaces,
maximumFractionDigits: decimalPlaces,
}).format(direction === "down" ? value : startValue)}
</span>
);
},
);
NumberTicker.displayName = "NumberTicker";
export { NumberTicker };控制項 · HTML · CSS · JS
直接改程式碼,再用控制項微調,預覽會隨輸入即時更新。

線上編輯每個元件,用控制項微調,下載完整原始碼,複製進階提示詞。
一次性 $49暫定價格
測試模式:不會真的扣款。
免費:預覽、複製按鈕和課程說明。
會動的文字不需要額外配圖就能吸引目光;動效跟著字形走,訊息本身仍是主角。
首屏標語、標題、數字計數和值得停留一下的短標籤。
時長、字母或詞之間的錯峰間隔、緩動曲線,以及漸層或高亮的顏色。
把 GodUI (github.com/LucasBassetti/godui)(MIT)中的「數字滾動」元件加入我的 React + Tailwind CSS 應用程式。原始檔:https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/packages/lab/src/number-ticker。會動的文字不需要額外配圖就能吸引目光;動效跟著字形走,訊息本身仍是主角。 適用情境:首屏標語、標題、數字計數和值得停留一下的短標籤。 可調參數:時長、字母或詞之間的錯峰間隔、緩動曲線,以及漸層或高亮的顏色。 支援淺色與深色主題,遵循 prefers-reduced-motion。保留 MIT 授權聲明。
更完整的提示詞,包含調參、無障礙和接入步驟。