├── .browserslistrc ├── preview.gif ├── babel.config.js ├── preview_old.gif ├── postcss.config.js ├── src ├── i18n │ ├── index.js │ ├── cn.js │ └── en.js ├── main.js ├── App.vue ├── store.js └── components │ ├── Counter.vue │ ├── ViewOnGithub.vue │ └── Setting.vue ├── .editorconfig ├── .gitignore ├── .eslintrc.js ├── public └── index.html ├── package.json ├── vue.config.js ├── README.md └── LICENSE /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverBehave/Motivation/HEAD/preview.gif -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /preview_old.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverBehave/Motivation/HEAD/preview_old.gif -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/i18n/index.js: -------------------------------------------------------------------------------- 1 | import en from './en' 2 | import cn from './cn' 3 | 4 | export default { 5 | en: en, 6 | cn: cn 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | '@vue/standard' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |输入日期,看时间飞逝
29 |你输入的任何信息都不会离开你的浏览器
30 |Motivated by Motivation
` 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/i18n/en.js: -------------------------------------------------------------------------------- 1 | export default { 2 | toasted: { 3 | welcome_back: 'Welcome Back! You have been away for {sec} seconds', 4 | date_invaild: 'Date invalid!', 5 | set_date: 'Set Successfully!' 6 | }, 7 | level: { 8 | light: 'Light', 9 | moderate: 'Moderate', 10 | terrifying: 'Terrifying', 11 | wtf: 'WTF?' 12 | }, 13 | title: { 14 | motivation: 'Motivation', 15 | level: 'Level', 16 | date: 'Date (Like birthday)' 17 | }, 18 | button: { 19 | confirm: 'Confirm' 20 | }, 21 | placeholder: { 22 | year: 'Year', 23 | month: 'Month', 24 | day: 'Day' 25 | }, 26 | message: { 27 | default: 'Click to Set Time', 28 | readme: `Enter a date and see how time flies
29 |No data will leave your browser
30 |Motivated by Motivation
` 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "motivation", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "moment": "^2.24.0", 12 | "offline-plugin": "^5.0.6", 13 | "purecss": "^1.0.0", 14 | "vue": "^2.6.6", 15 | "vue-i18n": "^8.10.0", 16 | "vue-js-modal": "^1.3.28", 17 | "vue-toasted": "^1.1.26", 18 | "vuex": "^3.0.1", 19 | "vuex-persistedstate": "^2.5.4" 20 | }, 21 | "devDependencies": { 22 | "@vue/cli-plugin-babel": "^3.5.0", 23 | "@vue/cli-plugin-eslint": "^3.5.0", 24 | "@vue/cli-service": "^3.5.0", 25 | "@vue/eslint-config-standard": "^4.0.0", 26 | "babel-eslint": "^10.0.1", 27 | "eslint": "^5.8.0", 28 | "eslint-plugin-vue": "^5.0.0", 29 | "vue-template-compiler": "^2.5.21" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const OfflinePlugin = require('offline-plugin') 2 | 3 | let prod = (process.env.NODE_ENV === 'production') 4 | 5 | let config = { 6 | configureWebpack: { 7 | plugins: [] 8 | } 9 | } 10 | 11 | // Plugin 12 | let Offline = new OfflinePlugin({ 13 | // https://github.com/NekR/offline-plugin/blob/master/docs/examples/SPA.md 14 | // Unless specified in webpack's configuration itself 15 | publicPath: '/', 16 | appShell: '/', 17 | externals: [ 18 | '/' 19 | ], 20 | responseStrategy: 'network-first', 21 | AppCache: { 22 | FALLBACK: { 23 | '/': '/error/cache-missed' 24 | } 25 | }, 26 | excludes: ['**/.*', '**/_*', '**/*.map', '**/*.gz'] 27 | }) 28 | 29 | // Push Plugin Only in Prod 30 | if (prod) { 31 | config.configureWebpack.plugins.push(Offline) 32 | } else { 33 | console.log('Some plugins may not work as they are disabled when developing.') 34 | } 35 | 36 | module.exports = config 37 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import store from './store' 4 | 5 | import Purecss from 'purecss' 6 | import VModal from 'vue-js-modal' 7 | import Toasted from 'vue-toasted' 8 | import moment from 'moment' 9 | import VueI18n from 'vue-i18n' 10 | 11 | import * as OfflinePluginRuntime from 'offline-plugin/runtime' 12 | 13 | import lang from './i18n' 14 | 15 | Vue.config.productionTip = false 16 | Vue.prototype.$moment = moment 17 | Vue.use(VModal, { 18 | componentName: 'vue-modal' 19 | }) 20 | Vue.use(Toasted, { 21 | duration: 3000 22 | }) 23 | Vue.use(Purecss) 24 | Vue.use(VueI18n) 25 | 26 | OfflinePluginRuntime.install() 27 | 28 | export const i18n = new VueI18n({ 29 | locale: (() => { 30 | let l = navigator.language.toLocaleLowerCase() 31 | return l.includes('zh') || l.includes('cn') ? 'cn' : l 32 | })(), // 设置语言环境 33 | fallbackLocale: 'en', 34 | messages: lang // 设置语言环境信息 35 | }) 36 | 37 | new Vue({ 38 | store, 39 | i18n, 40 | render: h => h(App) 41 | }).$mount('#app') 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Motivation 2 | 3 | [](https://app.netlify.com/sites/motivation-countdown/deploys) 4 | 5 |  6 | 7 | 输入生日,看时间流逝 8 | 9 | ## Other Editions (其他版本) 10 | 11 | - Wallpaper Engine Edition ([Source Code](https://github.com/NeverBehave/Motivation/tree/Wallpaper-Engine)): https://steamcommunity.com/workshop/filedetails/?id=1683433667 12 | 13 | - Inspired by Project(Also Macos ScreenSaver): https://github.com/soffes/Motivation 14 | 15 | - Windows ScreenSaver: @TODO 16 | 17 | ## Project setup 18 | ``` 19 | yarn install 20 | ``` 21 | 22 | ### Compiles and hot-reloads for development 23 | ``` 24 | yarn run serve 25 | ``` 26 | 27 | ### Compiles and minifies for production 28 | ``` 29 | yarn run build 30 | ``` 31 | 32 | ### Run your tests 33 | ``` 34 | yarn run test 35 | ``` 36 | 37 | ### Lints and fixes files 38 | ``` 39 | yarn run lint 40 | ``` 41 | 42 | ### Customize configuration 43 | See [Configuration Reference](https://cli.vuejs.org/config/). 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 NeverBehave 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 2 |{{ string }}
4 |