Yacine4154 commited on
Commit
30d8d56
·
verified ·
1 Parent(s): f11d6a0

l'horloge est legerement décalée. le 1 a la place du 12 etc... remplacer les formules par des equations tres simples

Browse files
Files changed (6) hide show
  1. README.md +9 -5
  2. components/footer.js +56 -0
  3. components/navbar.js +56 -0
  4. index.html +57 -19
  5. script.js +26 -0
  6. style.css +17 -18
README.md CHANGED
@@ -1,10 +1,14 @@
1
  ---
2
- title: Mathmagic Clock
3
- emoji: 📉
4
- colorFrom: purple
5
- colorTo: red
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: MathMagic Clock 🧙⏱️
3
+ colorFrom: pink
4
+ colorTo: green
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
14
+
components/footer.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>MathClock ⏰</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <style>
12
+ @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
13
+ </style>
14
+ </head>
15
+ <body class="bg-gray-100 min-h-screen flex flex-col">
16
+ <custom-navbar></custom-navbar>
17
+
18
+ <main class="flex-grow flex items-center justify-center p-4">
19
+ <div class="clock-container relative w-64 h-64 md:w-80 md:h-80 lg:w-96 lg:h-96 bg-white rounded-full shadow-xl border-8 border-indigo-500">
20
+ <!-- Clock face with math numbers -->
21
+ <div class="numbers absolute w-full h-full">
22
+ <!-- Each number position is calculated with transform -->
23
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 5%; left: 50%; transform: translateX(-50%);">1+1</div>
24
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 15%; left: 75%; transform: translateX(-50%);">2×1</div>
25
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 30%; left: 90%; transform: translateX(-50%);">6−3</div>
26
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 50%; left: 95%; transform: translateX(-50%);">12÷1</div>
27
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 70%; left: 90%; transform: translateX(-50%);">5+5</div>
28
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 85%; left: 75%; transform: translateX(-50%);">3×2</div>
29
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 95%; left: 50%; transform: translateX(-50%);">10−3</div>
30
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 85%; left: 25%; transform: translateX(-50%);">16÷2</div>
31
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 70%; left: 10%; transform: translateX(-50%);">3+6</div>
32
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 50%; left: 5%; transform: translateX(-50%);">20÷2</div>
33
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 30%; left: 10%; transform: translateX(-50%);">7+4</div>
34
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 15%; left: 25%; transform: translateX(-50%);">3×4</div>
35
+ </div>
36
+
37
+ <!-- Clock hands -->
38
+ <div class="clock-hands absolute w-full h-full">
39
+ <div class="hand hour-hand absolute bg-indigo-800 rounded-full origin-bottom" style="width: 6px; height: 30%; bottom: 50%; left: 50%; transform: translateX(-50%);"></div>
40
+ <div class="hand minute-hand absolute bg-indigo-600 rounded-full origin-bottom" style="width: 4px; height: 40%; bottom: 50%; left: 50%; transform: translateX(-50%);"></div>
41
+ <div class="hand second-hand absolute bg-red-500 rounded-full origin-bottom" style="width: 2px; height: 45%; bottom: 50%; left: 50%; transform: translateX(-50%);"></div>
42
+ <div class="center-dot absolute bg-indigo-500 rounded-full" style="width: 10px; height: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%);"></div>
43
+ </div>
44
+ </div>
45
+ </main>
46
+
47
+ <div class="current-time-display text-center mb-8 text-xl font-mono font-bold text-indigo-800"></div>
48
+
49
+ <custom-footer></custom-footer>
50
+
51
+ <script src="components/navbar.js"></script>
52
+ <script src="components/footer.js"></script>
53
+ <script src="script.js"></script>
54
+ <script>feather.replace();</script>
55
+ </body>
56
+ </html>
components/navbar.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ nav {
7
+ background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
8
+ padding: 1rem 2rem;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
13
+ }
14
+ .logo {
15
+ color: white;
16
+ font-weight: bold;
17
+ font-size: 1.25rem;
18
+ display: flex;
19
+ align-items: center;
20
+ gap: 0.5rem;
21
+ }
22
+ ul {
23
+ display: flex;
24
+ gap: 1.5rem;
25
+ list-style: none;
26
+ margin: 0;
27
+ padding: 0;
28
+ }
29
+ a {
30
+ color: white;
31
+ text-decoration: none;
32
+ transition: opacity 0.2s;
33
+ font-weight: 500;
34
+ display: flex;
35
+ align-items: center;
36
+ gap: 0.25rem;
37
+ }
38
+ a:hover {
39
+ opacity: 0.8;
40
+ text-decoration: underline;
41
+ }
42
+ </style>
43
+ <nav>
44
+ <div class="logo">
45
+ <i data-feather="clock"></i>
46
+ <span>MathClock</span>
47
+ </div>
48
+ <ul>
49
+ <li><a href="/"><i data-feather="home"></i> Home</a></li>
50
+ <li><a href="#"><i data-feather="info"></i> About</a></li>
51
+ </ul>
52
+ </nav>
53
+ `;
54
+ }
55
+ }
56
+ customElements.define('custom-navbar', CustomNavbar);
index.html CHANGED
@@ -1,19 +1,57 @@
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="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>MathClock </title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <style>
12
+ @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
13
+ </style>
14
+ </head>
15
+ <body class="bg-gray-100 min-h-screen flex flex-col">
16
+ <custom-navbar></custom-navbar>
17
+
18
+ <main class="flex-grow flex items-center justify-center p-4">
19
+ <div class="clock-container relative w-64 h-64 md:w-80 md:h-80 lg:w-96 lg:h-96 bg-white rounded-full shadow-xl border-8 border-indigo-500">
20
+ <!-- Clock face with math numbers -->
21
+ <div class="numbers absolute w-full h-full">
22
+ <!-- Each number position is calculated with transform (corrected positions) -->
23
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 5%; left: 50%; transform: translateX(-50%);">12÷1</div>
24
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 15%; left: 25%; transform: translateX(-50%);">2−1</div>
25
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 30%; left: 10%; transform: translateX(-50%);">1+2</div>
26
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 50%; left: 5%; transform: translateX(-50%);">4−1</div>
27
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 70%; left: 10%; transform: translateX(-50%);">2+3</div>
28
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 85%; left: 25%; transform: translateX(-50%);">6÷1</div>
29
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 95%; left: 50%; transform: translateX(-50%);">7−0</div>
30
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 85%; left: 75%; transform: translateX(-50%);">4+4</div>
31
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 70%; left: 90%; transform: translateX(-50%);">9×1</div>
32
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 50%; left: 95%; transform: translateX(-50%);">10−1</div>
33
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 30%; left: 90%; transform: translateX(-50%);">5+6</div>
34
+ <div class="number text-xs md:text-sm lg:text-base font-mono font-bold text-indigo-700 absolute" style="top: 15%; left: 75%; transform: translateX(-50%);">12×1</div>
35
+ </div>
36
+
37
+ <!-- Clock hands -->
38
+ <div class="clock-hands absolute w-full h-full">
39
+ <div class="hand hour-hand absolute bg-indigo-800 rounded-full origin-bottom" style="width: 6px; height: 30%; bottom: 50%; left: 50%; transform: translateX(-50%);"></div>
40
+ <div class="hand minute-hand absolute bg-indigo-600 rounded-full origin-bottom" style="width: 4px; height: 40%; bottom: 50%; left: 50%; transform: translateX(-50%);"></div>
41
+ <div class="hand second-hand absolute bg-red-500 rounded-full origin-bottom" style="width: 2px; height: 45%; bottom: 50%; left: 50%; transform: translateX(-50%);"></div>
42
+ <div class="center-dot absolute bg-indigo-500 rounded-full" style="width: 10px; height: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%);"></div>
43
+ </div>
44
+ </div>
45
+ </main>
46
+
47
+ <div class="current-time-display text-center mb-8 text-xl font-mono font-bold text-indigo-800"></div>
48
+
49
+ <custom-footer></custom-footer>
50
+
51
+ <script src="components/navbar.js"></script>
52
+ <script src="components/footer.js"></script>
53
+ <script src="script.js"></script>
54
+ <script>feather.replace();</script>
55
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
56
+ </body>
57
+ </html>
script.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Clock functionality
2
+ function updateClock() {
3
+ const now = new Date();
4
+ const hours = now.getHours() % 12;
5
+ const minutes = now.getMinutes();
6
+ const seconds = now.getSeconds();
7
+
8
+ // Calculate degrees for clock hands
9
+ // Corrected hour calculation (12 should be at top)
10
+ const hourDeg = ((hours * 30) + (minutes * 0.5)) - 180;
11
+ const minuteDeg = minutes * 6;
12
+ const secondDeg = seconds * 6;
13
+
14
+ // Rotate clock hands
15
+ document.querySelector('.hour-hand').style.transform = `translateX(-50%) rotate(${hourDeg}deg)`;
16
+ document.querySelector('.minute-hand').style.transform = `translateX(-50%) rotate(${minuteDeg}deg)`;
17
+ document.querySelector('.second-hand').style.transform = `translateX(-50%) rotate(${secondDeg}deg)`;
18
+
19
+ // Update digital display
20
+ const timeString = now.toLocaleTimeString();
21
+ document.querySelector('.current-time-display').textContent = `Current Time: ${timeString}`;
22
+ }
23
+
24
+ // Initialize clock and update every second
25
+ updateClock();
26
+ setInterval(updateClock, 1000);
style.css CHANGED
@@ -1,28 +1,27 @@
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
28
  }
 
 
 
 
 
 
 
1
+ /* Shared styles */
2
  body {
3
+ font-family: 'Space Mono', monospace;
 
4
  }
5
 
6
+ /* Clock animation */
7
+ .hand {
8
+ transition: transform 0.5s cubic-bezier(0.4, 2.3, 0.6, 1);
9
  }
10
 
11
+ .clock-container {
12
+ transition: transform 0.3s ease;
 
 
 
13
  }
14
 
15
+ .clock-container:hover {
16
+ transform: scale(1.02);
 
 
 
 
17
  }
18
 
19
+ .current-time-display {
20
+ animation: pulse 2s infinite;
21
  }
22
+
23
+ @keyframes pulse {
24
+ 0% { opacity: 0.8; }
25
+ 50% { opacity: 1; }
26
+ 100% { opacity: 0.8; }
27
+ }