diff --git a/docs/vtv-presets.html b/docs/vtv-presets.html index 187083e..aa05afe 100644 --- a/docs/vtv-presets.html +++ b/docs/vtv-presets.html @@ -154,6 +154,12 @@ h1 em { font-style: normal; color: var(--sys); } @media (max-width: 46rem) { .vtv { grid-template-columns: 1fr; } } .vtv[hidden] { display: none; } +.seg__n { + margin-left: .45em; font-size: .85em; opacity: .55; + font-variant-numeric: tabular-nums; +} +.seg button[aria-pressed="true"] .seg__n { opacity: .75; } + .vtv__id { padding: 1.1rem 1.25rem; border-right: 1px solid var(--rule); } @media (max-width: 46rem) { .vtv__id { border-right: 0; border-bottom: 1px solid var(--rule); } } @@ -247,6 +253,10 @@ td.fn { +
+ + +
38 / 38 VTV @@ -261,7 +271,7 @@ td.fn {
-
+
Police hull · shared with Dragon

BLACKER DRAGON

@@ -271,7 +281,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1SLAVERBOOST 1CHUTE
2SLAVERBOOST 1CHUTELIFT CUT
3SLAVERBOOST 1LIFT CUT
4SLAVERBOOST 1LIFT CUT
5SLAVERBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1SLAVER
-
+
Armadillo hull · shared with Armadillo, Blacker Armadillo

BLACKER PUCK

@@ -281,7 +291,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASER 2BOOST 1HORN
2LASER 2BOOST 1HORNLIFT CUT
3LASER 2BOOST 1LIFT CUT
4LASER 2BOOST 1LIFT CUTHORN
5LASER 2BOOST 1DEMOPACKDROPPER2LIFT CUT
6LIFT CUTBOOST 1LASER 2
-
+
Police hull · shared with Blacker Dragon

DRAGON

@@ -291,7 +301,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1SLAVERBOOST 1CHUTE
2SLAVERBOOST 1CHUTELIFT CUT
3SLAVERBOOST 1LIFT CUT
4SLAVERBOOST 1LIFT CUT
5SLAVERBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1SLAVER
-
+
Roadblock hull · shared with Mantis, Ripper, Spitter

ROAD BLOCK

@@ -301,7 +311,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVETBOOST 1CHUTE
2RIVETBOOST 1CHUTELIFT CUT
3RIVETBOOST 1LIFT CUT
4RIVETBOOST 1LIFT CUTCHUTE
5RIVETLASER 1DEMO PACKLIFT CUT
6LIFT CUTBOOST 1BOOST 2RIVET
-
+
Vole hull · shared with Gator, Grunt, Vole

BATTLE BARGE

@@ -311,7 +321,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASERBOOST 1CHUTE
2LASERBOOST 1CHUTELIFT CUT
3LASERBOOST 1LIFT CUT
4LASERBOOST 1LIFT CUTCHUTE
5LASERBOOST 1DEMO PACKLIFT CUT
6LIFT CUTBOOST 1BOOST 2LASER
-
+
Vole hull · shared with Battle Barge, Grunt, Vole

GATOR

@@ -321,7 +331,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVETBOOST 1CHUTE
2RIVETBOOST 1CHUTELIFT CUT
3RIVETBOOST 1LIFT CUT
4RIVETBOOST 1LIFT CUTCHUTE
5RIVETBOOST 1DEMO PACKLIFT CUT
6LIFT CUTBOOST 1BOOST 2RIVET
-
+
Roadblock hull · shared with Ripper, Road Block, Spitter

MANTIS

@@ -331,7 +341,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASER 1BOOST 1CHUTE
2LASER 1BOOST 1CHUTELIFT CUT
3LASER 1BOOST 1LIFT CUT
4LASER 1BOOST 1LIFT CUTCHUTE
5LASER 1BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2LASER 1
-
+
Skeeter hull · shared with Blacker Wasp, Chigger, Flea, Skeeter, Wasp

ROACH

@@ -341,7 +351,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVET 2BOOST 1CHUTE
2RIVET 2BOOST 1CHUTELIFT CUT
3RIVET 2BOOST 1LIFT CUT
4RIVET 2BOOST 1LIFT CUT
5RIVET 2BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1RIVET 2
-
+
Roadblock hull · shared with Mantis, Ripper, Road Block

SPITTER

@@ -351,7 +361,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVET 2BOOST 1CHUTE
2RIVET 2BOOST 1CHUTELIFT CUT
3RIVET 2BOOST 1LIFT CUT
4RIVET 2BOOST 1LIFT CUT
5RIVET 2BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1RIVET 2
-
+
Armadillo hull · shared with Armadillo, Blacker Puck

BLACKER ARMADILLO

@@ -361,7 +371,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASER 2BOOST 1HORN
2LASER 2BOOST 1HORNLIFT CUT
3LASER 2BOOST 1LIFT CUT
4LASER 2BOOST 1LIFT CUTHORN
5LASER 2BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1LASER 2
-
+
Skeeter hull · shared with Chigger, Flea, Roach, Skeeter, Wasp

BLACKER WASP

@@ -371,7 +381,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1DEMO PACKBOOST 1CHUTE
2DEMO PACKBOOST 1CHUTELIFT CUT
3DEMO PACKBOOST 1LIFT CUT
4DEMO PACKBOOST 1LIFT CUTCHUTE
5DEMO PACKBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2DEMO PACK
-
+
Skeeter hull · shared with Blacker Wasp, Flea, Roach, Skeeter, Wasp

CHIGGER

@@ -381,7 +391,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVETBOOST 1CHUTE
2RIVETBOOST 1CHUTELIFT CUT
3RIVETBOOST 1LIFT CUT
4RIVETBOOST 1LIFT CUTCHUTE
5RIVETBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2RIVET
-
+
Skeeter hull · shared with Blacker Wasp, Chigger, Roach, Skeeter, Wasp

FLEA

@@ -391,7 +401,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1DEMO PACKBOOST 1CHUTE
2DEMO PACKBOOST 1CHUTELIFT CUT
3DEMO PACKBOOST 1LIFT CUT
4DEMO PACKBOOST 1LIFT CUTCHUTE
5DEMO PACKBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2DEMO PACK
-
+
Vole hull · shared with Battle Barge, Gator, Vole

GRUNT

@@ -401,7 +411,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVETBOOST 1CHUTE
2RIVETBOOST 1CHUTELIFT CUT
3RIVETBOOST 1LIFT CUT
4RIVETBOOST 1LIFT CUTCHUTE
5RIVETBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2RIVET
-
+
Quark hull · shared with Blacker Lepton, Blacker Quark, Lepton, Quark

NEUTRINO

@@ -411,7 +421,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 2CHUTE
2BOOST 2CHUTELIFT CUT
3BOOST 2LIFT CUT
4BOOST 2BOOST 4LIFT CUTCHUTE
5BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Quark hull

PROTON

@@ -421,7 +431,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1RIVETBOOST 1CHUTE
2RIVETBOOST 1CHUTELIFT CUT
3RIVETBOOST 1LIFT CUT
4RIVETBOOST 1LIFT CUTCHUTE
5RIVETBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2RIVET
-
+
Armadillo hull · shared with Blacker Armadillo, Blacker Puck

ARMADILLO

@@ -431,7 +441,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASER 2BOOST 1HORN
2LASER 2BOOST 1HORNLIFT CUT
3LASER 2BOOST 1LIFT CUT
4LASER 2BOOST 1LIFT CUTHORN
5LASER 2BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1LASER 2
-
+
Roadblock hull · shared with Mantis, Road Block, Spitter

RIPPER

@@ -441,7 +451,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1DEMO PACKBOOST 1CHUTE
2DEMO PACKBOOST 1CHUTELIFT CUT
3DEMO PACKBOOST 1LIFT CUT
4DEMO PACKBOOST 1LIFT CUTCHUTE
5DEMO PACKBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2DEMO PACK
-
+
Skeeter hull · shared with Blacker Wasp, Chigger, Flea, Roach, Wasp

SKEETER

@@ -451,7 +461,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASER 2BOOST 1CHUTE
2LASER 2BOOST 1CHUTELIFT CUT
3LASER 2BOOST 1LIFT CUT
4LASER 2BOOST 1LIFT CUTCHUTE
5LASER 2BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2LASER 2
-
+
Vole hull · shared with Battle Barge, Gator, Grunt

VOLE

@@ -461,7 +471,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1LASERBOOST 1CHUTE
2LASERBOOST 1CHUTELIFT CUT
3LASERBOOST 1LIFT CUT
4LASERBOOST 1LIFT CUTCHUTE
5LASERBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2LASER
-
+
Skeeter hull · shared with Blacker Wasp, Chigger, Flea, Roach, Skeeter

WASP

@@ -471,7 +481,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1DEMO PACKBOOST 1CHUTE
2DEMO PACKBOOST 1CHUTELIFT CUT
3DEMO PACKBOOST 1LIFT CUT
4DEMO PACKBOOST 1LIFT CUTCHUTE
5DEMO PACKBOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2DEMO PACK
-
+
Mule hull · shared with Blacker Broccoli, Burro, Mule, Screaming Broccoli

BARGE

@@ -481,7 +491,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Mule hull · shared with Barge, Burro, Mule, Screaming Broccoli (console says Bug)

BLACKER BROCCOLI

@@ -491,7 +501,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 3LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Quark hull · shared with Blacker Quark, Lepton, Neutrino, Quark

BLACKER LEPTON

@@ -501,7 +511,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Quark hull · shared with Blacker Lepton, Lepton, Neutrino, Quark

BLACKER QUARK

@@ -511,7 +521,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2
2BOOST 1BOOST 2LIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUT
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2
-
+
Bug hull · shared with Black Speck, Bug, Speck

BLACKER SPECK

@@ -521,7 +531,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 3LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Bull hull · shared with Black Tarantula, Bull, Tarantula (console says Bug)

BLACKER TARANTULA

@@ -531,7 +541,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 2CHUTE
2BOOST 2CHUTELIFT CUT
3BOOST 2LIFT CUT
4BOOST 2BOOST 4LIFT CUTCHUTE
5BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Bug hull · shared with Blacker Speck, Bug, Speck

BLACK SPECK

@@ -541,7 +551,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 3LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Bull hull · shared with Blacker Tarantula, Bull, Tarantula

BLACK TARANTULA

@@ -551,7 +561,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 2CHUTE
2BOOST 2CHUTELIFT CUT
3BOOST 2LIFT CUT
4BOOST 2BOOST 4LIFT CUTCHUTE
5BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Mule hull · shared with Barge, Blacker Broccoli, Burro, Mule

SCREAMING BROCCOLI

@@ -561,7 +571,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 3LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Bug hull · shared with Black Speck, Blacker Speck, Speck

BUG

@@ -571,7 +581,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Bull hull · shared with Black Tarantula, Blacker Tarantula, Tarantula

BULL

@@ -581,7 +591,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Mule hull · shared with Barge, Blacker Broccoli, Mule, Screaming Broccoli

BURRO

@@ -591,7 +601,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 1CHUTE
2BOOST 1BOOST 1CHUTELIFT CUT
3BOOST 1BOOST 1LIFT CUT
4BOOST 1BOOST 1LIFT CUTCHUTE
5BOOST 1BOOST 1HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 1CHUTE
-
+
Quark hull · shared with Blacker Lepton, Blacker Quark, Neutrino, Quark

LEPTON

@@ -601,7 +611,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Mule hull · shared with Barge, Blacker Broccoli, Burro, Screaming Broccoli

MULE

@@ -611,7 +621,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Quark hull · shared with Blacker Lepton, Blacker Quark, Lepton, Neutrino

QUARK

@@ -621,7 +631,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2
2BOOST 1BOOST 2LIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUT
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2
-
+
Bug hull · shared with Black Speck, Blacker Speck, Bug

SPECK

@@ -631,7 +641,7 @@ td.fn {
Preset assignments
PresetTRIGGERTHUMB HIGHTHUMB LOWPINKY
1BOOST 1BOOST 2CHUTE
2BOOST 1BOOST 2CHUTELIFT CUT
3BOOST 1BOOST 2LIFT CUT
4BOOST 1BOOST 2LIFT CUTCHUTE
5BOOST 1BOOST 2HORNLIFT CUT
6LIFT CUTBOOST 1BOOST 2CHUTE
-
+
Bull hull · shared with Black Tarantula, Blacker Tarantula, Bull

TARANTULA

@@ -662,18 +672,20 @@ const cards = [...document.querySelectorAll('.vtv')]; const count = document.getElementById('count'); const search = document.getElementById('search'); let filter = 'all'; +let hull = 'all'; function apply() { const q = search.value.trim().toLowerCase(); let shown = 0; for (const c of cards) { const tags = c.dataset.tags; + const okHull = hull === 'all' || c.dataset.hull === hull; const okTag = filter === 'all' || (filter === 'armed' && tags.includes('armed')) || (filter === 'unarmed' && tags.includes('unarmed')) || tags.split(' ').includes(filter); const okQ = !q || c.dataset.search.includes(q); - const on = okTag && okQ; + const on = okTag && okHull && okQ; c.hidden = !on; if (on) shown++; } @@ -689,6 +701,14 @@ for (const b of document.querySelectorAll('[data-filter]')) { apply(); }); } +for (const b of document.querySelectorAll('#hulls button')) { + b.addEventListener('click', () => { + hull = b.dataset.hull; + for (const o of document.querySelectorAll('#hulls button')) + o.setAttribute('aria-pressed', String(o === b)); + apply(); + }); +} search.addEventListener('input', apply); apply(); diff --git a/tools/pages/build_page.py b/tools/pages/build_page.py index e5bf09e..b178b17 100644 --- a/tools/pages/build_page.py +++ b/tools/pages/build_page.py @@ -135,7 +135,7 @@ for name in ORDER: hull = '' cards.append(""" -
+
{hull}

{display}

@@ -145,10 +145,29 @@ for name in ORDER:
{l4}
""".format( - tags=tags, search=html.escape(search), display=html.escape(display.upper()), + tags=tags, hullcode=(code[:1] or '?'), + search=html.escape(search), display=html.escape(display.upper()), key=html.escape(name), chips=loadout_chips(v), nsub=len(v['subsystems']), hull=hull, nrec=v['L4']['records'], l4=table(v['L4']))) +# Tabs by hull. The first letter of a vehicle's two-letter art code is the +# hull the game actually draws it with; the console's class names are +# subdivisions of those five - Bull and Roadblock are both 'b', Bug and +# Skeeter both 's'. Grouping by the letter keeps kin together whatever the +# console called them. +HULL_TABS = [('l', 'Particles'), ('s', 'Bugs'), ('m', 'Mules'), + ('b', 'Bulls'), ('p', 'Police')] +hull_tabs = ''.join( + '' + % (letter, label, + sum(1 for v in data.values() if (v.get('silhouette') or '?')[:1] == letter)) + for letter, label in HULL_TABS) +loose = sorted(n for n, v in data.items() + if (v.get('silhouette') or '?')[:1] not in dict(HULL_TABS)) +if loose: + print('!! not in any hull tab: %s' % loose) + armed = sum(1 for v in data.values() if v['weapons']) CSS = """ *, *::before, *::after { box-sizing: border-box; } @@ -302,6 +321,12 @@ h1 em { font-style: normal; color: var(--sys); } @media (max-width: 46rem) { .vtv { grid-template-columns: 1fr; } } .vtv[hidden] { display: none; } +.seg__n { + margin-left: .45em; font-size: .85em; opacity: .55; + font-variant-numeric: tabular-nums; +} +.seg button[aria-pressed="true"] .seg__n { opacity: .75; } + .vtv__id { padding: 1.1rem 1.25rem; border-right: 1px solid var(--rule); } @media (max-width: 46rem) { .vtv__id { border-right: 0; border-bottom: 1px solid var(--rule); } } @@ -378,18 +403,20 @@ const cards = [...document.querySelectorAll('.vtv')]; const count = document.getElementById('count'); const search = document.getElementById('search'); let filter = 'all'; +let hull = 'all'; function apply() { const q = search.value.trim().toLowerCase(); let shown = 0; for (const c of cards) { const tags = c.dataset.tags; + const okHull = hull === 'all' || c.dataset.hull === hull; const okTag = filter === 'all' || (filter === 'armed' && tags.includes('armed')) || (filter === 'unarmed' && tags.includes('unarmed')) || tags.split(' ').includes(filter); const okQ = !q || c.dataset.search.includes(q); - const on = okTag && okQ; + const on = okTag && okHull && okQ; c.hidden = !on; if (on) shown++; } @@ -405,6 +432,14 @@ for (const b of document.querySelectorAll('[data-filter]')) { apply(); }); } +for (const b of document.querySelectorAll('#hulls button')) { + b.addEventListener('click', () => { + hull = b.dataset.hull; + for (const o of document.querySelectorAll('#hulls button')) + o.setAttribute('aria-pressed', String(o === b)); + apply(); + }); +} search.addEventListener('input', apply); apply(); """ @@ -438,6 +473,10 @@ PAGE = """
+
+ + {hulltabs} +
{n} / {n} VTV @@ -471,5 +510,6 @@ PAGE = """ """ open(OUT, 'w', encoding='utf-8').write(PAGE.format( - css=CSS, js=JS, cards=''.join(cards), n=len(data), armed=armed)) + css=CSS, js=JS, cards=''.join(cards), n=len(data), armed=armed, + hulltabs=hull_tabs)) print('wrote %s (%d VTVs)' % (OUT, len(data)))