Files
projectorpi-web/projectorpi_web/index.html
Marijn Doeve 82f3f33478
Some checks failed
release-nightly / release-image (push) Has been cancelled
release-tag / release-image (push) Failing after 19m18s
Better css
2023-09-12 23:42:51 +02:00

102 lines
3.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
#top {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(7, 1fr);
column-gap: normal;
justify-items: center;
}
#bottom {
display: grid;
grid-template: auto / repeat(4, 1fr);
justify-items: center;
}
.remote-button {
width: 70px;
height: 70px;
font-size: 50px;
}
#pwr {
grid-area: 1 / 3;
}
[data-direction="up"] {
grid-area: 2 / 2;
}
[data-direction="down"] {
grid-area: 4 / 2;
}
[data-direction="left"] {
grid-area: 3 / 1;
}
[data-direction="right"] {
grid-area: 3 / 3;
}
[data-direction="enter"] {
grid-area: 3 / 2;
}
[data-direction="menu"] {
grid-area: 5 / 1;
}
[data-direction="vol_up"] {
grid-area: 6 / 2;
}
[data-direction="vol_down"] {
grid-area: 7 / 2;
}
</style>
</head>
<body>
<main>
<div id="top">
<button class="remote-button" data-direction="up">🔼</button>
<button class="remote-button" data-direction="right">▶️</button>
<button class="remote-button" data-direction="down">🔽</button>
<button class="remote-button" data-direction="left">◀️</button>
<button class="remote-button" data-direction="enter">🆗</button>
<button class="remote-button" data-direction="menu">↩️</button>
<button class="remote-button" data-direction="vol_up">⏫️</button>
<button class="remote-button" data-direction="vol_down">⏬️</button>
<button class="remote-button" id="pwr">⏹️</button></div>
<div id="bottom">
<button class="remote-button" data-number="1">1</button>
<button class="remote-button" data-number="2">2</button>
<button class="remote-button" data-number="3">3</button>
<button class="remote-button" data-number="4">4</button>
</div>
</main>
<script>
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('click', (e) => {
let direction = e.target.dataset.direction
let number = e.target.dataset.number
if (direction) {
fetch(`/control/${direction}`, {method: 'POST'})
}
if (number) {
fetch(`/select/${number}`, {method: 'POST'})
}
if (e.target.id === 'pwr') {
fetch('/sleep', {method: 'POST'})
}
});
})
</script>
</body>
</html>