-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
71 lines (68 loc) · 1.63 KB
/
test.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
<body @onload='data.UpdateDate()'>
<div id="clock">
<p class="date" vg-html='data.Date' @onmouseover='data.UpdateDate()'></p>
<p class="time" vg-html='data.Time'></p>
<p class="text">Vugu Clock</p>
<button @click="data.Schedule()">Test</button>
</div>
</body>
<style>
html,body {
height: 100%;
}
body {
background: #0f3854;
background: radial-gradient(ellipse at center, #0a2e38 0%, #000000 70%);
background-size: 100%;
}
p {
margin: 0;
padding: 0;
}
#clock {
font-family: 'Share Tech Mono', monospace;
color: #ffffff;
text-align: center;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #daf6ff;
text-shadow: 0 0 20px rgba(10, 175, 230, 1), 0 0 20px rgba(10, 175, 230, 0);
.time {
letter-spacing: 0.05em;
font-size: 80px;
padding: 5px 0;
}
.date {
letter-spacing: 0.1em;
font-size: 24px;
}
.text {
letter-spacing: 0.1em;
font-size: 12px;
padding: 20px 0 0;
}
}
</style>
<script type="application/x-go">
import "time"
type RootData struct {
Date string
Time string
}
func (data *RootData) Schedule() {
ticker := time.NewTicker(1 * time.Second)
go func() {
for _ = range ticker.C {
data.UpdateDate()
}
}()
}
func (data *RootData) UpdateDate() {
fmt.Println("something is happening yo")
dt := time.Now()
data.Date = dt.Format("01-02-2006")
data.Time = dt.Format("2006-01-02 3:4:5 PM")
}
</script>