-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue-countdown.html
45 lines (37 loc) · 1.73 KB
/
vue-countdown.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Vue Countdown</title>
<meta name="description" content="Soon enough to be married with Polymer's Material Design.">
<link rel="stylesheet" href="vue-countdown.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.7/vue.min.js"></script>
</head>
<body id="demo" v-bind:class="{'alarm': isAlarm}">
<div class="Countdown__container">
<section class="Start" v-if="!hasStarted">
<form class="Start__form" v-on:submit="startTimer">
<input
autofocus
type="text"
value="{{this.startingValue}}"
placeholder="How many seconds should the timer go?"
v-model="startingValue">
<button type="submit" class="btn btn-default">Start Timer</button>
</form>
</section>
<section class="During" v-if="hasStarted && !hasFinished">
<div id="During__body">
</div>
<button class="btn" v-if="!hasStopped" v-on:click="stopTimer">Stop Timer</button>
<button class="btn" v-if="hasStopped" v-on:click="startTimer">Continue Timer</button>
</section>
<section class="Finish" v-if="hasFinished">
<button class="Finish__button" v-on:click="stopAlarm" v-if="isAlarm">Stop Alarm</button>
<button class="Finish__button" v-on:click="restart">New Timer</button>
</section>
</div>
<script src="vue-countdown.js"></script>
</body>
</html>