From 139e11b5fcd5ae17314ec2fbb3ef6a4ce747c827 Mon Sep 17 00:00:00 2001 From: Marce Coll Date: Sat, 27 Nov 2021 13:25:20 +0100 Subject: [PATCH] Some style, fixed JS --- static/index.js | 19 +++++++++++++++++++ static/style.css | 23 +++++++++++++++++++++++ templates/index.html | 12 +++++++++--- 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 static/style.css 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 @@ Absencia de Presencia + -
- - +
+ + +
+ + + +