Spaces:
Running

undefined / index.html
olive1970's picture
je voudrai rentrai un symbole a des phrases. je vais rentrais des phrases et choisir un symbole. tu gardera l'historique . les phrases seront dispose de maniere verticale. une fois le symbole associe tu l'affichera uniquement si je rentre le mot de passe 5328 et tu l'affichera pendant 20s
6028abf verified
Raw History Blame Contribute Delete
5.79 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Symbolic Phrase Vault</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<style>
.history-item {
transition: all 0.3s ease;
}
.history-item:hover {
transform: translateX(5px);
}
.symbol-display {
animation: symbolFade 20s forwards;
}
@keyframes symbolFade {
0% { opacity: 1; }
90% { opacity: 1; }
100% { opacity: 0; }
}
</style>
</head>
<body class="bg-gradient-to-br from-gray-100 to-gray-200 min-h-screen">
<div class="container mx-auto px-4 py-12 max-w-4xl">
<div class="text-center mb-16">
<h1 class="text-5xl font-bold text-gray-800 mb-4">Symbolic Phrase Vault 🔐</h1>
<p class="text-xl text-gray-600 max-w-2xl mx-auto">Associez des symboles à vos phrases secrètes</p>
</div>
<div class="bg-white rounded-xl shadow-lg p-8 mb-12">
<div class="flex flex-col gap-6">
<div>
<label for="phraseInput" class="block text-sm font-medium text-gray-700 mb-2">Votre phrase</label>
<textarea id="phraseInput" rows="3" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition" placeholder="Entrez votre phrase ici"></textarea>
</div>
<div>
<label for="symbolInput" class="block text-sm font-medium text-gray-700 mb-2">Symbole associé</label>
<input type="text" id="symbolInput" maxlength="1" class="w-16 px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition text-center text-2xl" placeholder="🔣">
</div>
<button id="saveBtn" class="px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
Sauvegarder l'association
</button>
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-8 mb-12">
<h2 class="text-2xl font-semibold text-gray-800 mb-4">Historique des associations</h2>
<div id="historyList" class="space-y-3">
<!-- History items will be added here -->
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-8">
<h2 class="text-2xl font-semibold text-gray-800 mb-4">Afficher le symbole</h2>
<div class="flex flex-col gap-4">
<input type="password" id="passwordInput" class="px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition" placeholder="Mot de passe (5328)">
<button id="showSymbolBtn" class="px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
Afficher le symbole
</button>
<div id="symbolDisplay" class="text-center text-8xl py-8 hidden symbol-display"></div>
</div>
</div>
</div>
<script>
let associations = JSON.parse(localStorage.getItem('phraseSymbolAssociations')) || [];
function updateHistoryList() {
const historyList = document.getElementById('historyList');
historyList.innerHTML = '';
associations.forEach((item, index) => {
const div = document.createElement('div');
div.className = 'history-item p-4 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer';
div.innerHTML = `
<div class="flex justify-between items-center">
<div>
<p class="text-gray-700">${item.phrase}</p>
</div>
<span class="text-2xl">${item.symbol}</span>
</div>
`;
historyList.appendChild(div);
});
}
document.getElementById('saveBtn').addEventListener('click', () => {
const phrase = document.getElementById('phraseInput').value.trim();
const symbol = document.getElementById('symbolInput').value.trim();
if (phrase && symbol) {
associations.push({ phrase, symbol });
localStorage.setItem('phraseSymbolAssociations', JSON.stringify(associations));
updateHistoryList();
document.getElementById('phraseInput').value = '';
document.getElementById('symbolInput').value = '';
}
});
document.getElementById('showSymbolBtn').addEventListener('click', () => {
const password = document.getElementById('passwordInput').value;
if (password === '5328' && associations.length > 0) {
const symbolDisplay = document.getElementById('symbolDisplay');
symbolDisplay.textContent = associations[associations.length - 1].symbol;
symbolDisplay.classList.remove('hidden');
setTimeout(() => {
symbolDisplay.classList.add('hidden');
}, 20000);
}
});
// Initialize
document.addEventListener('DOMContentLoaded', () => {
updateHistoryList();
feather.replace();
});
</script>
</body>
</html>