adrianoL commited on
Commit
cb6e833
·
verified ·
1 Parent(s): 0aed52a

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +251 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Tabuada M Gica
3
- emoji: 👁
4
- colorFrom: indigo
5
- colorTo: indigo
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: tabuada-m-gica
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: blue
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,251 @@
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="pt-br">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Calculadora de Tabuada</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
+ /* Efeito de onda animado no background */
11
+ body::before {
12
+ content: "";
13
+ position: fixed;
14
+ top: 0;
15
+ left: 0;
16
+ width: 100%;
17
+ height: 100%;
18
+ background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899);
19
+ background-size: 400% 400%;
20
+ animation: gradientBG 15s ease infinite;
21
+ z-index: -1;
22
+ opacity: 0.9;
23
+ }
24
+
25
+ @keyframes gradientBG {
26
+ 0% { background-position: 0% 50%; }
27
+ 50% { background-position: 100% 50%; }
28
+ 100% { background-position: 0% 50%; }
29
+ }
30
+
31
+ /* Animação de entrada para os resultados */
32
+ @keyframes fadeIn {
33
+ from { opacity: 0; transform: translateY(20px); }
34
+ to { opacity: 1; transform: translateY(0); }
35
+ }
36
+
37
+ .result-item {
38
+ animation: fadeIn 0.3s ease-out forwards;
39
+ animation-delay: calc(var(--order) * 0.05s);
40
+ }
41
+
42
+ /* Efeito de hover nos botões */
43
+ .btn-hover {
44
+ transition: all 0.3s ease;
45
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
46
+ }
47
+
48
+ .btn-hover:hover {
49
+ transform: translateY(-2px);
50
+ box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
51
+ }
52
+
53
+ .btn-hover:active {
54
+ transform: translateY(0);
55
+ }
56
+ </style>
57
+ </head>
58
+ <body class="min-h-screen flex items-center justify-center p-4">
59
+ <div class="w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden">
60
+ <!-- Cabeçalho -->
61
+ <div class="bg-gradient-to-r from-blue-500 to-purple-600 p-6 text-white">
62
+ <div class="flex items-center justify-between">
63
+ <h1 class="text-2xl font-bold">
64
+ <i class="fas fa-calculator mr-2"></i> Tabuada Mágica
65
+ </h1>
66
+ <button id="info-btn" class="text-white hover:text-blue-200 transition">
67
+ <i class="fas fa-info-circle text-xl"></i>
68
+ </button>
69
+ </div>
70
+ <p class="text-sm opacity-90 mt-1">Calcule a tabuada de qualquer número</p>
71
+ </div>
72
+
73
+ <!-- Corpo do aplicativo -->
74
+ <div class="p-6">
75
+ <div class="mb-6">
76
+ <label for="number" class="block text-sm font-medium text-gray-700 mb-1">
77
+ <i class="fas fa-hashtag mr-1 text-blue-500"></i> Digite um número:
78
+ </label>
79
+ <div class="flex">
80
+ <input
81
+ type="number"
82
+ id="number"
83
+ min="1"
84
+ class="flex-1 rounded-l-lg border border-gray-300 px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
85
+ placeholder="Ex: 7"
86
+ >
87
+ <button
88
+ id="calculate-btn"
89
+ class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-r-lg btn-hover transition"
90
+ >
91
+ <i class="fas fa-play mr-1"></i> Calcular
92
+ </button>
93
+ </div>
94
+ </div>
95
+
96
+ <div class="mb-4">
97
+ <label for="range" class="block text-sm font-medium text-gray-700 mb-1">
98
+ <i class="fas fa-sliders-h mr-1 text-purple-500"></i> Quantidade de multiplicações:
99
+ </label>
100
+ <div class="flex items-center">
101
+ <input
102
+ type="range"
103
+ id="range"
104
+ min="1"
105
+ max="20"
106
+ value="10"
107
+ class="flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"
108
+ >
109
+ <span id="range-value" class="ml-3 text-gray-700 font-medium w-8 text-center">10</span>
110
+ </div>
111
+ </div>
112
+
113
+ <!-- Resultados -->
114
+ <div id="results" class="mt-8 space-y-2 hidden">
115
+ <h3 class="text-lg font-semibold text-gray-800 border-b pb-2 flex items-center">
116
+ <i class="fas fa-list-ol mr-2 text-green-500"></i> Resultados
117
+ </h3>
118
+ <div id="results-container" class="grid grid-cols-2 sm:grid-cols-3 gap-3"></div>
119
+ </div>
120
+ </div>
121
+
122
+ <!-- Rodapé -->
123
+ <div class="bg-gray-50 px-6 py-3 text-center text-sm text-gray-600">
124
+ <p>Pressione Enter para calcular</p>
125
+ </div>
126
+ </div>
127
+
128
+ <!-- Modal de informações -->
129
+ <div id="info-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
130
+ <div class="bg-white rounded-lg max-w-md w-full mx-4 p-6">
131
+ <div class="flex justify-between items-center mb-4">
132
+ <h3 class="text-xl font-bold text-gray-800">
133
+ <i class="fas fa-info-circle text-blue-500 mr-2"></i> Sobre o App
134
+ </h3>
135
+ <button id="close-modal" class="text-gray-500 hover:text-gray-700">
136
+ <i class="fas fa-times"></i>
137
+ </button>
138
+ </div>
139
+ <div class="space-y-3 text-gray-700">
140
+ <p>Este aplicativo calcula a tabuada de qualquer número inteiro positivo.</p>
141
+ <p><span class="font-semibold">Como usar:</span></p>
142
+ <ol class="list-decimal pl-5 space-y-1">
143
+ <li>Digite um número no campo</li>
144
+ <li>Ajuste quantas multiplicações deseja ver</li>
145
+ <li>Clique em "Calcular" ou pressione Enter</li>
146
+ </ol>
147
+ <p class="pt-2">Você pode ver a tabuada de 1 até 20 multiplicações.</p>
148
+ </div>
149
+ <div class="mt-6 flex justify-center">
150
+ <button id="close-modal-btn" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg btn-hover transition">
151
+ <i class="fas fa-check mr-1"></i> Entendi
152
+ </button>
153
+ </div>
154
+ </div>
155
+ </div>
156
+
157
+ <script>
158
+ document.addEventListener('DOMContentLoaded', function() {
159
+ // Elementos do DOM
160
+ const numberInput = document.getElementById('number');
161
+ const calculateBtn = document.getElementById('calculate-btn');
162
+ const rangeInput = document.getElementById('range');
163
+ const rangeValue = document.getElementById('range-value');
164
+ const resultsContainer = document.getElementById('results-container');
165
+ const resultsSection = document.getElementById('results');
166
+ const infoBtn = document.getElementById('info-btn');
167
+ const infoModal = document.getElementById('info-modal');
168
+ const closeModal = document.getElementById('close-modal');
169
+ const closeModalBtn = document.getElementById('close-modal-btn');
170
+
171
+ // Atualizar valor do range
172
+ rangeInput.addEventListener('input', function() {
173
+ rangeValue.textContent = this.value;
174
+ });
175
+
176
+ // Calcular tabuada
177
+ function calculateTimesTable() {
178
+ const number = parseInt(numberInput.value);
179
+ const range = parseInt(rangeInput.value);
180
+
181
+ if (isNaN(number) || number <= 0) {
182
+ alert('Por favor, digite um número válido maior que zero.');
183
+ return;
184
+ }
185
+
186
+ // Limpar resultados anteriores
187
+ resultsContainer.innerHTML = '';
188
+
189
+ // Gerar e exibir resultados
190
+ for (let i = 1; i <= range; i++) {
191
+ const result = number * i;
192
+ const resultItem = document.createElement('div');
193
+ resultItem.className = 'bg-gray-50 p-3 rounded-lg border border-gray-200 result-item';
194
+ resultItem.style.setProperty('--order', i);
195
+ resultItem.innerHTML = `
196
+ <div class="flex items-center">
197
+ <span class="bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded-full mr-2">${i}</span>
198
+ <span class="text-gray-700">${number} × ${i} =</span>
199
+ <span class="ml-auto font-bold text-blue-600">${result}</span>
200
+ </div>
201
+ `;
202
+ resultsContainer.appendChild(resultItem);
203
+ }
204
+
205
+ // Mostrar seção de resultados
206
+ resultsSection.classList.remove('hidden');
207
+
208
+ // Rolagem suave para os resultados
209
+ setTimeout(() => {
210
+ resultsSection.scrollIntoView({ behavior: 'smooth' });
211
+ }, 300);
212
+ }
213
+
214
+ // Event listeners
215
+ calculateBtn.addEventListener('click', calculateTimesTable);
216
+
217
+ numberInput.addEventListener('keypress', function(e) {
218
+ if (e.key === 'Enter') {
219
+ calculateTimesTable();
220
+ }
221
+ });
222
+
223
+ // Modal de informações
224
+ infoBtn.addEventListener('click', function() {
225
+ infoModal.classList.remove('hidden');
226
+ document.body.style.overflow = 'hidden';
227
+ });
228
+
229
+ const closeModalFunc = function() {
230
+ infoModal.classList.add('hidden');
231
+ document.body.style.overflow = '';
232
+ };
233
+
234
+ closeModal.addEventListener('click', closeModalFunc);
235
+ closeModalBtn.addEventListener('click', closeModalFunc);
236
+
237
+ // Fechar modal ao clicar fora
238
+ infoModal.addEventListener('click', function(e) {
239
+ if (e.target === infoModal) {
240
+ closeModalFunc();
241
+ }
242
+ });
243
+
244
+ // Efeito de foco no input ao carregar
245
+ setTimeout(() => {
246
+ numberInput.focus();
247
+ }, 500);
248
+ });
249
+ </script>
250
+ <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=adrianoL/tabuada-m-gica" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
251
+ </html>