diff --git a/.eslintrc.js b/.eslintrc.js index 07ec69a..d2eb214 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,17 +4,19 @@ module.exports = { node: true }, extends: [ - "plugin:vue/essential", - "eslint:recommended", - "@vue/typescript/recommended", - "@vue/prettier", - "@vue/prettier/@typescript-eslint" + 'plugin:vue/essential', + 'eslint:recommended', + '@vue/typescript/recommended', + '@vue/prettier', + '@vue/prettier/@typescript-eslint' ], parserOptions: { ecmaVersion: 2020 }, rules: { - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off" + '@typescript-eslint/camelcase': 'off', + '@typescript-eslint/no-explicit-any': 'off', + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' } -}; +} diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..b43b020 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +v14.4.0 \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..ee136f3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "arrowParens": "always" +} diff --git a/babel.config.js b/babel.config.js index 397abca..716b023 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"] -}; + presets: ['@vue/cli-plugin-babel/preset'] +} diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..ce136e8 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,4 @@ +[[redirects]] + from = "/*" + to = "/" + status = 200 \ No newline at end of file diff --git a/package.json b/package.json index bb619d4..cdae5fa 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,13 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@vue/composition-api": "^1.0.0-beta.1", "core-js": "^3.6.5", "register-service-worker": "^1.7.1", "vue": "^2.6.11", "vue-router": "^3.2.0", - "vuex": "^3.4.0" + "vuex": "^3.4.0", + "youtube-video-js": "^3.2.0" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.33.0", diff --git a/public/favicon.ico b/public/favicon.ico index df36fcf..98977da 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/img/icons/android-chrome-192x192.png b/public/img/icons/android-chrome-192x192.png index b02aa64..5ff5aea 100644 Binary files a/public/img/icons/android-chrome-192x192.png and b/public/img/icons/android-chrome-192x192.png differ diff --git a/public/img/icons/android-chrome-512x512.png b/public/img/icons/android-chrome-512x512.png index 06088b0..e80a35a 100644 Binary files a/public/img/icons/android-chrome-512x512.png and b/public/img/icons/android-chrome-512x512.png differ diff --git a/public/img/icons/android-chrome-maskable-192x192.png b/public/img/icons/android-chrome-maskable-192x192.png index 791e9c8..5ff5aea 100644 Binary files a/public/img/icons/android-chrome-maskable-192x192.png and b/public/img/icons/android-chrome-maskable-192x192.png differ diff --git a/public/img/icons/android-chrome-maskable-512x512.png b/public/img/icons/android-chrome-maskable-512x512.png index 5f2098e..e80a35a 100644 Binary files a/public/img/icons/android-chrome-maskable-512x512.png and b/public/img/icons/android-chrome-maskable-512x512.png differ diff --git a/public/img/icons/apple-touch-icon-120x120.png b/public/img/icons/apple-touch-icon-120x120.png index 1427cf6..db4a22f 100644 Binary files a/public/img/icons/apple-touch-icon-120x120.png and b/public/img/icons/apple-touch-icon-120x120.png differ diff --git a/public/img/icons/apple-touch-icon-152x152.png b/public/img/icons/apple-touch-icon-152x152.png index f24d454..39f365f 100644 Binary files a/public/img/icons/apple-touch-icon-152x152.png and b/public/img/icons/apple-touch-icon-152x152.png differ diff --git a/public/img/icons/apple-touch-icon-180x180.png b/public/img/icons/apple-touch-icon-180x180.png index 404e192..d1d5c8e 100644 Binary files a/public/img/icons/apple-touch-icon-180x180.png and b/public/img/icons/apple-touch-icon-180x180.png differ diff --git a/public/img/icons/apple-touch-icon-60x60.png b/public/img/icons/apple-touch-icon-60x60.png index cf10a56..a83295e 100644 Binary files a/public/img/icons/apple-touch-icon-60x60.png and b/public/img/icons/apple-touch-icon-60x60.png differ diff --git a/public/img/icons/apple-touch-icon-76x76.png b/public/img/icons/apple-touch-icon-76x76.png index c500769..0e53c51 100644 Binary files a/public/img/icons/apple-touch-icon-76x76.png and b/public/img/icons/apple-touch-icon-76x76.png differ diff --git a/public/img/icons/apple-touch-icon.png b/public/img/icons/apple-touch-icon.png index 03c0c5d..d1d5c8e 100644 Binary files a/public/img/icons/apple-touch-icon.png and b/public/img/icons/apple-touch-icon.png differ diff --git a/public/img/icons/favicon-16x16.png b/public/img/icons/favicon-16x16.png index 42af009..bbecc4d 100644 Binary files a/public/img/icons/favicon-16x16.png and b/public/img/icons/favicon-16x16.png differ diff --git a/public/img/icons/favicon-32x32.png b/public/img/icons/favicon-32x32.png index 46ca04d..7194a27 100644 Binary files a/public/img/icons/favicon-32x32.png and b/public/img/icons/favicon-32x32.png differ diff --git a/public/img/icons/msapplication-icon-144x144.png b/public/img/icons/msapplication-icon-144x144.png index 7808237..422d549 100644 Binary files a/public/img/icons/msapplication-icon-144x144.png and b/public/img/icons/msapplication-icon-144x144.png differ diff --git a/public/img/icons/mstile-150x150.png b/public/img/icons/mstile-150x150.png index 3b37a43..f04ea46 100644 Binary files a/public/img/icons/mstile-150x150.png and b/public/img/icons/mstile-150x150.png differ diff --git a/public/img/icons/safari-pinned-tab.svg b/public/img/icons/safari-pinned-tab.svg index e44c0d5..00625ea 100644 --- a/public/img/icons/safari-pinned-tab.svg +++ b/public/img/icons/safari-pinned-tab.svg @@ -1,3 +1,8 @@ - - + + + + + + + diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..00625ea --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/App.vue b/src/App.vue index 0228dd3..ccaef51 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,32 +1,16 @@
- +

Bons programmeurs

diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/assets/sounds/move.mp3 b/src/assets/sounds/move.mp3 new file mode 100644 index 0000000..a58e527 Binary files /dev/null and b/src/assets/sounds/move.mp3 differ diff --git a/src/components/DreamMaker.vue b/src/components/DreamMaker.vue new file mode 100644 index 0000000..bf43391 --- /dev/null +++ b/src/components/DreamMaker.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 5025bb6..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - diff --git a/src/main.ts b/src/main.ts index 246503d..b096f58 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,13 +1,16 @@ -import Vue from "vue"; -import App from "./App.vue"; -import "./registerServiceWorker"; -import router from "./router"; -import store from "./store"; +import Vue from 'vue' +import App from './App.vue' +import './registerServiceWorker' +import router from './router' +import store from './store' +import VueCompositionAPI from '@vue/composition-api' -Vue.config.productionTip = false; +Vue.use(VueCompositionAPI) + +Vue.config.productionTip = false new Vue({ router, store, - render: h => h(App) -}).$mount("#app"); + render: (h) => h(App) +}).$mount('#app') diff --git a/src/registerServiceWorker.ts b/src/registerServiceWorker.ts index 30b7895..e940164 100644 --- a/src/registerServiceWorker.ts +++ b/src/registerServiceWorker.ts @@ -1,34 +1,34 @@ /* eslint-disable no-console */ -import { register } from "register-service-worker"; +import { register } from 'register-service-worker' -if (process.env.NODE_ENV === "production") { +if (process.env.NODE_ENV === 'production') { register(`${process.env.BASE_URL}service-worker.js`, { ready() { console.log( - "App is being served from cache by a service worker.\n" + - "For more details, visit https://goo.gl/AFskqB" - ); + 'App is being served from cache by a service worker.\n' + + 'For more details, visit https://goo.gl/AFskqB' + ) }, registered() { - console.log("Service worker has been registered."); + console.log('Service worker has been registered.') }, cached() { - console.log("Content has been cached for offline use."); + console.log('Content has been cached for offline use.') }, updatefound() { - console.log("New content is downloading."); + console.log('New content is downloading.') }, updated() { - console.log("New content is available; please refresh."); + console.log('New content is available; please refresh.') }, offline() { console.log( - "No internet connection found. App is running in offline mode." - ); + 'No internet connection found. App is running in offline mode.' + ) }, error(error) { - console.error("Error during service worker registration:", error); + console.error('Error during service worker registration:', error) } - }); + }) } diff --git a/src/router/index.ts b/src/router/index.ts index 8716a04..043c87b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,30 +1,21 @@ -import Vue from "vue"; -import VueRouter, { RouteConfig } from "vue-router"; -import Home from "../views/Home.vue"; +import Vue from 'vue' +import VueRouter, { RouteConfig } from 'vue-router' +import Home from '../views/Home.vue' -Vue.use(VueRouter); +Vue.use(VueRouter) const routes: Array = [ { - path: "/", - name: "Home", + path: '/', + name: 'Home', component: Home - }, - { - path: "/about", - name: "About", - // route level code-splitting - // this generates a separate chunk (about.[hash].js) for this route - // which is lazy-loaded when the route is visited. - component: () => - import(/* webpackChunkName: "about" */ "../views/About.vue") } -]; +] const router = new VueRouter({ - mode: "history", + mode: 'history', base: process.env.BASE_URL, routes -}); +}) -export default router; +export default router diff --git a/src/shims-tsx.d.ts b/src/shims-tsx.d.ts index 2bcdf9f..c656c68 100644 --- a/src/shims-tsx.d.ts +++ b/src/shims-tsx.d.ts @@ -1,4 +1,4 @@ -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue' declare global { namespace JSX { @@ -7,7 +7,7 @@ declare global { // tslint:disable no-empty-interface interface ElementClass extends Vue {} interface IntrinsicElements { - [elem: string]: any; + [elem: string]: any } } } diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts index 0660bd6..d9f24fa 100644 --- a/src/shims-vue.d.ts +++ b/src/shims-vue.d.ts @@ -1,4 +1,4 @@ -declare module "*.vue" { - import Vue from "vue"; - export default Vue; +declare module '*.vue' { + import Vue from 'vue' + export default Vue } diff --git a/src/store/index.ts b/src/store/index.ts index fb6015f..0107c20 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,11 +1,11 @@ -import Vue from "vue"; -import Vuex from "vuex"; +import Vue from 'vue' +import Vuex from 'vuex' -Vue.use(Vuex); +Vue.use(Vuex) export default new Vuex.Store({ state: {}, mutations: {}, actions: {}, modules: {} -}); +}) diff --git a/src/styles/app.scss b/src/styles/app.scss new file mode 100644 index 0000000..ce4ceca --- /dev/null +++ b/src/styles/app.scss @@ -0,0 +1,31 @@ +@import url('https://fonts.googleapis.com/css2?family=Anonymous+Pro&display=swap'); + +$color: #f8efba; + +body { + text-align: center; + font-family: 'Anonymous Pro', monospace; + background-color: #2c3a47; + color: $color; + margin: 0; +} + +button { + font-family: 'Anonymous Pro', monospace; + border: none; + padding: 1rem; + text-decoration: none; + background: #0069ed; + color: $color; + cursor: pointer; + transition: background 250ms ease-in-out, transform 150ms ease; +} + +button:hover, +button:focus { + background: #0053ba; +} + +button:active { + transform: scale(0.99); +} diff --git a/src/utils/notification.ts b/src/utils/notification.ts new file mode 100644 index 0000000..02c42ce --- /dev/null +++ b/src/utils/notification.ts @@ -0,0 +1,19 @@ +declare const Notification: any + +export const notify = (message: string) => { + if (!('Notification' in window)) { + return + } else if (Notification.permission === 'granted') { + new Notification(message) + } else if (Notification.permission !== 'denied') { + Notification.requestPermission((permission: any) => { + if (!('permission' in Notification)) { + Notification.permission = permission + } + + if (permission === 'granted') { + new Notification(message) + } + }) + } +} diff --git a/src/views/Home.vue b/src/views/Home.vue index 191049e..56dec4f 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,18 +1,156 @@ - + + diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..cabe973 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,91 @@ +const mainColor = '#3f4fa6' + +module.exports = { + pwa: { + themeColor: mainColor, + msTileColor: mainColor, + workboxOptions: { + skipWaiting: true, + clientsClaim: true + }, + name: '', + manifestOptions: { + background_color: mainColor, + theme_color: mainColor, + icons: [ + { + src: './img/icons/android-chrome-192x192.png', + sizes: '192x192', + type: 'image/png' + }, + { + src: './img/icons/android-chrome-512x512.png', + sizes: '512x512', + type: 'image/png' + }, + { + src: './img/icons/android-chrome-maskable-192x192.png', + sizes: '192x192', + type: 'image/png', + purpose: 'maskable' + }, + { + src: './img/icons/android-chrome-maskable-512x512.png', + sizes: '512x512', + type: 'image/png', + purpose: 'maskable' + }, + { + src: './img/icons/apple-touch-icon-60x60.png', + sizes: '60x60', + type: 'image/png' + }, + { + src: './img/icons/apple-touch-icon-76x76.png', + sizes: '76x76', + type: 'image/png' + }, + { + src: './img/icons/apple-touch-icon-120x120.png', + sizes: '120x120', + type: 'image/png' + }, + { + src: './img/icons/apple-touch-icon-152x152.png', + sizes: '152x152', + type: 'image/png' + }, + { + src: './img/icons/apple-touch-icon-180x180.png', + sizes: '180x180', + type: 'image/png' + }, + { + src: './img/icons/apple-touch-icon.png', + sizes: '180x180', + type: 'image/png' + }, + { + src: './img/icons/favicon-16x16.png', + sizes: '16x16', + type: 'image/png' + }, + { + src: './img/icons/favicon-32x32.png', + sizes: '32x32', + type: 'image/png' + }, + { + src: './img/icons/msapplication-icon-144x144.png', + sizes: '144x144', + type: 'image/png' + }, + { + src: './img/icons/mstile-150x150.png', + sizes: '150x150', + type: 'image/png' + } + ] + } + } +} diff --git a/yarn.lock b/yarn.lock index 3a85a9e..0e23668 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1225,6 +1225,13 @@ optionalDependencies: prettier "^1.18.2" +"@vue/composition-api@^1.0.0-beta.1": + version "1.0.0-beta.1" + resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-1.0.0-beta.1.tgz#bd5c3fc902f8bd75c3bd9180974572a51a416447" + integrity sha512-QByO16Ij9QR/JK0XWZh6cSs76nMlcEpr67enklteiDWvJesO5ziS22rRILr3HAwV3pBnGqZszeNfwEEWx1vCHw== + dependencies: + tslib "^2.0.0" + "@vue/eslint-config-prettier@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@vue/eslint-config-prettier/-/eslint-config-prettier-6.0.0.tgz#ad5912b308f4ae468458e02a2b05db0b9d246700" @@ -7258,6 +7265,11 @@ resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1: dependencies: path-parse "^1.0.6" +resource-manager-js@^5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/resource-manager-js/-/resource-manager-js-5.0.7.tgz#df2a4e65be234e2e846354ca31421fb0ae1c27c6" + integrity sha512-MCx8XHSonLhBeC6FvMyWJZ73g9Rk4NkLIOguxrS9Q6IFqY/GBnv75UCwj0gv3GQRWz8ei4X3A6VLFNfLLYddMg== + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -8296,6 +8308,11 @@ tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== +tslib@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3" + integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g== + tslint@^5.20.1: version "5.20.1" resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" @@ -9161,3 +9178,10 @@ yorkie@^2.0.0: is-ci "^1.0.10" normalize-path "^1.0.0" strip-indent "^2.0.0" + +youtube-video-js@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/youtube-video-js/-/youtube-video-js-3.2.0.tgz#f9873ac92812e3ce443dd0856f909936c3dafc9b" + integrity sha512-6ePqvcZ2FUgz1ueaI2Mr9e9P6utBmBlGHAJstVSjKrAKEQiiTsZNPaQ2tQM2dNogPKnEM2jZp/YKiJWhoJT7gw== + dependencies: + resource-manager-js "^5.0.7"