Kraft102 commited on
Commit
8f231d6
·
verified ·
1 Parent(s): a4218a7

BYG ET SIMPELT SPIL

Browse files
Files changed (6) hide show
  1. README.md +7 -4
  2. components/footer.js +108 -0
  3. components/header.js +87 -0
  4. index.html +66 -19
  5. script.js +99 -0
  6. style.css +60 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Spin Win Simplicity
3
- emoji: 💻
4
- colorFrom: red
5
  colorTo: pink
 
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: Spin & Win Simplicity 🎰
3
+ colorFrom: purple
 
4
  colorTo: pink
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).
components/footer.js ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background-color: #1E293B;
8
+ color: white;
9
+ padding: 2rem 1rem;
10
+ margin-top: 3rem;
11
+ }
12
+
13
+ .footer-content {
14
+ max-width: 1200px;
15
+ margin: 0 auto;
16
+ display: grid;
17
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
18
+ gap: 2rem;
19
+ }
20
+
21
+ .footer-section h3 {
22
+ font-size: 1.2rem;
23
+ margin-bottom: 1rem;
24
+ font-weight: 600;
25
+ }
26
+
27
+ .footer-section p, .footer-section a {
28
+ color: #CBD5E1;
29
+ margin-bottom: 0.5rem;
30
+ display: block;
31
+ text-decoration: none;
32
+ }
33
+
34
+ .footer-section a:hover {
35
+ color: white;
36
+ }
37
+
38
+ .social-links {
39
+ display: flex;
40
+ gap: 1rem;
41
+ margin-top: 1rem;
42
+ }
43
+
44
+ .social-links a {
45
+ color: white;
46
+ background-color: #334155;
47
+ width: 2.5rem;
48
+ height: 2.5rem;
49
+ border-radius: 50%;
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ transition: all 0.3s ease;
54
+ }
55
+
56
+ .social-links a:hover {
57
+ transform: translateY(-3px);
58
+ background-color: #4F46E5;
59
+ }
60
+
61
+ .copyright {
62
+ text-align: center;
63
+ margin-top: 2rem;
64
+ padding-top: 1rem;
65
+ border-top: 1px solid #334155;
66
+ color: #94A3B8;
67
+ font-size: 0.9rem;
68
+ }
69
+
70
+ @media (max-width: 768px) {
71
+ .footer-content {
72
+ grid-template-columns: 1fr;
73
+ }
74
+ }
75
+ </style>
76
+ <footer>
77
+ <div class="footer-content">
78
+ <div class="footer-section">
79
+ <h3>Spin & Win</h3>
80
+ <p>A simple, fun game of chance with minimalist design for maximum enjoyment.</p>
81
+ <div class="social-links">
82
+ <a href="#"><i data-feather="facebook"></i></a>
83
+ <a href="#"><i data-feather="twitter"></i></a>
84
+ <a href="#"><i data-feather="instagram"></i></a>
85
+ </div>
86
+ </div>
87
+ <div class="footer-section">
88
+ <h3>Quick Links</h3>
89
+ <a href="#">Home</a>
90
+ <a href="#">About</a>
91
+ <a href="#">Prizes</a>
92
+ <a href="#">Terms</a>
93
+ </div>
94
+ <div class="footer-section">
95
+ <h3>Contact</h3>
96
+ <a href="#"><i data-feather="mail"></i> hello@spinandwin.com</a>
97
+ <a href="#"><i data-feather="phone"></i> +1 234 567 890</a>
98
+ </div>
99
+ </div>
100
+ <div class="copyright">
101
+ &copy; ${new Date().getFullYear()} Spin & Win Simplicity. All rights reserved.
102
+ </div>
103
+ </footer>
104
+ `;
105
+ }
106
+ }
107
+
108
+ customElements.define('custom-footer', CustomFooter);
components/header.js ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomHeader extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ header {
7
+ background: linear-gradient(90deg, #7C3AED 0%, #4F46E5 100%);
8
+ color: white;
9
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
10
+ }
11
+
12
+ nav {
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ padding: 1rem 2rem;
17
+ max-width: 1200px;
18
+ margin: 0 auto;
19
+ }
20
+
21
+ .logo {
22
+ font-size: 1.5rem;
23
+ font-weight: 700;
24
+ display: flex;
25
+ align-items: center;
26
+ gap: 0.5rem;
27
+ }
28
+
29
+ .nav-links {
30
+ display: flex;
31
+ gap: 2rem;
32
+ }
33
+
34
+ .nav-links a {
35
+ color: white;
36
+ text-decoration: none;
37
+ font-weight: 500;
38
+ transition: all 0.3s ease;
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 0.3rem;
42
+ }
43
+
44
+ .nav-links a:hover {
45
+ opacity: 0.8;
46
+ transform: translateY(-2px);
47
+ }
48
+
49
+ @media (max-width: 768px) {
50
+ nav {
51
+ flex-direction: column;
52
+ gap: 1rem;
53
+ padding: 1rem;
54
+ }
55
+
56
+ .nav-links {
57
+ gap: 1rem;
58
+ }
59
+ }
60
+ </style>
61
+ <header>
62
+ <nav>
63
+ <div class="logo">
64
+ <i data-feather="zap"></i>
65
+ <span>Spin & Win</span>
66
+ </div>
67
+ <div class="nav-links">
68
+ <a href="#">
69
+ <i data-feather="home"></i>
70
+ Home
71
+ </a>
72
+ <a href="#">
73
+ <i data-feather="info"></i>
74
+ About
75
+ </a>
76
+ <a href="#">
77
+ <i data-feather="gift"></i>
78
+ Prizes
79
+ </a>
80
+ </div>
81
+ </nav>
82
+ </header>
83
+ `;
84
+ }
85
+ }
86
+
87
+ customElements.define('custom-header', CustomHeader);
index.html CHANGED
@@ -1,19 +1,66 @@
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>Spin & Win Simplicity</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=Poppins:wght@300;400;600;700&display=swap');
13
+ </style>
14
+ </head>
15
+ <body class="font-[Poppins] bg-gradient-to-br from-gray-100 to-gray-200 min-h-screen">
16
+ <custom-header></custom-header>
17
+
18
+ <main class="container mx-auto px-4 py-12">
19
+ <div class="max-w-4xl mx-auto text-center">
20
+ <h1 class="text-5xl font-bold text-gray-800 mb-6">Spin & Win</h1>
21
+ <p class="text-xl text-gray-600 mb-12">A simple, fun game of chance with minimalist design</p>
22
+
23
+ <div class="bg-white rounded-2xl shadow-xl p-8 mb-12">
24
+ <div class="wheel-container relative w-64 h-64 mx-auto mb-8">
25
+ <div class="wheel w-full h-full rounded-full border-8 border-gray-200 relative overflow-hidden transition-transform duration-5000 ease-out">
26
+ <!-- Wheel segments will be added by JS -->
27
+ </div>
28
+ <div class="wheel-pointer absolute top-0 left-1/2 -translate-x-1/2 w-8 h-8">
29
+ <div class="triangle w-0 h-0 border-l-8 border-r-8 border-b-16 border-l-transparent border-r-transparent border-b-red-500 mx-auto"></div>
30
+ </div>
31
+ </div>
32
+
33
+ <button id="spin-btn" class="bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600 text-white font-bold py-3 px-8 rounded-full shadow-lg transition-all duration-300 transform hover:scale-105">
34
+ SPIN NOW
35
+ </button>
36
+ </div>
37
+
38
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
39
+ <div class="bg-white p-6 rounded-xl shadow-md">
40
+ <i data-feather="award" class="w-12 h-12 text-purple-500 mx-auto mb-4"></i>
41
+ <h3 class="text-xl font-semibold mb-2">Simple Rules</h3>
42
+ <p class="text-gray-600">Just spin and see what you win. No complicated rules!</p>
43
+ </div>
44
+ <div class="bg-white p-6 rounded-xl shadow-md">
45
+ <i data-feather="zap" class="w-12 h-12 text-blue-500 mx-auto mb-4"></i>
46
+ <h3 class="text-xl font-semibold mb-2">Instant Fun</h3>
47
+ <p class="text-gray-600">Get your adrenaline pumping with every spin.</p>
48
+ </div>
49
+ <div class="bg-white p-6 rounded-xl shadow-md">
50
+ <i data-feather="smile" class="w-12 h-12 text-green-500 mx-auto mb-4"></i>
51
+ <h3 class="text-xl font-semibold mb-2">Pure Enjoyment</h3>
52
+ <p class="text-gray-600">Designed for maximum enjoyment with minimal fuss.</p>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </main>
57
+
58
+ <custom-footer></custom-footer>
59
+
60
+ <script src="components/header.js"></script>
61
+ <script src="components/footer.js"></script>
62
+ <script src="script.js"></script>
63
+ <script>feather.replace();</script>
64
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
65
+ </body>
66
+ </html>
script.js ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Wheel configuration
3
+ const prizes = [
4
+ { text: "Try Again", color: "#F87171" },
5
+ { text: "10% Off", color: "#60A5FA" },
6
+ { text: "Free Spin", color: "#34D399" },
7
+ { text: "20% Off", color: "#A78BFA" },
8
+ { text: "Jackpot", color: "#FBBF24" },
9
+ { text: "5% Off", color: "#F472B6" }
10
+ ];
11
+
12
+ const wheel = document.querySelector('.wheel');
13
+ const spinBtn = document.getElementById('spin-btn');
14
+ let canSpin = true;
15
+
16
+ // Create wheel segments
17
+ function createWheelSegments() {
18
+ const segmentAngle = 360 / prizes.length;
19
+
20
+ prizes.forEach((prize, index) => {
21
+ const segment = document.createElement('div');
22
+ segment.className = 'wheel-segment';
23
+ segment.style.transform = `rotate(${segmentAngle * index}deg)`;
24
+ segment.style.backgroundColor = prize.color;
25
+
26
+ const text = document.createElement('div');
27
+ text.className = 'transform -rotate-45 translate-x-8 translate-y-8';
28
+ text.textContent = prize.text;
29
+ segment.appendChild(text);
30
+
31
+ wheel.appendChild(segment);
32
+ });
33
+ }
34
+
35
+ // Spin the wheel
36
+ function spinWheel() {
37
+ if (!canSpin) return;
38
+
39
+ canSpin = false;
40
+ spinBtn.disabled = true;
41
+
42
+ // Add spinning class
43
+ wheel.classList.add('spinning');
44
+
45
+ // Determine result after spin
46
+ setTimeout(() => {
47
+ const randomPrize = Math.floor(Math.random() * prizes.length);
48
+ showResult(prizes[randomPrize]);
49
+
50
+ // Reset wheel
51
+ setTimeout(() => {
52
+ wheel.classList.remove('spinning');
53
+ wheel.style.transform = `rotate(${0}deg)`;
54
+ canSpin = true;
55
+ spinBtn.disabled = false;
56
+ }, 500);
57
+ }, 5500);
58
+ }
59
+
60
+ // Show result modal
61
+ function showResult(prize) {
62
+ const modal = document.createElement('div');
63
+ modal.className = 'modal';
64
+ modal.innerHTML = `
65
+ <div class="modal-content">
66
+ <h2 class="text-3xl font-bold mb-4">${prize.text}!</h2>
67
+ <p class="text-xl mb-6">${getPrizeMessage(prize.text)}</p>
68
+ <button class="close-modal bg-${prize.color} hover:bg-opacity-90 text-white font-bold py-2 px-6 rounded-full">
69
+ Awesome!
70
+ </button>
71
+ </div>
72
+ `;
73
+
74
+ document.body.appendChild(modal);
75
+ modal.style.display = 'flex';
76
+
77
+ modal.querySelector('.close-modal').addEventListener('click', () => {
78
+ modal.style.display = 'none';
79
+ setTimeout(() => modal.remove(), 300);
80
+ });
81
+ }
82
+
83
+ // Get prize message
84
+ function getPrizeMessage(prize) {
85
+ const messages = {
86
+ "Try Again": "Better luck next time!",
87
+ "5% Off": "A small discount for your next spin!",
88
+ "10% Off": "Nice! You got a decent discount.",
89
+ "20% Off": "Great! That's a solid discount.",
90
+ "Free Spin": "You get to spin again for free!",
91
+ "Jackpot": "Congratulations! You hit the jackpot!"
92
+ };
93
+ return messages[prize] || "Thanks for playing!";
94
+ }
95
+
96
+ // Initialize
97
+ createWheelSegments();
98
+ spinBtn.addEventListener('click', spinWheel);
99
+ });
style.css CHANGED
@@ -1,28 +1,70 @@
 
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
+ /* Base styles */
2
  body {
3
+ font-family: 'Poppins', sans-serif;
 
4
  }
5
 
6
+ /* Wheel animation */
7
+ @keyframes spin {
8
+ 0% {
9
+ transform: rotate(0deg);
10
+ }
11
+ 100% {
12
+ transform: rotate(3600deg);
13
+ }
14
  }
15
 
16
+ .wheel {
17
+ transform: rotate(0deg);
 
 
 
18
  }
19
 
20
+ .wheel.spinning {
21
+ animation: spin 5s cubic-bezier(0.17, 0.67, 0.21, 0.99) forwards;
 
 
 
 
22
  }
23
 
24
+ /* Wheel segments */
25
+ .wheel-segment {
26
+ position: absolute;
27
+ width: 50%;
28
+ height: 50%;
29
+ transform-origin: bottom right;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ color: white;
34
+ font-weight: bold;
35
+ overflow: hidden;
36
  }
37
+
38
+ /* Result modal */
39
+ .modal {
40
+ display: none;
41
+ position: fixed;
42
+ top: 0;
43
+ left: 0;
44
+ width: 100%;
45
+ height: 100%;
46
+ background-color: rgba(0, 0, 0, 0.5);
47
+ z-index: 100;
48
+ justify-content: center;
49
+ align-items: center;
50
+ }
51
+
52
+ .modal-content {
53
+ background-color: white;
54
+ padding: 2rem;
55
+ border-radius: 1rem;
56
+ max-width: 90%;
57
+ text-align: center;
58
+ animation: fadeIn 0.3s ease-out;
59
+ }
60
+
61
+ @keyframes fadeIn {
62
+ from {
63
+ opacity: 0;
64
+ transform: translateY(-20px);
65
+ }
66
+ to {
67
+ opacity: 1;
68
+ transform: translateY(0);
69
+ }
70
+ }