Michael Orlitzky [Wed, 10 Sep 2025 14:30:19 +0000 (10:30 -0400)]
index.html.in: finish the QR focus toggle
Get the QR focus toggle working "completely."
* Don't show ticket resize transitions when the page loads
(Commuter bus / MARC).
* Fade out the origin/destination and zone when the QR is
focused (Commuter bus / MARC).
* Resize the bottom portion of the ticket when the QR code
is focused, so that the QR sits in the "middle" like it
does on CharmPass.
* Don't recompute dimensions if we're going to toggle the
QR code _off_.
BaltimoreLink tickets are essentially correct. I have yet to compare
against real Commuter bus and MARC train tickets, but the current
behavior is reasonable.
Reimplement the sizing of the commuter bus and MARC train tickets to
account for the split top and bottom halves of the ticket. This is not
too difficult because, this time around, we take advantage of the
transform-box and transform-origin properties to scale only the bottom
half of the ticket, and only downwards.
The new magic numbers were found by comparing old/new versions of the
page in two separate browser tabs. This also happens to fix the
alignment of the grey ticket separator, because the top half of the
ticket (that contains it) is no longer being scaled
1. The ticket separator becomes misaligned when you scale the
ticket background independently
2. Only the bottom of the ticket is resized when the QR gains
focus.
Both of these will be easier if we split the bottom part of the ticket
from the top (separator, dimples, and the stuff above them). This
commit does that. The top/bottom parts aren't grouped because we
probably won't need to manipulate them as groups, so for now, there
are just two ticket background layers with an epsilon of overlap.
Tapping the QR code now brings it into focus and centers it in the
ticket, accompanied by a nice CSS transition that mimics the real
thing. The timing was adjusted to make the transition faster, and a
portability issue was hacked around. What does work, works in both
Firefox and WebKit (on the desktop) at least.
Still to-do is the ticket resizing that takes place when the QR code
gets bigger, and the vertical translation of the (growing) QR code.
tableau.svg: group QR code with a (white, "invisible") background
The QR code is a path, so the "click" handler that we want to write
for it will only work if the thin black squiggle is tapped. To work
around that, we add a square white background behind the squiggle that
is the same color as the ticket. Afterwards, the "QR code" consists of
the black squiggle and the square; you can click on either.
Whatever problem was preventing us from swapping day/night colors via
CSS classes is gone. Or at least hiding in a browser that I don't have
in front of me.
tableau.svg: less rounding on the code background's corners
Just like the ticket background, the background on the security code
has had its corners un-rounded a bit in the latest version of
CharmPass. Turn ours down from 10 to 5.75 to match.
tableau.svg: less rounding on ticket background corners
The June 2025 CharmPass has slightly less rounding on the corners of
the tickets, and it actually is noticeable. Update the corners of our
ticket to match.
index.html.in: remove links to my personal website
The MTA just sent me a cease and desist for charm-bypass.com, which I
intend to honor. But if somebody else wants to... *shrug* then my name
shouldn't be plastered all over the page.
Michael Orlitzky [Wed, 13 Dec 2023 00:25:26 +0000 (19:25 -0500)]
index.html.in: add New Carrollton MARC info
The code for New Carrollton is NCR (thanks you-know-who), and it's on
the Penn Line, so all we have to do is fill in the zone information
based on the CharmPass prices to each of the other Penn destinations.
Michael Orlitzky [Wed, 13 Dec 2023 00:13:56 +0000 (19:13 -0500)]
index.html.in: add Frederick <-> Washington MARC info
Both Frederick and Washington D.C. are on the Brunswick line, and the
code for Frederick is FRC (thanks you-know-who). The cost of that
ticket is $9 in CharmPass, so that's a Four Zone.
Michael Orlitzky [Tue, 12 Dec 2023 21:00:20 +0000 (16:00 -0500)]
cgi-bin/code.cgi: new CGI script to update the daily code on a web host
This isn't really part of CharmBypass, but it will come in handy on
charm-bypass.com, and where else to put it? It's a CGI script that
allows visitors to update the code. You should probably password
protect it and make it available only to trusted users.
The script is written in POSIX shell script. Why? Because I didn't
really want to venture beyond a single-page, off-line, static HTML
file. But writing a CGI script in POSIX shell was just too dumb to say
no to. It uses sed to parse/edit index.html. Everything about it is
bad.
It can be tested with "python -m http.server --cgi", but the 302
redirect won't work because python doesn't support it.
tableau.svg: overlap the city and its copy by one unit
This fixes a display glitch where there's one pixel of space visible
between the end of the city (or its copy) and the beginning of its
copy (or the original).
tableau.svg: strip all stroke-foo properties that follow stroke:none
Inkscape crams all of these properties into the file, I guess so that
information isn't lost if you disable and re-enable the stroke on some
element. And most of them are stripped during minimization, but a
bunch of impotent stroke-widths make it through to the final document.
I've stripped all of it by hand, since removing it all was just as
easy as removing the stroke-width.
tableau.svg: shrink/translate everything down to width=2932
Previously, we had width=2932.6 and a matching viewport. It shouldn't
matter when a viewport is defined, but in the interest of pedantry:
SVG2 punts to CSS2.1 for the width, and CSS2.1 doesn't support user
(SVG internal) coordinates. Instead, width=2932.6 would represent
pixels, and 0.6 pixels doesn't make sense. We avoid the non-issue by
shrinking/translating things a tiny bit.
index.html.in: also validate the origin/destination when the page loads
Firefox (at least) retains your origin/destination selections when the
page reloads, so if we don't validate those choices at page load, it's
possible to "skip" validation of an invalid pair by submitting the
form right after a reload.
Without this, the unicode right-arrow doesn't show up on android. (If
we try to outsmart it with an XML entity reference, our minimization
pipeline deletes the entity reference and puts the arrow back. Thanks
for that.)
tableau.svg: add the MARC Train origin/destination
This (finally?) had to be hacked into the XML by hand because inkscape
isn't smart enough to handle multiple <tspan>s within a single <text>
element. We want to keep the origin, arrow, and destination all as
separate tspans (with ids) so that we can change the origin and
destination easily from a script.
Since I was already hacking it by hand, I cleaned up the XML a bit.
Hopefully it can survive a round trip through inkscape in the future.