summaryrefslogtreecommitdiff
path: root/template.html
blob: ffb833cf5964b61d239fa5bf625b688908744791 (plain)
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
<!DOCTYPE html>
<html>
	<head>
		<title>Startpage</title>
		<style type="text/css">
			body {
				background: grey;
				-moz-background-size: cover;
				-o-background-size: cover;
				background-size: cover;
			}
			{{ if .BgImage }}
				body {
					background: black url(/bgimg) no-repeat center center fixed;
				}
			{{ end }}
			a {
				color: #eee;
				text-decoration: none;
			}
			a:hover {
				color: white;
				text-decoration: underline;
			}
			* {
				font-family: "DejaVu Sans Light", sans-serif;
				color: white;
			}
			footer {
				font-size: 8pt;
			}
			#yr_no_credit {
				position: fixed;
				display: inline-block;
				bottom: 2mm;
				left: 10mm;
				background: black;
			}
			#imageinfo {
				position: fixed;
				bottom: 2mm;
				right: 10mm;
				background: black;
			}
			#weather {
				position: fixed;
				top: 10mm;
				left: 10mm;
			}
			#temp {
				position: absolute;
				top: 30px;
				left: 60px;
				font-size:70px;
				text-shadow: black 2px 2px;
				color: white;
			}
			#links {
				position: absolute;
				top: 40%;
				left: 20%;
				columns: 2;
				-moz-columns: 2;
				padding: 5mm;
				background: rgba(0,0,0,0.6);
			}
			#links ul {
				padding: 0px;
				margin: 0px;
				list-style: none;
			}
			#links ul li {
				padding: 0px;
				margin: 0px;
				font-size: 10pt;
			}
		</style>
	</head>
	<body>
		{{ if .Weather }}
			<div id="weather">
				<a href="{{ .Weather.URL }}"><img src="{{ .Weather.Icon }}" alt="" /></a>
				<span id="temp">{{ .Weather.Temp.Value }}°</span>
			</div>
		{{ end }}
		{{ if .Links }}
			<div id="links">
				<ul>
					{{ range .Links }}
						<li><a href="{{ .URL }}">{{ .Title }}</a></li>
					{{ end }}
				</ul>
			</div>
		{{ end }}


		<footer>
			{{ if .Weather }}
				<div id="yr_no_credit">Weather forecast from Yr, delivered by the Norwegian Meteorological Institute and NRK</div>
			{{ end }}

			{{ if .BgImage }}
				<span id="imageinfo">
					<a href="http://reddit.com{{ .BgImage.Permalink }}">{{ .BgImage.Title }}</a>{{ if .CanSaveBg}}
						| {{ if .BgImage.Saved }}saved{{ else }}<a href="/savebg">save</a>{{ end }}
					{{ end }}
				</span>
			{{ end}}
		</footer>
	</body>
</html>