├── .babelrc ├── index.js ├── examples ├── twelve-hour-clock.html ├── twenty-four-hour-clock.html ├── localization.html ├── daily-counter.html ├── hourly-counter.html ├── minute-counter.html ├── twelve-hour-clock-without-seconds.html ├── minute-counter-overflow.html ├── twenty-four-hour-clock-without-seconds.html ├── simple-counter-autostart.html ├── twelve-hour-clock-custom-time.html ├── twenty-four-hour-clock-custom-time.html ├── simple-countdown-autostart.html ├── simple-counter-minimum-digits.html ├── countdown-stop-callback.html ├── multiple-instances.html ├── interval-callback.html ├── base.html ├── daily-counter-countdown.html ├── load-new-clock-face.html ├── countdown-from-new-years.html ├── countdown-start-callback.html ├── countdown-to-new-years.html ├── countdown-from-new-years-without-seconds.html ├── countdown-to-new-years-without-seconds.html ├── test.html ├── base-vue.html └── simple-counter.html ├── .gitignore ├── package.json ├── webpack.config.js ├── src ├── flipclock.vue ├── flipclock.css ├── flipclock.module.min.js └── flipclock.min.js ├── .eslintrc.js ├── README.md ├── LICENSE └── dist ├── flipclock.js └── index.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }] 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import FlipClock from './src/flipclock.vue'; 2 | import FlipclockModule from './src/flipclock.module.min'; 3 | import FlipclockJs from './src/flipclock.min'; 4 | 5 | const install = Vue => { 6 | if (install.installed) return; 7 | Vue.component('FlipClock', FlipClock); 8 | }; 9 | 10 | if (typeof window !== 'undefined' && window.Vue) { 11 | install(window.Vue); 12 | } 13 | 14 | export default install; 15 | export { FlipClock, FlipclockModule, FlipclockJs }; 16 | -------------------------------------------------------------------------------- /examples/twelve-hour-clock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/twenty-four-hour-clock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/localization.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/daily-counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/hourly-counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/minute-counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/twelve-hour-clock-without-seconds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/minute-counter-overflow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/twenty-four-hour-clock-without-seconds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/simple-counter-autostart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/twelve-hour-clock-custom-time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/twenty-four-hour-clock-custom-time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/simple-countdown-autostart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/simple-counter-minimum-digits.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/countdown-stop-callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/multiple-instances.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 | 19 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/interval-callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/daily-counter-countdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/load-new-clock-face.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/countdown-from-new-years.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/countdown-start-callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 16 | 17 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /examples/countdown-to-new-years.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /examples/countdown-from-new-years-without-seconds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | -------------------------------------------------------------------------------- /examples/countdown-to-new-years-without-seconds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mvpleung/flipclock", 3 | "version": "0.0.6", 4 | "description": "flipclock for vue, 删除 jquery 依赖", 5 | "email": "mvpleung@gmail.com", 6 | "author": "mvpleung ", 7 | "license": "MIT", 8 | "main": "index.js", 9 | "scripts": { 10 | "dev": "cross-env NODE_ENV=development webpack-dev-server --progress --colors --inline --hot --host 0.0.0.0", 11 | "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/mvpleung/vue-flipclock" 16 | }, 17 | "bugs": { 18 | "url": "https://github.com/mvpleung/vue-flipclock/issues" 19 | }, 20 | "keywords": [ 21 | "vue", 22 | "flipclock", 23 | "翻页时钟" 24 | ], 25 | "devDependencies": { 26 | "babel-core": "^6.26.0", 27 | "babel-loader": "^7.1.4", 28 | "babel-preset-es2015": "^6.24.1", 29 | "cross-env": "^5.0.1", 30 | "css-loader": "^0.28.4", 31 | "file-loader": "^0.11.2", 32 | "node-sass": "^4.9.0", 33 | "sass-loader": "^7.0.3", 34 | "uglifyjs-webpack-plugin": "^1.2.6", 35 | "vue-loader": "^14.2.2", 36 | "vue-template-compiler": "^2.5.16", 37 | "webpack": "^3.12.0", 38 | "webpack-dev-server": "^3.1.4" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /examples/base-vue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 |
19 |
20 | 21 |
22 | 23 | 24 | 25 | 26 |
27 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /examples/simple-counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | var UglifyJSPlugin = require('uglifyjs-webpack-plugin'); 4 | 5 | function resolve(dir) { 6 | return path.join(__dirname, '.', dir); 7 | } 8 | 9 | module.exports = { 10 | entry: { 11 | index: './index.js' 12 | }, 13 | output: { 14 | path: path.resolve(__dirname, './dist'), 15 | publicPath: '/', 16 | filename: '[name].js' 17 | }, 18 | resolve: { 19 | extensions: ['.js', '.vue', '.json'], 20 | alias: { 21 | vue$: 'vue/dist/vue.esm.js', 22 | '@': resolve('src') 23 | } 24 | }, 25 | module: { 26 | rules: [ 27 | { 28 | test: /\.vue$/, 29 | loader: 'vue-loader', 30 | options: { 31 | loaders: { 32 | // Since sass-loader (weirdly) has SCSS as its default parse mode, we map 33 | // the "scss" and "sass" values for the lang attribute to the right configs here. 34 | // other preprocessors should work out of the box, no loader config like this nessessary. 35 | scss: 'vue-style-loader!css-loader!sass-loader', 36 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax' 37 | } 38 | // other vue-loader options go here 39 | } 40 | }, 41 | { 42 | test: /\.js$/, 43 | loader: 'babel-loader?cacheDirectory', 44 | include: [resolve('src'), resolve('test')], 45 | exclude: /node_modules/ 46 | }, 47 | { 48 | test: /\.(png|jpg|gif|svg)$/, 49 | loader: 'file-loader', 50 | options: { 51 | name: '[name].[ext]?[hash]' 52 | } 53 | } 54 | ] 55 | }, 56 | devServer: { 57 | historyApiFallback: true, 58 | noInfo: true 59 | }, 60 | performance: { 61 | hints: false 62 | }, 63 | devtool: '#eval-source-map', 64 | devServer: { 65 | contentBase: path.join(__dirname, '../src/components'), 66 | port: 9000, //端口改为9000 67 | open: true 68 | } 69 | }; 70 | 71 | if (process.env.NODE_ENV === 'production') { 72 | module.exports.devtool = false; 73 | // http://vue-loader.vuejs.org/en/workflow/production.html 74 | module.exports.plugins = (module.exports.plugins || []).concat([ 75 | new webpack.DefinePlugin({ 76 | 'process.env': { 77 | NODE_ENV: "'production'" 78 | } 79 | }), 80 | new UglifyJSPlugin({ 81 | cache: true, 82 | parallel: true, 83 | uglifyOptions: { 84 | output: { 85 | beautify: false, 86 | comments: false // remove all comments, 87 | } 88 | }, 89 | sourceMap: false 90 | }), 91 | new webpack.LoaderOptionsPlugin({ 92 | minimize: true 93 | }) 94 | ]); 95 | } 96 | -------------------------------------------------------------------------------- /src/flipclock.vue: -------------------------------------------------------------------------------- 1 | /* 2 | * 翻页时钟组件 3 | * @Author: liangzc 4 | * @Date: 2018-06-08 10:19:55 5 | * @Last Modified by: liangzc 6 | * @Last Modified time: 2018-06-30 13:37:04 7 | */ 8 | 12 | 166 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | //[0: pass, 1: warn, 2: error] 3 | // required to lint *.vue files 4 | root: true, 5 | env: { 6 | browser: true, 7 | commonjs: true, 8 | es6: true 9 | }, 10 | parserOptions: { 11 | parser: 'babel-eslint', 12 | //语法支持 13 | ecmaVersion: 6, 14 | sourceType: 'module', 15 | ecmaFeatures: { 16 | jsx: true, 17 | experimentalObjectRestSpread: true 18 | } 19 | }, 20 | extends: [ 21 | // add more generic rulesets here, such as: 22 | // 'eslint:recommended', 23 | 'plugin:vue/essential' 24 | ], 25 | plugins: ['vue', 'flowtype'], 26 | // add your custom rules here 27 | rules: { 28 | // allow paren-less arrow functions 29 | 'arrow-parens': 0, 30 | // allow async-await 31 | 'generator-star-spacing': 0, 32 | //禁止直接使用 Object.prototypes 的内置属性 33 | 'no-prototype-builtins': 0, 34 | // allow debugger during development 35 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, 36 | // 强制使用有效的 JSDoc 注释 37 | 'valid-jsdoc': 0, 38 | 'space-before-function-paren': 0, 39 | 'no-inner-declarations': 0, 40 | 'no-regex-spaces': 2, //禁止在正则表达式字面量中使用多个空格 /foo bar/ 41 | 'no-proto': 2, //禁止使用__proto__属性 42 | 'no-return-assign': 1, //return 语句中不能有赋值表达式 43 | 'no-shadow-restricted-names': 2, //严格模式中规定的限制标识符不能作为声明时的变量名使用 44 | 'no-self-compare': 2, //不能比较自身 45 | 'no-this-before-super': 0, //在调用super()之前不能使用this或super 46 | 'no-extend-native': 0, // 可以使用扩展方法 47 | 'no-const-assign': 2, //禁止修改const声明的变量 48 | 'no-constant-condition': 2, //禁止在条件中使用常量表达式 if(true) if(1) 49 | 'no-dupe-keys': 2, //在创建对象字面量时不允许键重复 {a:1,a:1} 50 | 'no-dupe-args': 2, //函数参数不能重复 51 | 'no-duplicate-case': 2, //switch中的case标签不能重复 52 | 'no-duplicate-imports': 2, //每一个模块只能有一个import表达式 53 | 'no-else-return': 2, //如果if语句里面有return,后面不能跟else语句 54 | 'no-labels': 2, //禁止使用空label 55 | 'no-extra-bind': 2, //禁止不必要的函数绑定 56 | 'no-extra-boolean-cast': 2, //禁止不必要的bool转换 57 | 'no-extra-parens': [2, 'all', { returnAssign: false, ignoreJSX: 'all' }], //禁止非必要的括号 58 | 'no-extra-semi': 2, //禁止多余的分号 59 | 'no-fallthrough': 1, //禁止switch穿透 60 | 'no-func-assign': 2, //禁止重复的函数声明 61 | 'no-implicit-coercion': 1, //禁止隐式转换 62 | 'no-multi-spaces': 1, //不能用多余的空格 63 | 'no-new-require': 2, //禁止使用new require 64 | 'no-obj-calls': 2, //不能调用内置的全局对象,比如Math() JSON() 65 | 'no-invalid-regexp': 2, //禁止无效的正则表达式 66 | 'no-invalid-this': 0, //禁止无效的this,只能用在构造器,类,对象字面量 67 | 'no-irregular-whitespace': 2, //不能有不规则的空格 68 | 'no-lone-blocks': 2, //禁止不必要的嵌套块 69 | 'no-iterator': 2, //禁止使用__iterator__ 属性 70 | 'no-loop-func': 1, //禁止在循环中使用函数(如果没有引用外部变量不形成闭包就可以) 71 | 'no-mixed-requires': [0, false], //声明时不能混用声明类型 72 | 'no-mixed-spaces-and-tabs': [2, false], //禁止混用tab和空格 73 | 'no-ex-assign': 2, //禁止给catch语句中的异常参数赋值 74 | 'linebreak-style': [0, 'windows'], //换行风格 75 | 'no-sparse-arrays': 2, //禁止稀疏数组, [1,,2] 76 | 'no-unneeded-ternary': 2, //禁止不必要的嵌套 var isYes = answer === 1 ? true : false; 77 | 'no-unreachable': 2, //不能有无法执行的代码,return, throw, continue, break后不要有代码 78 | 'no-unused-expressions': 0, //禁止无用的表达式 79 | 'no-unsafe-negation': 2, //关系运算符的左操作数不能否定,如 if (!key in obj) {} 80 | 'no-unsafe-finally': 2, //finally语句块中不要有控制流语句,如 return 1 81 | 'no-useless-call': 2, //禁止不必要的call和apply 82 | 'no-useless-computed-key': 2, //在对象中避免使用不必要的计算属性键,如 const user = { ['name']: 'John Doe' } 83 | 'no-useless-constructor': 2, //避免不必要的构造,比如空的构造函数 84 | 'no-useless-escape': 0, //避免不必要的转义 85 | 'no-useless-rename': 2, //导入、导出和解构赋值,不要赋相同的名字,如 import { config as config } from './config' 86 | 'no-whitespace-before-property': 2, //属性前不要有空格,如 user .name 87 | 'comma-dangle': [2, 'never'], //对象字面量项尾不能有逗号 88 | 'comma-spacing': [2, { before: false, after: true }], //对象字面量中逗号的前后空格 89 | 'comma-style': [2, 'last'], //逗号风格,换行时在行首还是行尾 90 | 'no-redeclare': 2, //禁止重复声明变量 91 | 'no-spaced-func': 2, //函数调用时 函数名与()之间不能有空格 92 | 'no-unused-vars': [ 93 | //不能有声明后未被使用的变量或参数 94 | 2, 95 | { 96 | vars: 'all', 97 | // args: 'after-used' 98 | args: 'none' 99 | } 100 | ], 101 | 'dot-notation': [ 102 | //避免不必要的方括号 103 | 0, 104 | { 105 | allowKeywords: true 106 | } 107 | ], 108 | 'operator-linebreak': [2, 'after'], //换行时运算符在行尾还是行首 109 | 'space-after-keywords': [0, 'always'], //关键字后面是否要空一格 110 | 'space-infix-ops': 2, //中缀操作符周围要不要有空格 111 | 'key-spacing': [ 112 | 0, 113 | { 114 | beforeColon: false, 115 | afterColon: true 116 | } 117 | ], //对象字面量中冒号的前后空格 118 | 'brace-style': [1, '1tbs'], //大括号风格 119 | 'func-call-spacing': [2, 'never'], //标示符和请求之间不能有空格 120 | 'handle-callback-err': 0, //nodejs 处理错误 121 | 'use-isnan': 2, //禁止比较时使用NaN,只能用isNaN() 122 | 'valid-typeof': 2, //必须使用合法的typeof的值 123 | eqeqeq: 2, //必须使用全等 124 | 'prefer-const': 0, //首选const 125 | 'prefer-spread': 0, //首选展开运算 126 | 'keyword-spacing': 2, 127 | 'default-case': 2, //switch语句最后必须有default 128 | semi: [2, 'always'], //0:关闭,1:警告,2:异常 129 | indent: [ 130 | 'error', 131 | 2, 132 | { 133 | SwitchCase: 1 134 | } 135 | ], 136 | 'max-len': [ 137 | //每行最长字符 138 | 'error', 139 | { 140 | code: 80, 141 | ignoreComments: true, 142 | ignoreTrailingComments: true, 143 | ignoreUrls: true, 144 | ignoreStrings: true, 145 | ignoreTemplateLiterals: true, 146 | ignoreRegExpLiterals: true 147 | } 148 | ], 149 | quotes: ['error', 'single'], //单引号 150 | 151 | //link:https://github.com/vuejs/eslint-plugin-vue 152 | 'vue/v-bind-style': 2, //v-bind 缩写模式 153 | 'vue/v-on-style': 2, //v-on 缩写模式 154 | 'vue/attribute-hyphenation': 2, //kebab-case (短横线分隔式) 155 | 'vue/html-self-closing': 2, //标签自关闭 156 | 'vue/max-attributes-per-line': [ 157 | //多属性换行,第一个属性例外 158 | 2, 159 | { 160 | singleline: 1, 161 | multiline: { 162 | max: 1, 163 | allowFirstLine: true 164 | } 165 | } 166 | ], 167 | 'vue/mustache-interpolation-spacing': 2, //{{ keyword }} 168 | 'vue/name-property-casing': [2, 'kebab-case'], //组件 name 属性必须使用 kebab-case 短横线 169 | 'vue/no-async-in-computed-properties': 2, //computed 计算属性不能使用异步 170 | 'vue/no-parsing-error': 2, //检测编译错误 171 | 'vue/no-shared-component-data': 2, //data() { return {} } When using the data property on a component (i.e. anywhere except on new Vue), the value must be a function that returns an object. 172 | 'vue/no-template-key': 2, //template 标签不允许有key 173 | 'vue/no-textarea-mustache': 2, //textarea 请使用 v-model 174 | 'vue/no-unused-vars': 2, //v-for 指令不允许存在未使用的变量声明 175 | 'vue/require-v-for-key': 2, //v-for 必须指定 key 176 | 'vue/require-valid-default-prop': 2, //校验 props 属性的默认值 177 | 'vue/return-in-computed-property': 2, //computed 计算属性必须存在 return 178 | 'vue/valid-v-bind': 2, //校验 bind 的值是否有效 179 | 'vue/valid-v-if': 2, //校验 v-if 表达式 180 | 'vue/valid-v-else-if': 2, //校验 v-else-if 181 | 'vue/valid-v-else': 2, //v-else 后不能跟表达式 182 | 'vue/valid-v-model': 2, //校验 v-model 183 | 'vue/this-in-template': 2, //template 中不允许出现 this 184 | 'vue/html-quotes': 2 //html节点必须使用双引号 185 | } 186 | }; 187 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FlipClock 2 | 3 | flipclock for Vue,Rejecting jQuery dependency 4 | 5 | ### Installation 6 | 7 | FlipClock.js can be installed in the following ways: 8 | 9 | #### Node (NPM) 10 | 11 | npm install @mvpleung/flipclock -S 12 | 13 | #### Script (Vue) 14 | 15 | 16 | 17 | #### Script (window) 18 | 19 | 20 | 21 | --- 22 | 23 | ### Demo & Documentation 24 | 25 | [Example](https://github.com/mvpleung/vue-flipclock/tree/master/examples) 26 | 27 | [Vue Script Example](https://github.com/mvpleung/vue-flipclock/tree/master/examples/base-vue.html) 28 | 29 | Website and documentation at http://flipclockjs.com/ 30 | 31 | --- 32 | 33 | ### Vue Demo 34 | 35 | ```js 36 | import { FlipClock } from '@mvpleung/flipclock'; 37 | export default { 38 | ... 39 | components: { 40 | FlipClock 41 | } 42 | } 43 | 44 | ... 45 | 46 | 47 | ``` 48 | 49 | --- 50 | 51 | ### Documentation 52 | 53 | | Field | Type | Description | 54 | | ----------- | -------- | --------------------------------------------------------------------------------- | 55 | | **digit** | `Number` | `deprecated`, An integer used to start the clock(Use `Options.digit` instead) | 56 | | **options** | `Object` | flipclock configuration, Support dynamic modification options to change flipclock | 57 | 58 | --- 59 | 60 | ### Options 61 | 62 | Website and documentation at http://flipclockjs.com/ 63 | 64 | | Field | Type | Description | 65 | | --------------- | --------- | --------------------------------------------------------------------------------------------------------- | 66 | | **time** | `Number` | Source of time | 67 | | **digit** | `Number` | An integer used to start the clock(For Example: `countdown-to-new-years`) | 68 | | **label** | `Boolean` | Whether or not a time label is displayed | 69 | | **dot** | `Boolean` | Whether the time division dots are displayed | 70 | | **divider** | `Object` | Time partition configuration, See below `Divider Options` | 71 | | **clockFace** | `String` | This is the name of the clock that is used to build the clock display. The default value is HourlyCounter | 72 | | **showSeconds** | `Boolean` | Display seconds. The default value is true | 73 | | **callbacks** | `Object` | Options: [ init: Function, create: Function, interval: Function, start: Function, stop: Function, reset: Function, destroy: Function ] | 74 | | **...** | `...` | More configuration to see here [http://flipclockjs.com](http://flipclockjs.com) | 75 | 76 | --- 77 | 78 | ### Divider Options 79 | 80 | | Field | Type | Description | Example | 81 | | ----------- | -------- | ---------------------------------------------------------- | ----------------------------------------------- | 82 | | **days** | `String` | Segmentation between day and hour nodes, support HTML | `天`,`` | 83 | | **hours** | `String` | Segmentation between hourly and minute nodes, support HTML | `小时`,`小时` | 84 | | **minutes** | `String` | Segmentation between minute and second nodes, support HTML | `分钟`,`` | 85 | | **seconds** | `String` | Second unit | `秒`,`` | 86 | 87 | --- 88 | 89 | ### Instance Methods 90 | 91 | > this.\$refs.flipclcok.start(); 92 | 93 | | Method | Params | Description | 94 | | ----------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | 95 | | **trigger** | `event`,`params` | Trigger FlipClock Method | 96 | | **start** | `callback` | Start the clock | 97 | | **stop** | `callback` | Stop the clock | 98 | | **reset** | `options`,`callback` | Reset the clock, If the `options` is present, the clock will be reset by the `options` | 99 | | **loadClockFace** | `name`, `options` | This method allows you to load a clock face. The first argument is the name of the clock face, and the second is an object of options used to override the default properties. | 100 | | **loadLanguage** | `name` | This method allows you to load a language file. The argument is the name of the language file. | 101 | | **setCountdown** | `countdown` | This method set the clockdown property to true or false. In addition to setting the property, this method will also change the direction the clock is flipping. | 102 | | **getTime** | | This method will get the current FlipFactory.Time object. | 103 | | **setTime** | `time` | This method will set the time on the clock by passing a value which will be passed to the FlipFactory.Time object. | 104 | | **instance** | | This method will get the current FlipClock object. | 105 | 106 | --- 107 | 108 | ### Method Callbacks 109 | 110 | > this.\$refs.flipclock.Method(callback) 111 | 112 | ```js 113 | ... 114 | stop() { 115 | this.$refs.flipclock.stop(() => { 116 | alert('Stop !'); 117 | }) 118 | }, 119 | stopReset() { 120 | this.$refs.flipclock.stop(() => { 121 | alert('Stop !'); 122 | this.reset(); 123 | }) 124 | } 125 | ... 126 | ``` 127 | 128 | --- 129 | 130 | ### FlipClock Callbacks 131 | 132 | ```js 133 | ... 134 | options: { 135 | digit: 15, 136 | countdown: true, 137 | clockFace: 'DailyCounter', 138 | ... 139 | callbacks: { 140 | stop: function () { 141 | alert('The clock has stopped!') 142 | } 143 | } 144 | } 145 | ... 146 | ``` 147 | 148 | --- 149 | 150 | ### License 151 | 152 | --- 153 | 154 | [LICENSE](https://github.com/mvpleung/vue-flipclock/blob/master/LICENSE) 155 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/flipclock.css: -------------------------------------------------------------------------------- 1 | /* Get the bourbon mixin from http://bourbon.io */ 2 | /* Reset */ 3 | .flip-clock-wrapper * { 4 | -webkit-box-sizing: border-box; 5 | -moz-box-sizing: border-box; 6 | -ms-box-sizing: border-box; 7 | -o-box-sizing: border-box; 8 | box-sizing: border-box; 9 | -webkit-backface-visibility: hidden; 10 | -moz-backface-visibility: hidden; 11 | -ms-backface-visibility: hidden; 12 | -o-backface-visibility: hidden; 13 | backface-visibility: hidden; 14 | } 15 | 16 | .flip-clock-wrapper a { 17 | cursor: pointer; 18 | text-decoration: none; 19 | /* color: #ccc; */ 20 | color: white; 21 | } 22 | 23 | .flip-clock-wrapper a:hover { 24 | color: #fff; 25 | } 26 | 27 | .flip-clock-wrapper ul { 28 | list-style: none; 29 | } 30 | 31 | .flip-clock-wrapper.clearfix:before, 32 | .flip-clock-wrapper.clearfix:after { 33 | content: ' '; 34 | display: table; 35 | } 36 | 37 | .flip-clock-wrapper.clearfix:after { 38 | clear: both; 39 | } 40 | 41 | .flip-clock-wrapper.clearfix { 42 | *zoom: 1; 43 | } 44 | 45 | /* Main */ 46 | .flip-clock-wrapper { 47 | font: normal 11px 'Helvetica Neue', Helvetica, sans-serif; 48 | -webkit-user-select: none; 49 | 50 | margin: 0 auto; 51 | display: -webkit-box; 52 | -webkit-box-orient: horizontal; 53 | -webkit-box-pack: center; 54 | -webkit-box-align: center; 55 | -webkit-justify-content: center; 56 | 57 | display: -moz-box; 58 | -moz-box-orient: horizontal; 59 | -moz-box-pack: center; 60 | -moz-box-align: center; 61 | -moz-justify-content: center; 62 | 63 | display: -o-box; 64 | -o-box-orient: horizontal; 65 | -o-box-pack: center; 66 | -o-box-align: center; 67 | -o-justify-content: center; 68 | 69 | display: -ms-box; 70 | -ms-box-orient: horizontal; 71 | -ms-box-pack: center; 72 | -ms-box-align: center; 73 | -ms-justify-content: center; 74 | 75 | display: flex; 76 | box-orient: horizontal; 77 | box-pack: center; 78 | box-align: center; 79 | justify-content: center; 80 | } 81 | 82 | .flip-clock-meridium { 83 | background: none !important; 84 | box-shadow: 0 0 0 !important; 85 | font-size: 36px !important; 86 | } 87 | 88 | .flip-clock-meridium a { 89 | color: #313333; 90 | } 91 | 92 | .flip-clock-wrapper { 93 | text-align: center; 94 | position: relative; 95 | width: 100%; 96 | /* margin: 1em; */ 97 | } 98 | 99 | .flip-clock-wrapper:before, 100 | .flip-clock-wrapper:after { 101 | content: ' '; /* 1 */ 102 | display: table; /* 2 */ 103 | } 104 | .flip-clock-wrapper:after { 105 | clear: both; 106 | } 107 | 108 | /* Skeleton */ 109 | .flip-clock-wrapper ul { 110 | position: relative; 111 | float: left; 112 | margin: 5px; 113 | width: 60px; 114 | height: 90px; 115 | font-size: 80px; 116 | font-weight: bold; 117 | line-height: 87px; 118 | border-radius: 6px; 119 | background: #000; 120 | } 121 | 122 | .flip-clock-wrapper ul li { 123 | z-index: 1; 124 | position: absolute; 125 | left: 0; 126 | top: 0; 127 | width: 100%; 128 | height: 100%; 129 | line-height: 87px; 130 | text-decoration: none !important; 131 | } 132 | 133 | .flip-clock-wrapper ul li:first-child { 134 | z-index: 2; 135 | } 136 | 137 | .flip-clock-wrapper ul li a { 138 | display: block; 139 | height: 100%; 140 | -webkit-perspective: 200px; 141 | -moz-perspective: 200px; 142 | perspective: 200px; 143 | margin: 0 !important; 144 | overflow: visible !important; 145 | cursor: default !important; 146 | } 147 | 148 | .flip-clock-wrapper ul li a div { 149 | z-index: 1; 150 | position: absolute; 151 | left: 0; 152 | width: 100%; 153 | height: 50%; 154 | font-size: 80px; 155 | overflow: hidden; 156 | outline: 1px solid transparent; 157 | } 158 | 159 | .flip-clock-wrapper ul li a div .shadow { 160 | position: absolute; 161 | width: 100%; 162 | height: 100%; 163 | z-index: 2; 164 | } 165 | 166 | .flip-clock-wrapper ul li a div.up { 167 | -webkit-transform-origin: 50% 100%; 168 | -moz-transform-origin: 50% 100%; 169 | -ms-transform-origin: 50% 100%; 170 | -o-transform-origin: 50% 100%; 171 | transform-origin: 50% 100%; 172 | top: 0; 173 | } 174 | 175 | .flip-clock-wrapper ul li a div.up:after { 176 | content: ''; 177 | position: absolute; 178 | top: 44px; 179 | left: 0; 180 | z-index: 5; 181 | width: 100%; 182 | height: 3px; 183 | background-color: #000; 184 | background-color: rgba(0, 0, 0, 0.4); 185 | } 186 | 187 | .flip-clock-wrapper ul li a div.down { 188 | -webkit-transform-origin: 50% 0; 189 | -moz-transform-origin: 50% 0; 190 | -ms-transform-origin: 50% 0; 191 | -o-transform-origin: 50% 0; 192 | transform-origin: 50% 0; 193 | bottom: 0; 194 | border-bottom-left-radius: 6px; 195 | border-bottom-right-radius: 6px; 196 | } 197 | 198 | .flip-clock-wrapper ul li a div div.inn { 199 | position: absolute; 200 | left: 0; 201 | z-index: 1; 202 | width: 100%; 203 | height: 200%; 204 | /* color: #ccc; */ 205 | color: white; 206 | text-shadow: 0 1px 2px #000; 207 | text-align: center; 208 | /* background-color: #333; */ 209 | background: rgba(189, 208, 255, 1); 210 | border-radius: 6px; 211 | border-radius: 6px; 212 | font-size: 70px; 213 | } 214 | 215 | .flip-clock-wrapper ul li a div.up div.inn { 216 | top: 0; 217 | } 218 | 219 | .flip-clock-wrapper ul li a div.down div.inn { 220 | bottom: 0; 221 | } 222 | 223 | /* PLAY */ 224 | .flip-clock-wrapper ul.play li.flip-clock-before { 225 | z-index: 3; 226 | } 227 | 228 | .flip-clock-wrapper .flip { 229 | box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); 230 | } 231 | 232 | .flip-clock-wrapper ul.play li.flip-clock-active { 233 | -webkit-animation: asd 0.5s 0.5s linear both; 234 | -moz-animation: asd 0.5s 0.5s linear both; 235 | animation: asd 0.5s 0.5s linear both; 236 | z-index: 5; 237 | } 238 | 239 | .flip-clock-divider { 240 | float: left; 241 | display: inline-block; 242 | position: relative; 243 | width: 20px; 244 | height: 100px; 245 | } 246 | 247 | .flip-clock-divider:first-child { 248 | width: 0; 249 | } 250 | 251 | .flip-clock-dot { 252 | display: block; 253 | background: #323434; 254 | width: 10px; 255 | height: 10px; 256 | position: absolute; 257 | border-radius: 50%; 258 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); 259 | left: 5px; 260 | } 261 | 262 | .flip-clock-divider .flip-clock-label { 263 | position: absolute; 264 | top: -1.5em; 265 | right: -112.5px; 266 | color: black; 267 | text-shadow: none; 268 | } 269 | 270 | .flip-clock-divider.minutes .flip-clock-label { 271 | right: -135px; 272 | } 273 | 274 | .flip-clock-divider.seconds .flip-clock-label { 275 | right: -135px; 276 | } 277 | 278 | .flip-clock-dot.top { 279 | top: 30px; 280 | } 281 | 282 | .flip-clock-dot.bottom { 283 | bottom: 30px; 284 | } 285 | 286 | @-webkit-keyframes asd { 287 | 0% { 288 | z-index: 2; 289 | } 290 | 291 | 20% { 292 | z-index: 4; 293 | } 294 | 295 | 100% { 296 | z-index: 4; 297 | } 298 | } 299 | 300 | @-moz-keyframes asd { 301 | 0% { 302 | z-index: 2; 303 | } 304 | 305 | 20% { 306 | z-index: 4; 307 | } 308 | 309 | 100% { 310 | z-index: 4; 311 | } 312 | } 313 | 314 | @-o-keyframes asd { 315 | 0% { 316 | z-index: 2; 317 | } 318 | 319 | 20% { 320 | z-index: 4; 321 | } 322 | 323 | 100% { 324 | z-index: 4; 325 | } 326 | } 327 | 328 | @keyframes asd { 329 | 0% { 330 | z-index: 2; 331 | } 332 | 333 | 20% { 334 | z-index: 4; 335 | } 336 | 337 | 100% { 338 | z-index: 4; 339 | } 340 | } 341 | 342 | .flip-clock-wrapper ul.play li.flip-clock-active .down { 343 | z-index: 2; 344 | -webkit-animation: turn 0.5s 0.5s linear both; 345 | -moz-animation: turn 0.5s 0.5s linear both; 346 | animation: turn 0.5s 0.5s linear both; 347 | } 348 | 349 | @-webkit-keyframes turn { 350 | 0% { 351 | -webkit-transform: rotateX(90deg); 352 | } 353 | 354 | 100% { 355 | -webkit-transform: rotateX(0deg); 356 | } 357 | } 358 | 359 | @-moz-keyframes turn { 360 | 0% { 361 | -moz-transform: rotateX(90deg); 362 | } 363 | 364 | 100% { 365 | -moz-transform: rotateX(0deg); 366 | } 367 | } 368 | 369 | @-o-keyframes turn { 370 | 0% { 371 | -o-transform: rotateX(90deg); 372 | } 373 | 374 | 100% { 375 | -o-transform: rotateX(0deg); 376 | } 377 | } 378 | 379 | @keyframes turn { 380 | 0% { 381 | transform: rotateX(90deg); 382 | } 383 | 384 | 100% { 385 | transform: rotateX(0deg); 386 | } 387 | } 388 | 389 | .flip-clock-wrapper ul.play li.flip-clock-before .up { 390 | z-index: 2; 391 | -webkit-animation: turn2 0.5s linear both; 392 | -moz-animation: turn2 0.5s linear both; 393 | animation: turn2 0.5s linear both; 394 | } 395 | 396 | @-webkit-keyframes turn2 { 397 | 0% { 398 | -webkit-transform: rotateX(0deg); 399 | } 400 | 401 | 100% { 402 | -webkit-transform: rotateX(-90deg); 403 | } 404 | } 405 | 406 | @-moz-keyframes turn2 { 407 | 0% { 408 | -moz-transform: rotateX(0deg); 409 | } 410 | 411 | 100% { 412 | -moz-transform: rotateX(-90deg); 413 | } 414 | } 415 | 416 | @-o-keyframes turn2 { 417 | 0% { 418 | -o-transform: rotateX(0deg); 419 | } 420 | 421 | 100% { 422 | -o-transform: rotateX(-90deg); 423 | } 424 | } 425 | 426 | @keyframes turn2 { 427 | 0% { 428 | transform: rotateX(0deg); 429 | } 430 | 431 | 100% { 432 | transform: rotateX(-90deg); 433 | } 434 | } 435 | 436 | .flip-clock-wrapper ul li.flip-clock-active { 437 | z-index: 3; 438 | } 439 | 440 | /* SHADOW */ 441 | .flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { 442 | background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); 443 | background: -webkit-gradient( 444 | linear, 445 | left top, 446 | left bottom, 447 | color-stop(0%, rgba(0, 0, 0, 0.1)), 448 | color-stop(100%, black) 449 | ); 450 | background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; 451 | background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); 452 | background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); 453 | background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; 454 | -webkit-animation: show 0.5s linear both; 455 | -moz-animation: show 0.5s linear both; 456 | animation: show 0.5s linear both; 457 | } 458 | 459 | .flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { 460 | /* background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); 461 | background: -webkit-gradient( 462 | linear, 463 | left top, 464 | left bottom, 465 | color-stop(0%, rgba(0, 0, 0, 0.1)), 466 | color-stop(100%, black) 467 | ); 468 | background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; 469 | background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); 470 | background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); */ 471 | background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, #bdd0ff 100%; 472 | /* -webkit-animation: hide 0.5s 0.3s linear both; 473 | -moz-animation: hide 0.5s 0.3s linear both; */ 474 | animation: hide 0.5s 0.3s linear both; 475 | } 476 | 477 | /*DOWN*/ 478 | .flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { 479 | /* background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); 480 | background: -webkit-gradient( 481 | linear, 482 | left top, 483 | left bottom, 484 | color-stop(0%, black), 485 | color-stop(100%, rgba(0, 0, 0, 0.1)) 486 | ); 487 | background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; 488 | background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); 489 | background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); */ 490 | background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; 491 | /* -webkit-animation: show 0.5s linear both; 492 | -moz-animation: show 0.5s linear both; */ 493 | animation: show 0.5s linear both; 494 | } 495 | 496 | .flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { 497 | /* background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); 498 | background: -webkit-gradient( 499 | linear, 500 | left top, 501 | left bottom, 502 | color-stop(0%, black), 503 | color-stop(100%, rgba(0, 0, 0, 0.1)) 504 | ); 505 | background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; 506 | background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); 507 | background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); */ 508 | background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; 509 | /* -webkit-animation: hide 0.5s 0.3s linear both; 510 | -moz-animation: hide 0.5s 0.3s linear both; */ 511 | animation: hide 0.5s 0.2s linear both; 512 | } 513 | 514 | @-webkit-keyframes show { 515 | 0% { 516 | opacity: 0; 517 | } 518 | 519 | 100% { 520 | opacity: 1; 521 | } 522 | } 523 | 524 | @-moz-keyframes show { 525 | 0% { 526 | opacity: 0; 527 | } 528 | 529 | 100% { 530 | opacity: 1; 531 | } 532 | } 533 | 534 | @-o-keyframes show { 535 | 0% { 536 | opacity: 0; 537 | } 538 | 539 | 100% { 540 | opacity: 1; 541 | } 542 | } 543 | 544 | @keyframes show { 545 | 0% { 546 | opacity: 0; 547 | } 548 | 549 | 100% { 550 | opacity: 1; 551 | } 552 | } 553 | 554 | @-webkit-keyframes hide { 555 | 0% { 556 | opacity: 1; 557 | } 558 | 559 | 100% { 560 | opacity: 0; 561 | } 562 | } 563 | 564 | @-moz-keyframes hide { 565 | 0% { 566 | opacity: 1; 567 | } 568 | 569 | 100% { 570 | opacity: 0; 571 | } 572 | } 573 | 574 | @-o-keyframes hide { 575 | 0% { 576 | opacity: 1; 577 | } 578 | 579 | 100% { 580 | opacity: 0; 581 | } 582 | } 583 | 584 | @keyframes hide { 585 | 0% { 586 | opacity: 1; 587 | } 588 | 589 | 100% { 590 | opacity: 0; 591 | } 592 | } 593 | -------------------------------------------------------------------------------- /dist/flipclock.js: -------------------------------------------------------------------------------- 1 | !function(t){var i={};function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}e.m=t,e.c=i,e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="/",e(e.s=13)}({13:function(t,i){var e,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){};n.createDom=function(t){if("string"!=typeof t)return t;var i=document.createElement("span");i.innerHTML=t;var e=i.childNodes[0];return i=null,e},n.insertBefore=function(t,i){t="string"==typeof t?n.createDom(t):t,(i="string"==typeof i?n.createDom(i):i).parentNode.insertBefore(t,i)},n.extend=function(t,i){"use strict";var e=n.prototype.extend;n._prototyping=!0;var s=new this;e.call(s,t),s.base=function(){},delete n._prototyping;var a=s.constructor,r=s.constructor=function(){if(!n._prototyping)if(this._constructing||this.constructor===r)this._constructing=!0,a.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||e).call(arguments[0],s)};return r.ancestor=this,r.extend=this.extend,r.createDom=this.createDom,r.insertBefore=this.insertBefore,r.forEach=this.forEach,r.implement=this.implement,r.prototype=s,r.toString=this.toString,r.valueOf=function(t){return"object"===t?r:a.valueOf()},e.call(r,i),"function"==typeof r.init&&r.init(),r},n.prototype={extend:function(t,i){if(arguments.length>1){var e=this[t];if(e&&"function"==typeof i&&(!e.valueOf||e.valueOf()!==i.valueOf())&&/\bbase\b/.test(i)){var s=i.valueOf();(i=function(){var t=this.base||n.prototype.base;this.base=e;var i=s.apply(this,arguments);return this.base=t,i}).valueOf=function(t){return"object"===t?i:s},i.toString=n.toString}this[t]=i}else if(t){var a=n.prototype.extend;n._prototyping||"function"==typeof this||(a=this.extend||a);for(var r={toSource:null},o=["constructor","toString","valueOf"],c=n._prototyping?0:1;u=o[c++];)t[u]!==r[u]&&a.call(this,u,t[u]);for(var u in t)r[u]||a.call(this,u,t[u])}return this}},n=n.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(t,i,e){for(var s in t)void 0===this.prototype[s]&&i.call(e,t[s],s,t)},implement:function(){for(var t=0;t',''].join("");e&&(s=""),t=this.factory.localize(t);var a=['',''+(t||"")+"",s,""],r=n.createDom(a.join(""));return this.dividers.push(r),r},createList:function(t,i){"object"===(void 0===t?"undefined":s(t))&&(i=t,t=0);var n=new e.List(this.factory,t,i);return this.lists.push(n),n},reset:function(){this.factory.time=new e.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(t){},addDigit:function(t){var i=this.createList(t,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(i)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0===this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(t,i){var e=this;Array.isArray(t)&&t.forEach(function(t,s){var n=e.lists[s];n?(i||t===n.digit||n.play(),n.select(t)):e.addDigit(t)})}})}(),function(){"use strict";e.Factory=e.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(t,i,s){s||(s={}),this.lists=[],this.running=!1,this.base(s),this.$el=this.base.createDom(t),this.$el.classList.add(this.classes.wrapper),this.$wrapper=this.$el,this.original=i instanceof Date?i:i?Math.round(i):0,this.time=new e.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new e.Timer(this,s),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,s),this.autoStart&&this.start()},loadClockFace:function(t,i){var s,n=!1;return t=t.ucfirst()+"Face",this.face.stop&&(this.stop(),n=!0),this.$el.innerHTML="",this.time.minimumDigits=this.minimumDigits,(s=e[t]?new e[t](this,i):new e[this.defaultClockFace+"Face"](this,i)).build(),this.face=s,n&&this.start(),this.face},loadLanguage:function(t){var i;return i=e.Lang[t.ucfirst()]?e.Lang[t.ucfirst()]:e.Lang[t]?e.Lang[t]:e.Lang[this.defaultLanguage],this.lang=i},localize:function(t,i){var e=this.lang;if(!t)return null;var n=t.toLowerCase();return"object"===(void 0===i?"undefined":s(i))&&(e=i),e&&e[n]?e[n]:t},start:function(t){var i=this;i.running||i.countdown&&!(i.countdown&&i.time.time>0)?i.log("Trying to start timer when countdown already at 0"):(i.face.start(i.time),i.timer.start(function(){i.flip(),"function"==typeof t&&t()}))},stop:function(t){for(var i in this.face.stop(),this.timer.stop(t),this.lists)this.lists.hasOwnProperty(i)&&this.lists[i].stop()},reset:function(t){this.timer.reset(t),this.face.reset()},setTime:function(t){this.time.time=t,this.flip(!0)},getTime:function(t){return this.time},setCountdown:function(t){var i=this.running;this.countdown=Boolean(t),i&&(this.stop(),this.start())},flip:function(t){this.face.flip(!1,t)}})}(),function(){"use strict";e.List=e.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(t,i,e){this.factory=t,this.digit=i,this.lastDigit=i,this.$el=this.createList(),this.$obj=this.$el,i>0&&this.select(i),this.factory.$el.appendChild(this.$el)},select:function(t){if(void 0===t?t=this.digit:this.digit=t,this.digit!==this.lastDigit){var i=this.$el.querySelector("."+this.classes.before);i&&i.classList.remove(this.classes.before);var e=this.$el.querySelector("."+this.classes.active);e.classList.remove(this.classes.active),e.classList.add(this.classes.before),this.appendListItem(this.classes.active,this.digit),i&&i.remove(),this.lastDigit=this.digit}},play:function(){this.$el.classList.add(this.factory.classes.play)},stop:function(){var t=this;setTimeout(function(){t.$el.classList.remove(t.factory.classes.play)},this.factory.timer.interval)},createListItem:function(t,i){return['
  • ','','
    ','
    ','
    '+(i||"")+"
    ","
    ",'
    ','
    ','
    '+(i||"")+"
    ","
    ","
    ","
  • "].join("")},appendListItem:function(t,i){this.$el.appendChild(n.createDom(this.createListItem(t,i)))},createList:function(){var t=this.getPrevDigit()?this.getPrevDigit():this.digit;return n.createDom(['
      ',this.createListItem(this.classes.before,t),this.createListItem(this.classes.active,this.digit),"
    "].join(""))},getNextDigit:function(){return 9===this.digit?0:this.digit+1},getPrevDigit:function(){return 0===this.digit?9:this.digit-1}})}(),function(){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},e.Time=e.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(t,i,e){"object"!==(void 0===e?"undefined":s(e))&&(e={}),e.minimumDigits||(e.minimumDigits=t.minimumDigits),this.base(e),this.factory=t,i&&(this.time=i)},convertDigitsToArray:function(t){var i=[];t=t.toString();for(var e=0;ethis.minimumDigits&&(this.minimumDigits=i.length),this.minimumDigits>i.length)for(var e=i.length;e12?e-12:0===e?12:e,t.getMinutes()];return!0===i&&s.push(t.getSeconds()),this.digitize(s)},getSeconds:function(t){var i=this.getTimeSeconds();return t&&(60===i?i=0:i%=60),Math.ceil(i)},getWeeks:function(t){var i=this.getTimeSeconds()/60/60/24/7;return t&&(i%=52),Math.floor(i)},removeLeadingZeros:function(t,i){var e=0,s=[];return i.forEach(function(n,a){as.length&&t.forEach(function(t,e){i.createList(t)}),this.createDivider(),this.createDivider(),n.insertBefore(this.dividers[0],this.lists[this.lists.length-2].$el),n.insertBefore(this.dividers[1],this.lists[this.lists.length-4].$el),this.base()},flip:function(t,i){this.autoIncrement(),t=t||this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(t,i)}}),e.CounterFace=e.Face.extend({shouldAutoIncrement:!1,constructor:function(t,i){"object"!==(void 0===i?"undefined":s(i))&&(i={}),t.autoStart=i.autoStart,i.autoStart&&(this.shouldAutoIncrement=!0),t.increment=function(){t.countdown=!1,t.setTime(t.getTime().getTimeSeconds()+1)},t.decrement=function(){t.countdown=!0;var i=t.getTime().getTimeSeconds();i>0&&t.setTime(i-1)},t.setValue=function(i){t.setTime(i)},t.setCounter=function(i){t.setTime(i)},this.base(t,i)},build:function(){var t=this,i=this.factory.$el.querySelectorAll("ul"),e=this.factory.getTime().digitize([this.factory.getTime().time]);e.length>i.length&&e.forEach(function(i,e){t.createList(i).select(i)}),this.lists.forEach(function(t,i){t.play()}),this.base()},flip:function(t,i){this.shouldAutoIncrement&&this.autoIncrement(),t||(t=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(t,i)},reset:function(){this.factory.time=new e.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}}),e.DailyCounterFace=e.Face.extend({showSeconds:!0,constructor:function(t,i){this.base(t,i)},build:function(t){var i=this,e=this.factory.$el.querySelectorAll("ul"),s=0;(t=t||this.factory.time.getDayCounter(this.showSeconds)).length>e.length&&t.forEach(function(t,e){i.createList(t)}),this.showSeconds?n.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el):s=2,n.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4+s].$el),n.insertBefore(this.createDivider("Hours"),this.lists[this.lists.length-6+s].$el),n.insertBefore(this.createDivider("Days",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(t,i)}}),e.HourlyCounterFace=e.Face.extend({constructor:function(t,i){this.base(t,i)},build:function(t,i){var e=this,s=this.factory.$el.querySelectorAll("ul");(i=i||this.factory.time.getHourCounter()).length>s.length&&i.forEach(function(t,i){e.createList(t)}),n.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el),n.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4].$el),t||n.insertBefore(this.createDivider("Hours",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(t,i)},appendDigitToClock:function(t){this.base(t),this.dividers[0].insertAfter(this.dividers[0].next())}}),e.MinuteCounterFace=e.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(t,i){this.base(t,i)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(t,i){t||(t=this.factory.time.getMinuteCounter()),this.base(t,i)}}),e.TwelveHourClockFace=e.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var t=this.factory.time.getTime(!1,this.showSeconds);this.base(t),this.meridiumText=this.getMeridium(),this.meridium=n.createDom(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(t,i){this.meridiumText!==this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),i)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"===this.getMeridium()},isAM:function(){return"AM"===this.getMeridium()}}),e.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},e.Lang.ar=e.Lang.Arabic,e.Lang["ar-ar"]=e.Lang.Arabic,e.Lang.arabic=e.Lang.Arabic,e.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},e.Lang.da=e.Lang.Danish,e.Lang["da-dk"]=e.Lang.Danish,e.Lang.danish=e.Lang.Danish,e.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},e.Lang.de=e.Lang.German,e.Lang["de-de"]=e.Lang.German,e.Lang.german=e.Lang.German,e.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},e.Lang.en=e.Lang.English,e.Lang["en-us"]=e.Lang.English,e.Lang.english=e.Lang.English,e.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},e.Lang.es=e.Lang.Spanish,e.Lang["es-es"]=e.Lang.Spanish,e.Lang.spanish=e.Lang.Spanish,e.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},e.Lang.fi=e.Lang.Finnish,e.Lang["fi-fi"]=e.Lang.Finnish,e.Lang.finnish=e.Lang.Finnish,e.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},e.Lang.fr=e.Lang.French,e.Lang["fr-ca"]=e.Lang.French,e.Lang.french=e.Lang.French,e.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},e.Lang.it=e.Lang.Italian,e.Lang["it-it"]=e.Lang.Italian,e.Lang.italian=e.Lang.Italian,e.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},e.Lang.lv=e.Lang.Latvian,e.Lang["lv-lv"]=e.Lang.Latvian,e.Lang.latvian=e.Lang.Latvian,e.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},e.Lang.nl=e.Lang.Dutch,e.Lang["nl-be"]=e.Lang.Dutch,e.Lang.dutch=e.Lang.Dutch,e.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},e.Lang.no=e.Lang.Norwegian,e.Lang.nb=e.Lang.Norwegian,e.Lang["no-nb"]=e.Lang.Norwegian,e.Lang.norwegian=e.Lang.Norwegian,e.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},e.Lang.pt=e.Lang.Portuguese,e.Lang["pt-br"]=e.Lang.Portuguese,e.Lang.portuguese=e.Lang.Portuguese,e.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},e.Lang.ru=e.Lang.Russian,e.Lang["ru-ru"]=e.Lang.Russian,e.Lang.russian=e.Lang.Russian,e.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},e.Lang.sv=e.Lang.Swedish,e.Lang["sv-se"]=e.Lang.Swedish,e.Lang.swedish=e.Lang.Swedish,e.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},e.Lang.zh=e.Lang.Chinese,e.Lang["zh-cn"]=e.Lang.Chinese,e.Lang.chinese=e.Lang.Chinese}}); -------------------------------------------------------------------------------- /src/flipclock.module.min.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable *//*! flipclock 2015-08-31 */ 2 | "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Base=function(){};Base.createDom=function(t){if("string"!=typeof t)return t;var i=document.createElement("span");i.innerHTML=t;var e=i.childNodes[0];return i=null,e},Base.insertBefore=function(t,i){t="string"==typeof t?Base.createDom(t):t,i="string"==typeof i?Base.createDom(i):i,i.parentNode.insertBefore(t,i)},Base.extend=function(t,i){var e=Base.prototype.extend;Base._prototyping=!0;var s=new this;e.call(s,t),s.base=function(){},delete Base._prototyping;var n=s.constructor,o=s.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor===o)this._constructing=!0,n.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||e).call(arguments[0],s)};return o.ancestor=this,o.extend=this.extend,o.createDom=this.createDom,o.insertBefore=this.insertBefore,o.forEach=this.forEach,o.implement=this.implement,o.prototype=s,o.toString=this.toString,o.valueOf=function(t){return"object"===t?o:n.valueOf()},e.call(o,i),"function"==typeof o.init&&o.init(),o},Base.prototype={extend:function(t,i){if(arguments.length>1){var e=this[t];if(e&&"function"==typeof i&&(!e.valueOf||e.valueOf()!==i.valueOf())&&/\bbase\b/.test(i)){var s=i.valueOf();i=function(){var t=this.base||Base.prototype.base;this.base=e;var i=s.apply(this,arguments);return this.base=t,i},i.valueOf=function(t){return"object"===t?i:s},i.toString=Base.toString}this[t]=i}else if(t){var n=Base.prototype.extend;Base._prototyping||"function"==typeof this||(n=this.extend||n);for(var o={toSource:null},a=["constructor","toString","valueOf"],c=Base._prototyping?0:1;r=a[c++];)t[r]!==o[r]&&n.call(this,r,t[r]);for(var r in t)o[r]||n.call(this,r,t[r])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(t,i,e){for(var s in t)void 0===this.prototype[s]&&i.call(e,t[s],s,t)},implement:function(){for(var t=0;t',''].join("");!e&&this.dot||(s=""),t=this.factory.localize(t);var n=['',''+(this.label&&t?t:"")+"",s,""],o=Base.createDom(n.join(""));return this.dividers.push(o),o},createList:function(t,i){"object"===(void 0===t?"undefined":_typeof(t))&&(i=t,t=0);var e=new FlipClock.List(this.factory,t,i);return this.lists.push(e),e},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(t){},addDigit:function(t){var i=this.createList(t,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(i)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0===this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(t,i){var e=this;Array.isArray(t)&&t.forEach(function(t,s){var n=e.lists[s];n?(i||t===n.digit||n.play(),n.select(t)):e.addDigit(t)})}}),FlipClock.Factory=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(t,i,e){e||(e={}),this.lists=[],this.running=!1,this.base(e),this.$el=this.base.createDom(t),this.$el.classList.add(this.classes.wrapper),this.$wrapper=this.$el,this.original=i instanceof Date?i:i?Math.round(i):0,this.time=new FlipClock.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new FlipClock.Timer(this,e),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,e),this.autoStart&&this.start()},loadClockFace:function(t,i){var e,s=!1;return t=t.ucfirst()+"Face",this.face.stop&&(this.stop(),s=!0),this.$el.innerHTML="",this.time.minimumDigits=this.minimumDigits,e=FlipClock[t]?new FlipClock[t](this,i):new FlipClock[this.defaultClockFace+"Face"](this,i),e.build(),this.face=e,s&&this.start(),this.face},loadLanguage:function(t){var i;return i=FlipClock.Lang[t.ucfirst()]?FlipClock.Lang[t.ucfirst()]:FlipClock.Lang[t]?FlipClock.Lang[t]:FlipClock.Lang[this.defaultLanguage],this.lang=i},localize:function(t,i){var e=this.lang;if(!t)return null;var s=t.toLowerCase();return"object"===(void 0===i?"undefined":_typeof(i))&&(e=i),e&&e[s]?e[s]:t},start:function(t){var i=this;i.running||i.countdown&&!(i.countdown&&i.time.time>0)?i.log("Trying to start timer when countdown already at 0"):(i.face.start(i.time),i.timer.start(function(){i.flip(),"function"==typeof t&&t()}))},stop:function(t){this.face.stop(),this.timer.stop(t);for(var i in this.lists)this.lists.hasOwnProperty(i)&&this.lists[i].stop()},reset:function(t){this.timer.reset(t),this.face.reset()},setTime:function(t){this.time.time=t,this.flip(!0)},getTime:function(t){return this.time},setCountdown:function(t){var i=this.running;this.countdown=Boolean(t),i&&(this.stop(),this.start())},flip:function(t){this.face.flip(!1,t)}}),FlipClock.List=FlipClock.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(t,i,e){this.factory=t,this.digit=i,this.lastDigit=i,this.$el=this.createList(),this.$obj=this.$el,i>0&&this.select(i),this.factory.$el.appendChild(this.$el)},select:function(t){if(void 0===t?t=this.digit:this.digit=t,this.digit!==this.lastDigit){var i=this.$el.querySelector("."+this.classes.before);i&&i.classList.remove(this.classes.before);var e=this.$el.querySelector("."+this.classes.active);e.classList.remove(this.classes.active),e.classList.add(this.classes.before),this.appendListItem(this.classes.active,this.digit),i&&i.remove(),this.lastDigit=this.digit}},play:function(){this.$el.classList.add(this.factory.classes.play)},stop:function(){var t=this;setTimeout(function(){t.$el.classList.remove(t.factory.classes.play)},this.factory.timer.interval)},createListItem:function(t,i){return['
  • ','','
    ','
    ','
    '+(i||"")+"
    ","
    ",'
    ','
    ','
    '+(i||"")+"
    ","
    ","
    ","
  • "].join("")},appendListItem:function(t,i){this.$el.appendChild(Base.createDom(this.createListItem(t,i)))},createList:function(){var t=this.getPrevDigit()?this.getPrevDigit():this.digit;return Base.createDom(['
      ',this.createListItem(this.classes.before,t),this.createListItem(this.classes.active,this.digit),"
    "].join(""))},getNextDigit:function(){return 9===this.digit?0:this.digit+1},getPrevDigit:function(){return 0===this.digit?9:this.digit-1}}),String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},FlipClock.Time=FlipClock.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(t,i,e){"object"!==(void 0===e?"undefined":_typeof(e))&&(e={}),e.minimumDigits||(e.minimumDigits=t.minimumDigits),this.base(e),this.factory=t,i&&(this.time=i)},convertDigitsToArray:function(t){var i=[];t=t.toString();for(var e=0;ethis.minimumDigits&&(this.minimumDigits=i.length),this.minimumDigits>i.length)for(var e=i.length;e12?e-12:0===e?12:e,t.getMinutes()];return!0===i&&s.push(t.getSeconds()),this.digitize(s)},getSeconds:function(t){var i=this.getTimeSeconds();return t&&(60===i?i=0:i%=60),Math.ceil(i)},getWeeks:function(t){var i=this.getTimeSeconds()/60/60/24/7;return t&&(i%=52),Math.floor(i)},removeLeadingZeros:function(t,i){var e=0,s=[];return i.forEach(function(n,o){oe.length&&t.forEach(function(t,e){i.createList(t)}),this.createDivider(),this.createDivider(),Base.insertBefore(this.dividers[0],this.lists[this.lists.length-2].$el),Base.insertBefore(this.dividers[1],this.lists[this.lists.length-4].$el),this.base()},flip:function(t,i){this.autoIncrement(),t=t||this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(t,i)}}),FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(t,i){"object"!==(void 0===i?"undefined":_typeof(i))&&(i={}),t.autoStart=i.autoStart,i.autoStart&&(this.shouldAutoIncrement=!0),t.increment=function(){t.countdown=!1,t.setTime(t.getTime().getTimeSeconds()+1)},t.decrement=function(){t.countdown=!0;var i=t.getTime().getTimeSeconds();i>0&&t.setTime(i-1)},t.setValue=function(i){t.setTime(i)},t.setCounter=function(i){t.setTime(i)},this.base(t,i)},build:function(){var t=this,i=this.factory.$el.querySelectorAll("ul"),e=this.factory.getTime().digitize([this.factory.getTime().time]);e.length>i.length&&e.forEach(function(i,e){t.createList(i).select(i)}),this.lists.forEach(function(t,i){t.play()}),this.base()},flip:function(t,i){this.shouldAutoIncrement&&this.autoIncrement(),t||(t=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(t,i)},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}}),FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,constructor:function(t,i){this.base(t,i)},build:function(t){var i=this,e=this.factory.$el.querySelectorAll("ul"),s=0;t=t||this.factory.time.getDayCounter(this.showSeconds),t.length>e.length&&t.forEach(function(t,e){i.createList(t)}),this.showSeconds?Base.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el):s=2,Base.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4+s].$el),Base.insertBefore(this.createDivider("Hours"),this.lists[this.lists.length-6+s].$el),Base.insertBefore(this.createDivider("Days",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(t,i)}}),FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(t,i){this.base(t,i)},build:function(t,i){var e=this,s=this.factory.$el.querySelectorAll("ul");i=i||this.factory.time.getHourCounter(),i.length>s.length&&i.forEach(function(t,i){e.createList(t)}),Base.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el),Base.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4].$el),t||Base.insertBefore(this.createDivider("Hours",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(t,i)},appendDigitToClock:function(t){this.base(t),this.dividers[0].insertAfter(this.dividers[0].next())}}),FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(t,i){this.base(t,i)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(t,i){t||(t=this.factory.time.getMinuteCounter()),this.base(t,i)}}),FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var t=this.factory.time.getTime(!1,this.showSeconds);this.base(t),this.meridiumText=this.getMeridium(),this.meridium=Base.createDom(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(t,i){this.meridiumText!==this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),i)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"===this.getMeridium()},isAM:function(){return"AM"===this.getMeridium()}}),FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic,FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish,FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German,FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English,FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish,FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish,FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French,FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian,FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian,FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch,FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian,FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese,FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian,FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish,FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese,"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=FlipClock:window.FlipClock=FlipClock; -------------------------------------------------------------------------------- /src/flipclock.min.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable *//*! flipclock 2015-08-31 */"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Base=function(){};Base.createDom=function(t){if("string"!=typeof t)return t;var i=document.createElement("span");i.innerHTML=t;var e=i.childNodes[0];return i=null,e},Base.insertBefore=function(t,i){t="string"==typeof t?Base.createDom(t):t,i="string"==typeof i?Base.createDom(i):i,i.parentNode.insertBefore(t,i)},Base.extend=function(t,i){var e=Base.prototype.extend;Base._prototyping=!0;var n=new this;e.call(n,t),n.base=function(){},delete Base._prototyping;var s=n.constructor,o=n.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor===o)this._constructing=!0,s.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||e).call(arguments[0],n)};return o.ancestor=this,o.extend=this.extend,o.createDom=this.createDom,o.insertBefore=this.insertBefore,o.forEach=this.forEach,o.implement=this.implement,o.prototype=n,o.toString=this.toString,o.valueOf=function(t){return"object"===t?o:s.valueOf()},e.call(o,i),"function"==typeof o.init&&o.init(),o},Base.prototype={extend:function(t,i){if(arguments.length>1){var e=this[t];if(e&&"function"==typeof i&&(!e.valueOf||e.valueOf()!==i.valueOf())&&/\bbase\b/.test(i)){var n=i.valueOf();i=function(){var t=this.base||Base.prototype.base;this.base=e;var i=n.apply(this,arguments);return this.base=t,i},i.valueOf=function(t){return"object"===t?i:n},i.toString=Base.toString}this[t]=i}else if(t){var s=Base.prototype.extend;Base._prototyping||"function"==typeof this||(s=this.extend||s);for(var o={toSource:null},a=["constructor","toString","valueOf"],c=Base._prototyping?0:1;r=a[c++];)t[r]!==o[r]&&s.call(this,r,t[r]);for(var r in t)o[r]||s.call(this,r,t[r])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(t,i,e){for(var n in t)void 0===this.prototype[n]&&i.call(e,t[n],n,t)},implement:function(){for(var t=0;t',''].join("");e&&(n=""),t=this.factory.localize(t);var s=['',''+(t||"")+"",n,""],o=Base.createDom(s.join(""));return this.dividers.push(o),o},createList:function(t,i){"object"===(void 0===t?"undefined":_typeof(t))&&(i=t,t=0);var e=new _FlipClock.List(this.factory,t,i);return this.lists.push(e),e},reset:function(){this.factory.time=new _FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(t){},addDigit:function(t){var i=this.createList(t,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(i)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0===this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(t,i){var e=this;Array.isArray(t)&&t.forEach(function(t,n){var s=e.lists[n];s?(i||t===s.digit||s.play(),s.select(t)):e.addDigit(t)})}})}(),function(){_FlipClock.Factory=_FlipClock.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(t,i,e){e||(e={}),this.lists=[],this.running=!1,this.base(e),this.$el=this.base.createDom(t),this.$el.classList.add(this.classes.wrapper),this.$wrapper=this.$el,this.original=i instanceof Date?i:i?Math.round(i):0,this.time=new _FlipClock.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new _FlipClock.Timer(this,e),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,e),this.autoStart&&this.start()},loadClockFace:function(t,i){var e,n=!1;return t=t.ucfirst()+"Face",this.face.stop&&(this.stop(),n=!0),this.$el.innerHTML="",this.time.minimumDigits=this.minimumDigits,e=_FlipClock[t]?new _FlipClock[t](this,i):new _FlipClock[this.defaultClockFace+"Face"](this,i),e.build(),this.face=e,n&&this.start(),this.face},loadLanguage:function(t){var i;return i=_FlipClock.Lang[t.ucfirst()]?_FlipClock.Lang[t.ucfirst()]:_FlipClock.Lang[t]?_FlipClock.Lang[t]:_FlipClock.Lang[this.defaultLanguage],this.lang=i},localize:function(t,i){var e=this.lang;if(!t)return null;var n=t.toLowerCase();return"object"===(void 0===i?"undefined":_typeof(i))&&(e=i),e&&e[n]?e[n]:t},start:function(t){var i=this;i.running||i.countdown&&!(i.countdown&&i.time.time>0)?i.log("Trying to start timer when countdown already at 0"):(i.face.start(i.time),i.timer.start(function(){i.flip(),"function"==typeof t&&t()}))},stop:function(t){this.face.stop(),this.timer.stop(t);for(var i in this.lists)this.lists.hasOwnProperty(i)&&this.lists[i].stop()},reset:function(t){this.timer.reset(t),this.face.reset()},setTime:function(t){this.time.time=t,this.flip(!0)},getTime:function(t){return this.time},setCountdown:function(t){var i=this.running;this.countdown=Boolean(t),i&&(this.stop(),this.start())},flip:function(t){this.face.flip(!1,t)}})}(),function(){_FlipClock.List=_FlipClock.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(t,i,e){this.factory=t,this.digit=i,this.lastDigit=i,this.$el=this.createList(),this.$obj=this.$el,i>0&&this.select(i),this.factory.$el.appendChild(this.$el)},select:function(t){if(void 0===t?t=this.digit:this.digit=t,this.digit!==this.lastDigit){var i=this.$el.querySelector("."+this.classes.before);i&&i.classList.remove(this.classes.before);var e=this.$el.querySelector("."+this.classes.active);e.classList.remove(this.classes.active),e.classList.add(this.classes.before),this.appendListItem(this.classes.active,this.digit),i&&i.remove(),this.lastDigit=this.digit}},play:function(){this.$el.classList.add(this.factory.classes.play)},stop:function(){var t=this;setTimeout(function(){t.$el.classList.remove(t.factory.classes.play)},this.factory.timer.interval)},createListItem:function(t,i){return['
  • ','','
    ','
    ','
    '+(i||"")+"
    ","
    ",'
    ','
    ','
    '+(i||"")+"
    ","
    ","
    ","
  • "].join("")},appendListItem:function(t,i){this.$el.appendChild(Base.createDom(this.createListItem(t,i)))},createList:function(){var t=this.getPrevDigit()?this.getPrevDigit():this.digit;return Base.createDom(['
      ',this.createListItem(this.classes.before,t),this.createListItem(this.classes.active,this.digit),"
    "].join(""))},getNextDigit:function(){return 9===this.digit?0:this.digit+1},getPrevDigit:function(){return 0===this.digit?9:this.digit-1}})}(),function(){String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},_FlipClock.Time=_FlipClock.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(t,i,e){"object"!==(void 0===e?"undefined":_typeof(e))&&(e={}),e.minimumDigits||(e.minimumDigits=t.minimumDigits),this.base(e),this.factory=t,i&&(this.time=i)},convertDigitsToArray:function(t){var i=[];t=t.toString();for(var e=0;ethis.minimumDigits&&(this.minimumDigits=i.length),this.minimumDigits>i.length)for(var e=i.length;e12?e-12:0===e?12:e,t.getMinutes()];return!0===i&&n.push(t.getSeconds()),this.digitize(n)},getSeconds:function(t){var i=this.getTimeSeconds();return t&&(60===i?i=0:i%=60),Math.ceil(i)},getWeeks:function(t){var i=this.getTimeSeconds()/60/60/24/7;return t&&(i%=52),Math.floor(i)},removeLeadingZeros:function(t,i){var e=0,n=[];return i.forEach(function(s,o){oe.length&&t.forEach(function(t,e){i.createList(t)}),this.createDivider(),this.createDivider(),Base.insertBefore(this.dividers[0],this.lists[this.lists.length-2].$el),Base.insertBefore(this.dividers[1],this.lists[this.lists.length-4].$el),this.base()},flip:function(t,i){this.autoIncrement(),t=t||this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(t,i)}})}(),function(){_FlipClock.CounterFace=_FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(t,i){"object"!==(void 0===i?"undefined":_typeof(i))&&(i={}),t.autoStart=i.autoStart,i.autoStart&&(this.shouldAutoIncrement=!0),t.increment=function(){t.countdown=!1,t.setTime(t.getTime().getTimeSeconds()+1)},t.decrement=function(){t.countdown=!0;var i=t.getTime().getTimeSeconds();i>0&&t.setTime(i-1)},t.setValue=function(i){t.setTime(i)},t.setCounter=function(i){t.setTime(i)},this.base(t,i)},build:function(){var t=this,i=this.factory.$el.querySelectorAll("ul"),e=this.factory.getTime().digitize([this.factory.getTime().time]);e.length>i.length&&e.forEach(function(i,e){t.createList(i).select(i)}),this.lists.forEach(function(t,i){t.play()}),this.base()},flip:function(t,i){this.shouldAutoIncrement&&this.autoIncrement(),t||(t=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(t,i)},reset:function(){this.factory.time=new _FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}})}(),function(){_FlipClock.DailyCounterFace=_FlipClock.Face.extend({showSeconds:!0,constructor:function(t,i){this.base(t,i)},build:function(t){var i=this,e=this.factory.$el.querySelectorAll("ul"),n=0;t=t||this.factory.time.getDayCounter(this.showSeconds),t.length>e.length&&t.forEach(function(t,e){i.createList(t)}),this.showSeconds?Base.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el):n=2,Base.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4+n].$el),Base.insertBefore(this.createDivider("Hours"),this.lists[this.lists.length-6+n].$el),Base.insertBefore(this.createDivider("Days",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(t,i)}})}(),function(){_FlipClock.HourlyCounterFace=_FlipClock.Face.extend({constructor:function(t,i){this.base(t,i)},build:function(t,i){var e=this,n=this.factory.$el.querySelectorAll("ul");i=i||this.factory.time.getHourCounter(),i.length>n.length&&i.forEach(function(t,i){e.createList(t)}),Base.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el),Base.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4].$el),t||Base.insertBefore(this.createDivider("Hours",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(t,i)},appendDigitToClock:function(t){this.base(t),this.dividers[0].insertAfter(this.dividers[0].next())}})}(),function(){_FlipClock.MinuteCounterFace=_FlipClock.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(t,i){this.base(t,i)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(t,i){t||(t=this.factory.time.getMinuteCounter()),this.base(t,i)}})}(),function(){_FlipClock.TwelveHourClockFace=_FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var t=this.factory.time.getTime(!1,this.showSeconds);this.base(t),this.meridiumText=this.getMeridium(),this.meridium=Base.createDom(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(t,i){this.meridiumText!==this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),i)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"===this.getMeridium()},isAM:function(){return"AM"===this.getMeridium()}})}(),function(){_FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},_FlipClock.Lang.ar=_FlipClock.Lang.Arabic,_FlipClock.Lang["ar-ar"]=_FlipClock.Lang.Arabic,_FlipClock.Lang.arabic=_FlipClock.Lang.Arabic}(),function(){_FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},_FlipClock.Lang.da=_FlipClock.Lang.Danish,_FlipClock.Lang["da-dk"]=_FlipClock.Lang.Danish,_FlipClock.Lang.danish=_FlipClock.Lang.Danish}(),function(){_FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},_FlipClock.Lang.de=_FlipClock.Lang.German,_FlipClock.Lang["de-de"]=_FlipClock.Lang.German,_FlipClock.Lang.german=_FlipClock.Lang.German}(),function(){_FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},_FlipClock.Lang.en=_FlipClock.Lang.English,_FlipClock.Lang["en-us"]=_FlipClock.Lang.English,_FlipClock.Lang.english=_FlipClock.Lang.English}(),function(){_FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},_FlipClock.Lang.es=_FlipClock.Lang.Spanish,_FlipClock.Lang["es-es"]=_FlipClock.Lang.Spanish,_FlipClock.Lang.spanish=_FlipClock.Lang.Spanish}(),function(){_FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},_FlipClock.Lang.fi=_FlipClock.Lang.Finnish,_FlipClock.Lang["fi-fi"]=_FlipClock.Lang.Finnish,_FlipClock.Lang.finnish=_FlipClock.Lang.Finnish}(),function(){_FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},_FlipClock.Lang.fr=_FlipClock.Lang.French,_FlipClock.Lang["fr-ca"]=_FlipClock.Lang.French,_FlipClock.Lang.french=_FlipClock.Lang.French}(),function(){_FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},_FlipClock.Lang.it=_FlipClock.Lang.Italian,_FlipClock.Lang["it-it"]=_FlipClock.Lang.Italian,_FlipClock.Lang.italian=_FlipClock.Lang.Italian}(),function(){_FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},_FlipClock.Lang.lv=_FlipClock.Lang.Latvian,_FlipClock.Lang["lv-lv"]=_FlipClock.Lang.Latvian,_FlipClock.Lang.latvian=_FlipClock.Lang.Latvian}(),function(){_FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},_FlipClock.Lang.nl=_FlipClock.Lang.Dutch,_FlipClock.Lang["nl-be"]=_FlipClock.Lang.Dutch,_FlipClock.Lang.dutch=_FlipClock.Lang.Dutch}(),function(){_FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},_FlipClock.Lang.no=_FlipClock.Lang.Norwegian,_FlipClock.Lang.nb=_FlipClock.Lang.Norwegian,_FlipClock.Lang["no-nb"]=_FlipClock.Lang.Norwegian,_FlipClock.Lang.norwegian=_FlipClock.Lang.Norwegian}(),function(){_FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},_FlipClock.Lang.pt=_FlipClock.Lang.Portuguese,_FlipClock.Lang["pt-br"]=_FlipClock.Lang.Portuguese,_FlipClock.Lang.portuguese=_FlipClock.Lang.Portuguese}(),function(){_FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},_FlipClock.Lang.ru=_FlipClock.Lang.Russian,_FlipClock.Lang["ru-ru"]=_FlipClock.Lang.Russian,_FlipClock.Lang.russian=_FlipClock.Lang.Russian}(),function(){_FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},_FlipClock.Lang.sv=_FlipClock.Lang.Swedish,_FlipClock.Lang["sv-se"]=_FlipClock.Lang.Swedish,_FlipClock.Lang.swedish=_FlipClock.Lang.Swedish}(),function(){_FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},_FlipClock.Lang.zh=_FlipClock.Lang.Chinese,_FlipClock.Lang["zh-cn"]=_FlipClock.Lang.Chinese,_FlipClock.Lang.chinese=_FlipClock.Lang.Chinese}(); -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | !function(t){var i={};function e(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="/",e(e.s=3)}([function(t,i){t.exports=function(t){var i=[];return i.toString=function(){return this.map(function(i){var e=function(t,i){var e=t[1]||"",n=t[3];if(!n)return e;if(i&&"function"==typeof btoa){var s=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(n),o=n.sources.map(function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"});return[e].concat(o).concat([s]).join("\n")}return[e].join("\n")}(i,t);return i[2]?"@media "+i[2]+"{"+e+"}":e}).join("")},i.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},s=0;s'+t.divider[i]+""))}t.time&&this.clock.setTime(t.time),t.time&&this.clock.autoStart&&this.clock.start()},instance:function(){return this.clock},trigger:function(t,i){this.clock&&this.clock[t]&&this.clock[t](arguments.slice(1))},start:function(t){this.clock&&this.clock.start(t)},stop:function(t){this.clock&&this.clock.stop(t)},reset:function(t,i){"function"==typeof t&&(i=t,t=null),this.clock&&this.clock.reset(i),t&&(t.digit=void 0!==t.digit?t.digit:0,this.init(t))},increment:function(){this.clock&&this.clock.increment()},decrement:function(){this.clock&&this.clock.decrement()},loadClockFace:function(t,i){this.clock&&this.clock.loadClockFace(t,i)},loadLanguage:function(t){this.clock&&this.clock.loadLanguage(t)},setCountdown:function(t){this.clock&&this.clock.setCountdown(t)},getTime:function(){this.clock&&this.clock.getTime()},setTime:function(t){this.clock&&this.clock.setTime(t)},setOptions:function(t){this.clock&&this.clock.setOptions(t)},destroyClock:function(){this.clock&&(this.clock.stop(),this.clock=null)}},beforeDestroy:function(){this.destroyClock()}}},function(t,i,e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s="function"==typeof Symbol&&"symbol"==n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},o=function(){};o.createDom=function(t){if("string"!=typeof t)return t;var i=document.createElement("span");i.innerHTML=t;var e=i.childNodes[0];return i=null,e},o.insertBefore=function(t,i){t="string"==typeof t?o.createDom(t):t,(i="string"==typeof i?o.createDom(i):i).parentNode.insertBefore(t,i)},o.extend=function(t,i){var e=o.prototype.extend;o._prototyping=!0;var n=new this;e.call(n,t),n.base=function(){},delete o._prototyping;var s=n.constructor,r=n.constructor=function(){if(!o._prototyping)if(this._constructing||this.constructor===r)this._constructing=!0,s.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||e).call(arguments[0],n)};return r.ancestor=this,r.extend=this.extend,r.createDom=this.createDom,r.insertBefore=this.insertBefore,r.forEach=this.forEach,r.implement=this.implement,r.prototype=n,r.toString=this.toString,r.valueOf=function(t){return"object"===t?r:s.valueOf()},e.call(r,i),"function"==typeof r.init&&r.init(),r},o.prototype={extend:function(t,i){if(arguments.length>1){var e=this[t];if(e&&"function"==typeof i&&(!e.valueOf||e.valueOf()!==i.valueOf())&&/\bbase\b/.test(i)){var n=i.valueOf();(i=function(){var t=this.base||o.prototype.base;this.base=e;var i=n.apply(this,arguments);return this.base=t,i}).valueOf=function(t){return"object"===t?i:n},i.toString=o.toString}this[t]=i}else if(t){var s=o.prototype.extend;o._prototyping||"function"==typeof this||(s=this.extend||s);for(var r={toSource:null},a=["constructor","toString","valueOf"],c=o._prototyping?0:1;l=a[c++];)t[l]!==r[l]&&s.call(this,l,t[l]);for(var l in t)r[l]||s.call(this,l,t[l])}return this}},o=o.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(t,i,e){for(var n in t)void 0===this.prototype[n]&&i.call(e,t[n],n,t)},implement:function(){for(var t=0;t',''].join("");!e&&this.dot||(n=""),t=this.factory.localize(t);var s=['',''+(this.label&&t?t:"")+"",n,""],r=o.createDom(s.join(""));return this.dividers.push(r),r},createList:function(t,i){"object"===(void 0===t?"undefined":s(t))&&(i=t,t=0);var e=new r.List(this.factory,t,i);return this.lists.push(e),e},reset:function(){this.factory.time=new r.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(t){},addDigit:function(t){var i=this.createList(t,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(i)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0===this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(t,i){var e=this;Array.isArray(t)&&t.forEach(function(t,n){var s=e.lists[n];s?(i||t===s.digit||s.play(),s.select(t)):e.addDigit(t)})}}),r.Factory=r.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(t,i,e){e||(e={}),this.lists=[],this.running=!1,this.base(e),this.$el=this.base.createDom(t),this.$el.classList.add(this.classes.wrapper),this.$wrapper=this.$el,this.original=i instanceof Date?i:i?Math.round(i):0,this.time=new r.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new r.Timer(this,e),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,e),this.autoStart&&this.start()},loadClockFace:function(t,i){var e,n=!1;return t=t.ucfirst()+"Face",this.face.stop&&(this.stop(),n=!0),this.$el.innerHTML="",this.time.minimumDigits=this.minimumDigits,(e=r[t]?new r[t](this,i):new r[this.defaultClockFace+"Face"](this,i)).build(),this.face=e,n&&this.start(),this.face},loadLanguage:function(t){var i;return i=r.Lang[t.ucfirst()]?r.Lang[t.ucfirst()]:r.Lang[t]?r.Lang[t]:r.Lang[this.defaultLanguage],this.lang=i},localize:function(t,i){var e=this.lang;if(!t)return null;var n=t.toLowerCase();return"object"===(void 0===i?"undefined":s(i))&&(e=i),e&&e[n]?e[n]:t},start:function(t){var i=this;i.running||i.countdown&&!(i.countdown&&i.time.time>0)?i.log("Trying to start timer when countdown already at 0"):(i.face.start(i.time),i.timer.start(function(){i.flip(),"function"==typeof t&&t()}))},stop:function(t){for(var i in this.face.stop(),this.timer.stop(t),this.lists)this.lists.hasOwnProperty(i)&&this.lists[i].stop()},reset:function(t){this.timer.reset(t),this.face.reset()},setTime:function(t){this.time.time=t,this.flip(!0)},getTime:function(t){return this.time},setCountdown:function(t){var i=this.running;this.countdown=Boolean(t),i&&(this.stop(),this.start())},flip:function(t){this.face.flip(!1,t)}}),r.List=r.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(t,i,e){this.factory=t,this.digit=i,this.lastDigit=i,this.$el=this.createList(),this.$obj=this.$el,i>0&&this.select(i),this.factory.$el.appendChild(this.$el)},select:function(t){if(void 0===t?t=this.digit:this.digit=t,this.digit!==this.lastDigit){var i=this.$el.querySelector("."+this.classes.before);i&&i.classList.remove(this.classes.before);var e=this.$el.querySelector("."+this.classes.active);e.classList.remove(this.classes.active),e.classList.add(this.classes.before),this.appendListItem(this.classes.active,this.digit),i&&i.remove(),this.lastDigit=this.digit}},play:function(){this.$el.classList.add(this.factory.classes.play)},stop:function(){var t=this;setTimeout(function(){t.$el.classList.remove(t.factory.classes.play)},this.factory.timer.interval)},createListItem:function(t,i){return['
  • ','','
    ','
    ','
    '+(i||"")+"
    ","
    ",'
    ','
    ','
    '+(i||"")+"
    ","
    ","
    ","
  • "].join("")},appendListItem:function(t,i){this.$el.appendChild(o.createDom(this.createListItem(t,i)))},createList:function(){var t=this.getPrevDigit()?this.getPrevDigit():this.digit;return o.createDom(['
      ',this.createListItem(this.classes.before,t),this.createListItem(this.classes.active,this.digit),"
    "].join(""))},getNextDigit:function(){return 9===this.digit?0:this.digit+1},getPrevDigit:function(){return 0===this.digit?9:this.digit-1}}),String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},r.Time=r.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(t,i,e){"object"!==(void 0===e?"undefined":s(e))&&(e={}),e.minimumDigits||(e.minimumDigits=t.minimumDigits),this.base(e),this.factory=t,i&&(this.time=i)},convertDigitsToArray:function(t){var i=[];t=t.toString();for(var e=0;ethis.minimumDigits&&(this.minimumDigits=i.length),this.minimumDigits>i.length)for(var e=i.length;e12?e-12:0===e?12:e,t.getMinutes()];return!0===i&&n.push(t.getSeconds()),this.digitize(n)},getSeconds:function(t){var i=this.getTimeSeconds();return t&&(60===i?i=0:i%=60),Math.ceil(i)},getWeeks:function(t){var i=this.getTimeSeconds()/60/60/24/7;return t&&(i%=52),Math.floor(i)},removeLeadingZeros:function(t,i){var e=0,n=[];return i.forEach(function(s,o){oe.length&&t.forEach(function(t,e){i.createList(t)}),this.createDivider(),this.createDivider(),o.insertBefore(this.dividers[0],this.lists[this.lists.length-2].$el),o.insertBefore(this.dividers[1],this.lists[this.lists.length-4].$el),this.base()},flip:function(t,i){this.autoIncrement(),t=t||this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(t,i)}}),r.CounterFace=r.Face.extend({shouldAutoIncrement:!1,constructor:function(t,i){"object"!==(void 0===i?"undefined":s(i))&&(i={}),t.autoStart=i.autoStart,i.autoStart&&(this.shouldAutoIncrement=!0),t.increment=function(){t.countdown=!1,t.setTime(t.getTime().getTimeSeconds()+1)},t.decrement=function(){t.countdown=!0;var i=t.getTime().getTimeSeconds();i>0&&t.setTime(i-1)},t.setValue=function(i){t.setTime(i)},t.setCounter=function(i){t.setTime(i)},this.base(t,i)},build:function(){var t=this,i=this.factory.$el.querySelectorAll("ul"),e=this.factory.getTime().digitize([this.factory.getTime().time]);e.length>i.length&&e.forEach(function(i,e){t.createList(i).select(i)}),this.lists.forEach(function(t,i){t.play()}),this.base()},flip:function(t,i){this.shouldAutoIncrement&&this.autoIncrement(),t||(t=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(t,i)},reset:function(){this.factory.time=new r.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}}),r.DailyCounterFace=r.Face.extend({showSeconds:!0,constructor:function(t,i){this.base(t,i)},build:function(t){var i=this,e=this.factory.$el.querySelectorAll("ul"),n=0;(t=t||this.factory.time.getDayCounter(this.showSeconds)).length>e.length&&t.forEach(function(t,e){i.createList(t)}),this.showSeconds?o.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el):n=2,o.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4+n].$el),o.insertBefore(this.createDivider("Hours"),this.lists[this.lists.length-6+n].$el),o.insertBefore(this.createDivider("Days",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(t,i)}}),r.HourlyCounterFace=r.Face.extend({constructor:function(t,i){this.base(t,i)},build:function(t,i){var e=this,n=this.factory.$el.querySelectorAll("ul");(i=i||this.factory.time.getHourCounter()).length>n.length&&i.forEach(function(t,i){e.createList(t)}),o.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el),o.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4].$el),t||o.insertBefore(this.createDivider("Hours",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(t,i)},appendDigitToClock:function(t){this.base(t),this.dividers[0].insertAfter(this.dividers[0].next())}}),r.MinuteCounterFace=r.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(t,i){this.base(t,i)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(t,i){t||(t=this.factory.time.getMinuteCounter()),this.base(t,i)}}),r.TwelveHourClockFace=r.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var t=this.factory.time.getTime(!1,this.showSeconds);this.base(t),this.meridiumText=this.getMeridium(),this.meridium=o.createDom(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(t,i){this.meridiumText!==this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),i)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"===this.getMeridium()},isAM:function(){return"AM"===this.getMeridium()}}),r.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},r.Lang.ar=r.Lang.Arabic,r.Lang["ar-ar"]=r.Lang.Arabic,r.Lang.arabic=r.Lang.Arabic,r.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},r.Lang.da=r.Lang.Danish,r.Lang["da-dk"]=r.Lang.Danish,r.Lang.danish=r.Lang.Danish,r.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},r.Lang.de=r.Lang.German,r.Lang["de-de"]=r.Lang.German,r.Lang.german=r.Lang.German,r.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},r.Lang.en=r.Lang.English,r.Lang["en-us"]=r.Lang.English,r.Lang.english=r.Lang.English,r.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},r.Lang.es=r.Lang.Spanish,r.Lang["es-es"]=r.Lang.Spanish,r.Lang.spanish=r.Lang.Spanish,r.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},r.Lang.fi=r.Lang.Finnish,r.Lang["fi-fi"]=r.Lang.Finnish,r.Lang.finnish=r.Lang.Finnish,r.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},r.Lang.fr=r.Lang.French,r.Lang["fr-ca"]=r.Lang.French,r.Lang.french=r.Lang.French,r.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},r.Lang.it=r.Lang.Italian,r.Lang["it-it"]=r.Lang.Italian,r.Lang.italian=r.Lang.Italian,r.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},r.Lang.lv=r.Lang.Latvian,r.Lang["lv-lv"]=r.Lang.Latvian,r.Lang.latvian=r.Lang.Latvian,r.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},r.Lang.nl=r.Lang.Dutch,r.Lang["nl-be"]=r.Lang.Dutch,r.Lang.dutch=r.Lang.Dutch,r.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},r.Lang.no=r.Lang.Norwegian,r.Lang.nb=r.Lang.Norwegian,r.Lang["no-nb"]=r.Lang.Norwegian,r.Lang.norwegian=r.Lang.Norwegian,r.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},r.Lang.pt=r.Lang.Portuguese,r.Lang["pt-br"]=r.Lang.Portuguese,r.Lang.portuguese=r.Lang.Portuguese,r.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},r.Lang.ru=r.Lang.Russian,r.Lang["ru-ru"]=r.Lang.Russian,r.Lang.russian=r.Lang.Russian,r.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},r.Lang.sv=r.Lang.Swedish,r.Lang["sv-se"]=r.Lang.Swedish,r.Lang.swedish=r.Lang.Swedish,r.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},r.Lang.zh=r.Lang.Chinese,r.Lang["zh-cn"]=r.Lang.Chinese,r.Lang.chinese=r.Lang.Chinese,"object"===s(i)&&void 0!==t?t.exports=r:window.FlipClock=r},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e(4),s=e(2),o=e.n(s),r=e(12),a=e.n(r);e.d(i,"FlipClock",function(){return n.a}),e.d(i,"FlipclockModule",function(){return o.a}),e.d(i,"FlipclockJs",function(){return a.a});const c=t=>{c.installed||t.component("FlipClock",n.a)};"undefined"!=typeof window&&window.Vue&&c(window.Vue),i.default=c},function(t,i,e){"use strict";var n=e(1),s=e(10),o=e(11);var r=function(t){e(5)},a=Object(o.a)(n.a,s.a,s.b,!1,r,null,null);i.a=a.exports},function(t,i,e){var n=e(6);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,e(8).default)("405fb43b",n,!0,{})},function(t,i,e){(i=t.exports=e(0)(!1)).i(e(7),""),i.push([t.i,"",""])},function(t,i,e){(t.exports=e(0)(!1)).push([t.i,'.flip-clock-wrapper *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden}.flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#fff}.flip-clock-wrapper a:hover{color:#fff}.flip-clock-wrapper ul{list-style:none}.flip-clock-wrapper.clearfix:after,.flip-clock-wrapper.clearfix:before{content:" ";display:table}.flip-clock-wrapper.clearfix:after{clear:both}.flip-clock-wrapper.clearfix{*zoom:1}.flip-clock-wrapper{font:normal 11px Helvetica Neue,Helvetica,sans-serif;-webkit-user-select:none;margin:0 auto;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-pack:center;-webkit-box-align:center;-webkit-justify-content:center;display:-moz-box;-moz-box-orient:horizontal;-moz-box-pack:center;-moz-box-align:center;-moz-justify-content:center;display:-o-box;-o-box-orient:horizontal;-o-box-pack:center;-o-box-align:center;-o-justify-content:center;display:-ms-box;-ms-box-orient:horizontal;-ms-box-pack:center;-ms-box-align:center;-ms-justify-content:center;display:flex;box-orient:horizontal;box-pack:center;box-align:center;justify-content:center}.flip-clock-meridium{background:none!important;box-shadow:0 0 0!important;font-size:36px!important}.flip-clock-meridium a{color:#313333}.flip-clock-wrapper{text-align:center;position:relative;width:100%}.flip-clock-wrapper:after,.flip-clock-wrapper:before{content:" ";display:table}.flip-clock-wrapper:after{clear:both}.flip-clock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:700;line-height:87px;border-radius:6px;background:#000}.flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none!important}.flip-clock-wrapper ul li:first-child{z-index:2}.flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;-moz-perspective:200px;perspective:200px;margin:0!important;overflow:visible!important;cursor:default!important}.flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;-moz-transform-origin:50% 100%;-ms-transform-origin:50% 100%;-o-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,.4)}.flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-ms-transform-origin:50% 0;-o-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}.flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#fff;text-shadow:0 1px 2px #000;text-align:center;background:#bdd0ff;border-radius:6px;font-size:70px}.flip-clock-wrapper ul li a div.up div.inn{top:0}.flip-clock-wrapper ul li a div.down div.inn{bottom:0}.flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}.flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,.7)}.flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd .5s .5s linear both;-moz-animation:asd .5s .5s linear both;animation:asd .5s .5s linear both;z-index:5}.flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}.flip-clock-divider:first-child{width:0}.flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.5);left:5px}.flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-112.5px;color:#000;text-shadow:none}.flip-clock-divider.minutes .flip-clock-label,.flip-clock-divider.seconds .flip-clock-label{right:-135px}.flip-clock-dot.top{top:30px}.flip-clock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}20%{z-index:4}to{z-index:4}}@-moz-keyframes asd{0%{z-index:2}20%{z-index:4}to{z-index:4}}@-o-keyframes asd{0%{z-index:2}20%{z-index:4}to{z-index:4}}@keyframes asd{0%{z-index:2}20%{z-index:4}to{z-index:4}}.flip-clock-wrapper ul.play li.flip-clock-active .down{z-index:2;-webkit-animation:turn .5s .5s linear both;-moz-animation:turn .5s .5s linear both;animation:turn .5s .5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg)}to{-webkit-transform:rotateX(0deg)}}@-moz-keyframes turn{0%{-moz-transform:rotateX(90deg)}to{-moz-transform:rotateX(0deg)}}@-o-keyframes turn{0%{-o-transform:rotateX(90deg)}to{-o-transform:rotateX(0deg)}}@keyframes turn{0%{transform:rotateX(90deg)}to{transform:rotateX(0deg)}}.flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 .5s linear both;-moz-animation:turn2 .5s linear both;animation:turn2 .5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0deg)}to{-webkit-transform:rotateX(-90deg)}}@-moz-keyframes turn2{0%{-moz-transform:rotateX(0deg)}to{-moz-transform:rotateX(-90deg)}}@-o-keyframes turn2{0%{-o-transform:rotateX(0deg)}to{-o-transform:rotateX(-90deg)}}@keyframes turn2{0%{transform:rotateX(0deg)}to{transform:rotateX(-90deg)}}.flip-clock-wrapper ul li.flip-clock-active{z-index:3}.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1) 0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,#000 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:linear,to bottom,rgba(0,0,0,.1) 0,#bdd0ff 100%;animation:hide .5s .3s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:linear,to bottom,#000 0,rgba(0,0,0,.1) 100%;animation:show .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:linear,to bottom,#000 0,rgba(0,0,0,.1) 100%;animation:hide .5s .2s linear both}@-webkit-keyframes show{0%{opacity:0}to{opacity:1}}@-moz-keyframes show{0%{opacity:0}to{opacity:1}}@-o-keyframes show{0%{opacity:0}to{opacity:1}}@keyframes show{0%{opacity:0}to{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}to{opacity:0}}@-moz-keyframes hide{0%{opacity:1}to{opacity:0}}@-o-keyframes hide{0%{opacity:1}to{opacity:0}}@keyframes hide{0%{opacity:1}to{opacity:0}}',""])},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(t,i,e,s){l=e,h=s||{};var r=Object(n.a)(t,i);return g(r),function(i){for(var e=[],s=0;se.parts.length&&(n.parts.length=e.parts.length)}else{var r=[];for(s=0;s1){var e=this[t];if(e&&"function"==typeof i&&(!e.valueOf||e.valueOf()!==i.valueOf())&&/\bbase\b/.test(i)){var n=i.valueOf();(i=function(){var t=this.base||r.prototype.base;this.base=e;var i=n.apply(this,arguments);return this.base=t,i}).valueOf=function(t){return"object"===t?i:n},i.toString=r.toString}this[t]=i}else if(t){var s=r.prototype.extend;r._prototyping||"function"==typeof this||(s=this.extend||s);for(var o={toSource:null},a=["constructor","toString","valueOf"],c=r._prototyping?0:1;l=a[c++];)t[l]!==o[l]&&s.call(this,l,t[l]);for(var l in t)o[l]||s.call(this,l,t[l])}return this}},r=r.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(t,i,e){for(var n in t)void 0===this.prototype[n]&&i.call(e,t[n],n,t)},implement:function(){for(var t=0;t',''].join("");e&&(n=""),t=this.factory.localize(t);var s=['',''+(t||"")+"",n,""],o=r.createDom(s.join(""));return this.dividers.push(o),o},createList:function(t,i){"object"===(void 0===t?"undefined":o(t))&&(i=t,t=0);var e=new n.List(this.factory,t,i);return this.lists.push(e),e},reset:function(){this.factory.time=new n.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(t){},addDigit:function(t){var i=this.createList(t,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(i)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0===this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(t,i){var e=this;Array.isArray(t)&&t.forEach(function(t,n){var s=e.lists[n];s?(i||t===s.digit||s.play(),s.select(t)):e.addDigit(t)})}}),n.Factory=n.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(t,i,e){e||(e={}),this.lists=[],this.running=!1,this.base(e),this.$el=this.base.createDom(t),this.$el.classList.add(this.classes.wrapper),this.$wrapper=this.$el,this.original=i instanceof Date?i:i?Math.round(i):0,this.time=new n.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new n.Timer(this,e),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,e),this.autoStart&&this.start()},loadClockFace:function(t,i){var e,s=!1;return t=t.ucfirst()+"Face",this.face.stop&&(this.stop(),s=!0),this.$el.innerHTML="",this.time.minimumDigits=this.minimumDigits,(e=n[t]?new n[t](this,i):new n[this.defaultClockFace+"Face"](this,i)).build(),this.face=e,s&&this.start(),this.face},loadLanguage:function(t){var i;return i=n.Lang[t.ucfirst()]?n.Lang[t.ucfirst()]:n.Lang[t]?n.Lang[t]:n.Lang[this.defaultLanguage],this.lang=i},localize:function(t,i){var e=this.lang;if(!t)return null;var n=t.toLowerCase();return"object"===(void 0===i?"undefined":o(i))&&(e=i),e&&e[n]?e[n]:t},start:function(t){var i=this;i.running||i.countdown&&!(i.countdown&&i.time.time>0)?i.log("Trying to start timer when countdown already at 0"):(i.face.start(i.time),i.timer.start(function(){i.flip(),"function"==typeof t&&t()}))},stop:function(t){for(var i in this.face.stop(),this.timer.stop(t),this.lists)this.lists.hasOwnProperty(i)&&this.lists[i].stop()},reset:function(t){this.timer.reset(t),this.face.reset()},setTime:function(t){this.time.time=t,this.flip(!0)},getTime:function(t){return this.time},setCountdown:function(t){var i=this.running;this.countdown=Boolean(t),i&&(this.stop(),this.start())},flip:function(t){this.face.flip(!1,t)}}),n.List=n.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(t,i,e){this.factory=t,this.digit=i,this.lastDigit=i,this.$el=this.createList(),this.$obj=this.$el,i>0&&this.select(i),this.factory.$el.appendChild(this.$el)},select:function(t){if(void 0===t?t=this.digit:this.digit=t,this.digit!==this.lastDigit){var i=this.$el.querySelector("."+this.classes.before);i&&i.classList.remove(this.classes.before);var e=this.$el.querySelector("."+this.classes.active);e.classList.remove(this.classes.active),e.classList.add(this.classes.before),this.appendListItem(this.classes.active,this.digit),i&&i.remove(),this.lastDigit=this.digit}},play:function(){this.$el.classList.add(this.factory.classes.play)},stop:function(){var t=this;setTimeout(function(){t.$el.classList.remove(t.factory.classes.play)},this.factory.timer.interval)},createListItem:function(t,i){return['
  • ','','
    ','
    ','
    '+(i||"")+"
    ","
    ",'
    ','
    ','
    '+(i||"")+"
    ","
    ","
    ","
  • "].join("")},appendListItem:function(t,i){this.$el.appendChild(r.createDom(this.createListItem(t,i)))},createList:function(){var t=this.getPrevDigit()?this.getPrevDigit():this.digit;return r.createDom(['
      ',this.createListItem(this.classes.before,t),this.createListItem(this.classes.active,this.digit),"
    "].join(""))},getNextDigit:function(){return 9===this.digit?0:this.digit+1},getPrevDigit:function(){return 0===this.digit?9:this.digit-1}}),String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},n.Time=n.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(t,i,e){"object"!==(void 0===e?"undefined":o(e))&&(e={}),e.minimumDigits||(e.minimumDigits=t.minimumDigits),this.base(e),this.factory=t,i&&(this.time=i)},convertDigitsToArray:function(t){var i=[];t=t.toString();for(var e=0;ethis.minimumDigits&&(this.minimumDigits=i.length),this.minimumDigits>i.length)for(var e=i.length;e12?e-12:0===e?12:e,t.getMinutes()];return!0===i&&n.push(t.getSeconds()),this.digitize(n)},getSeconds:function(t){var i=this.getTimeSeconds();return t&&(60===i?i=0:i%=60),Math.ceil(i)},getWeeks:function(t){var i=this.getTimeSeconds()/60/60/24/7;return t&&(i%=52),Math.floor(i)},removeLeadingZeros:function(t,i){var e=0,n=[];return i.forEach(function(s,o){oe.length&&t.forEach(function(t,e){i.createList(t)}),this.createDivider(),this.createDivider(),r.insertBefore(this.dividers[0],this.lists[this.lists.length-2].$el),r.insertBefore(this.dividers[1],this.lists[this.lists.length-4].$el),this.base()},flip:function(t,i){this.autoIncrement(),t=t||this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(t,i)}}),n.CounterFace=n.Face.extend({shouldAutoIncrement:!1,constructor:function(t,i){"object"!==(void 0===i?"undefined":o(i))&&(i={}),t.autoStart=i.autoStart,i.autoStart&&(this.shouldAutoIncrement=!0),t.increment=function(){t.countdown=!1,t.setTime(t.getTime().getTimeSeconds()+1)},t.decrement=function(){t.countdown=!0;var i=t.getTime().getTimeSeconds();i>0&&t.setTime(i-1)},t.setValue=function(i){t.setTime(i)},t.setCounter=function(i){t.setTime(i)},this.base(t,i)},build:function(){var t=this,i=this.factory.$el.querySelectorAll("ul"),e=this.factory.getTime().digitize([this.factory.getTime().time]);e.length>i.length&&e.forEach(function(i,e){t.createList(i).select(i)}),this.lists.forEach(function(t,i){t.play()}),this.base()},flip:function(t,i){this.shouldAutoIncrement&&this.autoIncrement(),t||(t=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(t,i)},reset:function(){this.factory.time=new n.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}}),n.DailyCounterFace=n.Face.extend({showSeconds:!0,constructor:function(t,i){this.base(t,i)},build:function(t){var i=this,e=this.factory.$el.querySelectorAll("ul"),n=0;(t=t||this.factory.time.getDayCounter(this.showSeconds)).length>e.length&&t.forEach(function(t,e){i.createList(t)}),this.showSeconds?r.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el):n=2,r.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4+n].$el),r.insertBefore(this.createDivider("Hours"),this.lists[this.lists.length-6+n].$el),r.insertBefore(this.createDivider("Days",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(t,i)}}),n.HourlyCounterFace=n.Face.extend({constructor:function(t,i){this.base(t,i)},build:function(t,i){var e=this,n=this.factory.$el.querySelectorAll("ul");(i=i||this.factory.time.getHourCounter()).length>n.length&&i.forEach(function(t,i){e.createList(t)}),r.insertBefore(this.createDivider("Seconds"),this.lists[this.lists.length-2].$el),r.insertBefore(this.createDivider("Minutes"),this.lists[this.lists.length-4].$el),t||r.insertBefore(this.createDivider("Hours",!0),this.lists[0].$el),this.base()},flip:function(t,i){t||(t=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(t,i)},appendDigitToClock:function(t){this.base(t),this.dividers[0].insertAfter(this.dividers[0].next())}}),n.MinuteCounterFace=n.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(t,i){this.base(t,i)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(t,i){t||(t=this.factory.time.getMinuteCounter()),this.base(t,i)}}),n.TwelveHourClockFace=n.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var t=this.factory.time.getTime(!1,this.showSeconds);this.base(t),this.meridiumText=this.getMeridium(),this.meridium=r.createDom(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(t,i){this.meridiumText!==this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),i)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"===this.getMeridium()},isAM:function(){return"AM"===this.getMeridium()}}),n.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},n.Lang.ar=n.Lang.Arabic,n.Lang["ar-ar"]=n.Lang.Arabic,n.Lang.arabic=n.Lang.Arabic,n.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},n.Lang.da=n.Lang.Danish,n.Lang["da-dk"]=n.Lang.Danish,n.Lang.danish=n.Lang.Danish,n.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},n.Lang.de=n.Lang.German,n.Lang["de-de"]=n.Lang.German,n.Lang.german=n.Lang.German,n.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},n.Lang.en=n.Lang.English,n.Lang["en-us"]=n.Lang.English,n.Lang.english=n.Lang.English,n.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},n.Lang.es=n.Lang.Spanish,n.Lang["es-es"]=n.Lang.Spanish,n.Lang.spanish=n.Lang.Spanish,n.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},n.Lang.fi=n.Lang.Finnish,n.Lang["fi-fi"]=n.Lang.Finnish,n.Lang.finnish=n.Lang.Finnish,n.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},n.Lang.fr=n.Lang.French,n.Lang["fr-ca"]=n.Lang.French,n.Lang.french=n.Lang.French,n.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},n.Lang.it=n.Lang.Italian,n.Lang["it-it"]=n.Lang.Italian,n.Lang.italian=n.Lang.Italian,n.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},n.Lang.lv=n.Lang.Latvian,n.Lang["lv-lv"]=n.Lang.Latvian,n.Lang.latvian=n.Lang.Latvian,n.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},n.Lang.nl=n.Lang.Dutch,n.Lang["nl-be"]=n.Lang.Dutch,n.Lang.dutch=n.Lang.Dutch,n.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},n.Lang.no=n.Lang.Norwegian,n.Lang.nb=n.Lang.Norwegian,n.Lang["no-nb"]=n.Lang.Norwegian,n.Lang.norwegian=n.Lang.Norwegian,n.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},n.Lang.pt=n.Lang.Portuguese,n.Lang["pt-br"]=n.Lang.Portuguese,n.Lang.portuguese=n.Lang.Portuguese,n.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},n.Lang.ru=n.Lang.Russian,n.Lang["ru-ru"]=n.Lang.Russian,n.Lang.russian=n.Lang.Russian,n.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},n.Lang.sv=n.Lang.Swedish,n.Lang["sv-se"]=n.Lang.Swedish,n.Lang.swedish=n.Lang.Swedish,n.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},n.Lang.zh=n.Lang.Chinese,n.Lang["zh-cn"]=n.Lang.Chinese,n.Lang.chinese=n.Lang.Chinese}]); --------------------------------------------------------------------------------