-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (56 loc) · 1.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<title>Panel Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css"/>
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<style>
table.fixed { table-layout:fixed; width: 600px;}
table.fixed td { text-align:left; font-size: 100px; width: 20%}
</style>
</head>
<body>
<table class="fixed" style="align-self: center; position: absolute; margin: 100px;">
<td><span id="soat"></span></td>
<td><span class="blinker"></span></td>
<td><span id="daqiqa"></span></td>
<td><span class="blinker"></span></td>
<td><span id="soniya"></span></td>
</tr>
<tr>
<td></td>
<td></td>
<td><span id="til"></span></td>
<td></td>
<td></td>
</tr>
</table>
<py-script>
from js import document
from asyncio import sleep
from datetime import datetime
soat = document.querySelector("#soat")
daqiqa = document.querySelector("#daqiqa")
soniya = document.querySelector("#soniya")
blinkers = document.querySelectorAll(".blinker")
til = document.querySelector("#til")
async def run():
blink = True
while True:
_blinker = "" if blink else "👁"
_til = "" if blink else "👅"
hozirgi_vaqt = datetime.now()
_soat, _daqiqa, _soniya = hozirgi_vaqt.hour, hozirgi_vaqt.minute, hozirgi_vaqt.second
soat.textContent = f"{_soat:0<2}"
daqiqa.textContent = f"{_daqiqa:0<2}"
soniya.textContent = f"{_soniya:0<2}"
til.textContent = _til
for blinker in blinkers:
blinker.textContent = _blinker
blink = not blink
await sleep(1)
await run()
</py-script>
</body>
</html>