├── .gitignore ├── .npmignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── Countdown.vue └── index.js └── vue.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | ._* 3 | .DS_Store 4 | .git 5 | .hg 6 | .npmrc 7 | .lock-wscript 8 | .svn 9 | .wafpickle-* 10 | config.gypi 11 | CVS 12 | npm-debug.log 13 | node_modules 14 | /.idea 15 | /node_modules 16 | /.github 17 | /src 18 | /public 19 | .eslintrc.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue3-flip-countdown 2 | 3 | > Customize Countdown timer with Flip Animation for [Vue](https://vuejs.org/ "Vue Homepage") 3.x 4 | 5 | > [vue3-flip-countdown.netlify.app](https://vue3-flip-countdown.netlify.app/) 6 | 7 | 8 |

9 | 10 | ![Netlify Status](https://api.netlify.com/api/v1/badges/69e11230-2c8b-4725-9540-7c0a861294e4/deploy-status) 11 | 12 | 13 | 14 | 15 | 16 |

17 | 18 | 19 | ## [Demo](https://vue3-flip-countdown.netlify.app/) 20 | 21 | 22 | 23 | 24 | 25 | ## Table of contents 26 | 27 | 28 | - [Demo](#demo) 29 | - [Installation](#installation) 30 | - [Global Usage](#global-usage) 31 | - [Single File Component Usage](#single-file-component-usage) 32 | - [Emits](#emits) 33 | - [Props](#props) 34 | - [References](#references) 35 | - [Requirements](#requirements) 36 | - [License](#license) 37 | 38 | ## Installation 39 | 40 | ``` 41 | npm i vue3-flip-countdown --save 42 | ``` 43 | 44 | ## Global Usage 45 | main.js 46 | ```js 47 | import { createApp } from 'vue' 48 | import App from './App.vue' 49 | import Countdown from 'vue3-flip-countdown' 50 | createApp(App).use(Countdown).mount('#app') 51 | ``` 52 | 53 | App.vue 54 | ```js 55 | 58 | 59 | 67 | ``` 68 | 69 | ## Single File Component Usage 70 | ```vue 71 | 74 | 75 | 84 | ``` 85 | 86 | ## Emits 87 | 88 | | Name | Description | 89 | | --- | --- | 90 | | timeElapsed | event that created when the time came | 91 | 92 | ## Props 93 | 94 | | Name | Type | Default | 95 | | --- | --- | --- | 96 | | deadlineISO | String
YYYY-MM-DDTHH:mm:ss.sssZ | | 97 | | deadline | String
YYYY-MM-DD HH:mm:ss | 32d,0h,0m,10s | 98 | | deadlineDate | Date | | 99 | | countdownSize | String | 3rem | 100 | | labelSize | String | 1.2rem | 101 | | flipAnimation | Boolean | true | 102 | | mainColor | String | '#EC685C' | 103 | | secondFlipColor | String | props.mainColor | 104 | | mainFlipBackgroundColor | String | '#222222' | 105 | | secondFlipBackgroundColor | String | '#393939' | 106 | | labelColor | String | '#222222' | 107 | | showLabels | Boolean | true | 108 | | stop | Boolean | | 109 | | showDays | Boolean | true | 110 | | showHours | Boolean | true | 111 | | showMinutes | Boolean | true | 112 | | showSeconds | Boolean | true | 113 | | labels | Object | {days: 'Days',hours: 'Hours',minutes: 'Minutes',seconds: 'Seconds',} | 114 | 115 | 116 | 117 | # References 118 | 119 | - [vue2-flip-countdown](https://github.com/philipjkim/vue2-flip-countdown) 120 | - [vuejs-countdown](https://github.com/getanwar/vuejs-countdown) 121 | - [Demo for 'Flip clock & countdown, Vue'](https://codepen.io/shshaw/pen/BzObXp) 122 | 123 | ## Requirements 124 | 125 | - [Vue](https://vuejs.org/) version **3.x.x** 126 | 127 | ## License 128 | 129 | [MIT](https://choosealicense.com/licenses/mit/) Copyright (c) 2021, [Emre Coşkunçay](https://github.com/coskuncayemre) 130 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue3-flip-countdown", 3 | "version": "0.1.4", 4 | "description": "Countdown timer with Flip Animation for Vue 3.x", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/coskuncayemre/vue3-flip-countdown.git" 8 | }, 9 | "bugs": { 10 | "url": "https://github.com/coskuncayemre/vue3-flip-countdown/issues" 11 | }, 12 | "homepage": "https://github.com/coskuncayemre/vue3-flip-countdown#readme", 13 | "keywords": [ 14 | "vue3", 15 | "javascript", 16 | "vue", 17 | "vuejs", 18 | "vuejs3", 19 | "countdown", 20 | "flip-countdown", 21 | "timer" 22 | ], 23 | "author": "Emre Coşkunçay", 24 | "license": "MIT", 25 | "private": false, 26 | "main": "dist/vue3-flip-countdown.common.js", 27 | "scripts": { 28 | "serve": "vue-cli-service serve", 29 | "build": "vue-cli-service build --target lib --name vue3-flip-countdown src/index.js", 30 | "lint": "vue-cli-service lint" 31 | }, 32 | "dependencies": { 33 | "vue": "^3.0.0" 34 | }, 35 | "devDependencies": { 36 | "@vue/cli-plugin-babel": "~4.5.0", 37 | "@vue/cli-plugin-eslint": "~4.5.0", 38 | "@vue/cli-service": "~4.5.0", 39 | "@vue/compiler-sfc": "~3.0.0", 40 | "babel-eslint": "^10.1.0", 41 | "eslint": "^6.7.2", 42 | "eslint-plugin-vue": "^7.0.0", 43 | "less": "^4.1.2", 44 | "less-loader": "^5.0.0", 45 | "moment": "^2.29.1", 46 | "sass-loader": "^10.1.1" 47 | }, 48 | "eslintConfig": { 49 | "root": true, 50 | "env": { 51 | "node": true 52 | }, 53 | "extends": [ 54 | "plugin:vue/vue3-essential", 55 | "eslint:recommended" 56 | ], 57 | "parserOptions": { 58 | "parser": "babel-eslint" 59 | }, 60 | "rules": {} 61 | }, 62 | "browserslist": [ 63 | "> 1%", 64 | "last 2 versions", 65 | "not dead" 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coskuncay/vue3-flip-countdown/8735af1362a7c223fc77d1a53bfe352fb10def63/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Countdown.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 342 | 343 | 543 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Countdown from './Countdown.vue' 2 | 3 | function install(app) { 4 | 5 | if (install.installed) { 6 | return 7 | } 8 | 9 | install.installed = true 10 | 11 | app.component(Countdown.name, Countdown) 12 | } 13 | 14 | export default install 15 | 16 | export { 17 | install, 18 | Countdown, 19 | } -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | // vue.config.js 2 | /** 3 | * @type {import('@vue/cli-service').ProjectOptions} 4 | */ 5 | module.exports = { 6 | // options... 7 | chainWebpack: config => { 8 | config.output.filename('vue3-flip-countdown.js') 9 | config.optimization.splitChunks().clear(); 10 | 11 | }, 12 | productionSourceMap: false, 13 | configureWebpack: { 14 | optimization: { 15 | splitChunks: false, 16 | } 17 | }, 18 | css: { 19 | extract: false 20 | } 21 | 22 | } --------------------------------------------------------------------------------