Adds base + Parse

This commit is contained in:
Gabriel Moisan Matte 2021-05-10 13:24:38 -04:00
parent fa997ea092
commit 3cb22cc8ad
11 changed files with 4641 additions and 0 deletions

View file

@ -0,0 +1 @@
node_modules

View file

@ -0,0 +1,13 @@
[
{
"name":"Mario",
"description":"Princess saving italian plumber",
"portrait": "/imgs/mini/Mario.png",
"large": "/imgs/large/Mario.png",
"serie_icon":"/imgs/serie/MarioBros.svg",
"select_sound":{
"url": "/sounds/Mario.wav",
"type": "audio/wav"
}
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) by Toomai Glittershine for SmashWiki -->
<svg id="svg2" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
height="256" width="256"
viewBox="0 0 256 256">
<metadata id="metadata7">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<path id="mainsymbolpath" style="opacity:0.5;fill:#000000;fill-opacity:1;stroke:none"
d="m 128,212.38632 c 15.9073,0 34.65561,-2.0023 43.11687,-11.16199 6.29934,-6.8193 7.95659,-19.35241 7.80515,-27.75713 C 175.5147,168.69696 159.88634,155.82487 128,155.82487 c -31.88634,0 -47.5147,12.87209 -50.92202,17.64233 -0.15144,8.40472 1.50581,20.93783 7.80515,27.75713 8.46126,9.15969 27.20957,11.16199 43.11687,11.16199 z m -24.43986,-33.69723 c 0,8.16157 0.77173,15.4721 4.85982,15.4721 4.08809,0 4.85983,-7.11217 4.85983,-15.27374 0,-8.16158 -0.17666,-15.27374 -4.61188,-15.27374 -4.43522,0 -5.10777,6.9138 -5.10777,15.07538 z m 48.87972,0 c 0,8.16157 -0.77173,15.4721 -4.85982,15.4721 -4.08809,0 -4.85983,-7.11217 -4.85983,-15.27374 0,-8.16158 0.17666,-15.27374 4.61188,-15.27374 4.43522,0 5.10777,6.9138 5.10777,15.07538 z M 42.65625,131.59375 c 0,5.69377 0.60849,10.63762 1.6875,14.96875 C 57.9451,135.81508 65.67652,105.32877 58,82.78125 47.61719,99.6068 42.65625,118.5715 42.65625,131.59375 z m 29.75013,53.36262 c -15.81763,-5.83563 -36.74304,-19.32486 -36.74304,-53.35092 0,-34.02606 28.13416,-96.21888 92.33666,-96.21888 64.2025,0 92.33666,62.19282 92.33666,96.21888 0,34.02606 -20.92541,47.51529 -36.74304,53.35092 -2.12331,24.99715 -21.42,34.49785 -55.59362,34.49785 -34.17362,0 -53.47031,-9.5007 -55.59362,-34.49785 z M 198,82.78125 c -7.67652,22.54752 0.0549,53.03383 13.65625,63.78125 1.07901,-4.33113 1.6875,-9.27498 1.6875,-14.96875 0,-13.02225 -4.96094,-31.98695 -15.34375,-48.8125 z m -70,-33.76804 c -24.04063,0 -43.529412,18.89219 -43.529412,42.19688 0,23.3047 19.488782,42.19688 43.529412,42.19688 24.04064,0 43.52942,-18.89218 43.52942,-42.19688 0,-23.30469 -19.48878,-42.19688 -43.52942,-42.19688 z"
/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Select Your Character!</title>
<meta name="description" content="Promotional character select screen">
<meta name="author" content="gab9281">
<link rel="stylesheet" href="styles.css?v=1.0">
<script src="script.js" defer></script>
</head>
<body>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,15 @@
{
"name": "select-your-character",
"version": "1.0.0",
"description": "Make it As Set - Project 6 - Character select screen",
"main": "script.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "live-server --port=9000"
},
"author": "Gabriel Moisan Matte",
"license": "ISC",
"devDependencies": {
"live-server": "^1.2.1"
}
}

View file

@ -0,0 +1,49 @@
let characters = new Map();
async function downloadCharacters(){
let response = await fetch("./characters.json");
let char_array = await response.json();
for(let c of char_array){
c._audio = null;
Object.defineProperty(c, "audio", {
get : () => {
if(this._audio == null){
c._audio = new Audio(c.select_sound.url);
}
return c._audio;
}
});
characters.set(c.name,c);
}
return characters;
}
function createElement(tag,options){
let elem = document.createElement(tag);
return Object.assign(elem,options);
}
(async function(){
await downloadCharacters();
for(let c of characters.values()){
let rootelem = document.createElement('div');
let name = createElement('p',{innerHTML:c.name});
let desc = createElement('p',{innerHTML:c.description});
let small = createElement('img',{src:c.portrait});
let big = createElement('img',{src:c.large});
let icon = createElement('img',{src:c.serie_icon});
let audioCtrl = createElement("button",{innerHTML:"Sound",onclick:()=>{c.audio.play()}});
rootelem.append(name,desc,small,big,icon,audioCtrl)
document.body.append(rootelem);
}
})();

Binary file not shown.