commit 1244feeebe6c4f92897d6fc3fb12ccfde9565544 Author: Pascal Phelipot Date: Thu Feb 15 23:09:47 2024 +0100 intial commit diff --git a/css/app.css b/css/app.css new file mode 100644 index 0000000..f4332ca --- /dev/null +++ b/css/app.css @@ -0,0 +1,50 @@ +/* CSS Reset */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +@font-face { + font-family: apex; + src: url("../font/Apex-Regular.ttf"); +} + +body { + font-family: 'apex', sans-serif; +} + +/* Category Container styles */ +.category-container { + width: 30%; + margin-top: 20px; + display: flex; + flex-direction: row; + align-items: center; +} + +/* Legend Mosaic styles */ +.legend-item { + text-align: center; + padding: 10px; + border: 1px solid #ddd; + border-radius: 8px; + background-color: #f9f9f9; + margin-bottom: 10px; + width: 100px; + height: 150px; + display: flex; + flex-direction: column; + justify-content: space-between; + } + + .legend-item img { + max-width: 100%; + height: auto; + border-radius: 50%; + } + + .legend-item p { + margin: 0; + font-weight: bold; + } \ No newline at end of file diff --git a/data/legends.json b/data/legends.json new file mode 100644 index 0000000..96d00a6 --- /dev/null +++ b/data/legends.json @@ -0,0 +1,186 @@ +legends = [ + { + "name": "wraith", + "type": "skirmisher", + "challenges": [ + "Win a match without taking damage", + "Eliminate 5 enemies in a single match" + ], + "loadouts": [], + "image": "img/legends/Wraith_Legend_Card.png" + }, + { + "name": "bangalore", + "type": "assault", + "challenges": [ + "Survive for 10 minutes without dealing damage", + "Revive 3 teammates in a single match" + ], + "loadouts": [], + "image": "img/legends/Bangalore_Legend_Card.png" + }, + { + "name": "bloodhound", + "type": "recon", + "challenges": [ + "Scan 10 enemy tracks", + "Deal damage with Beast of the Hunt active" + ], + "loadouts": [], + "image": "img/legends/Bloodhound_Legend_Card.png" + }, + { + "name": "ash", + "image": "img/legends/Ash_Legend_Card.png", + "type": "assault", + "challenges": [], + "loadouts": [] + }, + { + "name": "ballistic", + "image": "img/legends/Ballistic_Legend_Card.png", + "type": "assault", + "challenges": [], + "loadouts": [] + }, + { + "name": "catalyst", + "image": "img/legends/Catalyst_Legend_Card.png", + "type": "controller", + "challenges": [], + "loadouts": [] + }, + { + "name": "caustic", + "image": "img/legends/Caustic_Legend_Card.png", + "type": "controller", + "challenges": [], + "loadouts": [] + }, + { + "name": "conduit", + "image": "img/legends/Conduit_Legend_Card.png", + "type": "support", + "challenges": [], + "loadouts": [] + }, + { + "name": "crypto", + "image": "img/legends/Crypto_Legend_Card.png", + "type": "recon", + "challenges": [], + "loadouts": [] + }, + { + "name": "fuse", + "image": "img/legends/Fuse_Legend_Card.png", + "type": "assault", + "challenges": [], + "loadouts": [] + }, + { + "name": "gibraltar", + "image": "img/legends/Gibraltar_Legend_Card.png", + "type": "support", + "challenges": [], + "loadouts": [] + }, + { + "name": "horizon", + "image": "img/legends/Horizon_Legend_Card.png", + "type": "skirmisher", + "challenges": [], + "loadouts": [] + }, + { + "name": "lifeline", + "image": "img/legends/Lifeline_Legend_Card.png", + "type": "support", + "challenges": [], + "loadouts": [] + }, + { + "name": "loba", + "image": "img/legends/Loba_Legend_Card.png", + "type": "support", + "challenges": [], + "loadouts": [] + }, + { + "name": "mad Maggie", + "image": "img/legends/Mad_Maggie_Legend_Card.png", + "type": "assault", + "challenges": [], + "loadouts": [] + }, + { + "name": "mirage", + "image": "img/legends/Mirage_Legend_Card.png", + "type": "support", + "challenges": [], + "loadouts": [] + }, + { + "name": "newcastle", + "image": "img/legends/Newcastle_Legend_Card.png", + "type": "support", + "challenges": [], + "loadouts": [] + }, + { + "name": "octane", + "image": "img/legends/Octane_Legend_Card.png", + "type": "skirmisher", + "challenges": [], + "loadouts": [] + }, + { + "name": "pathfinder", + "image": "img/legends/Pathfinder_Legend_Card.png", + "type": "skirmisher", + "challenges": [], + "loadouts": [] + }, + { + "name": "rampart", + "image": "img/legends/Rampart_Legend_Card.png", + "type": "controller", + "challenges": [], + "loadouts": [] + }, + { + "name": "revenant", + "image": "img/legends/Revenant_Legend_Card.png", + "type": "skirmisher", + "challenges": [], + "loadouts": [] + }, + { + "name": "seer", + "image": "img/legends/Seer_Legend_Card.png", + "type": "recon", + "challenges": [], + "loadouts": [] + }, + { + "name": "valkyrie", + "image": "img/legends/Valkyrie_Legend_Card.png", + "type": "skirmisher", + "challenges": [], + "loadouts": [] + }, + { + "name": "vantage", + "image": "img/legends/Vantage_Legend_Card.png", + "type": "recon", + "challenges": [], + "loadouts": [] + }, + { + "name": "wattson", + "image": "img/legends/Wattson_Legend_Card.png", + "type": "controller", + "challenges": [], + "loadouts": [] + } +] \ No newline at end of file diff --git a/data/loadouts.json b/data/loadouts.json new file mode 100644 index 0000000..1a8254e --- /dev/null +++ b/data/loadouts.json @@ -0,0 +1,47 @@ +loadouts = [ + { + "name": "R-99", + "type": "light", + "challenges": [ + "Get 5 kills in a single match with the R-99", + "Deal 500 damage with the R-99 in a match" + ], + "image": "r99_image_url.jpg" + }, + { + "name": "Peacekeeper", + "type": "shotgun", + "challenges": [ + "Eliminate 3 enemies with a single Peacekeeper shot", + "Deal 1000 damage with the Peacekeeper in a match" + ], + "image": "peacekeeper_image_url.jpg" + }, + { + "name": "R-301", + "type": "light", + "challenges": [ + "Get 10 headshot kills with the R-301", + "Deal 750 damage with the R-301 in a match" + ], + "image": "r301_image_url.jpg" + }, + { + "name": "EVA-8 Auto", + "type": "shotgun", + "challenges": [ + "Eliminate an enemy with a single EVA-8 shot", + "Deal 800 damage with the EVA-8 in a match" + ], + "image": "eva8_image_url.jpg" + }, + { + "name": "Wingman", + "type": "drop_only", + "challenges": [ + "Get 5 kills with the Wingman in a match", + "Deal 500 damage with the Wingman in a match" + ], + "image": "wingman_image_url.jpg" + } +] \ No newline at end of file diff --git a/font/Apex-Black.ttf b/font/Apex-Black.ttf new file mode 100644 index 0000000..8e12cf1 Binary files /dev/null and b/font/Apex-Black.ttf differ diff --git a/font/Apex-BlackSlanted.ttf b/font/Apex-BlackSlanted.ttf new file mode 100644 index 0000000..41dd563 Binary files /dev/null and b/font/Apex-BlackSlanted.ttf differ diff --git a/font/Apex-Bold.ttf b/font/Apex-Bold.ttf new file mode 100644 index 0000000..4d0e8d6 Binary files /dev/null and b/font/Apex-Bold.ttf differ diff --git a/font/Apex-BoldSlanted.ttf b/font/Apex-BoldSlanted.ttf new file mode 100644 index 0000000..4f40ea9 Binary files /dev/null and b/font/Apex-BoldSlanted.ttf differ diff --git a/font/Apex-ExtraBold.ttf b/font/Apex-ExtraBold.ttf new file mode 100644 index 0000000..3cebc82 Binary files /dev/null and b/font/Apex-ExtraBold.ttf differ diff --git a/font/Apex-ExtraBoldSlanted.ttf b/font/Apex-ExtraBoldSlanted.ttf new file mode 100644 index 0000000..2287e11 Binary files /dev/null and b/font/Apex-ExtraBoldSlanted.ttf differ diff --git a/font/Apex-ExtraLight.ttf b/font/Apex-ExtraLight.ttf new file mode 100644 index 0000000..c2f018e Binary files /dev/null and b/font/Apex-ExtraLight.ttf differ diff --git a/font/Apex-ExtraLightSlanted.ttf b/font/Apex-ExtraLightSlanted.ttf new file mode 100644 index 0000000..645a818 Binary files /dev/null and b/font/Apex-ExtraLightSlanted.ttf differ diff --git a/font/Apex-Light.ttf b/font/Apex-Light.ttf new file mode 100644 index 0000000..a490f00 Binary files /dev/null and b/font/Apex-Light.ttf differ diff --git a/font/Apex-LightSlanted.ttf b/font/Apex-LightSlanted.ttf new file mode 100644 index 0000000..d3794f2 Binary files /dev/null and b/font/Apex-LightSlanted.ttf differ diff --git a/font/Apex-Medium.ttf b/font/Apex-Medium.ttf new file mode 100644 index 0000000..ba84450 Binary files /dev/null and b/font/Apex-Medium.ttf differ diff --git a/font/Apex-MediumSlanted.ttf b/font/Apex-MediumSlanted.ttf new file mode 100644 index 0000000..715d055 Binary files /dev/null and b/font/Apex-MediumSlanted.ttf differ diff --git a/font/Apex-Regular.ttf b/font/Apex-Regular.ttf new file mode 100644 index 0000000..7314bb2 Binary files /dev/null and b/font/Apex-Regular.ttf differ diff --git a/font/Apex-SemiBold.ttf b/font/Apex-SemiBold.ttf new file mode 100644 index 0000000..9240065 Binary files /dev/null and b/font/Apex-SemiBold.ttf differ diff --git a/font/Apex-SemiBoldSlanted.ttf b/font/Apex-SemiBoldSlanted.ttf new file mode 100644 index 0000000..f41f77d Binary files /dev/null and b/font/Apex-SemiBoldSlanted.ttf differ diff --git a/font/Apex-Slanted.ttf b/font/Apex-Slanted.ttf new file mode 100644 index 0000000..18490e1 Binary files /dev/null and b/font/Apex-Slanted.ttf differ diff --git a/font/Apex-Thin.ttf b/font/Apex-Thin.ttf new file mode 100644 index 0000000..cff0d91 Binary files /dev/null and b/font/Apex-Thin.ttf differ diff --git a/font/Apex-ThinSlanted.ttf b/font/Apex-ThinSlanted.ttf new file mode 100644 index 0000000..c444b3d Binary files /dev/null and b/font/Apex-ThinSlanted.ttf differ diff --git a/img/icons/Assault_Class.svg b/img/icons/Assault_Class.svg new file mode 100644 index 0000000..b7167c9 --- /dev/null +++ b/img/icons/Assault_Class.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + diff --git a/img/icons/Controller_Class.svg b/img/icons/Controller_Class.svg new file mode 100644 index 0000000..b004daa --- /dev/null +++ b/img/icons/Controller_Class.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + diff --git a/img/icons/Recon_Class.svg b/img/icons/Recon_Class.svg new file mode 100644 index 0000000..fe76d94 --- /dev/null +++ b/img/icons/Recon_Class.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + diff --git a/img/icons/Skirmisher_Class.svg b/img/icons/Skirmisher_Class.svg new file mode 100644 index 0000000..fbb5eee --- /dev/null +++ b/img/icons/Skirmisher_Class.svg @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/img/icons/Support_Class.svg b/img/icons/Support_Class.svg new file mode 100644 index 0000000..fb2d363 --- /dev/null +++ b/img/icons/Support_Class.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + diff --git a/img/legends/Ash_Legend_Card.png b/img/legends/Ash_Legend_Card.png new file mode 100644 index 0000000..c1156df Binary files /dev/null and b/img/legends/Ash_Legend_Card.png differ diff --git a/img/legends/Ballistic_Legend_Card.png b/img/legends/Ballistic_Legend_Card.png new file mode 100644 index 0000000..8e05c90 Binary files /dev/null and b/img/legends/Ballistic_Legend_Card.png differ diff --git a/img/legends/Bangalore_Legend_Card.png b/img/legends/Bangalore_Legend_Card.png new file mode 100644 index 0000000..2aa1e77 Binary files /dev/null and b/img/legends/Bangalore_Legend_Card.png differ diff --git a/img/legends/Bloodhound_Legend_Card.png b/img/legends/Bloodhound_Legend_Card.png new file mode 100644 index 0000000..39d65af Binary files /dev/null and b/img/legends/Bloodhound_Legend_Card.png differ diff --git a/img/legends/Catalyst_Legend_Card.png b/img/legends/Catalyst_Legend_Card.png new file mode 100644 index 0000000..99c9a30 Binary files /dev/null and b/img/legends/Catalyst_Legend_Card.png differ diff --git a/img/legends/Caustic_Legend_Card.png b/img/legends/Caustic_Legend_Card.png new file mode 100644 index 0000000..1263cd6 Binary files /dev/null and b/img/legends/Caustic_Legend_Card.png differ diff --git a/img/legends/Conduit_Legend_Card.png b/img/legends/Conduit_Legend_Card.png new file mode 100644 index 0000000..b62468b Binary files /dev/null and b/img/legends/Conduit_Legend_Card.png differ diff --git a/img/legends/Crypto_Legend_Card.png b/img/legends/Crypto_Legend_Card.png new file mode 100644 index 0000000..9627665 Binary files /dev/null and b/img/legends/Crypto_Legend_Card.png differ diff --git a/img/legends/Fuse_Legend_Card.png b/img/legends/Fuse_Legend_Card.png new file mode 100644 index 0000000..700d068 Binary files /dev/null and b/img/legends/Fuse_Legend_Card.png differ diff --git a/img/legends/Gibraltar_Legend_Card.png b/img/legends/Gibraltar_Legend_Card.png new file mode 100644 index 0000000..8442e17 Binary files /dev/null and b/img/legends/Gibraltar_Legend_Card.png differ diff --git a/img/legends/Horizon_Legend_Card.png b/img/legends/Horizon_Legend_Card.png new file mode 100644 index 0000000..e823c0e Binary files /dev/null and b/img/legends/Horizon_Legend_Card.png differ diff --git a/img/legends/Lifeline_Legend_Card.png b/img/legends/Lifeline_Legend_Card.png new file mode 100644 index 0000000..c4f3e0e Binary files /dev/null and b/img/legends/Lifeline_Legend_Card.png differ diff --git a/img/legends/Loba_Legend_Card.png b/img/legends/Loba_Legend_Card.png new file mode 100644 index 0000000..345ccca Binary files /dev/null and b/img/legends/Loba_Legend_Card.png differ diff --git a/img/legends/Mad_Maggie_Legend_Card.png b/img/legends/Mad_Maggie_Legend_Card.png new file mode 100644 index 0000000..e5e14fa Binary files /dev/null and b/img/legends/Mad_Maggie_Legend_Card.png differ diff --git a/img/legends/Mirage_Legend_Card.png b/img/legends/Mirage_Legend_Card.png new file mode 100644 index 0000000..7514c28 Binary files /dev/null and b/img/legends/Mirage_Legend_Card.png differ diff --git a/img/legends/Newcastle_Legend_Card.png b/img/legends/Newcastle_Legend_Card.png new file mode 100644 index 0000000..0f5baa7 Binary files /dev/null and b/img/legends/Newcastle_Legend_Card.png differ diff --git a/img/legends/Octane_Legend_Card.png b/img/legends/Octane_Legend_Card.png new file mode 100644 index 0000000..6643b4b Binary files /dev/null and b/img/legends/Octane_Legend_Card.png differ diff --git a/img/legends/Pathfinder_Legend_Card.png b/img/legends/Pathfinder_Legend_Card.png new file mode 100644 index 0000000..ba346c6 Binary files /dev/null and b/img/legends/Pathfinder_Legend_Card.png differ diff --git a/img/legends/Rampart_Legend_Card.png b/img/legends/Rampart_Legend_Card.png new file mode 100644 index 0000000..8b0bdee Binary files /dev/null and b/img/legends/Rampart_Legend_Card.png differ diff --git a/img/legends/Revenant_Legend_Card.png b/img/legends/Revenant_Legend_Card.png new file mode 100644 index 0000000..e432c27 Binary files /dev/null and b/img/legends/Revenant_Legend_Card.png differ diff --git a/img/legends/Seer_Legend_Card.png b/img/legends/Seer_Legend_Card.png new file mode 100644 index 0000000..0239766 Binary files /dev/null and b/img/legends/Seer_Legend_Card.png differ diff --git a/img/legends/Valkyrie_Legend_Card.png b/img/legends/Valkyrie_Legend_Card.png new file mode 100644 index 0000000..f1cd1b2 Binary files /dev/null and b/img/legends/Valkyrie_Legend_Card.png differ diff --git a/img/legends/Vantage_Legend_Card.png b/img/legends/Vantage_Legend_Card.png new file mode 100644 index 0000000..fcba39f Binary files /dev/null and b/img/legends/Vantage_Legend_Card.png differ diff --git a/img/legends/Wattson_Legend_Card.png b/img/legends/Wattson_Legend_Card.png new file mode 100644 index 0000000..32b1552 Binary files /dev/null and b/img/legends/Wattson_Legend_Card.png differ diff --git a/img/legends/Wraith_Legend_Card.png b/img/legends/Wraith_Legend_Card.png new file mode 100644 index 0000000..a1c0399 Binary files /dev/null and b/img/legends/Wraith_Legend_Card.png differ diff --git a/img/loadout/Alternator_SMG.png b/img/loadout/Alternator_SMG.png new file mode 100644 index 0000000..93d7b76 Binary files /dev/null and b/img/loadout/Alternator_SMG.png differ diff --git a/img/loadout/C.A.R._SMG.png b/img/loadout/C.A.R._SMG.png new file mode 100644 index 0000000..6056c31 Binary files /dev/null and b/img/loadout/C.A.R._SMG.png differ diff --git a/img/loadout/Devotion_LMG.png b/img/loadout/Devotion_LMG.png new file mode 100644 index 0000000..1e77bb6 Binary files /dev/null and b/img/loadout/Devotion_LMG.png differ diff --git a/img/loadout/EVA-8_Auto.png b/img/loadout/EVA-8_Auto.png new file mode 100644 index 0000000..ea434a7 Binary files /dev/null and b/img/loadout/EVA-8_Auto.png differ diff --git a/img/loadout/G7_Scout.png b/img/loadout/G7_Scout.png new file mode 100644 index 0000000..cda1eb5 Binary files /dev/null and b/img/loadout/G7_Scout.png differ diff --git a/img/loadout/HAVOC_Rifle.png b/img/loadout/HAVOC_Rifle.png new file mode 100644 index 0000000..02ac2bc Binary files /dev/null and b/img/loadout/HAVOC_Rifle.png differ diff --git a/img/loadout/Hemlok_Burst_AR.png b/img/loadout/Hemlok_Burst_AR.png new file mode 100644 index 0000000..bcd2121 Binary files /dev/null and b/img/loadout/Hemlok_Burst_AR.png differ diff --git a/img/loadout/Kraber_.50-Cal_Sniper.png b/img/loadout/Kraber_.50-Cal_Sniper.png new file mode 100644 index 0000000..a054577 Binary files /dev/null and b/img/loadout/Kraber_.50-Cal_Sniper.png differ diff --git a/img/loadout/L-STAR_EMG.png b/img/loadout/L-STAR_EMG.png new file mode 100644 index 0000000..a8bbe95 Binary files /dev/null and b/img/loadout/L-STAR_EMG.png differ diff --git a/img/loadout/Longbow_DMR.png b/img/loadout/Longbow_DMR.png new file mode 100644 index 0000000..aac6068 Binary files /dev/null and b/img/loadout/Longbow_DMR.png differ diff --git a/img/loadout/M600_Spitfire.png b/img/loadout/M600_Spitfire.png new file mode 100644 index 0000000..2543986 Binary files /dev/null and b/img/loadout/M600_Spitfire.png differ diff --git a/img/loadout/Mastiff_Shotgun.png b/img/loadout/Mastiff_Shotgun.png new file mode 100644 index 0000000..96f3895 Binary files /dev/null and b/img/loadout/Mastiff_Shotgun.png differ diff --git a/img/loadout/Mozambique_Shotgun.png b/img/loadout/Mozambique_Shotgun.png new file mode 100644 index 0000000..851a714 Binary files /dev/null and b/img/loadout/Mozambique_Shotgun.png differ diff --git a/img/loadout/Nemesis_Burst_AR.png b/img/loadout/Nemesis_Burst_AR.png new file mode 100644 index 0000000..c8b9c35 Binary files /dev/null and b/img/loadout/Nemesis_Burst_AR.png differ diff --git a/img/loadout/P2020.png b/img/loadout/P2020.png new file mode 100644 index 0000000..beccc88 Binary files /dev/null and b/img/loadout/P2020.png differ diff --git a/img/loadout/Peacekeeper.png b/img/loadout/Peacekeeper.png new file mode 100644 index 0000000..10b3453 Binary files /dev/null and b/img/loadout/Peacekeeper.png differ diff --git a/img/loadout/Prowler_Burst_PDW.png b/img/loadout/Prowler_Burst_PDW.png new file mode 100644 index 0000000..7b95117 Binary files /dev/null and b/img/loadout/Prowler_Burst_PDW.png differ diff --git a/img/loadout/R-301_Carbine.png b/img/loadout/R-301_Carbine.png new file mode 100644 index 0000000..cbb3315 Binary files /dev/null and b/img/loadout/R-301_Carbine.png differ diff --git a/img/loadout/R-99_SMG.png b/img/loadout/R-99_SMG.png new file mode 100644 index 0000000..52c4344 Binary files /dev/null and b/img/loadout/R-99_SMG.png differ diff --git a/img/loadout/RE-45_Auto.png b/img/loadout/RE-45_Auto.png new file mode 100644 index 0000000..11a6639 Binary files /dev/null and b/img/loadout/RE-45_Auto.png differ diff --git a/img/loadout/Rampage_LMG.png b/img/loadout/Rampage_LMG.png new file mode 100644 index 0000000..5cd9fb8 Binary files /dev/null and b/img/loadout/Rampage_LMG.png differ diff --git a/img/loadout/Sentinel.png b/img/loadout/Sentinel.png new file mode 100644 index 0000000..7728b62 Binary files /dev/null and b/img/loadout/Sentinel.png differ diff --git a/img/loadout/VK-47_Flatline.png b/img/loadout/VK-47_Flatline.png new file mode 100644 index 0000000..532984a Binary files /dev/null and b/img/loadout/VK-47_Flatline.png differ diff --git a/img/loadout/Volt_SMG.png b/img/loadout/Volt_SMG.png new file mode 100644 index 0000000..6c6435f Binary files /dev/null and b/img/loadout/Volt_SMG.png differ diff --git a/img/loadout/Wingman.png b/img/loadout/Wingman.png new file mode 100644 index 0000000..905dcda Binary files /dev/null and b/img/loadout/Wingman.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..735d154 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + ApexLottery + + + + + +

Apex Lottery

+
+ + + + + + \ No newline at end of file diff --git a/js/app.js b/js/app.js new file mode 100644 index 0000000..0329e18 --- /dev/null +++ b/js/app.js @@ -0,0 +1,75 @@ + +const loadJSONP = (url) => { + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.src = url; + script.addEventListener('load', () => resolve()); + script.addEventListener('error', () => reject(new Error(`Error loading script from ${url}`))); + document.body.appendChild(script); + }); +}; + +function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + +let App = { + config: { + data_legends_path: "./data/legends.json", + data_loadout_path: "./data/loadouts.json", + base_legends: [], + base_loadouts: [], + }, + run: async () => { + console.log("ApexLottery is being loaded"); + + try { + await Promise.all([ + loadJSONP(App.config.data_legends_path).then(() => { + App.config.base_legends = legends; + console.log("Loaded legends", App.config.base_legends); + }), + loadJSONP(App.config.data_loadout_path).then(() => { + App.config.base_loadouts = loadouts; + console.log("Loaded loadouts", App.config.base_loadouts); + }) + ]); + } catch (error) { + console.error("Error loading JSONP:", error); + return; + } + + // Create containers for each legend category + const categories = Array.from(new Set(App.config.base_legends.map(legend => legend.type))); + categories.forEach(category => { + const categoryContainer = document.createElement('div'); + categoryContainer.className = 'category-container'; + categoryContainer.id = category.toLowerCase(); // Using the lowercase type as the container ID + + document.body.appendChild(categoryContainer); + }); + + // Append legend items to the appropriate category container + App.config.base_legends.forEach(legend => { + const categoryContainer = document.getElementById(legend.type.toLowerCase()); + if (categoryContainer) { + const legendElement = document.createElement('div'); + legendElement.className = 'legend-item'; + + const legendImage = document.createElement('img'); + legendImage.src = legend.image; // Assuming each legend object has an 'image' property + legendElement.appendChild(legendImage); + + const legendName = document.createElement('p'); + legendName.textContent = legend.name; + legendElement.appendChild(legendName); + + categoryContainer.appendChild(legendElement); + } + }); + } +} + + +window.addEventListener('load', App.run) + diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..1767a7a --- /dev/null +++ b/notes.md @@ -0,0 +1,9 @@ +# Apex Random + +```bash +ls -1 | jq -R -n '[inputs | {name: capture("(?.*)_Legend_Card.png").name | ascii_downcase, image: ("img/legends/" + .), type: "", challenges: [], loadouts: []}]' + + +``` + +Enchainer une game Conduit avec une game Gibralatar \ No newline at end of file