-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
143 lines (121 loc) · 3.89 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Timer</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@latest/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="style.css"/>
<script src="https://use.fontawesome.com/365512f0c3.js"></script>
</head>
<body>
<div id="vapp" class="container-fluid">
<div style="-webkit-app-region: drag" class="text-center">
<div>
<span class="lightGrey">NY: </span><span style="font-size:x-large;">{{usClock}}</span>
</div>
<div>
<span class="lightGrey">EU: </span><span style="font-size:small;">{{euClock}}</span>
</div>
<div>
<span class="dateText lightGrey">{{usDate}}</span>
</div>
</div>
</div>
<!--end vue app-->
<script>
window.jQuery = window.$ = require('jquery');
</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@latest/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
const vueApp = new Vue({
components: {},
el: '#vapp',
data() {
return {
spinner: false,
oneMin: null,
fiveMin: null,
usClock: null,
euClock: null,
usDate: null
}
},
created() {},
watch: {},
mounted() {
getSize = () => {
var screenSize = {
"monitorWidth": window.innerWidth,
"monitorHeight": window.innerHeight
}
localStorage.setItem('screenSize', JSON.stringify(screenSize))
}
window.onresize = getSize
fiveMinCountdown = () => {
var cur_date = new Date();
var hour = cur_date.getHours();
var minutes = cur_date.getMinutes();
var seconds = cur_date.getSeconds();
var minutes_remain = 5 - minutes % 5 - 1;
var seconds_remain = 59 - seconds;
this.fiveMin = (
minutes_remain < 10
? "0"
: "") + minutes_remain + ":" + (
seconds_remain < 10
? "0"
: "") + seconds_remain
}
oneMinCountdown = () => {
var cur_date = new Date();
var hour = cur_date.getHours();
var minutes = cur_date.getMinutes();
var seconds = cur_date.getSeconds();
var minutes_remain = 1 - minutes % 1 - 1;
var seconds_remain = 59 - seconds;
this.oneMin = (
minutes_remain < 10
? "0"
: "") + minutes_remain + ":" + (
seconds_remain < 10
? "0"
: "") + seconds_remain
}
getTime = () => {
var now = new Date();
var USTime = now.toLocaleString("en-US", {
timeZone: "America/New_York",
hour: 'numeric',
minute: 'numeric',
second: 'numeric'
})
this.usClock = USTime
var EUTime = now.toLocaleString("fr-FR", {
timeZone: "Europe/Paris",
hour: 'numeric',
minute: 'numeric',
second: 'numeric'
})
this.euClock = EUTime
var options = {
weekday: "short",
year: "numeric",
month: "short",
day: "numeric"
};
var USDate = now.toLocaleString("en-US", options)
this.usDate = USDate
}
setInterval(() => {
fiveMinCountdown()
oneMinCountdown()
getTime()
}, 1000);
},
methods: {}
})
</script>
</body>
</html>