From c07ef64426410556b71526c305c9171476939403 Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Wed, 8 Jul 2026 13:27:15 -0600 Subject: [PATCH] fixing a bug with DOM usage --- app.css | 18 ++++++++++++++++++ app.js | 15 ++++++++++++++- index.html | 10 +++++----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/app.css b/app.css index 113a1fc..d32ac73 100644 --- a/app.css +++ b/app.css @@ -7,6 +7,8 @@ --accent: #cc0000; --accent-dim: #e8d7d7; --border: #202020; + --warn: #9a5b00; + --warn-dim: #fbe8c6; } @media (prefers-color-scheme: dark) { :root { @@ -17,6 +19,8 @@ --accent: #ff5c5c; --accent-dim: #3a2626; --border: #4a4d52; + --warn: #ffb84d; + --warn-dim: #40300f; } } * { box-sizing: border-box; } @@ -84,6 +88,10 @@ outline: none; border-color: var(--accent); } + .slot input.char-freeze { + border-color: var(--warn); + box-shadow: 0 0 0 2px var(--warn-dim); + } .symbols { display: flex; gap: 0.2rem; @@ -132,6 +140,16 @@ color: var(--accent); font-size: 0.95rem; } + .encounter--freeze { + border-color: var(--warn); + background: var(--warn-dim); + } + .freeze-warning { + color: var(--warn); + font-weight: bold; + font-size: 0.75rem; + margin-top: 0.35rem; + } h2 { font-size: 1rem; margin: 0 0 0.5rem; diff --git a/app.js b/app.js index 1a77d5b..b5aa4fc 100644 --- a/app.js +++ b/app.js @@ -18,6 +18,9 @@ var ROLE_LABEL = { var SYMBOL_BUTTONS = ["PK", "MN", "×", "♂", "♀"]; var FALLBACK_SPECIES = "MissingNo."; var FALLBACK_LEVEL = 127; +// Some glitch species (only reachable via the digit characters) are +// documented as freezing the real game outright, not just glitching it. +var FREEZE_KEYWORD = "Freezes"; var charmap = {"A":{"decimal":128,"pokemon":"Golduck"},"B":{"decimal":129,"pokemon":"Hypno"},"C":{"decimal":130,"pokemon":"Golbat"},"D":{"decimal":131,"pokemon":"Mewtwo"},"E":{"decimal":132,"pokemon":"Snorlax"},"F":{"decimal":133,"pokemon":"Magikarp"},"G":{"decimal":134,"pokemon":"MissingNo."},"H":{"decimal":135,"pokemon":"MissingNo."},"I":{"decimal":136,"pokemon":"Muk"},"J":{"decimal":137,"pokemon":"MissingNo."},"K":{"decimal":138,"pokemon":"Kingler"},"L":{"decimal":139,"pokemon":"Cloyster"},"M":{"decimal":140,"pokemon":"MissingNo."},"N":{"decimal":141,"pokemon":"Electrode"},"O":{"decimal":142,"pokemon":"Clefable"},"P":{"decimal":143,"pokemon":"Weezing"},"Q":{"decimal":144,"pokemon":"Persian"},"R":{"decimal":145,"pokemon":"Marowak"},"S":{"decimal":146,"pokemon":"MissingNo."},"T":{"decimal":147,"pokemon":"Haunter"},"U":{"decimal":148,"pokemon":"Abra"},"V":{"decimal":149,"pokemon":"Alakazam"},"W":{"decimal":150,"pokemon":"Pidgeotto"},"X":{"decimal":151,"pokemon":"Pidgeot"},"Y":{"decimal":152,"pokemon":"Starmie"},"Z":{"decimal":153,"pokemon":"Bulbasaur"},"(":{"decimal":154,"pokemon":"Venusaur"},")":{"decimal":155,"pokemon":"Tentacruel"},":":{"decimal":156,"pokemon":"MissingNo."},";":{"decimal":157,"pokemon":"Goldeen"},"[":{"decimal":158,"pokemon":"Seaking"},"]":{"decimal":159,"pokemon":"MissingNo."},"a":{"decimal":160,"pokemon":"MissingNo."},"b":{"decimal":161,"pokemon":"MissingNo."},"c":{"decimal":162,"pokemon":"MissingNo."},"d":{"decimal":163,"pokemon":"Ponyta"},"e":{"decimal":164,"pokemon":"Rapidash"},"f":{"decimal":165,"pokemon":"Rattata"},"g":{"decimal":166,"pokemon":"Raticate"},"h":{"decimal":167,"pokemon":"Nidorino"},"i":{"decimal":168,"pokemon":"Nidorina"},"j":{"decimal":169,"pokemon":"Geodude"},"k":{"decimal":170,"pokemon":"Porygon"},"l":{"decimal":171,"pokemon":"Aerodactyl"},"m":{"decimal":172,"pokemon":"MissingNo."},"n":{"decimal":173,"pokemon":"Magnemite"},"o":{"decimal":174,"pokemon":"MissingNo."},"p":{"decimal":175,"pokemon":"MissingNo."},"q":{"decimal":176,"pokemon":"Charmander"},"r":{"decimal":177,"pokemon":"Squirtle"},"s":{"decimal":178,"pokemon":"Charmeleon"},"t":{"decimal":179,"pokemon":"Wartortle"},"u":{"decimal":180,"pokemon":"Charizard"},"v":{"decimal":181,"pokemon":"MissingNo."},"w":{"decimal":182,"pokemon":"Kabutops Fossil"},"x":{"decimal":183,"pokemon":"Aerodactyl Fossil"},"y":{"decimal":184,"pokemon":"Ghost"},"z":{"decimal":185,"pokemon":"Oddish"},"PK":{"decimal":225,"pokemon":"Rival (#1)"},"MN":{"decimal":226,"pokemon":"Professor Oak"},"-":{"decimal":227,"pokemon":"Chief"},"?":{"decimal":230,"pokemon":"Rocket"},"!":{"decimal":231,"pokemon":"Cooltrainer Male"},"♂":{"decimal":239,"pokemon":"Blaine"},"×":{"decimal":241,"pokemon":"Gentleman"},".":{"decimal":242,"pokemon":"Rival (#2)"},"/":{"decimal":243,"pokemon":"Rival (Final)"},",":{"decimal":244,"pokemon":"Lorelei"},"♀":{"decimal":245,"pokemon":"Channeler"},"0":{"decimal":246,"pokemon":"Agatha"},"1":{"decimal":247,"pokemon":"Lance"},"2":{"decimal":248,"pokemon":"Glitch - Freezes Game"},"3":{"decimal":249,"pokemon":"Glitch - Freezes Game"},"4":{"decimal":250,"pokemon":"Glitch - Freezes Game"},"5":{"decimal":251,"pokemon":"Glitch Trainer (Can be used for ZZAZZ Glitch)"},"6":{"decimal":252,"pokemon":"Glitch Trainer (Can be used for ZZAZZ Glitch)"},"7":{"decimal":253,"pokemon":"Glitch Trainer (Freezes after battle)"},"8":{"decimal":254,"pokemon":"Glitch Trainer (Can be used for ZZAZZ Glitch)"},"9":{"decimal":255,"pokemon":"Glitch Trainer (Can be used for ZZAZZ Glitch)"}}; @@ -105,9 +108,12 @@ function decode() { var species = speciesEntry ? speciesEntry.pokemon : FALLBACK_SPECIES; var level = levelEntry ? levelEntry.decimal : FALLBACK_LEVEL; + var freezes = species.indexOf(FREEZE_KEYWORD) !== -1; + + document.getElementById("char" + speciesPos).classList.toggle("char-freeze", freezes); var card = document.createElement("div"); - card.className = "encounter"; + card.className = freezes ? "encounter encounter--freeze" : "encounter"; var from = document.createElement("div"); from.className = "from"; @@ -124,6 +130,13 @@ function decode() { levelEl.textContent = "Level " + level; card.appendChild(levelEl); + if (freezes) { + var warning = document.createElement("div"); + warning.className = "freeze-warning"; + warning.textContent = "⚠ Freezes the game on real hardware — don't use this in-game"; + card.appendChild(warning); + } + results.appendChild(card); } } diff --git a/index.html b/index.html index e968e19..b0862c5 100644 --- a/index.html +++ b/index.html @@ -34,13 +34,10 @@ -
@@ -51,7 +48,7 @@
-
Type up to 7 characters (letters, digits, or the symbols below each box). The 1st character has no effect — the glitch never reads it.
+
Type up to 7 characters (letters, digits, or the symbols below each box). The 1st character has no effect — the glitch never reads it. Boxes and results outlined in orange (⚠) are documented to freeze the real game.
@@ -66,5 +63,8 @@ Data source: internal Gen 1 index table (decimal / R-B-Y Pokémon / R-B-Y Letter columns). Based on the "Old Man Name Generator 2" tool archived from Glitch City Laboratories.
+