102 lines
3.0 KiB
HTML
102 lines
3.0 KiB
HTML
<!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>
|