-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (50 loc) · 2.31 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
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Хехефикация текста</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous">
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/[email protected]/brython.min.js">
</script>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/[email protected]/brython_stdlib.min.js">
</script>
</head>
<body class="d-flex" onload="brython()" style="height: 100vh">
<div class="container align-self-center">
<h1>Хехефикация текста</h1>
<div class="form-floating mb-3">
<textarea id="input" class="form-control" placeholder="Введите текст сюда" style="height: 100px"></textarea>
<label for="input">Ввод</label>
</div>
<div class="mb-3">
<label for="rate">Частота хехефикации</label>
<input type="range" min="0" max="1" step="0.05" class="form-range" id="rate">
<label for="level">Степень хехефикации</label>
<input type="range" min="0" max="1" step="0.05" class="form-range" id="level">
<button class="btn btn-secondary" id="submit">Нажми меня</button>
</div>
<div class="form-floating mb-3">
<textarea id="output" class="form-control" style="height: 100px"
placeholder="Здесь появится результат"></textarea>
<label for="output">Вывод</label>
</div>
</div>
<script type="text/python">
from browser import document
from main import text_to_heh
def action(event):
document["output"].value = text_to_heh(document["input"].value,
rate=float(document["rate"].value), level=float(document["level"].value))
document["submit"].bind("click", action)
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
</body>
</html>