KINGFAUS commited on
Commit
6b6beb4
·
verified ·
1 Parent(s): e6c0d50

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +209 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: King
3
- emoji: 🌖
4
- colorFrom: purple
5
  colorTo: green
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: king
3
+ emoji: 🐳
4
+ colorFrom: gray
5
  colorTo: green
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,209 @@
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="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Devine et Gagne - Jeu de Devinette</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 confetti {
11
+ 0% { transform: translateY(0) rotate(0deg); opacity: 1; }
12
+ 100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
13
+ }
14
+ .confetti {
15
+ position: absolute;
16
+ width: 10px;
17
+ height: 10px;
18
+ background-color: #f00;
19
+ animation: confetti 3s ease-in-out forwards;
20
+ }
21
+ .pulse {
22
+ animation: pulse 2s infinite;
23
+ }
24
+ @keyframes pulse {
25
+ 0% { transform: scale(1); }
26
+ 50% { transform: scale(1.05); }
27
+ 100% { transform: scale(1); }
28
+ }
29
+ </style>
30
+ </head>
31
+ <body class="bg-gradient-to-br from-purple-900 to-blue-800 min-h-screen text-white font-sans">
32
+ <div class="container mx-auto px-4 py-12">
33
+ <header class="text-center mb-12">
34
+ <h1 class="text-4xl md:text-5xl font-bold mb-4 text-yellow-300 pulse">
35
+ <i class="fas fa-trophy mr-3"></i>Devine et Gagne!
36
+ </h1>
37
+ <p class="text-xl text-blue-200">Devinez le bon nombre et tentez de gagner de l'argent!</p>
38
+ </header>
39
+
40
+ <main class="max-w-md mx-auto bg-white/10 backdrop-blur-sm rounded-xl shadow-2xl overflow-hidden p-8">
41
+ <!-- Étape 1: Jeu de devinette -->
42
+ <div id="game-step" class="text-center">
43
+ <h2 class="text-2xl font-semibold mb-6 text-yellow-200">Devinez un nombre entre 1 et 10</h2>
44
+ <div class="flex justify-center space-x-4 mb-8">
45
+ <button onclick="guessNumber(1)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">1</button>
46
+ <button onclick="guessNumber(2)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">2</button>
47
+ <button onclick="guessNumber(3)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">3</button>
48
+ <button onclick="guessNumber(4)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">4</button>
49
+ <button onclick="guessNumber(5)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">5</button>
50
+ </div>
51
+ <div class="flex justify-center space-x-4 mb-8">
52
+ <button onclick="guessNumber(6)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">6</button>
53
+ <button onclick="guessNumber(7)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">7</button>
54
+ <button onclick="guessNumber(8)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">8</button>
55
+ <button onclick="guessNumber(9)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">9</button>
56
+ <button onclick="guessNumber(10)" class="number-btn bg-blue-500 hover:bg-blue-600 w-12 h-12 rounded-full text-xl font-bold transition-all">10</button>
57
+ </div>
58
+ <div id="result" class="text-xl font-semibold min-h-8 mb-6"></div>
59
+ <div id="attempts" class="text-blue-200 mb-4">Tentatives restantes: 3</div>
60
+ </div>
61
+
62
+ <!-- Étape 2: Formulaire de gain -->
63
+ <div id="win-step" class="hidden text-center">
64
+ <div class="mb-6">
65
+ <i class="fas fa-gift text-6xl text-yellow-400 mb-4"></i>
66
+ <h2 class="text-3xl font-bold text-green-400 mb-2">Félicitations!</h2>
67
+ <p class="text-lg mb-4">Vous avez gagné <span class="font-bold text-yellow-300">1000 FCFA</span>!</p>
68
+ <p class="text-blue-200 mb-6">Entrez votre numéro de téléphone pour recevoir votre prix</p>
69
+ </div>
70
+ <form id="win-form" class="space-y-4">
71
+ <div>
72
+ <input type="tel" id="phone" placeholder="Votre numéro (ex: 771234567)"
73
+ class="w-full px-4 py-3 rounded-lg bg-white/20 border border-blue-300 focus:outline-none focus:ring-2 focus:ring-yellow-400 text-white placeholder-blue-200" required>
74
+ </div>
75
+ <button type="submit" class="w-full bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-4 rounded-lg transition-all">
76
+ <i class="fas fa-paper-plane mr-2"></i>Envoyer et Recevoir mon Prix
77
+ </button>
78
+ </form>
79
+ </div>
80
+
81
+ <!-- Étape 3: Confirmation -->
82
+ <div id="confirm-step" class="hidden text-center">
83
+ <i class="fas fa-check-circle text-6xl text-green-400 mb-6"></i>
84
+ <h2 class="text-2xl font-bold mb-4">Votre demande a été enregistrée!</h2>
85
+ <p class="mb-6">Nous vous contacterons sous peu pour vous faire gagner votre prix de <span class="font-bold text-yellow-300">1000 FCFA</span>.</p>
86
+ <button onclick="resetGame()" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-6 rounded-lg transition-all">
87
+ <i class="fas fa-redo mr-2"></i>Jouer à nouveau
88
+ </button>
89
+ </div>
90
+ </main>
91
+
92
+ <footer class="mt-16 text-center text-blue-200 text-sm">
93
+ <p>© 2023 Devine et Gagne. Tous droits réservés.</p>
94
+ <p class="mt-2">Jeu à but non lucratif - Réservé aux personnes majeures</p>
95
+ </footer>
96
+ </div>
97
+
98
+ <script>
99
+ // Variables du jeu
100
+ let secretNumber = Math.floor(Math.random() * 10) + 1;
101
+ let attemptsLeft = 3;
102
+ let hasWon = false;
103
+
104
+ // Éléments DOM
105
+ const gameStep = document.getElementById('game-step');
106
+ const winStep = document.getElementById('win-step');
107
+ const confirmStep = document.getElementById('confirm-step');
108
+ const resultDisplay = document.getElementById('result');
109
+ const attemptsDisplay = document.getElementById('attempts');
110
+ const winForm = document.getElementById('win-form');
111
+
112
+ // Fonction pour deviner un nombre
113
+ function guessNumber(number) {
114
+ if (hasWon || attemptsLeft <= 0) return;
115
+
116
+ const numberBtns = document.querySelectorAll('.number-btn');
117
+ numberBtns.forEach(btn => {
118
+ btn.disabled = true;
119
+ btn.classList.remove('bg-blue-500', 'hover:bg-blue-600');
120
+ btn.classList.add('bg-gray-500', 'cursor-not-allowed');
121
+ });
122
+
123
+ setTimeout(() => {
124
+ if (number === secretNumber) {
125
+ // Gagné
126
+ hasWon = true;
127
+ resultDisplay.innerHTML = `<span class="text-green-400"><i class="fas fa-check-circle mr-2"></i>Correct! Le nombre était ${secretNumber}!</span>`;
128
+ createConfetti();
129
+ setTimeout(() => {
130
+ gameStep.classList.add('hidden');
131
+ winStep.classList.remove('hidden');
132
+ }, 2000);
133
+ } else {
134
+ // Perdu
135
+ attemptsLeft--;
136
+ attemptsDisplay.textContent = `Tentatives restantes: ${attemptsLeft}`;
137
+ resultDisplay.innerHTML = `<span class="text-red-400"><i class="fas fa-times-circle mr-2"></i>Incorrect! Essayez encore.</span>`;
138
+
139
+ if (attemptsLeft <= 0) {
140
+ resultDisplay.innerHTML = `<span class="text-red-400"><i class="fas fa-sad-tear mr-2"></i>Désolé, le nombre était ${secretNumber}. Essayez à nouveau!</span>`;
141
+ setTimeout(() => {
142
+ resetGame();
143
+ }, 3000);
144
+ } else {
145
+ // Réactiver les boutons pour la prochaine tentative
146
+ numberBtns.forEach(btn => {
147
+ btn.disabled = false;
148
+ btn.classList.add('bg-blue-500', 'hover:bg-blue-600');
149
+ btn.classList.remove('bg-gray-500', 'cursor-not-allowed');
150
+ });
151
+ }
152
+ }
153
+ }, 500);
154
+ }
155
+
156
+ // Fonction pour créer des confettis
157
+ function createConfetti() {
158
+ const colors = ['#f00', '#0f0', '#00f', '#ff0', '#f0f', '#0ff'];
159
+ for (let i = 0; i < 50; i++) {
160
+ const confetti = document.createElement('div');
161
+ confetti.className = 'confetti';
162
+ confetti.style.left = Math.random() * 100 + 'vw';
163
+ confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
164
+ confetti.style.animationDuration = Math.random() * 2 + 2 + 's';
165
+ confetti.style.width = Math.random() * 10 + 5 + 'px';
166
+ confetti.style.height = Math.random() * 10 + 5 + 'px';
167
+ document.body.appendChild(confetti);
168
+
169
+ setTimeout(() => {
170
+ confetti.remove();
171
+ }, 3000);
172
+ }
173
+ }
174
+
175
+ // Gestion du formulaire de gain
176
+ winForm.addEventListener('submit', function(e) {
177
+ e.preventDefault();
178
+ const phoneNumber = document.getElementById('phone').value;
179
+
180
+ // Ici, vous pourriez envoyer le numéro à un serveur
181
+ console.log('Numéro enregistré:', phoneNumber);
182
+
183
+ winStep.classList.add('hidden');
184
+ confirmStep.classList.remove('hidden');
185
+ });
186
+
187
+ // Réinitialiser le jeu
188
+ function resetGame() {
189
+ secretNumber = Math.floor(Math.random() * 10) + 1;
190
+ attemptsLeft = 3;
191
+ hasWon = false;
192
+
193
+ resultDisplay.textContent = '';
194
+ attemptsDisplay.textContent = `Tentatives restantes: ${attemptsLeft}`;
195
+ document.getElementById('phone').value = '';
196
+
197
+ const numberBtns = document.querySelectorAll('.number-btn');
198
+ numberBtns.forEach(btn => {
199
+ btn.disabled = false;
200
+ btn.classList.add('bg-blue-500', 'hover:bg-blue-600');
201
+ btn.classList.remove('bg-gray-500', 'cursor-not-allowed');
202
+ });
203
+
204
+ confirmStep.classList.add('hidden');
205
+ gameStep.classList.remove('hidden');
206
+ }
207
+ </script>
208
+ <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=KINGFAUS/king" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
209
+ </html>