-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
123 lines (117 loc) · 7.48 KB
/
index.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<html>
<head>
<title>Alarm Clock (Demo AlpineJs)</title>
<script nomodule src="https://unpkg.com/browser-es-module-loader/dist/babel-browser-build.js"></script>
<script nomodule src="https://unpkg.com/browser-es-module-loader"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<script src="js/alarm.js"></script>
</head>
<body>
<div class="container" x-data='loadAlarmConfig()' x-init='() => {
statTimer();
}'>
<div class="row mt-5" >
<div class="col">
<div class="col-md-12">
<div class="card bg-dark ">
<div class="card-body">
<h3 class="card-title text-white">
<i class="fas fa-clock"></i>
<span type="text" x-text="time.hour"></span>:
<span type="text" x-text="time.minute"></span>:
<span type="text" x-text="time.second"></span>
<span type="text" x-text="time.a"></span>
</h3>
<a class="btn btn-light mt-2" @click="createAlarm()">Create Alarm</a>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card bg-light mt-3">
<div class="card-body">
<div class="row">
<div class="col" x-show="create_alarm">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col">
<label for="">Title</label>
<input placeholder="Type alarm title here" type="text" x-model="alarm.title" class="form-control">
</div>
<div class="w-100 mt-4"></div>
<div class="col">
<label for="">Hour</label>
<input type="number" x-model="alarm.hour" class="form-control">
</div>
<div class="col">
<label for="">Minute</label>
<input type="number" x-model="alarm.minute" class="form-control">
</div>
<div class="col">
<label for="">AM/PM</label>
<select class="form-control" name="" x-model="alarm.a" id="">
<option value="AM">AM</option>
<option value="PM">PM</option>
</select>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<button class="btn btn-dark" @click="saveAlarm()">
<i class="fas fa-check"></i>
</button>
</div>
</div>
<div x-show="is_alarm_error" class="row">
<div class="col">
<span x-text="alarm_error" class="text text-danger">
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div x-show="alarms.length > 0" class="row">
<div class="col-md-12">
<h2>Alarms</h2>
<template x-for="item in alarms" :key="item">
<div x-bind:class="getAlarmClass(item)">
<div class="card-body">
<h5 class="title">
<span x-text="item.title"></span> will
<span x-text="item.label"></span>
</h5>
<p class="h3 mt-2">
<i class="fas fa-bell mr-2"></i><span x-text="item.time_left"></span>
</p>
<hr>
<button x-show="item.active" @click="deactivateAlarm(item.index)" class="btn btn-danger">
Stop
</button>
<button x-show="!item.active" class="btn btn-success">
Stopped
</button>
</div>
</div>
</template>
</div>
</div>
</div>
</body>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="/__/firebase/7.14.0/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="/__/firebase/7.14.0/firebase-analytics.js"></script>
<!-- Initialize Firebase -->
<script src="/__/firebase/init.js"></script>
</html>