4 <meta name=
"viewport" content=
"width=device-width, initial-scale=1" />
12 * Reset styles for the html and body elements, the only two HTML
24 text-decoration: none;
25 vertical-align: baseline;
26 background: transparent;
29 /* The blinking fade in/out animation for the ticket date and time */
42 #tickettime, #ticketdate {
43 animation: blink
2s linear infinite;
46 /* Define, load, and specify the custom font we use for the ticket
47 * date, time, and service name. */
49 font-family: "CharmBypass Regular";
51 url("data:font/woff2;base64,@CBPREGULAR@") format("woff2")
54 #servicename, #tickettime, #ticketdate {
55 font-family: "CharmBypass Regular";
59 font-family: "CharmBypass Bold";
61 url("data:font/woff2;base64,@CBPBOLD@") format("woff2")
65 font-family: "CharmBypass Bold";
68 /************************/
69 /* Scrolling animations */
70 /************************/
75 transform: translateX(
0%);
78 transform: translateX(
100%);
83 animation: busroll
23s linear infinite;
90 transform: translateX(
0%);
93 transform: translateX(
100%);
98 animation: tramroll
17s linear infinite;
103 @keyframes trainroll {
105 transform: translateX(
0%);
108 transform: translateX(
100%);
113 animation: trainroll
11s linear infinite;
118 @keyframes cloudsfloat {
120 transform: translateX(
0%);
123 transform: translateX(-
50%);
128 animation: cloudsfloat
40s linear infinite;
131 @keyframes cloudscopyfloat {
133 transform: translateX(
0%);
136 transform: translateX(-
50%);
141 animation: cloudscopyfloat
40s linear infinite;
146 @keyframes treespass {
148 transform: translateX(
0%);
151 transform: translateX(-
50%);
156 /* The trees move a little faster than the clouds */
157 animation: treespass
30s linear infinite;
160 @keyframes treescopypass {
162 transform: translateX(
0%);
165 transform: translateX(-
50%);
170 /* The trees move a little faster than the clouds */
171 animation: treescopypass
30s linear infinite;
180 /******************************************/
181 /* First, set up the ticket date and time */
182 /******************************************/
184 /* There are two parameters, time and date, that we store in one
185 * underlying "date" variable. Default both to an hour from now. This
186 * is sensible because the date/time shown on your ticket is its
187 * EXPIRATION time, and tickets are valid for two hours. Having it
188 * show one hour in the future means that you didn't just use your
189 * ticket a second ago (if you just got caught on the light rail, for
190 * example) but also means that it's not expiring for a while.
192 const date = new Date();
194 /* Add an hour. We use the low-level get/setTime to change the number
195 * of milliseconds since the epoch that this date represents. Obviously
196 * correct, and avoids all suspicious corner cases (well, for a few more
198 date.setTime(date.getTime() + (
60*
60*
1000));
200 /* All
<text> elements produced by inkscape contain a single
<tspan>
201 * that itself contains the actual text. */
202 tt = document.getElementById("tickettime");
203 tt.firstChild.textContent = date.toLocaleTimeString();
205 td = document.getElementById("ticketdate");
211 td.firstChild.textContent = date.toLocaleDateString("en-US", dateopts);
214 /************************************************************/
215 /* Second, add the onclick handler for the night/day switch */
216 /************************************************************/
218 /* We always start in "day" mode */
222 sky.style.fill = "#efb02f";
225 function set_night() {
226 sky.style.fill = "#
143b66";
229 function swap_colors() {
240 document.body.addEventListener("click", swap_colors);