openfree commited on
Commit
94a8ce8
1 Parent(s): 914fb89

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +271 -19
index.html CHANGED
@@ -1,19 +1,271 @@
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>Interactive Calendar</title>
7
+ <style>
8
+ :root {
9
+ --primary: #4a90e2;
10
+ --secondary: #f5f5f5;
11
+ --text: #333;
12
+ --shadow: 0 2px 10px rgba(0,0,0,0.1);
13
+ }
14
+
15
+ * {
16
+ margin: 0;
17
+ padding: 0;
18
+ box-sizing: border-box;
19
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
20
+ }
21
+
22
+ body {
23
+ background: #f9f9f9;
24
+ padding: 2rem;
25
+ }
26
+
27
+ .container {
28
+ max-width: 1200px;
29
+ margin: 0 auto;
30
+ background: white;
31
+ border-radius: 12px;
32
+ box-shadow: var(--shadow);
33
+ padding: 2rem;
34
+ }
35
+
36
+ .header {
37
+ display: flex;
38
+ justify-content: space-between;
39
+ align-items: center;
40
+ margin-bottom: 2rem;
41
+ }
42
+
43
+ .filters {
44
+ display: flex;
45
+ gap: 1rem;
46
+ }
47
+
48
+ .filter-btn {
49
+ padding: 0.5rem 1rem;
50
+ border: none;
51
+ border-radius: 20px;
52
+ background: var(--secondary);
53
+ color: var(--text);
54
+ cursor: pointer;
55
+ transition: all 0.3s ease;
56
+ }
57
+
58
+ .filter-btn.active {
59
+ background: var(--primary);
60
+ color: white;
61
+ }
62
+
63
+ .calendar {
64
+ display: grid;
65
+ grid-template-columns: repeat(7, 1fr);
66
+ gap: 1rem;
67
+ }
68
+
69
+ .day-header {
70
+ text-align: center;
71
+ font-weight: bold;
72
+ padding: 1rem;
73
+ background: var(--secondary);
74
+ border-radius: 8px;
75
+ }
76
+
77
+ .day {
78
+ min-height: 120px;
79
+ background: white;
80
+ border-radius: 8px;
81
+ padding: 0.5rem;
82
+ border: 2px solid var(--secondary);
83
+ transition: all 0.3s ease;
84
+ }
85
+
86
+ .day.dragover {
87
+ background: var(--secondary);
88
+ transform: scale(1.02);
89
+ }
90
+
91
+ .event {
92
+ background: var(--primary);
93
+ color: white;
94
+ padding: 0.5rem;
95
+ border-radius: 4px;
96
+ margin-bottom: 0.5rem;
97
+ cursor: move;
98
+ animation: slideIn 0.3s ease;
99
+ }
100
+
101
+ .event[data-category="work"] { background: #4a90e2; }
102
+ .event[data-category="personal"] { background: #e24a4a; }
103
+ .event[data-category="meeting"] { background: #4ae24a; }
104
+
105
+ @keyframes slideIn {
106
+ from {
107
+ opacity: 0;
108
+ transform: translateY(-10px);
109
+ }
110
+ to {
111
+ opacity: 1;
112
+ transform: translateY(0);
113
+ }
114
+ }
115
+
116
+ .add-event {
117
+ position: fixed;
118
+ bottom: 2rem;
119
+ right: 2rem;
120
+ width: 60px;
121
+ height: 60px;
122
+ border-radius: 50%;
123
+ background: var(--primary);
124
+ color: white;
125
+ border: none;
126
+ font-size: 2rem;
127
+ cursor: pointer;
128
+ box-shadow: var(--shadow);
129
+ transition: transform 0.3s ease;
130
+ }
131
+
132
+ .add-event:hover {
133
+ transform: scale(1.1);
134
+ }
135
+ </style>
136
+ </head>
137
+ <body>
138
+ <div class="container">
139
+ <div class="header">
140
+ <h1>Calendar</h1>
141
+ <div class="filters">
142
+ <button class="filter-btn active" data-category="all">All</button>
143
+ <button class="filter-btn" data-category="work">Work</button>
144
+ <button class="filter-btn" data-category="personal">Personal</button>
145
+ <button class="filter-btn" data-category="meeting">Meeting</button>
146
+ </div>
147
+ </div>
148
+
149
+ <div class="calendar">
150
+ <div class="day-header">Sun</div>
151
+ <div class="day-header">Mon</div>
152
+ <div class="day-header">Tue</div>
153
+ <div class="day-header">Wed</div>
154
+ <div class="day-header">Thu</div>
155
+ <div class="day-header">Fri</div>
156
+ <div class="day-header">Sat</div>
157
+ </div>
158
+ </div>
159
+ <button class="add-event">+</button>
160
+
161
+ <script>
162
+ const calendar = document.querySelector('.calendar');
163
+ const filterBtns = document.querySelectorAll('.filter-btn');
164
+ let currentFilter = 'all';
165
+
166
+ // Generate calendar days
167
+ const daysInMonth = 31;
168
+ const firstDay = 3; // Wednesday
169
+
170
+ for(let i = 0; i < firstDay; i++) {
171
+ calendar.appendChild(createDayElement(''));
172
+ }
173
+
174
+ for(let i = 1; i <= daysInMonth; i++) {
175
+ calendar.appendChild(createDayElement(i));
176
+ }
177
+
178
+ function createDayElement(day) {
179
+ const div = document.createElement('div');
180
+ div.className = 'day';
181
+ div.textContent = day;
182
+
183
+ div.addEventListener('dragover', e => {
184
+ e.preventDefault();
185
+ div.classList.add('dragover');
186
+ });
187
+
188
+ div.addEventListener('dragleave', e => {
189
+ div.classList.remove('dragover');
190
+ });
191
+
192
+ div.addEventListener('drop', e => {
193
+ e.preventDefault();
194
+ div.classList.remove('dragover');
195
+
196
+ const eventData = JSON.parse(e.dataTransfer.getData('text/plain'));
197
+ const event = createEventElement(eventData.title, eventData.category);
198
+ div.appendChild(event);
199
+ });
200
+
201
+ return div;
202
+ }
203
+
204
+ function createEventElement(title, category) {
205
+ const div = document.createElement('div');
206
+ div.className = 'event';
207
+ div.textContent = title;
208
+ div.draggable = true;
209
+ div.dataset.category = category;
210
+
211
+ div.addEventListener('dragstart', e => {
212
+ e.dataTransfer.setData('text/plain', JSON.stringify({
213
+ title,
214
+ category
215
+ }));
216
+ });
217
+
218
+ return div;
219
+ }
220
+
221
+ // Sample events
222
+ const sampleEvents = [
223
+ { day: 5, title: 'Team Meeting', category: 'work' },
224
+ { day: 10, title: 'Dentist', category: 'personal' },
225
+ { day: 15, title: 'Conference', category: 'meeting' },
226
+ { day: 20, title: 'Project Deadline', category: 'work' }
227
+ ];
228
+
229
+ sampleEvents.forEach(event => {
230
+ const days = document.querySelectorAll('.day');
231
+ const targetDay = days[event.day + firstDay - 1];
232
+ if(targetDay) {
233
+ targetDay.appendChild(createEventElement(event.title, event.category));
234
+ }
235
+ });
236
+
237
+ // Filter functionality
238
+ filterBtns.forEach(btn => {
239
+ btn.addEventListener('click', () => {
240
+ filterBtns.forEach(b => b.classList.remove('active'));
241
+ btn.classList.add('active');
242
+ currentFilter = btn.dataset.category;
243
+
244
+ const events = document.querySelectorAll('.event');
245
+ events.forEach(event => {
246
+ if(currentFilter === 'all' || event.dataset.category === currentFilter) {
247
+ event.style.display = 'block';
248
+ } else {
249
+ event.style.display = 'none';
250
+ }
251
+ });
252
+ });
253
+ });
254
+
255
+ // Add new event button
256
+ document.querySelector('.add-event').addEventListener('click', () => {
257
+ const day = prompt('Enter day (1-31):');
258
+ const title = prompt('Enter event title:');
259
+ const category = prompt('Enter category (work/personal/meeting):');
260
+
261
+ if(day && title && category) {
262
+ const days = document.querySelectorAll('.day');
263
+ const targetDay = days[parseInt(day) + firstDay - 1];
264
+ if(targetDay) {
265
+ targetDay.appendChild(createEventElement(title, category));
266
+ }
267
+ }
268
+ });
269
+ </script>
270
+ </body>
271
+ </html>