diff --git a/js/editor.js b/js/editor.js index 000965d..64bfe25 100644 --- a/js/editor.js +++ b/js/editor.js @@ -142,8 +142,16 @@ function makeCardSVG(deck, cardInputTemplate, templateSVG, card) { selected = {svg: cardSVG, json: card}; setForm(cardInputTemplate, card); }, true); - Object.keys(cardInputTemplate.inputs).forEach(prop => - wrapSVGText(cardSVG.querySelector('#' + prop), String(card[prop] || ""))); + Object.keys(cardInputTemplate.inputs).forEach( + prop => wrapSVGText(cardSVG.querySelector('#' + prop), String(card[prop] || ""))); + Object.entries(cardInputTemplate.hide).forEach(hidable => { + if (hidable[1] in card) { + cardSVG.querySelector('#' + hidable[0]).setAttribute('display', ''); + } + else { + cardSVG.querySelector('#' + hidable[0]).setAttribute('display', 'none'); + } + }); } function upload() { diff --git a/template/environment/deck.svg b/template/environment/deck.svg index 754cf2a..a10ce7a 100644 --- a/template/environment/deck.svg +++ b/template/environment/deck.svg @@ -324,21 +324,26 @@ - - - - - - - + Header + - Keywords + + + + + + + + + Keywords + Text Here Text Here art by + @@ -346,18 +351,18 @@ - - - + + + + + + + + + + + + 3 - - - - - - - -3 -