Mobile refinements
parent
6f5b25bdf3
commit
d70aad2842
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, user-scalable=n">
|
||||||
<title>vue-counter</title>
|
<title>vue-counter</title>
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="<%= htmlWebpackPlugin.files.publicPath %>static/img/icons/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="<%= htmlWebpackPlugin.files.publicPath %>static/img/icons/favicon-32x32.png">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="<%= htmlWebpackPlugin.files.publicPath %>static/img/icons/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="<%= htmlWebpackPlugin.files.publicPath %>static/img/icons/favicon-16x16.png">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<header>
|
<header>
|
||||||
<span>Counter PWA</span>
|
<span>Counter</span>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="counter">
|
<div class="counter">
|
||||||
<div class="count-top">
|
<div class="count-top">
|
||||||
<label class="upper-label" for="limit">Limit</label>
|
<label class="upper-label" for="limit" @click="reset">Limit</label>
|
||||||
<input class="upper-input" id="limit" type="number" v-model="countBound" placeholder="10"/>
|
<input class="upper-input" name="limit" type="number" v-model="countBound" placeholder="10"/>
|
||||||
</div>
|
</div>
|
||||||
<div @click="bumpCount" :style="countStyle" class="count-bottom">
|
<div @click="bumpCount" :style="countStyle" class="count-bottom">
|
||||||
<div class="value">{{ countCurrent }}</div>
|
<div class="value">{{ countCurrent }}</div>
|
||||||
|
@ -11,11 +11,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'counter',
|
name: 'counter',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
msg: 'Welcome to Your Counter PWA',
|
|
||||||
countBound: 15,
|
countBound: 15,
|
||||||
countCurrent: 0,
|
countCurrent: 0,
|
||||||
limitReached: false,
|
limitReached: false,
|
||||||
|
@ -38,9 +39,14 @@ export default {
|
||||||
|
|
||||||
if (this.limitReached) {
|
if (this.limitReached) {
|
||||||
this.countStyle.backgroundColor = '#e53232'
|
this.countStyle.backgroundColor = '#e53232'
|
||||||
|
window.navigator.vibrate([200, 100, 200])
|
||||||
} else {
|
} else {
|
||||||
this.countStyle.backgroundColor = '#179e63'
|
this.countStyle.backgroundColor = '#179e63'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
reset () {
|
||||||
|
this.countCurrent = 0;
|
||||||
|
this.limitReached = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,23 +62,24 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.count-top {
|
.count-top {
|
||||||
display: table;
|
|
||||||
width:100%;
|
width:100%;
|
||||||
min-height:30%;
|
min-height:20%;
|
||||||
font-size: 3em;
|
font-size: 3em;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
.upper-label {
|
.upper-label {
|
||||||
display: table-cell;
|
flex: 0 0 auto;
|
||||||
width: 1px;
|
vertical-align: text-bottom;
|
||||||
min-height: 50%;
|
align-self: flex-end;
|
||||||
padding-left: 0.2em;
|
margin-bottom: 0.55em;
|
||||||
padding-right: 0.2em;
|
|
||||||
}
|
}
|
||||||
.upper-input {
|
.upper-input {
|
||||||
display: table-cell;
|
|
||||||
min-width: 97%;
|
|
||||||
min-height: 80%;
|
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
|
width: 3em;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
margin: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.count-bottom {
|
.count-bottom {
|
||||||
|
|
Loading…
Reference in New Issue