npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xiaxiangfeng/vue-flip-clock

v1.0.4

Published

A beautiful 3D flip clock component for Vue 3 with multiple modes (clock, countdown, timer)

Readme

Vue Flip Clock

A beautiful 3D flip clock component for Vue 3 with smooth animations and multiple modes.

✨ Features

  • 🎯 Three Modes: Clock, Countdown, and Timer
  • 🎨 Smooth 3D Animations: Realistic flip card animations
  • 📦 Lightweight: Minimal dependencies
  • 🔧 Easy to Use: Simple API with Vue 3 Composition API
  • 💪 TypeScript Support: Full type hints via JSDoc
  • 🎭 Customizable: SCSS styling that can be themed

📦 Installation

npm install vue-flip-clock

Or with yarn:

yarn add vue-flip-clock

Or with pnpm:

pnpm add vue-flip-clock

🚀 Quick Start

Global Registration

import { createApp } from 'vue'
import VueFlipClock from 'vue-flip-clock'
import 'vue-flip-clock/dist/style.css'

const app = createApp(App)
app.use(VueFlipClock)
app.mount('#app')

Then use it in your template:

<template>
  <FlipClock />
</template>

Local Registration

<template>
  <FlipClock mode="countdown" :value="targetTime" />
</template>

<script setup>
import { FlipClock } from 'vue-flip-clock'
import 'vue-flip-clock/dist/style.css'

const targetTime = Date.now() + 60 * 60 * 1000 // 1 hour from now
</script>

📖 Usage Examples

Clock Mode (Default)

Display current time:

<FlipClock />

Countdown Mode

Countdown to a specific time:

<script setup>
import { FlipClock } from 'vue-flip-clock'

// Countdown to a specific date
const targetDate = new Date('2024-12-31T23:59:59').getTime()
// Or countdown 1 hour from now
const oneHourLater = Date.now() + 60 * 60 * 1000
</script>

<template>
  <FlipClock mode="countdown" :value="targetDate" />
</template>

Timer Mode

Count up from a start time:

<script setup>
import { FlipClock } from 'vue-flip-clock'

// Timer started 5 minutes ago
const startTime = Date.now() - 5 * 60 * 1000
</script>

<template>
  <FlipClock mode="timer" :value="startTime" />
</template>

🔧 API

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | mode | 'clock' \| 'countdown' \| 'timer' | 'clock' | Display mode of the flip clock | | value | Date \| number | Date.now() | Reference time (timestamp or Date object) |

Mode Details

  • clock: Displays current time (HH:MM:SS). value prop is ignored.
  • countdown: Counts down to the target time specified in value. Stops at 00:00:00.
  • timer: Counts up from the start time specified in value.

Styling

The component uses SCSS for styling. You can customize the appearance by overriding CSS variables or classes:

.flip-clock-wrapper {
  /* Customize size */
  --flip-width: 60px;
  --flip-height: 90px;
  --flip-font-size: 80px;
}

.flip-clock-wrapper .inn {
  /* Customize colors */
  background-color: #502d2d;
  color: #ccc;
}

🎨 Demo

Check out the live demo to see all modes in action.

📋 Requirements

  • Vue 3.5.0 or higher

🛠️ Development

Setup

# Clone the repository
git clone https://github.com/xiaxiangfeng/vue-flip-clock.git
cd vue-flip-clock

# Install dependencies
npm install

# Start dev server for demo
npm run dev

# Build library
npm run build

# Build demo
npm run build:demo

Project Structure

vue-flip-clock/
├── lib/              # Component library source
│   ├── FlipClock.vue
│   ├── components/
│   └── index.js
├── demo/             # Demo application
│   ├── App.vue
│   └── main.js
├── dist/             # Build output (library)
└── dist-demo/        # Build output (demo)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT © Your Name

🙏 Acknowledgments

  • Inspired by classic flip clocks
  • Built with Vue 3 and Vite

Note: Replace xiaxiangfeng in URLs with your actual GitHub username before publishing.