-
Notifications
You must be signed in to change notification settings - Fork 0
/
html.go
122 lines (113 loc) · 2.42 KB
/
html.go
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
// Copyright 2019 Tim Shannon. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package main
const html = `
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Photo Frame</title>
<style>
body {
background-color: #000;
}
.img-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
background-image: url("/image");
-webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
-moz-animation: fadein 2s; /* Firefox < 16 */
-ms-animation: fadein 2s; /* Internet Explorer */
-o-animation: fadein 2s; /* Opera < 12.1 */
animation: fadein 2s;
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Internet Explorer */
@-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Opera < 12.1 */
@-o-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
</style>
</head>
<body>
<div class="img-container">
</div>
</body>
<script type="text/javascript">
(function() {
window.setTimeout(function() {
window.location.reload();
}, {{.Duration}});
})();
</script>
</html>
`
const loading = `
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Photo Frame</title>
<style>
body {
background-color: #000;
}
.loading {
position: absolute;
color: #fff;
text-align: center;
top: 50%;
width: 100%;
}
.img-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
</style>
</head>
<body>
<div class="img-container">
<h1 class="loading">Images are loading ...</h1>
</div>
</body>
<script type="text/javascript">
(function() {
window.setTimeout(function() {
window.location.reload();
}, {{.Duration}});
})();
</script>
</html>
`