lancekiegn commited on
Commit
0db8e9d
·
verified ·
1 Parent(s): e478222

create IOS application for home automation - Initial Deployment

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +262 -18
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Toool
3
- emoji: 📚
4
- colorFrom: pink
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: toool
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: purple
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,263 @@
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>HomeControl iOS</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
11
+ <style>
12
+ body {
13
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
14
+ background-color: #f2f2f7;
15
+ -webkit-tap-highlight-color: transparent;
16
+ }
17
+ .ios-card {
18
+ background: rgba(255, 255, 255, 0.8);
19
+ backdrop-filter: blur(20px);
20
+ -webkit-backdrop-filter: blur(20px);
21
+ }
22
+ .status-bar {
23
+ height: 44px;
24
+ }
25
+ .home-indicator {
26
+ width: 134px;
27
+ height: 5px;
28
+ border-radius: 100px;
29
+ background-color: black;
30
+ }
31
+ .device-card {
32
+ transition: all 0.3s ease;
33
+ }
34
+ .device-card:active {
35
+ transform: scale(0.95);
36
+ }
37
+ .slider::-webkit-slider-thumb {
38
+ -webkit-appearance: none;
39
+ appearance: none;
40
+ width: 24px;
41
+ height: 24px;
42
+ border-radius: 50%;
43
+ background: white;
44
+ cursor: pointer;
45
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
46
+ }
47
+ </style>
48
+ </head>
49
+ <body class="min-h-screen flex flex-col items-center justify-between pb-8 max-w-md mx-auto overflow-hidden">
50
+ <!-- iOS Status Bar -->
51
+ <div class="status-bar w-full px-6 flex items-center justify-between text-black">
52
+ <span class="font-semibold">9:41</span>
53
+ <div class="flex space-x-1">
54
+ <i data-feather="signal" class="w-4 h-4"></i>
55
+ <i data-feather="wifi" class="w-4 h-4"></i>
56
+ <i data-feather="battery" class="w-4 h-4"></i>
57
+ </div>
58
+ </div>
59
+
60
+ <!-- Header -->
61
+ <div class="w-full px-6 py-4">
62
+ <h1 class="text-3xl font-bold text-gray-900">Home</h1>
63
+ <p class="text-gray-500 mt-1">Good afternoon</p>
64
+ </div>
65
+
66
+ <!-- Favorite Devices -->
67
+ <div class="w-full px-6">
68
+ <h2 class="text-xl font-semibold text-gray-900 mb-4">Favorites</h2>
69
+ <div class="grid grid-cols-2 gap-4">
70
+ <!-- Living Room Lights -->
71
+ <div class="ios-card device-card rounded-2xl p-4 shadow-sm border border-gray-100 flex flex-col items-center justify-center" onclick="toggleDevice('living-room-lights')">
72
+ <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-3">
73
+ <i data-feather="sun" class="text-blue-500 w-6 h-6"></i>
74
+ </div>
75
+ <span class="font-medium text-gray-900">Living Room</span>
76
+ <span class="text-xs text-gray-500">Lights</span>
77
+ <div class="mt-3 w-full">
78
+ <input type="range" min="0" max="100" value="75" class="slider w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
79
+ </div>
80
+ </div>
81
+
82
+ <!-- Thermostat -->
83
+ <div class="ios-card device-card rounded-2xl p-4 shadow-sm border border-gray-100 flex flex-col items-center justify-center" onclick="toggleDevice('thermostat')">
84
+ <div class="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mb-3">
85
+ <i data-feather="thermometer" class="text-red-500 w-6 h-6"></i>
86
+ </div>
87
+ <span class="font-medium text-gray-900">Home</span>
88
+ <span class="text-xs text-gray-500">Thermostat</span>
89
+ <div class="mt-3 flex items-center">
90
+ <span class="text-xl font-bold text-gray-900">22°</span>
91
+ <span class="text-gray-400 ml-1">C</span>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </div>
96
+
97
+ <!-- All Devices -->
98
+ <div class="w-full px-6 mt-8">
99
+ <h2 class="text-xl font-semibold text-gray-900 mb-4">All Devices</h2>
100
+ <div class="space-y-3">
101
+ <!-- Kitchen Lights -->
102
+ <div class="ios-card device-card rounded-xl p-4 shadow-sm border border-gray-100 flex items-center justify-between" onclick="toggleDevice('kitchen-lights')">
103
+ <div class="flex items-center">
104
+ <div class="w-10 h-10 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
105
+ <i data-feather="sun" class="text-yellow-500 w-5 h-5"></i>
106
+ </div>
107
+ <div>
108
+ <span class="font-medium text-gray-900 block">Kitchen</span>
109
+ <span class="text-xs text-gray-500">Lights • On</span>
110
+ </div>
111
+ </div>
112
+ <div class="relative">
113
+ <div class="w-12 h-6 flex items-center bg-gray-300 rounded-full p-1 toggle-switch" id="kitchen-lights">
114
+ <div class="toggle-circle bg-white w-5 h-5 rounded-full shadow-md transform translate-x-0"></div>
115
+ </div>
116
+ </div>
117
+ </div>
118
+
119
+ <!-- Bedroom Lights -->
120
+ <div class="ios-card device-card rounded-xl p-4 shadow-sm border border-gray-100 flex items-center justify-between" onclick="toggleDevice('bedroom-lights')">
121
+ <div class="flex items-center">
122
+ <div class="w-10 h-10 bg-purple-100 rounded-full flex items-center justify-center mr-3">
123
+ <i data-feather="sun" class="text-purple-500 w-5 h-5"></i>
124
+ </div>
125
+ <div>
126
+ <span class="font-medium text-gray-900 block">Bedroom</span>
127
+ <span class="text-xs text-gray-500">Lights • Off</span>
128
+ </div>
129
+ </div>
130
+ <div class="relative">
131
+ <div class="w-12 h-6 flex items-center bg-gray-300 rounded-full p-1 toggle-switch" id="bedroom-lights">
132
+ <div class="toggle-circle bg-white w-5 h-5 rounded-full shadow-md transform translate-x-6"></div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+
137
+ <!-- Front Door Lock -->
138
+ <div class="ios-card device-card rounded-xl p-4 shadow-sm border border-gray-100 flex items-center justify-between" onclick="toggleDevice('front-door')">
139
+ <div class="flex items-center">
140
+ <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3">
141
+ <i data-feather="lock" class="text-green-500 w-5 h-5"></i>
142
+ </div>
143
+ <div>
144
+ <span class="font-medium text-gray-900 block">Front Door</span>
145
+ <span class="text-xs text-gray-500">Lock • Locked</span>
146
+ </div>
147
+ </div>
148
+ <div class="relative">
149
+ <div class="w-12 h-6 flex items-center bg-blue-500 rounded-full p-1 toggle-switch" id="front-door">
150
+ <div class="toggle-circle bg-white w-5 h-5 rounded-full shadow-md transform translate-x-6"></div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+ <!-- Security Camera -->
156
+ <div class="ios-card device-card rounded-xl p-4 shadow-sm border border-gray-100 flex items-center justify-between" onclick="toggleDevice('camera')">
157
+ <div class="flex items-center">
158
+ <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center mr-3">
159
+ <i data-feather="video" class="text-indigo-500 w-5 h-5"></i>
160
+ </div>
161
+ <div>
162
+ <span class="font-medium text-gray-900 block">Security</span>
163
+ <span class="text-xs text-gray-500">Camera • Active</span>
164
+ </div>
165
+ </div>
166
+ <div class="relative">
167
+ <div class="w-12 h-6 flex items-center bg-blue-500 rounded-full p-1 toggle-switch" id="camera">
168
+ <div class="toggle-circle bg-white w-5 h-5 rounded-full shadow-md transform translate-x-6"></div>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ </div>
174
+
175
+ <!-- Tab Bar -->
176
+ <div class="ios-card w-full max-w-md fixed bottom-0 left-0 right-0 mx-auto h-16 bg-white bg-opacity-80 backdrop-filter backdrop-blur-lg border-t border-gray-100 flex items-center justify-around">
177
+ <button class="flex flex-col items-center justify-center text-blue-500">
178
+ <i data-feather="home" class="w-6 h-6"></i>
179
+ <span class="text-xs mt-1">Home</span>
180
+ </button>
181
+ <button class="flex flex-col items-center justify-center text-gray-500">
182
+ <i data-feather="calendar" class="w-6 h-6"></i>
183
+ <span class="text-xs mt-1">Scenes</span>
184
+ </button>
185
+ <button class="flex flex-col items-center justify-center text-gray-500">
186
+ <i data-feather="settings" class="w-6 h-6"></i>
187
+ <span class="text-xs mt-1">Settings</span>
188
+ </button>
189
+ </div>
190
+
191
+ <!-- iOS Home Indicator -->
192
+ <div class="home-indicator mt-4"></div>
193
+
194
+ <script>
195
+ feather.replace();
196
+
197
+ function toggleDevice(deviceId) {
198
+ const device = document.getElementById(deviceId);
199
+ const circle = device.querySelector('.toggle-circle');
200
+ const isOn = circle.classList.contains('translate-x-6');
201
+
202
+ if (isOn) {
203
+ circle.classList.remove('translate-x-6');
204
+ circle.classList.add('translate-x-0');
205
+ device.classList.remove('bg-blue-500');
206
+ device.classList.add('bg-gray-300');
207
+ } else {
208
+ circle.classList.remove('translate-x-0');
209
+ circle.classList.add('translate-x-6');
210
+ device.classList.remove('bg-gray-300');
211
+ device.classList.add('bg-blue-500');
212
+ }
213
+
214
+ // Update status text if needed
215
+ const statusElement = document.querySelector(`[onclick="toggleDevice('${deviceId}')"] .text-gray-500`);
216
+ if (statusElement) {
217
+ const currentText = statusElement.textContent;
218
+ if (currentText.includes('On')) {
219
+ statusElement.textContent = currentText.replace('On', 'Off');
220
+ } else if (currentText.includes('Off')) {
221
+ statusElement.textContent = currentText.replace('Off', 'On');
222
+ } else if (currentText.includes('Locked')) {
223
+ statusElement.textContent = currentText.replace('Locked', 'Unlocked');
224
+ } else if (currentText.includes('Unlocked')) {
225
+ statusElement.textContent = currentText.replace('Unlocked', 'Locked');
226
+ } else if (currentText.includes('Active')) {
227
+ statusElement.textContent = currentText.replace('Active', 'Inactive');
228
+ } else if (currentText.includes('Inactive')) {
229
+ statusElement.textContent = currentText.replace('Inactive', 'Active');
230
+ }
231
+ }
232
+ }
233
+
234
+ // Add ripple effect to device cards
235
+ document.querySelectorAll('.device-card').forEach(card => {
236
+ card.addEventListener('click', function(e) {
237
+ const rect = this.getBoundingClientRect();
238
+ const x = e.clientX - rect.left;
239
+ const y = e.clientY - rect.top;
240
+
241
+ const ripple = document.createElement('span');
242
+ ripple.className = 'absolute bg-black bg-opacity-10 rounded-full -translate-x-1/2 -translate-y-1/2';
243
+ ripple.style.left = `${x}px`;
244
+ ripple.style.top = `${y}px`;
245
+ ripple.style.width = '0';
246
+ ripple.style.height = '0';
247
+ ripple.style.opacity = '0.5';
248
+
249
+ this.appendChild(ripple);
250
+
251
+ const size = Math.max(rect.width, rect.height);
252
+ ripple.style.width = `${size}px`;
253
+ ripple.style.height = `${size}px`;
254
+ ripple.style.opacity = '0';
255
+
256
+ setTimeout(() => {
257
+ ripple.remove();
258
+ }, 600);
259
+ });
260
+ });
261
+ </script>
262
+ </body>
263
  </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ create IOS application for home automation