-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
163 lines (145 loc) · 4.8 KB
/
Copy pathindex.html
File metadata and controls
163 lines (145 loc) · 4.8 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task Reminder App</title>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
<style>
/* Общие стили */
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: var(--tg-theme-bg-color, #f9f9f9);
color: var(--tg-theme-text-color, #2c2c2c);
transition: background-color 0.3s ease, color 0.3s ease;
}
h1 {
font-size: 24px;
margin-bottom: 20px;
}
.task-list {
width: 90%;
max-width: 400px;
display: flex;
flex-direction: column;
gap: 15px;
}
.task {
background-color: var(--tg-theme-secondary-bg-color, #fff);
padding: 15px;
border-radius: 8px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.task label {
font-size: 18px;
cursor: pointer;
}
.task input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}
button {
width: 100%;
max-width: 400px;
padding: 15px;
background-color: var(--tg-theme-button-color, #0088cc);
color: var(--tg-theme-button-text-color, #fff);
font-size: 18px;
border: none;
border-radius: 8px;
cursor: pointer;
margin-top: 20px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #006fa1;
}
button:disabled {
background-color: #d3d3d3;
cursor: not-allowed;
}
/* Мобильная адаптивность */
@media (max-width: 600px) {
h1 {
font-size: 20px;
}
.task label {
font-size: 16px;
}
button {
font-size: 16px;
}
}
</style>
</head>
<body>
<h1>Task Reminder App</h1>
<div class="task-list">
<div class="task">
<label for="task1">
<input type="checkbox" id="task1">
TONxDAO
</label>
</div>
<div class="task">
<label for="task2">
<input type="checkbox" id="task2">
Ton Station
</label>
</div>
<div class="task">
<label for="task3">
<input type="checkbox" id="task3">
Tonique App
</label>
</div>
</div>
<button id="setReminder">Set Reminder</button>
<script>
Telegram.WebApp.ready();
const task1 = document.getElementById('task1');
const task2 = document.getElementById('task2');
const task3 = document.getElementById('task3');
const setReminderButton = document.getElementById('setReminder');
// Функция для проверки, выбраны ли задачи
function checkTasks() {
return task1.checked || task2.checked || task3.checked;
}
// Обработчик для кнопки напоминания
setReminderButton.addEventListener('click', () => {
let tasks = [];
if (task1.checked) tasks.push('TONxDAO');
if (task2.checked) tasks.push('Ton Station');
if (task3.checked) tasks.push('Tonique App');
if (tasks.length > 0) {
// Отправляем данные боту
Telegram.WebApp.sendData(JSON.stringify({
tasks: tasks,
reminderTime: 60 // Напоминание через 60 минут
}));
alert('Напоминание установлено для задач: ' + tasks.join(', '));
} else {
alert('Выберите хотя бы одну задачу.');
}
});
// Блокируем кнопку, если задачи не выбраны
setReminderButton.disabled = !checkTasks();
document.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
checkbox.addEventListener('change', () => {
setReminderButton.disabled = !checkTasks();
});
});
</script>
</body>
</html>