milkida / index.html
olinux's picture
Add 1 files
cbc55c2 verified
Raw History Blame Contribute Delete
63.2 kB
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>PromptCraft - Jeu Collaboratif de Création de Prompts</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> .token-counter { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.1); padding: 2px 6px; border-radius: 10px; font-size: 12px; } .token-limit { background-color: #FECACA; animation: pulse 2s infinite; } @keyframes pulse { 0% { background-color: #FECACA; } 50% { background-color: #FEE2E2; } 100% { background-color: #FECACA; } } .highlight { background-color: #FEF08A; transition: background-color 0.5s; } #collaboration-feed, #prompt-history { max-height: 400px; overflow-y: auto; } .rating-star { cursor: pointer; transition: transform 0.2s; } .rating-star:hover { transform: scale(1.2); } .active-star { color: #F59E0B; } .prompt-card { transition: all 0.3s; } .prompt-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); } .selected-prompt { border: 2px solid #3B82F6; background-color: #EFF6FF; } .badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; } .progress-bar { height: 10px; border-radius: 5px; background-color: #E5E7EB; } .progress-fill { height: 100%; border-radius: 5px; background-color: #10B981; transition: width 0.5s ease; } .achievement-card { transition: all 0.3s; transform-style: preserve-3d; } .achievement-card:hover { transform: translateY(-5px) rotateX(5deg); } .unlocked { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(16, 185, 129, 0.2); } .locked { filter: grayscale(80%); opacity: 0.7; } .floating-notification { animation: floatUp 3s forwards; } @keyframes floatUp { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-100px); opacity: 0; } } #assistant-modal { transition: all 0.3s ease; } .modal-hidden { opacity: 0; pointer-events: none; } .modal-visible { opacity: 1; } #feedback-modal { transition: all 0.3s ease; } .feedback-option { transition: all 0.2s; } .feedback-option:hover { transform: scale(1.05); } .selected-feedback { background-color: #EFF6FF; border-color: #3B82F6; } </style> </head> <body class="bg-gray-50 min-h-screen"> <!-- Game Header --> <header class="bg-gradient-to-r from-blue-600 to-indigo-700 text-white shadow-lg"> <div class="container mx-auto px-4 py-6"> <div class="flex flex-col md:flex-row justify-between items-center"> <div class="flex items-center mb-4 md:mb-0"> <i class="fas fa-robot text-3xl mr-3"></i> <div> <h1 class="text-2xl md:text-3xl font-bold">PromptCraft</h1> <p class="text-sm md:text-base opacity-90">Jeu Collaboratif de Création de Prompts</p> </div> </div> <div class="flex items-center space-x-4"> <div class="bg-white bg-opacity-20 p-2 rounded-lg flex items-center"> <i class="fas fa-coins text-yellow-300 mr-2"></i> <span id="user-points" class="font-bold">0</span> </div> <div class="bg-white bg-opacity-20 p-2 rounded-lg flex items-center"> <i class="fas fa-trophy text-yellow-300 mr-2"></i> <span id="user-level" class="font-bold">1</span> </div> <div class="relative group"> <img src="https://ui-avatars.com/api/?name=Joueur&background=random" class="w-10 h-10 rounded-full cursor-pointer" id="user-avatar"> <div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden group-hover:block"> <span class="block px-4 py-2 text-sm text-gray-700 font-medium border-b">Joueur</span> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Profil</a> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Déconnexion</a> </div> </div> </div> </div> </div> </header> <!-- Level Progress --> <div class="bg-white shadow-sm"> <div class="container mx-auto px-4 py-2"> <div class="flex items-center"> <span class="text-sm font-medium text-gray-600 mr-2">Niveau 1</span> <div class="flex-1 progress-bar"> <div id="level-progress" class="progress-fill" style="width: 0%"></div> </div> <span class="text-sm font-medium text-gray-600 ml-2">Niveau 2</span> </div> </div> </div> <!-- Main Game Area --> <div class="container mx-auto px-4 py-8"> <!-- Game Grid --> <div class="grid md:grid-cols-3 gap-8"> <!-- Left Column - Challenge Board --> <div class="bg-white rounded-lg shadow-md p-6"> <div class="flex justify-between items-center mb-4"> <h2 class="text-xl font-semibold text-gray-800"> <i class="fas fa-flag-checkered text-blue-500 mr-2"></i> Défis du Jour </h2> <span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">3 défis disponibles</span> </div> <div class="space-y-4 mb-6"> <div class="p-4 border rounded-lg bg-gradient-to-r from-blue-50 to-indigo-50"> <div class="flex justify-between items-start mb-2"> <h3 class="font-medium text-blue-800">Défi de Base</h3> <span class="badge bg-blue-100 text-blue-800">+10 pts</span> </div> <p class="text-sm text-gray-600 mb-3">Crée et sauvegarde un prompt aujourd'hui</p> <div class="flex justify-between items-center"> <div class="text-xs text-gray-500">0/1 complété</div> <button class="text-xs bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded"> Commencer </button> </div> </div> <div class="p-4 border rounded-lg bg-gradient-to-r from-purple-50 to-pink-50"> <div class="flex justify-between items-start mb-2"> <h3 class="font-medium text-purple-800">Défi Collaboratif</h3> <span class="badge bg-purple-100 text-purple-800">+25 pts</span> </div> <p class="text-sm text-gray-600 mb-3">Partage un prompt avec la communauté</p> <div class="flex justify-between items-center"> <div class="text-xs text-gray-500">0/1 complété</div> <button class="text-xs bg-purple-600 hover:bg-purple-700 text-white px-3 py-1 rounded"> Commencer </button> </div> </div> <div class="p-4 border rounded-lg bg-gradient-to-r from-green-50 to-teal-50"> <div class="flex justify-between items-start mb-2"> <h3 class="font-medium text-green-800">Défi Expert</h3> <span class="badge bg-green-100 text-green-800">+50 pts</span> </div> <p class="text-sm text-gray-600 mb-3">Reçois 5 étoiles sur un prompt partagé</p> <div class="flex justify-between items-center"> <div class="text-xs text-gray-500">0/1 complété</div> <button class="text-xs bg-green-600 hover:bg-green-700 text-white px-3 py-1 rounded"> Commencer </button> </div> </div> </div> <div class="bg-yellow-50 p-4 rounded-lg border border-yellow-200"> <h3 class="font-semibold text-yellow-800 mb-2"> <i class="fas fa-lightbulb mr-2"></i> Astuce du Jour </h3> <p class="text-sm text-gray-700">Les prompts commençant par "Agis comme un expert en..." obtiennent en moyenne 30% plus de votes positifs!</p> </div> </div> <!-- Middle Column - Prompt Editor --> <div class="bg-white rounded-lg shadow-md p-6"> <div class="flex justify-between items-center mb-4"> <h2 class="text-xl font-semibold text-gray-800"> <i class="fas fa-edit text-indigo-500 mr-2"></i> Atelier de Création </h2> <div class="flex space-x-2"> <button id="random-theme" class="text-indigo-600 hover:text-indigo-800 text-sm"> <i class="fas fa-random mr-1"></i> Thème </button> <button id="open-assistant" class="text-indigo-600 hover:text-indigo-800 text-sm"> <i class="fas fa-magic mr-1"></i> Assistant </button> </div> </div> <div class="mb-4"> <label class="block text-gray-700 mb-2">Titre du prompt</label> <input type="text" id="prompt-title" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500" placeholder="Donnez un titre accrocheur..."> </div> <div class="relative mb-4"> <label class="block text-gray-700 mb-2">Votre chef-d'œuvre de prompt</label> <textarea id="prompt-content" rows="8" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500" placeholder="Écrivez votre prompt ici..."></textarea> <div class="token-counter" id="prompt-counter">0/512</div> </div> <div class="flex flex-wrap gap-2 mb-4"> <button id="save-prompt" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-4 rounded-lg transition duration-300 flex-1"> <i class="fas fa-save mr-2"></i> Sauvegarder </button> <button id="send-group" class="bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg transition duration-300 flex-1"> <i class="fas fa-share-alt mr-2"></i> Partager </button> <button id="clear-prompt" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-4 rounded-lg transition duration-300"> <i class="fas fa-trash-alt mr-2"></i> Effacer </button> </div> <div class="bg-blue-50 p-4 rounded-lg"> <h3 class="font-semibold text-blue-800 mb-2"> <i class="fas fa-chart-line mr-2"></i> Potentiel de Score </h3> <div class="grid grid-cols-3 gap-2 text-center text-xs"> <div class="bg-white p-2 rounded shadow-sm"> <div class="font-bold text-blue-600" id="length-score">0</div> <div class="text-gray-600">Longueur</div> </div> <div class="bg-white p-2 rounded shadow-sm"> <div class="font-bold text-purple-600" id="complexity-score">0</div> <div class="text-gray-600">Complexité</div> </div> <div class="bg-white p-2 rounded shadow-sm"> <div class="font-bold text-green-600" id="creativity-score">0</div> <div class="text-gray-600">Originalité</div> </div> </div> </div> </div> <!-- Right Column - Community Feed --> <div class="bg-white rounded-lg shadow-md p-6"> <div class="flex justify-between items-center mb-4"> <h2 class="text-xl font-semibold text-gray-800"> <i class="fas fa-users text-green-500 mr-2"></i> Galerie Communautaire </h2> <div class="flex items-center space-x-2"> <button id="refresh-feed" class="text-green-600 hover:text-green-800"> <i class="fas fa-sync-alt"></i> </button> <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded" id="active-players">12 joueurs</span> </div> </div> <div id="collaboration-feed" class="space-y-4 mb-4 p-2"> <div class="p-4 rounded-lg bg-gradient-to-r from-green-50 to-blue-50 border border-green-200"> <div class="flex justify-between items-start mb-2"> <h3 class="font-medium text-green-800">Analyse de sentiment avancée</h3> <div class="flex"> <span class="badge bg-green-100 text-green-800 mr-2">+15</span> <span class="badge bg-yellow-100 text-yellow-800">4.8★</span> </div> </div> <p class="text-sm text-gray-600 mb-3">"Analyse le sentiment de ce texte sur une échelle de 1 à 10, avec des sous-scores pour la colère, la joie, la tristesse et la surprise. Fournis une explication pour chaque score."</p> <div class="flex justify-between items-center text-xs text-gray-500"> <span>Par: Marie</span> <span>12 votes</span> </div> </div> <div class="p-4 rounded-lg bg-gradient-to-r from-purple-50 to-pink-50 border border-purple-200"> <div class="flex justify-between items-start mb-2"> <h3 class="font-medium text-purple-800">Générateur de noms de produits</h3> <div class="flex"> <span class="badge bg-purple-100 text-purple-800 mr-2">+8</span> <span class="badge bg-yellow-100 text-yellow-800">4.2★</span> </div> </div> <p class="text-sm text-gray-600 mb-3">"Génère 5 noms créatifs pour un nouveau [type de produit]. Les noms doivent être accrocheurs, faciles à retenir et refléter les caractéristiques suivantes: [liste de caractéristiques]."</p> <div class="flex justify-between items-center text-xs text-gray-500"> <span>Par: Pierre</span> <span>5 votes</span> </div> </div> </div> <div class="bg-indigo-50 p-4 rounded-lg"> <h3 class="font-semibold text-indigo-800 mb-2"> <i class="fas fa-trophy mr-2"></i> Classement </h3> <div class="space-y-2"> <div class="flex items-center justify-between bg-white p-2 rounded-lg"> <div class="flex items-center"> <span class="font-bold text-yellow-500 mr-2">1.</span> <img src="https://ui-avatars.com/api/?name=Marie&background=random" class="w-6 h-6 rounded-full mr-2"> <span class="text-sm">Marie</span> </div> <span class="text-sm font-bold">245 pts</span> </div> <div class="flex items-center justify-between bg-white p-2 rounded-lg"> <div class="flex items-center"> <span class="font-bold text-gray-400 mr-2">2.</span> <img src="https://ui-avatars.com/api/?name=Pierre&background=random" class="w-6 h-6 rounded-full mr-2"> <span class="text-sm">Pierre</span> </div> <span class="text-sm font-bold">180 pts</span> </div> <div class="flex items-center justify-between bg-white p-2 rounded-lg"> <div class="flex items-center"> <span class="font-bold text-amber-600 mr-2">3.</span> <img src="https://ui-avatars.com/api/?name=Thomas&background=random" class="w-6 h-6 rounded-full mr-2"> <span class="text-sm">Thomas</span> </div> <span class="text-sm font-bold">150 pts</span> </div> </div> </div> </div> </div> <!-- Achievements Section --> <section class="mt-8 bg-white rounded-lg shadow-md p-6"> <h2 class="text-2xl font-semibold text-gray-800 mb-4"> <i class="fas fa-medal text-yellow-500 mr-2"></i> Vos Récompenses </h2> <div class="grid grid-cols-2 md:grid-cols-4 gap-4"> <div class="achievement-card unlocked bg-gradient-to-br from-yellow-50 to-yellow-100 border border-yellow-200 p-4 rounded-lg text-center"> <div class="w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center mx-auto mb-3"> <i class="fas fa-star text-yellow-500 text-2xl"></i> </div> <h3 class="font-medium text-yellow-800 mb-1">Premier Pas</h3> <p class="text-xs text-gray-600">Créez votre premier prompt</p> </div> <div class="achievement-card unlocked bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 p-4 rounded-lg text-center"> <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-3"> <i class="fas fa-users text-blue-500 text-2xl"></i> </div> <h3 class="font-medium text-blue-800 mb-1">Collaborateur</h3> <p class="text-xs text-gray-600">Partagez 5 prompts</p> </div> <div class="achievement-card locked bg-gradient-to-br from-purple-50 to-purple-100 border border-purple-200 p-4 rounded-lg text-center"> <div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-3"> <i class="fas fa-crown text-purple-500 text-2xl"></i> </div> <h3 class="font-medium text-purple-800 mb-1">Maître Prompt</h3> <p class="text-xs text-gray-600">Atteignez le niveau 10</p> </div> <div class="achievement-card locked bg-gradient-to-br from-green-50 to-green-100 border border-green-200 p-4 rounded-lg text-center"> <div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-3"> <i class="fas fa-heart text-green-500 text-2xl"></i> </div> <h3 class="font-medium text-green-800 mb-1">Favori</h3> <p class="text-xs text-gray-600">Obtenez 50 votes positifs</p> </div> </div> </section> </div> <!-- Prompt Assistant Modal --> <div id="assistant-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 modal-hidden"> <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col"> <div class="p-4 border-b border-gray-200 flex justify-between items-center bg-indigo-50"> <h3 class="text-lg font-semibold text-indigo-800"> <i class="fas fa-magic mr-2"></i> Assistant de Création de Prompts </h3> <button id="close-assistant" class="text-gray-500 hover:text-gray-700"> <i class="fas fa-times"></i> </button> </div> <div class="p-4 overflow-y-auto flex-1"> <div class="mb-4"> <label class="block text-gray-700 mb-2">Type de prompt</label> <select id="assistant-type" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500"> <option value="creative">Création de contenu</option> <option value="analysis">Analyse de texte</option> <option value="translation">Traduction</option> <option value="coding">Assistance au codage</option> <option value="summary">Résumé de texte</option> <option value="ideas">Génération d'idées</option> </select> </div> <div class="mb-4"> <label class="block text-gray-700 mb-2">Domaine spécifique</label> <input type="text" id="assistant-domain" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500" placeholder="Ex: marketing, programmation, médecine..."> </div> <div class="mb-4"> <label class="block text-gray-700 mb-2">Ton souhaité</label> <div class="flex flex-wrap gap-2"> <button data-tone="professional" class="tone-btn bg-gray-200 hover:bg-gray-300 px-3 py-1 rounded-lg text-sm">Professionnel</button> <button data-tone="friendly" class="tone-btn bg-gray-200 hover:bg-gray-300 px-3 py-1 rounded-lg text-sm">Amical</button> <button data-tone="academic" class="tone-btn bg-gray-200 hover:bg-gray-300 px-3 py-1 rounded-lg text-sm">Académique</button> <button data-tone="casual" class="tone-btn bg-gray-200 hover:bg-gray-300 px-3 py-1 rounded-lg text-sm">Décontracté</button> <button data-tone="authoritative" class="tone-btn bg-gray-200 hover:bg-gray-300 px-3 py-1 rounded-lg text-sm">Autoritaire</button> </div> </div> <div class="mb-4"> <label class="block text-gray-700 mb-2">Détails supplémentaires</label> <textarea id="assistant-details" rows="3" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500" placeholder="Décrivez ce que vous souhaitez obtenir..."></textarea> </div> <div class="bg-blue-50 p-4 rounded-lg mb-4"> <h4 class="font-medium text-blue-800 mb-2">Exemple de structure</h4> <div id="structure-example" class="text-sm text-gray-700"> "Agis comme un expert en [domaine]. [Description de la tâche]. Fournis le résultat sous forme de [format souhaité]. Inclus les éléments suivants: [éléments spécifiques]." </div> </div> </div> <div class="p-4 border-t border-gray-200 flex justify-end space-x-3 bg-gray-50"> <button id="cancel-assistant" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-100"> Annuler </button> <button id="generate-prompt" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700"> <i class="fas fa-bolt mr-2"></i> Générer Prompt </button> </div> </div> </div> <!-- Feedback Modal --> <div id="feedback-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 modal-hidden"> <div class="bg-white rounded-lg shadow-xl w-full max-w-md max-h-[90vh] flex flex-col"> <div class="p-4 border-b border-gray-200 flex justify-between items-center bg-indigo-50"> <h3 class="text-lg font-semibold text-indigo-800"> <i class="fas fa-comment-dots mr-2"></i> Votre Avis Nous Intéresse </h3> <button id="close-feedback" class="text-gray-500 hover:text-gray-700"> <i class="fas fa-times"></i> </button> </div> <div class="p-4 overflow-y-auto flex-1"> <div class="text-center mb-6"> <i class="fas fa-smile-beam text-4xl text-yellow-400 mb-3"></i> <h3 class="text-xl font-medium text-gray-800 mb-2">Comment s'est passée votre expérience ?</h3> <p class="text-gray-600">Votre feedback nous aide à améliorer PromptCraft</p> </div> <div class="space-y-4 mb-6"> <div class="feedback-option p-4 border rounded-lg cursor-pointer" data-rating="5"> <div class="flex items-center"> <div class="flex mr-3"> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> </div> <div> <h4 class="font-medium">Excellent</h4> <p class="text-sm text-gray-600">L'outil a parfaitement répondu à mes besoins</p> </div> </div> </div> <div class="feedback-option p-4 border rounded-lg cursor-pointer" data-rating="4"> <div class="flex items-center"> <div class="flex mr-3"> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-gray-300"></i> </div> <div> <h4 class="font-medium">Très bien</h4> <p class="text-sm text-gray-600">Bon outil avec quelques améliorations possibles</p> </div> </div> </div> <div class="feedback-option p-4 border rounded-lg cursor-pointer" data-rating="3"> <div class="flex items-center"> <div class="flex mr-3"> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-gray-300"></i> <i class="fas fa-star text-gray-300"></i> </div> <div> <h4 class="font-medium">Moyen</h4> <p class="text-sm text-gray-600">Des fonctionnalités manquent pour répondre à mes besoins</p> </div> </div> </div> <div class="feedback-option p-4 border rounded-lg cursor-pointer" data-rating="2"> <div class="flex items-center"> <div class="flex mr-3"> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-gray-300"></i> <i class="fas fa-star text-gray-300"></i> <i class="fas fa-star text-gray-300"></i> </div> <div> <h4 class="font-medium">Décevant</h4> <p class="text-sm text-gray-600">Difficile à utiliser ou résultats insatisfaisants</p> </div> </div> </div> <div class="feedback-option p-4 border rounded-lg cursor-pointer" data-rating="1"> <div class="flex items-center"> <div class="flex mr-3"> <i class="fas fa-star text-yellow-400"></i> <i class="fas fa-star text-gray-300"></i> <i class="fas fa-star text-gray-300"></i> <i class="fas fa-star text-gray-300"></i> <i class="fas fa-star text-gray-300"></i> </div> <div> <h4 class="font-medium">Mauvais</h4> <p class="text-sm text-gray-600">L'outil ne répond pas du tout à mes attentes</p> </div> </div> </div> </div> <div class="mb-4"> <label class="block text-gray-700 mb-2">Commentaires supplémentaires (optionnel)</label> <textarea id="feedback-comment" rows="3" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500" placeholder="Que pouvons-nous améliorer ?"></textarea> </div> <div class="flex items-center"> <input type="checkbox" id="contact-me" class="rounded text-indigo-600 focus:ring-indigo-500 mr-2"> <label for="contact-me" class="text-sm text-gray-700">Je souhaite être contacté pour en discuter</label> </div> </div> <div class="p-4 border-t border-gray-200 flex justify-end space-x-3 bg-gray-50"> <button id="skip-feedback" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-100"> Passer </button> <button id="submit-feedback" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700"> <i class="fas fa-paper-plane mr-2"></i> Envoyer </button> </div> </div> </div> <!-- Notification Container --> <div id="notification-container" class="fixed bottom-4 right-4 space-y-2 z-50"></div> <script> // Game State const gameState = { points: 0, level: 1, xp: 0, xpToNextLevel: 100, achievements: { firstPrompt: false, sharedPrompt: false, fiveStars: false, level10: false }, dailyChallenges: { createPrompt: false, sharePrompt: false, getFeedback: false }, feedbackGiven: false }; // Prompt database let promptDB = { personal: [], shared: [] }; // Initialize the game document.addEventListener('DOMContentLoaded', function() { // Update UI with game state updateGameUI(); // Token counter function countTokens(text) { return Math.ceil(text.length / 4); } function updateCounter() { const text = document.getElementById('prompt-content').value; const counter = document.getElementById('prompt-counter'); const tokenCount = countTokens(text); counter.textContent = `${tokenCount}/512`; if (tokenCount > 512) { counter.classList.add('token-limit'); } else { counter.classList.remove('token-limit'); } // Update potential scores updatePotentialScores(text); } // Calculate potential scores based on prompt content function updatePotentialScores(text) { const length = Math.min(text.length / 5, 100); const complexity = Math.min((text.split(' ').length / 2) + (countTokens(text) / 2), 100); const creativity = calculateCreativityScore(text); document.getElementById('length-score').textContent = Math.floor(length); document.getElementById('complexity-score').textContent = Math.floor(complexity); document.getElementById('creativity-score').textContent = Math.floor(creativity); } // Very basic creativity calculation function calculateCreativityScore(text) { const creativeWords = ['créatif', 'original', 'innovant', 'unique', 'imagine', 'conçois']; let score = 0; creativeWords.forEach(word => { if (text.toLowerCase().includes(word)) score += 10; }); // More points for longer, more complex prompts score += Math.min(text.length / 10, 50); return Math.min(score, 100); } // Update game UI function updateGameUI() { document.getElementById('user-points').textContent = gameState.points; document.getElementById('user-level').textContent = gameState.level; document.getElementById('level-progress').style.width = `${(gameState.xp / gameState.xpToNextLevel) * 100}%`; // Update active players (random between 5 and 20) document.getElementById('active-players').textContent = `${Math.floor(Math.random() * 15) + 5} joueurs`; } // Show notification function showNotification(message, icon, color) { const notification = document.createElement('div'); notification.className = `floating-notification bg-${color}-100 border border-${color}-200 text-${color}-800 px-4 py-3 rounded-lg flex items-center`; notification.innerHTML = `<i class="fas fa-${icon} mr-2"></i> ${message}`; const container = document.getElementById('notification-container'); container.appendChild(notification); setTimeout(() => { notification.remove(); }, 3000); } // Add points to player function addPoints(amount, reason) { gameState.points += amount; gameState.xp += amount; // Check for level up if (gameState.xp >= gameState.xpToNextLevel) { gameState.level++; gameState.xp = gameState.xp - gameState.xpToNextLevel; gameState.xpToNextLevel = Math.floor(gameState.xpToNextLevel * 1.2); showNotification(`Niveau ${gameState.level} atteint!`, 'trophy', 'yellow'); } updateGameUI(); showNotification(`+${amount} points: ${reason}`, 'coins', 'yellow'); } // Save prompt document.getElementById('save-prompt').addEventListener('click', function() { const title = document.getElementById('prompt-title').value.trim(); const content = document.getElementById('prompt-content').value.trim(); if (!content) { showNotification("Veuillez écrire un prompt avant de sauvegarder", 'exclamation-triangle', 'red'); return; } if (countTokens(content) > 512) { showNotification("Votre prompt dépasse la limite de 512 tokens", 'exclamation-triangle', 'red'); return; } // Add to personal database const newPrompt = { id: Date.now(), title: title || "Sans titre", content: content, timestamp: new Date().toISOString(), shared: false }; promptDB.personal.push(newPrompt); // Complete daily challenge if not already completed if (!gameState.dailyChallenges.createPrompt) { gameState.dailyChallenges.createPrompt = true; addPoints(10, "Défi du jour: Création"); } // Check for first prompt achievement if (!gameState.achievements.firstPrompt) { gameState.achievements.firstPrompt = true; addPoints(20, "Récompense: Premier Prompt"); } // Clear form document.getElementById('prompt-title').value = ""; document.getElementById('prompt-content').value = ""; updateCounter(); showNotification("Prompt sauvegardé avec succès", 'check-circle', 'green'); // Show feedback modal after first save (if not already shown) if (!gameState.feedbackGiven && promptDB.personal.length === 1) { setTimeout(() => { showFeedbackModal(); }, 2000); } }); // Share prompt document.getElementById('send-group').addEventListener('click', function() { const title = document.getElementById('prompt-title').value.trim(); const content = document.getElementById('prompt-content').value.trim(); if (!content) { showNotification("Veuillez écrire un prompt avant de partager", 'exclamation-triangle', 'red'); return; } if (countTokens(content) > 512) { showNotification("Votre prompt dépasse la limite de 512 tokens", 'exclamation-triangle', 'red'); return; } // Add to shared database const newPrompt = { id: Date.now(), title: title || "Sans titre", content: content, timestamp: new Date().toISOString(), shared: true, votes: 0, rating: 0 }; promptDB.shared.push(newPrompt); // Complete daily challenge if not already completed if (!gameState.dailyChallenges.sharePrompt) { gameState.dailyChallenges.sharePrompt = true; addPoints(25, "Défi du jour: Partage"); } // Check for sharing achievement if (!gameState.achievements.sharedPrompt && promptDB.shared.length >= 5) { gameState.achievements.sharedPrompt = true; addPoints(50, "Récompense: Collaborateur"); } // Clear form document.getElementById('prompt-title').value = ""; document.getElementById('prompt-content').value = ""; updateCounter(); showNotification("Prompt partagé avec la communauté", 'share-alt', 'blue'); // Update community feed updateCommunityFeed(); }); // Clear prompt document.getElementById('clear-prompt').addEventListener('click', function() { document.getElementById('prompt-title').value = ""; document.getElementById('prompt-content').value = ""; updateCounter(); }); // Random theme button document.getElementById('random-theme').addEventListener('click', function() { const themes = [ "Générateur de noms de produits", "Analyse de sentiment avancée", "Assistant de rédaction créative", "Extracteur d'informations clés", "Traducteur technique", "Générateur d'idées innovantes", "Assistant de codage", "Analyseur de texte juridique" ]; const randomTheme = themes[Math.floor(Math.random() * themes.length)]; document.getElementById('prompt-title').value = randomTheme; showNotification(`Thème suggéré: ${randomTheme}`, 'lightbulb', 'purple'); }); // Refresh feed document.getElementById('refresh-feed').addEventListener('click', function() { updateCommunityFeed(); // Rotate icon const icon = this.querySelector('i'); icon.classList.add('animate-spin'); setTimeout(() => { icon.classList.remove('animate-spin'); }, 500); }); // Update community feed with shared prompts function updateCommunityFeed() { const feed = document.getElementById('collaboration-feed'); feed.innerHTML = ""; if (promptDB.shared.length === 0) { feed.innerHTML = '<div class="p-4 rounded-lg bg-gray-50"><p class="text-gray-500 text-center">Aucun prompt partagé pour le moment</p></div>'; return; } // Sort by timestamp (newest first) const sortedShared = [...promptDB.shared].sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp)); sortedShared.forEach(prompt => { const promptDiv = document.createElement('div'); promptDiv.className = 'p-4 rounded-lg bg-gradient-to-r from-blue-50 to-green-50 border border-blue-200'; const title = document.createElement('h3'); title.className = 'font-medium text-blue-800 mb-2'; title.textContent = prompt.title; const content = document.createElement('p'); content.className = 'text-sm text-gray-600 mb-3'; content.textContent = prompt.content.substring(0, 200) + (prompt.content.length > 200 ? "..." : ""); const meta = document.createElement('div'); meta.className = 'flex justify-between items-center text-xs text-gray-500'; const userSpan = document.createElement('span'); userSpan.textContent = `Par: Vous`; const voteSpan = document.createElement('span'); voteSpan.textContent = `0 votes`; meta.appendChild(userSpan); meta.appendChild(voteSpan); promptDiv.appendChild(title); promptDiv.appendChild(content); promptDiv.appendChild(meta); feed.appendChild(promptDiv); }); } // Prompt Assistant Functions const assistantModal = document.getElementById('assistant-modal'); const openAssistantBtn = document.getElementById('open-assistant'); const closeAssistantBtn = document.getElementById('close-assistant'); const cancelAssistantBtn = document.getElementById('cancel-assistant'); const generatePromptBtn = document.getElementById('generate-prompt'); const toneButtons = document.querySelectorAll('.tone-btn'); // Open assistant modal openAssistantBtn.addEventListener('click', function() { assistantModal.classList.remove('modal-hidden'); assistantModal.classList.add('modal-visible'); }); // Close assistant modal function closeAssistant() { assistantModal.classList.remove('modal-visible'); assistantModal.classList.add('modal-hidden'); } closeAssistantBtn.addEventListener('click', closeAssistant); cancelAssistantBtn.addEventListener('click', closeAssistant); // Tone selection let selectedTone = 'professional'; toneButtons.forEach(button => { button.addEventListener('click', function() { toneButtons.forEach(btn => btn.classList.remove('bg-indigo-600', 'text-white')); this.classList.add('bg-indigo-600', 'text-white'); selectedTone = this.dataset.tone; updateStructureExample(); }); }); // Update structure example based on selections function updateStructureExample() { const type = document.getElementById('assistant-type').value; const domain = document.getElementById('assistant-domain').value || '[domaine]'; let example = ""; switch(type) { case 'creative': example = `"Agis comme un expert en ${domain}. Je veux que tu crées un contenu ${getToneDescription()}. Le contenu doit inclure: [éléments spécifiques]. Fournis le résultat sous forme de [format]."`; break; case 'analysis': example = `"Agis comme un expert en ${domain}. Analyse ce texte: [texte/input]. Fournis une analyse ${getToneDescription()} qui inclut: [points d'analyse]. Présente les résultats sous forme de [format]."`; break; case 'translation': example = `"Agis comme un traducteur professionnel spécialisé en ${domain}. Traduis ce texte de [langue] à [langue] en conservant un ton ${getToneDescription()}. Adapte les expressions idiomatiques et explique tes choix si nécessaire."`; break; case 'coding': example = `"Agis comme un développeur senior expert en ${domain}. ${getToneDescription().charAt(0).toUpperCase() + getToneDescription().slice(1)}-moi comment [décrire le problème/la tâche]. Fournis une solution complète avec: [exigences]. Explique chaque étape clairement."`; break; case 'summary': example = `"Agis comme un expert en ${domain}. Résume ce texte en conservant les points clés avec un ton ${getToneDescription()}. Le résumé doit faire [longueur] et inclure: [éléments requis]. Présente-le sous forme de [format]."`; break; case 'ideas': example = `"Agis comme un expert en ${domain} avec une grande créativité. Génère des idées ${getToneDescription()} pour [sujet/objectif]. Les idées doivent être: [critères]. Fournis au moins [nombre] options différentes avec leurs avantages."`; break; default: example = `"Agis comme un expert en ${domain}. [Description de la tâche]. Fournis le résultat sous forme de [format souhaité]. Inclus les éléments suivants: [éléments spécifiques]."`; } document.getElementById('structure-example').textContent = example; } function getToneDescription() { switch(selectedTone) { case 'professional': return 'professionnel et technique'; case 'friendly': return 'amical et accessible'; case 'academic': return 'académique et précis'; case 'casual': return 'décontracté et conversationnel'; case 'authoritative': return 'autoritaire et direct'; default: return 'professionnel'; } } // Update example when inputs change document.getElementById('assistant-type').addEventListener('change', updateStructureExample); document.getElementById('assistant-domain').addEventListener('input', updateStructureExample); // Generate prompt generatePromptBtn.addEventListener('click', function() { const type = document.getElementById('assistant-type').value; const domain = document.getElementById('assistant-domain').value; const details = document.getElementById('assistant-details').value; if (!domain) { showNotification("Veuillez spécifier un domaine", 'exclamation-triangle', 'red'); return; } let generatedPrompt = ""; switch(type) { case 'creative': generatedPrompt = `Agis comme un expert en ${domain} avec une grande créativité. ${details || "Crée un contenu original et engageant qui captivera le public cible."} Utilise un ton ${getToneDescription()}. Structure ta réponse de manière claire et inclut des exemples concrets si pertinent.`; break; case 'analysis': generatedPrompt = `Agis comme un analyste expert en ${domain}. ${details || "Analyse le texte ou les données fournies de manière approfondie."} Utilise un ton ${getToneDescription()}. Fournis une analyse structurée avec: 1) Points clés, 2) Observations détaillées, 3) Conclusions et recommandations.`; break; case 'translation': generatedPrompt = `Agis comme un traducteur professionnel spécialisé en ${domain}. ${details || "Traduis le texte fourni en conservant le sens original tout en l'adaptant culturellement."} Utilise un ton ${getToneDescription()}. Pour les termes techniques ou ambigus, fournis des alternatives avec des explications.`; break; case 'coding': generatedPrompt = `Agis comme un développeur senior expert en ${domain}. ${details || "Résous le problème de programmation suivant de manière optimale."} Utilise un ton ${getToneDescription()}. Fournis: 1) Une solution fonctionnelle, 2) Une explication claire du code, 3) Des alternatives possibles, 4) Des bonnes pratiques associées.`; break; case 'summary': generatedPrompt = `Agis comme un expert en synthèse d'information en ${domain}. ${details || "Résume le texte fourni en conservant l'essentiel."} Utilise un ton ${getToneDescription()}. Le résumé doit être concis mais complet, avec une hiérarchie claire des informations. Inclus les points clés et les conclusions principales.`; break; case 'ideas': generatedPrompt = `Agis comme un expert en innovation et créativité en ${domain}. ${details || "Génère des idées originales et pertinentes pour le sujet donné."} Utilise un ton ${getToneDescription()}. Fournis plusieurs options avec pour chacune: 1) Description, 2) Avantages, 3) Mise en œuvre possible, 4) Potentiels défis.`; break; default: generatedPrompt = `Agis comme un expert en ${domain}. ${details || "Effectue la tâche demandée avec professionnalisme et précision."} Utilise un ton ${getToneDescription()}. Structure ta réponse de manière claire et logique, en fournissant des détails pertinents et des exemples si nécessaire.`; } // Insert generated prompt into editor document.getElementById('prompt-content').value = generatedPrompt; updateCounter(); // Suggest a title if empty if (!document.getElementById('prompt-title').value) { const typeNames = { 'creative': 'Création de contenu', 'analysis': 'Analyse experte', 'translation': 'Traduction professionnelle', 'coding': 'Solution de codage', 'summary': 'Résumé expert', 'ideas': 'Génération d\'idées' }; document.getElementById('prompt-title').value = `${typeNames[type]} en ${domain}`; } closeAssistant(); showNotification("Prompt généré avec succès!", 'check-circle', 'green'); }); // Feedback Modal Functions const feedbackModal = document.getElementById('feedback-modal'); const closeFeedbackBtn = document.getElementById('close-feedback'); const skipFeedbackBtn = document.getElementById('skip-feedback'); const submitFeedbackBtn = document.getElementById('submit-feedback'); const feedbackOptions = document.querySelectorAll('.feedback-option'); let selectedRating = 0; // Show feedback modal function showFeedbackModal() { feedbackModal.classList.remove('modal-hidden'); feedbackModal.classList.add('modal-visible'); } // Close feedback modal function closeFeedback() { feedbackModal.classList.remove('modal-visible'); feedbackModal.classList.add('modal-hidden'); } closeFeedbackBtn.addEventListener('click', closeFeedback); skipFeedbackBtn.addEventListener('click', function() { gameState.feedbackGiven = true; closeFeedback(); showNotification("Merci d'utiliser PromptCraft!", 'heart', 'pink'); }); // Feedback option selection feedbackOptions.forEach(option => { option.addEventListener('click', function() { feedbackOptions.forEach(opt => opt.classList.remove('selected-feedback')); this.classList.add('selected-feedback'); selectedRating = parseInt(this.dataset.rating); }); }); // Submit feedback submitFeedbackBtn.addEventListener('click', function() { if (selectedRating === 0) { showNotification("Veuillez sélectionner une note", 'exclamation-triangle', 'red'); return; } const comment = document.getElementById('feedback-comment').value; const contactRequested = document.getElementById('contact-me').checked; // In a real app, you would send this data to your backend console.log("Feedback submitted:", { rating: selectedRating, comment: comment, contactRequested: contactRequested }); gameState.feedbackGiven = true; // Add points for giving feedback addPoints(15, "Merci pour votre feedback!"); closeFeedback(); if (selectedRating >= 4) { showNotification("Merci pour votre excellent feedback! ❤️", 'smile-beam', 'green'); } else { showNotification("Merci pour votre feedback. Nous ferons mieux!", 'frown', 'blue'); } }); // Initialize with some mock data function initializeMockData() { // Add some personal prompts promptDB.personal.push({ id: 1, title: "Analyse de sentiment", content: "Analyse le sentiment de ce texte et donne une note de 1 à 5, avec 1 étant très négatif et 5 très positif.", timestamp: "2023-06-10T09:15:00", shared: false }); // Add some shared prompts from other users promptDB.shared.push({ id: 2, title: "Analyse de sentiment avancée", content: "Analyse le sentiment de ce texte sur une échelle de 1 à 10, avec des sous-scores pour la colère, la joie, la tristesse et la surprise. Fournis une explication pour chaque score.", timestamp: "2023-06-11T11:20:00", shared: true, votes: 12, rating: 4.8 }); promptDB.shared.push({ id: 3, title: "Générateur de noms de produits", content: "Génère 5 noms créatifs pour un nouveau [type de produit]. Les noms doivent être accrocheurs, faciles à retenir et refléter les caractéristiques suivantes: [liste de caractéristiques].", timestamp: "2023-06-13T16:45:00", shared: true, votes: 5, rating: 4.2 }); // Set initial game state gameState.points = 35; gameState.xp = 35; gameState.achievements.firstPrompt = true; gameState.dailyChallenges.createPrompt = true; } // Initialize initializeMockData(); updateCommunityFeed(); updateGameUI(); updateStructureExample(); // Set up event listeners for prompt content document.getElementById('prompt-content').addEventListener('input', updateCounter); }); </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=olinux/milkida" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> </html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PromptCraft - Jeu Collaboratif de Création de Prompts</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>
.token-counter {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
background: rgba(0,0,0,0.1);
padding: 2px 6px;
border-radius: 10px;
font-size: 12px;
}
.token-limit {
background-color: #FECACA;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { background-color: #FECACA; }
50% { background-color: #FEE2E2; }
100% { background-color: #FECACA; }
}
.highlight {
background-color: #FEF08A;
transition: background-color 0.5s;
}
#collaboration-feed, #prompt-history {
max-height: 400px;
overflow-y: auto;
}
.rating-star {
cursor: pointer;
transition: transform 0.2s;
}
.rating-star:hover {
transform: scale(1.2);
}
.active-star {
color: #F59E0B;
}
.prompt-card {
transition: all 0.3s;
}
.prompt-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.selected-prompt {
border: 2px solid #3B82F6;
background-color: #EFF6FF;
}
.badge {
display: inline-block;
padding: 2px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 600;
}
.progress-bar {
height: 10px;
border-radius: 5px;
background-color: #E5E7EB;
}
.progress-fill {
height: 100%;
border-radius: 5px;
background-color: #10B981;
transition: width 0.5s ease;
}
.achievement-card {
transition: all 0.3s;
transform-style: preserve-3d;
}
.achievement-card:hover {
transform: translateY(-5px) rotateX(5deg);
}
.unlocked {
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(16, 185, 129, 0.2);
}
.locked {
filter: grayscale(80%);
opacity: 0.7;
}
.floating-notification {
animation: floatUp 3s forwards;
}
@keyframes floatUp {
0% { transform: translateY(0); opacity: 1; }
100% { transform: translateY(-100px); opacity: 0; }
}
#assistant-modal {
transition: all 0.3s ease;
}
.modal-hidden {