apptransl / index.html
ffonavia's picture
Add 3 files
bd55ddb verified
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TikTok Lock</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes shake {
0%, 100% { transform: translateX(0); }
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.shake {
animation: shake 0.5s;
}
.bg-gradient {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.word-card {
transition: all 0.3s ease;
}
.word-card:hover {
transform: translateY(-3px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="min-h-screen flex flex-col items-center justify-center p-4">
<div class="w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transition-all duration-300">
<!-- Header -->
<div class="bg-gradient py-6 px-6 text-center">
<div class="flex items-center justify-center mb-4">
<i class="fas fa-lock text-white text-4xl mr-3"></i>
<h1 class="text-2xl font-bold text-white">TikTok Lock</h1>
</div>
<p class="text-white opacity-90">Для разблокировки переведите слова</p>
</div>
<!-- Timer -->
<div class="bg-purple-50 py-3 px-6 flex items-center justify-between">
<div class="flex items-center">
<i class="fas fa-clock text-purple-600 mr-2"></i>
<span class="text-purple-800 font-medium">Осталось:</span>
</div>
<div id="timer" class="text-purple-900 font-bold">05:00</div>
</div>
<!-- Words Container -->
<div class="p-6">
<div id="words-container" class="space-y-4 mb-6">
<!-- Words will be inserted here by JavaScript -->
</div>
<!-- Controls -->
<div class="flex flex-col space-y-4">
<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">
<i class="fas fa-check mr-2"></i> Проверить
</button>
<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">
<i class="fas fa-sync-alt mr-2"></i> Новые слова
</button>
</div>
</div>
<!-- Success Modal -->
<div id="success-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-8 max-w-sm w-full text-center animate-bounce">
<div class="text-green-500 text-6xl mb-4">
<i class="fas fa-check-circle"></i>
</div>
<h2 class="text-2xl font-bold text-gray-800 mb-2">Успех!</h2>
<p class="text-gray-600 mb-6">Доступ к TikTok разблокирован</p>
<button id="close-modal" class="bg-gradient hover:opacity-90 text-white font-bold py-2 px-6 rounded-lg transition-all">
Закрыть
</button>
</div>
</div>
</div>
<div class="mt-6 text-gray-500 text-sm text-center">
<p>Приложение заблокирует доступ через 5 минут</p>
</div>
</div>
<script>
// English to Russian dictionary
const wordDictionary = {
"apple": "яблоко",
"book": "книга",
"cat": "кот",
"dog": "собака",
"house": "дом",
"sun": "солнце",
"moon": "луна",
"water": "вода",
"fire": "огонь",
"tree": "дерево",
"car": "машина",
"city": "город",
"friend": "друг",
"school": "школа",
"computer": "компьютер",
"phone": "телефон",
"music": "музыка",
"love": "любовь",
"food": "еда",
"time": "время",
"work": "работа",
"money": "деньги",
"family": "семья",
"child": "ребенок",
"game": "игра",
"night": "ночь",
"day": "день",
"year": "год",
"week": "неделя",
"month": "месяц"
};
// Get random words from dictionary
function getRandomWords(count) {
const keys = Object.keys(wordDictionary);
const randomWords = [];
// Shuffle array and get first 'count' elements
const shuffled = keys.sort(() => 0.5 - Math.random());
return shuffled.slice(0, count);
}
// Display words in the container
function displayWords(words) {
const container = document.getElementById('words-container');
container.innerHTML = '';
words.forEach(word => {
const card = document.createElement('div');
card.className = 'word-card bg-white p-4 rounded-lg shadow-md border border-gray-200';
card.innerHTML = `
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm">Английское слово</p>
<p class="text-xl font-bold text-purple-800">${word}</p>
</div>
<i class="fas fa-arrow-right text-gray-400"></i>
<div class="w-1/2">
<p class="text-gray-500 text-sm">Русский перевод</p>
<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="Введите перевод">
</div>
</div>
`;
container.appendChild(card);
});
}
// Check answers
function checkAnswers() {
const inputs = document.querySelectorAll('#words-container input');
let allCorrect = true;
inputs.forEach(input => {
const userAnswer = input.value.trim().toLowerCase();
const correctAnswer = input.dataset.answer;
if (userAnswer === correctAnswer) {
input.classList.remove('border-red-500');
input.classList.add('border-green-500');
} else {
input.classList.remove('border-green-500');
input.classList.add('border-red-500');
allCorrect = false;
}
});
if (allCorrect) {
// Show success modal
document.getElementById('success-modal').classList.remove('hidden');
clearInterval(timerInterval);
} else {
// Shake the container for wrong answers
const container = document.getElementById('words-container');
container.classList.add('shake');
setTimeout(() => {
container.classList.remove('shake');
}, 500);
}
}
// Timer functionality
let timeLeft = 5 * 60; // 5 minutes in seconds
const timerElement = document.getElementById('timer');
let timerInterval;
function startTimer() {
timerInterval = setInterval(() => {
timeLeft--;
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
timerElement.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
if (timeLeft <= 0) {
clearInterval(timerInterval);
// Here you would implement the actual blocking of TikTok
alert('Время истекло! TikTok заблокирован.');
}
}, 1000);
}
// Initialize the app
function initApp() {
const words = getRandomWords(5);
displayWords(words);
startTimer();
}
// Event listeners
document.getElementById('check-btn').addEventListener('click', checkAnswers);
document.getElementById('new-words-btn').addEventListener('click', () => {
const words = getRandomWords(5);
displayWords(words);
});
document.getElementById('close-modal').addEventListener('click', () => {
document.getElementById('success-modal').classList.add('hidden');
// Reset timer and words when modal is closed
timeLeft = 5 * 60;
const words = getRandomWords(5);
displayWords(words);
clearInterval(timerInterval);
startTimer();
});
// Start the app
window.addEventListener('DOMContentLoaded', initApp);
</script>
<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>
</html>