✨ (pwa) add shortcut
This commit is contained in:
BIN
public/img/shortcuts/play-144x144.png
Normal file
BIN
public/img/shortcuts/play-144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/img/shortcuts/play-192x192.png
Normal file
BIN
public/img/shortcuts/play-192x192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -1,14 +1,15 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter, { RouteConfig } from 'vue-router'
|
||||
import Home from '../views/Home.vue'
|
||||
import Home from '@/views/Home.vue'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes: Array<RouteConfig> = [
|
||||
const routes: RouteConfig[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Home
|
||||
component: Home,
|
||||
props: (route) => ({ play: route.query.play })
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
@play="start"
|
||||
@pause="pause"
|
||||
/>
|
||||
<footer>
|
||||
<footer v-if="false">
|
||||
Made by
|
||||
<a
|
||||
href="https://github.com/jcalixte"
|
||||
@@ -66,7 +66,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from '@vue/composition-api'
|
||||
import { defineComponent, onMounted } from '@vue/composition-api'
|
||||
import { useTimer } from '@/hooks/useTimer'
|
||||
import DevSession from '@/components/DevSession.vue'
|
||||
import ZoneMusic from '@/components/ZoneMusic.vue'
|
||||
@@ -79,7 +79,10 @@ export default defineComponent({
|
||||
ZoneMusic,
|
||||
IntervalInput
|
||||
},
|
||||
setup() {
|
||||
props: {
|
||||
play: { type: Boolean, default: false }
|
||||
},
|
||||
setup(props) {
|
||||
const {
|
||||
interval,
|
||||
start,
|
||||
@@ -95,6 +98,12 @@ export default defineComponent({
|
||||
timeState.value === 'stopped' ? start() : pause()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.play) {
|
||||
start()
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
interval,
|
||||
toggle,
|
||||
|
||||
@@ -11,7 +11,18 @@ module.exports = {
|
||||
},
|
||||
manifestOptions: {
|
||||
background_color: mainColor,
|
||||
theme_color: mainColor,
|
||||
shortcuts: [
|
||||
{
|
||||
name: 'Start a session',
|
||||
short_name: 'Start session',
|
||||
description: 'Start a pair programming session',
|
||||
url: '/?play=true',
|
||||
icons: [
|
||||
{ src: '/img/shortcuts/play-192x192.png', sizes: '192x192' },
|
||||
{ src: '/img/shortcuts/play-144x144.png', sizes: '144x144' }
|
||||
]
|
||||
}
|
||||
],
|
||||
icons: [
|
||||
{
|
||||
src: './img/icons/android-chrome-192x192.png',
|
||||
|
||||
Reference in New Issue
Block a user