A whimsical screen saver featuring a sleeping cat and clock animation.
npx shadcn@latest add @refinery/sleeping-cat-screensaver| Name | Type | Description |
|---|---|---|
| bgColor | string | Background color class for the screen. |
| brandText | string | Brand label above the clock. |
| imageSrc | string | Image URL for the sleeping cat. |
| imageAlt | string | Alt text for the cat image. |
The design here is simple, with overall idea to keep it very minimal and clean screen-saver variant with a 'cute' feel. The main animation is the clock, which is implemented by using 'requestAnimationFrame' to update the time every second. We calculate the current time and format it as a string to display. The seconds progress bar is implemented by calculating how far through the current minute we are and animating the width of a div accordingly. The sleeping cat image is styled with a gentle pulse animation to give it some life without being distracting. The entire screen saver fades in and out smoothly using Motion animation. A subtle instruction text is included at the bottom to inform users how to exit the screen saver mode. The component accepts 'bgColor' and 'brandText' as props. The 'bgColor' prop allows you to customize the background color of the screen saver (recommended to keep light color shades matching the brand-theme), while the 'brandText' prop lets you display your brand name or any custom text above the clock for a personalized touch.