PAGE="
<!DOCTYPE html>
<html>
+<meta name='viewport' content='width=device-width'>
<head>
<style>
body {
background-color: #7fa99b;
- display: flex;
- flex-direction: column;
- white-space: pre-wrap;
}
form {
- max-width: max-content;
+ width: min(400px, 100%);
}
fieldset {
- align-items: center;
background-color: #f1d18a;
- column-gap: 15px;
display: flex;
- }
- button, fieldset, input, select {
- border: 1px solid;
+ flex-direction: column;
+ row-gap: 5px;
}
label {
- align-items: center;
- column-gap: 15px;
+ column-gap: 5px;
display: flex;
}
- p {
- font-size: 1.5em;
- margin: 0;
- }
- @media screen and (max-width: 980px) {
- form {
- min-width: 98vw;
- }
- fieldset {
- align-items: stretch;
- flex-direction: column;
- }
- button, input, label, legend, select {
- font-size: 4em;
- border-width: 4px;
- }
- label > input {
- width: 100%;
- font-size: 1em;
- }
+ input[type=date] {
+ width: 100%;
}
</style>
</head>
$(echo "${gyms}" | format_as "<option value='{}'>{}</option>")
</select>
<label>
- <p>📅</p>
- <input type='date' id='date' name='date' required />
+ 📅<input type='date' id='date' name='date' required />
</label>
<button type='submit'>Record</>
</fieldset>
format_for_html_input() {
/usr/bin/awk -F "|" '{printf "\
-<div class='\''container'\''>\
-<label for='\''%s'\''>%s</label>\
-<label for='\''%s'\''>%s</label>\
-<input id='\''%s'\'' name='\''%s'\'' type='\''text'\'' />\
-<label for='\''%s_local_record'\''>\
-<input id='\''%s_local_record'\''\
- name='\''%s_local_record'\''\
- type='\''checkbox'\'' />\
- Is gym record?\
-</label>\
-<label for='\''%s_global_record'\''>\
-<input id='\''%s_global_record'\''\
- name='\''%s_global_record'\''\
- type='\''checkbox'\'' />\
- Is record?\
-</label>\
-</div>",\
- $1, $2, $1, $3, $1, $1, $1, $1, $1, $1, $1, $1}'
+<fieldset>\
+ <legend>%s</legend>\
+ <label for='\''%s'\''>%s</label>\
+ <input id='\''%s'\'' name='\''%s'\'' type='\''text'\'' />\
+ <label for='\''%s_local_record'\''>\
+ <input id='\''%s_local_record'\''\
+ name='\''%s_local_record'\''\
+ type='\''checkbox'\'' />Is gym record?\
+ </label>\
+ <label for='\''%s_global_record'\''>\
+ <input id='\''%s_global_record'\''\
+ name='\''%s_global_record'\''\
+ type='\''checkbox'\'' />Is record?\
+ </label>\
+</fieldset>",\
+ $2, $1, $3, $1, $1, $1, $1, $1, $1, $1, $1}'
}
PAGE="
<!DOCTYPE html>
<html>
+<meta name='viewport' content='width=device-width'>
<head>
<script>
window.onbeforeunload = function (event) {
<style>
body {
background-color: #7fa99b;
- max-width: max(80vh, 1300px);
- white-space: pre-wrap;
}
- .container {
- background-color: #f1d18a;
- display: grid;
- grid-template-columns: 1fr 1.2fr 1fr 1fr 1fr;
- margin-bottom: 15px;
- padding: 15px;
- }
- .container, input, button {
- border: 1px solid;
- }
- button {
- font-size: 1em;
- min-width: min(30%, 200px);
- padding: 7px 15px;
+ form {
+ width: min(400px, 100%);
}
- form > label {
- align-items: center;
+ fieldset {
+ background-color: #f1d18a;
display: flex;
- column-gap: 15px;
- }
- @media screen and (max-width: 980px) {
- .container {
- display: flex;
- flex-direction: column;
- gap: 20px;
- }
- .container, input, button {
- border-width: 4px;
- }
- label, input[type=text], button {
- font-size: 4.5em;
- }
- input[type=text] {
- max-width: 98%;
- }
- input[type=number] {
- font-size: 1em;
- width: 400px;
- }
- input[type=checkbox] {
- width: 55px;
- height: 55px;
- }
+ flex-direction: column;
+ row-gap: 5px;
+ margin: 5px 0;
}
</style>
</head>
<input type='hidden' name='gym' value='${GYM}' />
<input type='hidden' name='date' value='${DATE}' />
<label>
- <p>Duration [min]:</p>
- <input type='number' name='duration' value='0' required />
+ Duration [min]: <input type='number' name='duration' value='0' required />
</label>
$(echo "${exercises}" | format_for_html_input)
<button>Submit</button>