animation: citycopyscroll 20s linear infinite;
}
+ /*****************/
+ /* Ticket sizing */
+ /*****************/
+
+ #ticketbottombg {
+ transform-box: fill-box;
+ transform-origin: top; /* scale down only */
+ }
+
/*****************/
/* QR code focus */
/*****************/
function resize_ticket() {
/* Get the "servicename" from the querystring if it's there */
const params = new URLSearchParams(document.location.search);
- const tbg = document.getElementById("ticketbg");
+ const tbg = document.getElementById("ticketbottombg");
const t = document.getElementById("ticket");
const sn = document.getElementById("servicename");
if (params.get("servicename") === "Commuter Bus") {
- /* The top of the background is initially at y=246.859, and
- * we scale it by a factor of 1.12 to y=276.482 for a change
- * of 29.623. So after we scale it, we translate it upwards
- * by that amount to put it back where it started. */
- tbg.setAttribute("transform", "translate(0 -29.623) scale(1 1.12)");
-
- /* Now translate the entire ticket up by the magic amount, 1/5
- * of the size change we made to the background. This ratio
- * was found by measuring pixels in side-by-side screenshots
- * of BaltimoreLink and Commuter Bus tickets. */
+ /* Scale the bottom part of the ticket (the white background
+ * only) downwards. There's no real motivation for this scale
+ * factor except that, visually, it gives the right result. */
+ tbg.setAttribute("transform", "scale(1 1.16)");
+
+ /* Now translate the entire ticket up by the magic amount.
+ * This number was found by measuring pixels in side-by-side
+ * screenshots of BaltimoreLink and Commuter Bus tickets. */
t.setAttribute("transform", "translate(0 -9.33)");
/* More magic numbers discovered by comparing the two
}
else if (params.get("servicename") === "MARC Train") {
/* insane tricks are explained above */
- tbg.setAttribute("transform",
- "translate(0 -72.378) scale(1 1.2932)");
+ tbg.setAttribute("transform", "scale(1 1.395)");
t.setAttribute("transform", "translate(0 -67.17)");
sn.setAttribute("transform", "translate(0 131.0)");
}