- Flask-Backend mit Emoji-Suche implementiert - Responsive Frontend mit modernem UI - Mehrsprachige Suche (Deutsch/Englisch) - Clipboard-Integration für Emoji-Kopieren - Docker-Support mit Dockerfile und docker-compose.yml - Vollständige Dokumentation in README.md - .gitignore für Python-Projekt konfiguriert Features: - Suche nach 4733+ Emojis - Große Emoji-Darstellung - Ein-Klick-Kopieren in Zwischenablage - Unicode-Anzeige für jedes Emoji - Responsive Design für alle Geräte
308 lines
9.0 KiB
HTML
308 lines
9.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Emoji Sucher</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
background: rgba(255, 255, 255, 0.95);
|
|
border-radius: 20px;
|
|
padding: 30px;
|
|
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
h1 {
|
|
text-align: center;
|
|
color: #333;
|
|
margin-bottom: 30px;
|
|
font-size: 2.5em;
|
|
font-weight: 300;
|
|
}
|
|
|
|
.search-container {
|
|
position: relative;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.search-input {
|
|
width: 100%;
|
|
padding: 15px 20px;
|
|
font-size: 18px;
|
|
border: 2px solid #e0e0e0;
|
|
border-radius: 50px;
|
|
outline: none;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.search-input:focus {
|
|
border-color: #667eea;
|
|
box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
|
|
}
|
|
|
|
.search-icon {
|
|
position: absolute;
|
|
right: 20px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
font-size: 20px;
|
|
color: #999;
|
|
}
|
|
|
|
.results-container {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
gap: 20px;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.emoji-card {
|
|
background: white;
|
|
border-radius: 15px;
|
|
padding: 20px;
|
|
text-align: center;
|
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.3s ease;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.emoji-card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.emoji-display {
|
|
font-size: 4em;
|
|
margin-bottom: 10px;
|
|
display: block;
|
|
}
|
|
|
|
.emoji-name {
|
|
font-size: 14px;
|
|
color: #666;
|
|
margin-bottom: 10px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.emoji-unicode {
|
|
font-size: 12px;
|
|
color: #999;
|
|
font-family: 'Courier New', monospace;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.copy-button {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
border: none;
|
|
padding: 8px 16px;
|
|
border-radius: 20px;
|
|
cursor: pointer;
|
|
font-size: 12px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.copy-button:hover {
|
|
transform: scale(1.05);
|
|
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.copy-button.copied {
|
|
background: #4CAF50;
|
|
}
|
|
|
|
.no-results {
|
|
text-align: center;
|
|
color: #666;
|
|
font-size: 18px;
|
|
margin-top: 50px;
|
|
}
|
|
|
|
.loading {
|
|
text-align: center;
|
|
color: #666;
|
|
font-size: 16px;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.spinner {
|
|
border: 3px solid #f3f3f3;
|
|
border-top: 3px solid #667eea;
|
|
border-radius: 50%;
|
|
width: 30px;
|
|
height: 30px;
|
|
animation: spin 1s linear infinite;
|
|
margin: 0 auto 10px;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
.stats {
|
|
text-align: center;
|
|
color: #666;
|
|
margin-bottom: 20px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.container {
|
|
padding: 20px;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 2em;
|
|
}
|
|
|
|
.results-container {
|
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
gap: 15px;
|
|
}
|
|
|
|
.emoji-display {
|
|
font-size: 3em;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>🔍 Emoji Sucher</h1>
|
|
|
|
<div class="search-container">
|
|
<input type="text" id="searchInput" class="search-input" placeholder="Emoji suchen... (z.B. 'smile', 'herz', 'katze', 'lachen')">
|
|
<span class="search-icon">🔍</span>
|
|
</div>
|
|
|
|
<div class="stats" id="stats"></div>
|
|
|
|
<div id="results" class="results-container"></div>
|
|
|
|
<div id="noResults" class="no-results" style="display: none;">
|
|
Keine Emojis gefunden. Versuche einen anderen Suchbegriff!
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
let searchTimeout;
|
|
const resultsContainer = document.getElementById('results');
|
|
const noResultsDiv = document.getElementById('noResults');
|
|
const statsDiv = document.getElementById('stats');
|
|
const searchInput = document.getElementById('searchInput');
|
|
|
|
// Suche mit Debouncing
|
|
searchInput.addEventListener('input', function() {
|
|
clearTimeout(searchTimeout);
|
|
const query = this.value.trim();
|
|
|
|
if (query.length === 0) {
|
|
resultsContainer.innerHTML = '';
|
|
noResultsDiv.style.display = 'none';
|
|
statsDiv.textContent = '';
|
|
return;
|
|
}
|
|
|
|
if (query.length < 2) {
|
|
return;
|
|
}
|
|
|
|
// Loading anzeigen
|
|
resultsContainer.innerHTML = '<div class="loading"><div class="spinner"></div>Suche...</div>';
|
|
noResultsDiv.style.display = 'none';
|
|
|
|
searchTimeout = setTimeout(() => {
|
|
searchEmojis(query);
|
|
}, 300);
|
|
});
|
|
|
|
async function searchEmojis(query) {
|
|
try {
|
|
const response = await fetch(`/search?q=${encodeURIComponent(query)}`);
|
|
const emojis = await response.json();
|
|
|
|
displayResults(emojis, query);
|
|
} catch (error) {
|
|
console.error('Fehler bei der Suche:', error);
|
|
resultsContainer.innerHTML = '<div class="no-results">Fehler bei der Suche. Bitte versuche es erneut.</div>';
|
|
}
|
|
}
|
|
|
|
function displayResults(emojis, query) {
|
|
if (emojis.length === 0) {
|
|
resultsContainer.innerHTML = '';
|
|
noResultsDiv.style.display = 'block';
|
|
statsDiv.textContent = '';
|
|
return;
|
|
}
|
|
|
|
noResultsDiv.style.display = 'none';
|
|
statsDiv.textContent = `${emojis.length} Emoji${emojis.length !== 1 ? 's' : ''} für "${query}" gefunden`;
|
|
|
|
resultsContainer.innerHTML = emojis.map(emoji => `
|
|
<div class="emoji-card" onclick="copyToClipboard('${emoji.char}', this)">
|
|
<span class="emoji-display">${emoji.char}</span>
|
|
<div class="emoji-name">${emoji.description}</div>
|
|
<div class="emoji-unicode">${emoji.unicode}</div>
|
|
<button class="copy-button" onclick="event.stopPropagation(); copyToClipboard('${emoji.char}', this)">
|
|
📋 Kopieren
|
|
</button>
|
|
</div>
|
|
`).join('');
|
|
}
|
|
|
|
async function copyToClipboard(emoji, button) {
|
|
try {
|
|
await navigator.clipboard.writeText(emoji);
|
|
|
|
// Visuelles Feedback
|
|
const originalText = button.textContent;
|
|
button.textContent = '✅ Kopiert!';
|
|
button.classList.add('copied');
|
|
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
button.classList.remove('copied');
|
|
}, 2000);
|
|
|
|
} catch (error) {
|
|
console.error('Fehler beim Kopieren:', error);
|
|
// Fallback für ältere Browser
|
|
const textArea = document.createElement('textarea');
|
|
textArea.value = emoji;
|
|
document.body.appendChild(textArea);
|
|
textArea.select();
|
|
document.execCommand('copy');
|
|
document.body.removeChild(textArea);
|
|
|
|
button.textContent = '✅ Kopiert!';
|
|
button.classList.add('copied');
|
|
setTimeout(() => {
|
|
button.textContent = '📋 Kopieren';
|
|
button.classList.remove('copied');
|
|
}, 2000);
|
|
}
|
|
}
|
|
|
|
// Fokus auf Suchfeld setzen
|
|
searchInput.focus();
|
|
</script>
|
|
</body>
|
|
</html>
|