x3HeadedMonkey commited on
Commit
6ddda98
·
verified ·
1 Parent(s): 143a9e8

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +273 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Faret
3
- emoji: 📚
4
- colorFrom: blue
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: faret
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: gray
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,273 @@
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>Fart Piano</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
+ .piano-key {
11
+ transition: all 0.1s ease;
12
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
13
+ }
14
+
15
+ .white-key {
16
+ position: relative;
17
+ z-index: 1;
18
+ }
19
+
20
+ .black-key {
21
+ position: absolute;
22
+ z-index: 2;
23
+ transform: translateX(-50%);
24
+ }
25
+
26
+ .piano-key:active, .piano-key.active {
27
+ transform: translateY(4px);
28
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
29
+ }
30
+
31
+ .white-key:active, .white-key.active {
32
+ background-color: #e5e7eb !important;
33
+ }
34
+
35
+ .black-key:active, .black-key.active {
36
+ background-color: #111827 !important;
37
+ }
38
+
39
+ .fart-cloud {
40
+ position: absolute;
41
+ width: 60px;
42
+ height: 40px;
43
+ background-color: rgba(0, 0, 0, 0.1);
44
+ border-radius: 50%;
45
+ animation: float 2s ease-out forwards;
46
+ opacity: 0;
47
+ }
48
+
49
+ @keyframes float {
50
+ 0% {
51
+ transform: translateY(0) scale(0.5);
52
+ opacity: 0.8;
53
+ }
54
+ 100% {
55
+ transform: translateY(-100px) scale(1.5);
56
+ opacity: 0;
57
+ }
58
+ }
59
+ </style>
60
+ </head>
61
+ <body class="bg-green-100 min-h-screen flex flex-col items-center justify-center p-4">
62
+ <div class="text-center mb-8">
63
+ <h1 class="text-4xl font-bold text-green-800 mb-2">Fart Piano</h1>
64
+ <p class="text-lg text-green-700">Press keys or click/tap to play hilarious fart sounds!</p>
65
+ <div class="mt-4 flex justify-center space-x-4">
66
+ <button id="random-btn" class="bg-yellow-500 hover:bg-yellow-600 text-white font-bold py-2 px-4 rounded-full transition">
67
+ <i class="fas fa-random mr-2"></i>Random Fart
68
+ </button>
69
+ <button id="combo-btn" class="bg-purple-500 hover:bg-purple-600 text-white font-bold py-2 px-4 rounded-full transition">
70
+ <i class="fas fa-bolt mr-2"></i>Fart Combo
71
+ </button>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="relative w-full max-w-3xl h-64 mb-12">
76
+ <!-- Piano container -->
77
+ <div class="relative h-full flex">
78
+ <!-- White keys -->
79
+ <div class="flex flex-1 relative">
80
+ <!-- C -->
81
+ <div data-note="C" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
82
+ <span class="text-gray-600 font-bold">C</span>
83
+ </div>
84
+ <!-- D -->
85
+ <div data-note="D" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
86
+ <span class="text-gray-600 font-bold">D</span>
87
+ </div>
88
+ <!-- E -->
89
+ <div data-note="E" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
90
+ <span class="text-gray-600 font-bold">E</span>
91
+ </div>
92
+ <!-- F -->
93
+ <div data-note="F" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
94
+ <span class="text-gray-600 font-bold">F</span>
95
+ </div>
96
+ <!-- G -->
97
+ <div data-note="G" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
98
+ <span class="text-gray-600 font-bold">G</span>
99
+ </div>
100
+ <!-- A -->
101
+ <div data-note="A" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
102
+ <span class="text-gray-600 font-bold">A</span>
103
+ </div>
104
+ <!-- B -->
105
+ <div data-note="B" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
106
+ <span class="text-gray-600 font-bold">B</span>
107
+ </div>
108
+ <!-- C (high) -->
109
+ <div data-note="C-high" class="white-key piano-key bg-white border border-gray-300 rounded-b-lg flex-1 flex flex-col justify-end items-center pb-2 cursor-pointer" style="z-index: 1;">
110
+ <span class="text-gray-600 font-bold">C</span>
111
+ </div>
112
+ </div>
113
+
114
+ <!-- Black keys -->
115
+ <div class="absolute top-0 left-0 w-full h-2/3 flex pointer-events-none" style="z-index: 2;">
116
+ <!-- C# -->
117
+ <div class="flex-1 relative">
118
+ <div data-note="C#" class="black-key piano-key bg-gray-900 rounded-b-lg w-8 h-32 mx-auto cursor-pointer" style="left: 70%;"></div>
119
+ </div>
120
+ <!-- D# -->
121
+ <div class="flex-1 relative">
122
+ <div data-note="D#" class="black-key piano-key bg-gray-900 rounded-b-lg w-8 h-32 mx-auto cursor-pointer" style="left: 70%;"></div>
123
+ </div>
124
+ <!-- F# -->
125
+ <div class="flex-1 relative">
126
+ <div data-note="F#" class="black-key piano-key bg-gray-900 rounded-b-lg w-8 h-32 mx-auto cursor-pointer" style="left: 70%;"></div>
127
+ </div>
128
+ <!-- G# -->
129
+ <div class="flex-1 relative">
130
+ <div data-note="G#" class="black-key piano-key bg-gray-900 rounded-b-lg w-8 h-32 mx-auto cursor-pointer" style="left: 70%;"></div>
131
+ </div>
132
+ <!-- A# -->
133
+ <div class="flex-1 relative">
134
+ <div data-note="A#" class="black-key piano-key bg-gray-900 rounded-b-lg w-8 h-32 mx-auto cursor-pointer" style="left: 70%;"></div>
135
+ </div>
136
+ <!-- Empty space for B and high C -->
137
+ <div class="flex-1"></div>
138
+ <div class="flex-1"></div>
139
+ </div>
140
+ </div>
141
+ </div>
142
+
143
+ <div class="text-center text-gray-700">
144
+ <p class="mb-2">Keyboard controls: A S D F G H J K (white keys) and W E T Y U (black keys)</p>
145
+ <p class="text-sm text-gray-500">Warning: This piano may cause uncontrollable laughter!</p>
146
+ </div>
147
+
148
+ <audio id="C" src="https://www.myinstants.com/media/sounds/fart.mp3"></audio>
149
+ <audio id="C#" src="https://www.myinstants.com/media/sounds/fart-01.mp3"></audio>
150
+ <audio id="D" src="https://www.myinstants.com/media/sounds/fart-02.mp3"></audio>
151
+ <audio id="D#" src="https://www.myinstants.com/media/sounds/fart-03.mp3"></audio>
152
+ <audio id="E" src="https://www.myinstants.com/media/sounds/fart-04.mp3"></audio>
153
+ <audio id="F" src="https://www.myinstants.com/media/sounds/fart-05.mp3"></audio>
154
+ <audio id="F#" src="https://www.myinstants.com/media/sounds/fart-06.mp3"></audio>
155
+ <audio id="G" src="https://www.myinstants.com/media/sounds/fart-07.mp3"></audio>
156
+ <audio id="G#" src="https://www.myinstants.com/media/sounds/fart-08.mp3"></audio>
157
+ <audio id="A" src="https://www.myinstants.com/media/sounds/fart-09.mp3"></audio>
158
+ <audio id="A#" src="https://www.myinstants.com/media/sounds/fart-10.mp3"></audio>
159
+ <audio id="B" src="https://www.myinstants.com/media/sounds/fart-11.mp3"></audio>
160
+ <audio id="C-high" src="https://www.myinstants.com/media/sounds/fart-12.mp3"></audio>
161
+
162
+ <script>
163
+ document.addEventListener('DOMContentLoaded', function() {
164
+ const keys = document.querySelectorAll('.piano-key');
165
+ const randomBtn = document.getElementById('random-btn');
166
+ const comboBtn = document.getElementById('combo-btn');
167
+
168
+ // Keyboard to note mapping
169
+ const keyMap = {
170
+ 'a': 'C',
171
+ 'w': 'C#',
172
+ 's': 'D',
173
+ 'e': 'D#',
174
+ 'd': 'E',
175
+ 'f': 'F',
176
+ 't': 'F#',
177
+ 'g': 'G',
178
+ 'y': 'G#',
179
+ 'h': 'A',
180
+ 'u': 'A#',
181
+ 'j': 'B',
182
+ 'k': 'C-high'
183
+ };
184
+
185
+ // Play sound and animate key
186
+ function playNote(note) {
187
+ const audio = document.getElementById(note);
188
+ if (audio) {
189
+ audio.currentTime = 0;
190
+ audio.play();
191
+
192
+ // Find the key element
193
+ const key = document.querySelector(`.piano-key[data-note="${note}"]`);
194
+ if (key) {
195
+ // Add active class
196
+ key.classList.add('active');
197
+
198
+ // Create fart cloud
199
+ if (Math.random() > 0.3) { // 70% chance to show cloud
200
+ const cloud = document.createElement('div');
201
+ cloud.className = 'fart-cloud';
202
+
203
+ // Position cloud above the key
204
+ const rect = key.getBoundingClientRect();
205
+ cloud.style.left = `${rect.left + rect.width/2 - 30}px`;
206
+ cloud.style.top = `${rect.top - 20}px`;
207
+
208
+ document.body.appendChild(cloud);
209
+
210
+ // Remove cloud after animation
211
+ setTimeout(() => {
212
+ cloud.remove();
213
+ }, 2000);
214
+ }
215
+
216
+ // Remove active class after delay
217
+ setTimeout(() => {
218
+ key.classList.remove('active');
219
+ }, 150);
220
+ }
221
+ }
222
+ }
223
+
224
+ // Click/tap event for keys
225
+ keys.forEach(key => {
226
+ key.addEventListener('mousedown', () => {
227
+ const note = key.getAttribute('data-note');
228
+ playNote(note);
229
+ });
230
+
231
+ key.addEventListener('touchstart', (e) => {
232
+ e.preventDefault();
233
+ const note = key.getAttribute('data-note');
234
+ playNote(note);
235
+ });
236
+ });
237
+
238
+ // Keyboard events
239
+ document.addEventListener('keydown', (e) => {
240
+ const note = keyMap[e.key.toLowerCase()];
241
+ if (note && !e.repeat) {
242
+ playNote(note);
243
+ }
244
+ });
245
+
246
+ // Random fart button
247
+ randomBtn.addEventListener('click', () => {
248
+ const notes = Array.from(keys).map(key => key.getAttribute('data-note'));
249
+ const randomNote = notes[Math.floor(Math.random() * notes.length)];
250
+ playNote(randomNote);
251
+ });
252
+
253
+ // Fart combo button
254
+ comboBtn.addEventListener('click', () => {
255
+ const notes = Array.from(keys).map(key => key.getAttribute('data-note'));
256
+
257
+ // Play 5-8 random notes in sequence with delays
258
+ const count = 5 + Math.floor(Math.random() * 4);
259
+ let delay = 0;
260
+
261
+ for (let i = 0; i < count; i++) {
262
+ setTimeout(() => {
263
+ const randomNote = notes[Math.floor(Math.random() * notes.length)];
264
+ playNote(randomNote);
265
+ }, delay);
266
+
267
+ delay += 200 + Math.random() * 300; // Random delay between 200-500ms
268
+ }
269
+ });
270
+ });
271
+ </script>
272
+ <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=x3HeadedMonkey/faret" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
273
+ </html>