diff --git a/static/index.js b/static/index.js index b74032c..46f8024 100644 --- a/static/index.js +++ b/static/index.js @@ -16,4 +16,23 @@ r(() => { const resultat = await response.text(); g('response').innerHTML = resultat; }); + + const afegirPart = (t) => { + const frase = g('frase'); + let conector = ' de '; + + if (frase.value === '') { + conector = 'la '; + } + + g('frase').value = g('frase').value + conector + t; + } + + g('absencia').addEventListener('click', () => { + afegirPart('absencia') + }); + + g('presencia').addEventListener('click', () => { + afegirPart('presencia') + }); }) diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..c582020 --- /dev/null +++ b/static/style.css @@ -0,0 +1,23 @@ +button { + padding: 30px; + font-size: 14px; +} + +#frase { + width: 800px; + height: 300px; + text-align: center; + + font-size: 17px; +} + +#container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +#buttons { + padding: 50px; +} diff --git a/templates/index.html b/templates/index.html index aa64f06..4cf5fa1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,11 +2,17 @@