Compare commits
2 Commits
ad26ef0196
...
f04bb3f69b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f04bb3f69b | ||
|
|
139e11b5fc |
@@ -16,4 +16,23 @@ r(() => {
|
|||||||
const resultat = await response.text();
|
const resultat = await response.text();
|
||||||
g('response').innerHTML = resultat;
|
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')
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
23
static/style.css
Normal file
23
static/style.css
Normal file
@@ -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;
|
||||||
|
}
|
||||||
@@ -2,11 +2,17 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Absencia de Presencia</title>
|
<title>Absencia de Presencia</title>
|
||||||
<script src="/static/index.js"></script>
|
<script src="/static/index.js"></script>
|
||||||
|
<link rel="stylesheet" href="/static/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div id="container">
|
||||||
<input type="text" id="frase"/>
|
<textarea id="frase"></textarea>
|
||||||
<input type="button" id="submit"/>
|
|
||||||
|
<div id="buttons">
|
||||||
|
<button id="absencia">Absencia</button>
|
||||||
|
<button id="presencia">Presencia</button>
|
||||||
|
<button id="submit">Calcula</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="response"></p>
|
<p id="response"></p>
|
||||||
|
|||||||
Reference in New Issue
Block a user