ffonavia commited on
Commit
bd55ddb
·
verified ·
1 Parent(s): f9e8c57

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +242 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Apptransl
3
- emoji: 🌍
4
- colorFrom: gray
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: apptransl
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,242 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>TikTok Lock</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ @keyframes shake {
11
+ 0%, 100% { transform: translateX(0); }
12
+ 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
13
+ 20%, 40%, 60%, 80% { transform: translateX(5px); }
14
+ }
15
+ .shake {
16
+ animation: shake 0.5s;
17
+ }
18
+ .bg-gradient {
19
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
20
+ }
21
+ .word-card {
22
+ transition: all 0.3s ease;
23
+ }
24
+ .word-card:hover {
25
+ transform: translateY(-3px);
26
+ box-shadow: 0 10px 20px rgba(0,0,0,0.1);
27
+ }
28
+ </style>
29
+ </head>
30
+ <body class="bg-gray-100 font-sans">
31
+ <div class="min-h-screen flex flex-col items-center justify-center p-4">
32
+ <div class="w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transition-all duration-300">
33
+ <!-- Header -->
34
+ <div class="bg-gradient py-6 px-6 text-center">
35
+ <div class="flex items-center justify-center mb-4">
36
+ <i class="fas fa-lock text-white text-4xl mr-3"></i>
37
+ <h1 class="text-2xl font-bold text-white">TikTok Lock</h1>
38
+ </div>
39
+ <p class="text-white opacity-90">Для разблокировки переведите слова</p>
40
+ </div>
41
+
42
+ <!-- Timer -->
43
+ <div class="bg-purple-50 py-3 px-6 flex items-center justify-between">
44
+ <div class="flex items-center">
45
+ <i class="fas fa-clock text-purple-600 mr-2"></i>
46
+ <span class="text-purple-800 font-medium">Осталось:</span>
47
+ </div>
48
+ <div id="timer" class="text-purple-900 font-bold">05:00</div>
49
+ </div>
50
+
51
+ <!-- Words Container -->
52
+ <div class="p-6">
53
+ <div id="words-container" class="space-y-4 mb-6">
54
+ <!-- Words will be inserted here by JavaScript -->
55
+ </div>
56
+
57
+ <!-- Controls -->
58
+ <div class="flex flex-col space-y-4">
59
+ <button id="check-btn" class="bg-gradient hover:opacity-90 text-white font-bold py-3 px-4 rounded-lg transition-all flex items-center justify-center">
60
+ <i class="fas fa-check mr-2"></i> Проверить
61
+ </button>
62
+ <button id="new-words-btn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-3 px-4 rounded-lg transition-all flex items-center justify-center">
63
+ <i class="fas fa-sync-alt mr-2"></i> Новые слова
64
+ </button>
65
+ </div>
66
+ </div>
67
+
68
+ <!-- Success Modal -->
69
+ <div id="success-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
70
+ <div class="bg-white rounded-xl p-8 max-w-sm w-full text-center animate-bounce">
71
+ <div class="text-green-500 text-6xl mb-4">
72
+ <i class="fas fa-check-circle"></i>
73
+ </div>
74
+ <h2 class="text-2xl font-bold text-gray-800 mb-2">Успех!</h2>
75
+ <p class="text-gray-600 mb-6">Доступ к TikTok разблокирован</p>
76
+ <button id="close-modal" class="bg-gradient hover:opacity-90 text-white font-bold py-2 px-6 rounded-lg transition-all">
77
+ Закрыть
78
+ </button>
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ <div class="mt-6 text-gray-500 text-sm text-center">
84
+ <p>Приложение заблокирует доступ через 5 минут</p>
85
+ </div>
86
+ </div>
87
+
88
+ <script>
89
+ // English to Russian dictionary
90
+ const wordDictionary = {
91
+ "apple": "яблоко",
92
+ "book": "книга",
93
+ "cat": "кот",
94
+ "dog": "собака",
95
+ "house": "дом",
96
+ "sun": "солнце",
97
+ "moon": "луна",
98
+ "water": "вода",
99
+ "fire": "огонь",
100
+ "tree": "дерево",
101
+ "car": "машина",
102
+ "city": "город",
103
+ "friend": "друг",
104
+ "school": "школа",
105
+ "computer": "компьютер",
106
+ "phone": "телефон",
107
+ "music": "музыка",
108
+ "love": "любовь",
109
+ "food": "еда",
110
+ "time": "время",
111
+ "work": "работа",
112
+ "money": "деньги",
113
+ "family": "семья",
114
+ "child": "ребенок",
115
+ "game": "игра",
116
+ "night": "ночь",
117
+ "day": "день",
118
+ "year": "год",
119
+ "week": "неделя",
120
+ "month": "месяц"
121
+ };
122
+
123
+ // Get random words from dictionary
124
+ function getRandomWords(count) {
125
+ const keys = Object.keys(wordDictionary);
126
+ const randomWords = [];
127
+
128
+ // Shuffle array and get first 'count' elements
129
+ const shuffled = keys.sort(() => 0.5 - Math.random());
130
+ return shuffled.slice(0, count);
131
+ }
132
+
133
+ // Display words in the container
134
+ function displayWords(words) {
135
+ const container = document.getElementById('words-container');
136
+ container.innerHTML = '';
137
+
138
+ words.forEach(word => {
139
+ const card = document.createElement('div');
140
+ card.className = 'word-card bg-white p-4 rounded-lg shadow-md border border-gray-200';
141
+ card.innerHTML = `
142
+ <div class="flex items-center justify-between">
143
+ <div>
144
+ <p class="text-gray-500 text-sm">Английское слово</p>
145
+ <p class="text-xl font-bold text-purple-800">${word}</p>
146
+ </div>
147
+ <i class="fas fa-arrow-right text-gray-400"></i>
148
+ <div class="w-1/2">
149
+ <p class="text-gray-500 text-sm">Русский перевод</p>
150
+ <input type="text" data-answer="${wordDictionary[word]}" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Введите перевод">
151
+ </div>
152
+ </div>
153
+ `;
154
+ container.appendChild(card);
155
+ });
156
+ }
157
+
158
+ // Check answers
159
+ function checkAnswers() {
160
+ const inputs = document.querySelectorAll('#words-container input');
161
+ let allCorrect = true;
162
+
163
+ inputs.forEach(input => {
164
+ const userAnswer = input.value.trim().toLowerCase();
165
+ const correctAnswer = input.dataset.answer;
166
+
167
+ if (userAnswer === correctAnswer) {
168
+ input.classList.remove('border-red-500');
169
+ input.classList.add('border-green-500');
170
+ } else {
171
+ input.classList.remove('border-green-500');
172
+ input.classList.add('border-red-500');
173
+ allCorrect = false;
174
+ }
175
+ });
176
+
177
+ if (allCorrect) {
178
+ // Show success modal
179
+ document.getElementById('success-modal').classList.remove('hidden');
180
+ clearInterval(timerInterval);
181
+ } else {
182
+ // Shake the container for wrong answers
183
+ const container = document.getElementById('words-container');
184
+ container.classList.add('shake');
185
+ setTimeout(() => {
186
+ container.classList.remove('shake');
187
+ }, 500);
188
+ }
189
+ }
190
+
191
+ // Timer functionality
192
+ let timeLeft = 5 * 60; // 5 minutes in seconds
193
+ const timerElement = document.getElementById('timer');
194
+ let timerInterval;
195
+
196
+ function startTimer() {
197
+ timerInterval = setInterval(() => {
198
+ timeLeft--;
199
+
200
+ const minutes = Math.floor(timeLeft / 60);
201
+ const seconds = timeLeft % 60;
202
+
203
+ timerElement.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
204
+
205
+ if (timeLeft <= 0) {
206
+ clearInterval(timerInterval);
207
+ // Here you would implement the actual blocking of TikTok
208
+ alert('Время истекло! TikTok заблокирован.');
209
+ }
210
+ }, 1000);
211
+ }
212
+
213
+ // Initialize the app
214
+ function initApp() {
215
+ const words = getRandomWords(5);
216
+ displayWords(words);
217
+ startTimer();
218
+ }
219
+
220
+ // Event listeners
221
+ document.getElementById('check-btn').addEventListener('click', checkAnswers);
222
+
223
+ document.getElementById('new-words-btn').addEventListener('click', () => {
224
+ const words = getRandomWords(5);
225
+ displayWords(words);
226
+ });
227
+
228
+ document.getElementById('close-modal').addEventListener('click', () => {
229
+ document.getElementById('success-modal').classList.add('hidden');
230
+ // Reset timer and words when modal is closed
231
+ timeLeft = 5 * 60;
232
+ const words = getRandomWords(5);
233
+ displayWords(words);
234
+ clearInterval(timerInterval);
235
+ startTimer();
236
+ });
237
+
238
+ // Start the app
239
+ window.addEventListener('DOMContentLoaded', initApp);
240
+ </script>
241
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ffonavia/apptransl" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
242
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ приложение для смартфона блокирует доступ в тик-ток. для разблокировки нужно подставить перевод пяти английских слов на русский. слова должны каждый раз обновляться