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 Ticket Text";
51 url("data:font/woff2;base64,@TICKETFONT@") format("woff2")
54 #servicename, #tickettime, #ticketdate {
55 font-family: "CharmBypass Ticket Text" !important;
58 /************************/
59 /* Scrolling animations */
60 /************************/
63 transform: translateX(
0%);
66 transform: translateX(
100%);
71 animation: busroll
20s linear infinite;
76 transform: translateX(
0%);
79 transform: translateX(
100%);
84 animation: tramroll
15s linear infinite;
87 @keyframes cloudsfloat {
89 transform: translateX(
0%);
92 transform: translateX(-
50%);
97 animation: cloudsfloat
40s linear infinite;
100 @keyframes cloudscopyfloat {
102 transform: translateX(
0%);
105 transform: translateX(-
50%);
110 animation: cloudscopyfloat
40s linear infinite;
119 /******************************************/
120 /* First, set up the ticket date and time */
121 /******************************************/
123 /* There are two parameters, time and date, that we store in one
124 * underlying "date" variable. Default both to an hour from now. This
125 * is sensible because the date/time shown on your ticket is its
126 * EXPIRATION time, and tickets are valid for two hours. Having it
127 * show one hour in the future means that you didn't just use your
128 * ticket a second ago (if you just got caught on the light rail, for
129 * example) but also means that it's not expiring for a while.
131 const date = new Date();
133 /* Add an hour. We use the low-level get/setTime to change the number
134 * of milliseconds since the epoch that this date represents. Obviously
135 * correct, and avoids all suspicious corner cases (well, for a few more
137 date.setTime(date.getTime() + (
60*
60*
1000));
139 /* All
<text> elements produced by inkscape contain a single
<tspan>
140 * that itself contains the actual text. */
141 tt = document.getElementById("tickettime");
142 tt.firstChild.textContent = date.toLocaleTimeString();
144 td = document.getElementById("ticketdate");
150 td.firstChild.textContent = date.toLocaleDateString("en-US", dateopts);
153 /************************************************************/
154 /* Second, add the onclick handler for the night/day switch */
155 /************************************************************/
157 /* We always start in "day" mode */
161 sky.style.fill = "#efb02f";
164 function set_night() {
165 sky.style.fill = "#
143b66";
168 function swap_colors() {
179 document.body.addEventListener("click", swap_colors);