File size: 15,197 Bytes
018be98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e77a79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>InstaClone | Sua rede social</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        body {
            font-family: 'Inter', sans-serif;
            background-color: #fafafa;
        }
        .story-ring {
            background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        }
        .post-like-animation {
            animation: like 0.5s ease-in-out;
        }
        @keyframes like {
            0% { transform: scale(1); }
            50% { transform: scale(1.2); }
            100% { transform: scale(1); }
        }
        .dark-mode {
            background-color: #121212;
            color: #f5f5f5;
        }
        .dark-mode .bg-white {
            background-color: #1e1e1e !important;
        }
        .dark-mode .text-gray-800 {
            color: #f5f5f5 !important;
        }
    </style>
</head>
<body class="text-gray-800">
    <!-- Navbar -->
    <nav class="bg-white border-b border-gray-200 fixed w-full z-10">
        <div class="max-w-6xl mx-auto px-4">
            <div class="flex justify-between h-16">
                <!-- Logo -->
                <div class="flex items-center">
                    <a href="#" class="text-2xl font-bold">InstaClone</a>
                </div>

                <!-- Search -->
                <div class="hidden md:flex items-center mx-4 flex-1 max-w-md">
                    <div class="relative w-full">
                        <input type="text" placeholder="Pesquisar" class="bg-gray-100 rounded-md py-1 px-4 pl-10 w-full focus:outline-none focus:ring-2 focus:ring-gray-300">
                        <i data-feather="search" class="absolute left-3 top-2 text-gray-400"></i>
                    </div>
                </div>

                <!-- Icons -->
                <div class="flex items-center space-x-4">
                    <a href="#" class="p-2 rounded-full hover:bg-gray-100">
                        <i data-feather="home"></i>
                    </a>
                    <a href="#" class="p-2 rounded-full hover:bg-gray-100">
                        <i data-feather="message-square"></i>
                    </a>
                    <a href="#" class="p-2 rounded-full hover:bg-gray-100">
                        <i data-feather="plus-square"></i>
                    </a>
                    <a href="#" class="p-2 rounded-full hover:bg-gray-100">
                        <i data-feather="compass"></i>
                    </a>
                    <a href="#" class="p-2 rounded-full hover:bg-gray-100">
                        <i data-feather="heart"></i>
                    </a>
                    <button id="darkModeToggle" class="p-2 rounded-full hover:bg-gray-100">
                        <i data-feather="moon"></i>
                    </button>
                    <div class="relative">
                        <button class="flex items-center space-x-2 focus:outline-none">
                            <img src="http://static.photos/people/200x200/1" alt="Profile" class="w-8 h-8 rounded-full object-cover">
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="pt-16 pb-16 max-w-6xl mx-auto px-4 md:flex">
        <!-- Left Column - Stories and Posts -->
        <div class="md:w-2/3 md:pr-8">
            <!-- Stories -->
            <div class="bg-white border border-gray-200 rounded-lg p-4 mb-6 overflow-x-auto">
                <div class="flex space-x-4">
                    <!-- Your Story -->
                    <div class="flex flex-col items-center space-y-1">
                        <div class="relative">
                            <div class="story-ring rounded-full p-0.5">
                                <img src="http://static.photos/people/200x200/1" alt="Your Story" class="w-16 h-16 rounded-full object-cover border-2 border-white">
                            </div>
                            <div class="absolute bottom-0 right-0 bg-blue-500 rounded-full p-1">
                                <i data-feather="plus" class="w-3 h-3 text-white"></i>
                            </div>
                        </div>
                        <span class="text-xs">Seu story</span>
                    </div>

                    <!-- Other Stories -->
                    <template x-for="i in 10" :key="i">
                        <div class="flex flex-col items-center space-y-1">
                            <div class="story-ring rounded-full p-0.5">
                                <img :src="`http://static.photos/people/200x200/${i+1}`" alt="Story" class="w-16 h-16 rounded-full object-cover border-2 border-white">
                            </div>
                            <span class="text-xs truncate w-16 text-center" x-text="'user_'+i"></span>
                        </div>
                    </template>
                </div>
            </div>

            <!-- Posts -->
            <template x-for="i in 5" :key="i">
                <div class="bg-white border border-gray-200 rounded-lg mb-6" data-aos="fade-up">
                    <!-- Post Header -->
                    <div class="flex items-center p-3">
                        <div class="story-ring rounded-full p-0.5 mr-3">
                            <img :src="`http://static.photos/people/200x200/${i}`" alt="Profile" class="w-8 h-8 rounded-full object-cover border-2 border-white">
                        </div>
                        <span class="font-semibold" x-text="'user_'+i"></span>
                        <span class="mx-1"></span>
                        <span class="text-gray-500 text-sm">2h</span>
                        <button class="ml-auto">
                            <i data-feather="more-vertical" class="text-gray-500"></i>
                        </button>
                    </div>

                    <!-- Post Image -->
                    <img :src="`http://static.photos/nature/640x360/${i}`" alt="Post" class="w-full object-cover">

                    <!-- Post Actions -->
                    <div class="p-3">
                        <div class="flex space-x-4 mb-2">
                            <button class="post-like" @click="toggleLike($event)">
                                <i data-feather="heart" class="text-gray-800"></i>
                            </button>
                            <button>
                                <i data-feather="message-square" class="text-gray-800"></i>
                            </button>
                            <button>
                                <i data-feather="send" class="text-gray-800"></i>
                            </button>
                            <button class="ml-auto">
                                <i data-feather="bookmark" class="text-gray-800"></i>
                            </button>
                        </div>

                        <!-- Likes -->
                        <div class="font-semibold mb-1">1,234 curtidas</div>

                        <!-- Caption -->
                        <div class="mb-1">
                            <span class="font-semibold" x-text="'user_'+i"></span>
                            <span> Esta é uma legenda de exemplo para o post. #instaclone #webdev</span>
                        </div>

                        <!-- Comments -->
                        <div class="text-gray-500 mb-1">Ver todos os 45 comentários</div>
                        <div class="text-sm mb-1">
                            <span class="font-semibold">outro_usuario</span>
                            <span> Que foto incrível!</span>
                        </div>
                        <div class="text-sm text-gray-500" x-text="'2h'"></div>

                        <!-- Add Comment -->
                        <div class="flex items-center mt-3 border-t border-gray-100 pt-3">
                            <input type="text" placeholder="Adicione um comentário..." class="flex-1 focus:outline-none bg-transparent">
                            <button class="text-blue-500 font-semibold">Publicar</button>
                        </div>
                    </div>
                </div>
            </template>
        </div>

        <!-- Right Column - Suggestions -->
        <div class="hidden md:block md:w-1/3">
            <!-- User Profile -->
            <div class="flex items-center mb-6">
                <img src="http://static.photos/people/200x200/1" alt="Profile" class="w-14 h-14 rounded-full object-cover mr-4">
                <div>
                    <div class="font-semibold">seu_usuario</div>
                    <div class="text-gray-500">Seu Nome</div>
                </div>
                <button class="ml-auto text-blue-500 text-sm font-semibold">Mudar</button>
            </div>

            <!-- Suggestions -->
            <div class="mb-4">
                <div class="flex justify-between items-center mb-3">
                    <span class="text-gray-500 font-semibold">Sugestões para você</span>
                    <button class="text-sm font-semibold">Ver tudo</button>
                </div>

                <template x-for="i in 5" :key="i">
                    <div class="flex items-center mb-3">
                        <img :src="`http://static.photos/people/200x200/${i+10}`" alt="Suggestion" class="w-8 h-8 rounded-full object-cover mr-3">
                        <div class="flex-1">
                            <div class="font-semibold text-sm" x-text="'suggested_user_'+i"></div>
                            <div class="text-gray-500 text-xs">Segue você</div>
                        </div>
                        <button class="text-blue-500 text-xs font-semibold">Seguir</button>
                    </div>
                </template>
            </div>

            <!-- Footer Links -->
            <div class="text-xs text-gray-400">
                <div class="mb-4">
                    <a href="#" class="mr-2">Sobre</a>
                    <a href="#" class="mr-2">Ajuda</a>
                    <a href="#" class="mr-2">Imprensa</a>
                    <a href="#" class="mr-2">API</a>
                    <a href="#" class="mr-2">Carreiras</a>
                    <a href="#" class="mr-2">Privacidade</a>
                    <a href="#" class="mr-2">Termos</a>
                    <a href="#" class="mr-2">Localizações</a>
                </div>
                <div>
                    <span>© 2023 INSTACLONE</span>
                </div>
            </div>
        </div>
    </main>

    <!-- Bottom Navigation (Mobile) -->
    <nav class="md:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 flex justify-around py-3">
        <a href="#" class="p-2">
            <i data-feather="home"></i>
        </a>
        <a href="#" class="p-2">
            <i data-feather="search"></i>
        </a>
        <a href="#" class="p-2">
            <i data-feather="plus-square"></i>
        </a>
        <a href="#" class="p-2">
            <i data-feather="heart"></i>
        </a>
        <a href="#" class="p-2">
            <img src="http://static.photos/people/200x200/1" alt="Profile" class="w-6 h-6 rounded-full object-cover">
        </a>
    </nav>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Initialize AOS
            AOS.init({
                duration: 800,
                easing: 'ease-in-out',
                once: true
            });

            // Feather Icons
            feather.replace();

            // Dark Mode Toggle
            const darkModeToggle = document.getElementById('darkModeToggle');
            const html = document.documentElement;

            darkModeToggle.addEventListener('click', function() {
                html.classList.toggle('dark-mode');
                const icon = darkModeToggle.querySelector('i');
                if (html.classList.contains('dark-mode')) {
                    feather.icons['sun'].replace(icon);
                } else {
                    feather.icons['moon'].replace(icon);
                }
            });

            // Like animation
            document.querySelectorAll('.post-like').forEach(button => {
                button.addEventListener('click', function(e) {
                    const icon = this.querySelector('i');
                    if (icon.getAttribute('data-feather') === 'heart') {
                        feather.icons['heart'].replace(icon);
                        icon.classList.add('post-like-animation');
                        icon.style.fill = 'red';
                        icon.style.color = 'red';
                        setTimeout(() => {
                            icon.classList.remove('post-like-animation');
                        }, 500);
                    } else {
                        feather.icons['heart'].replace(icon);
                        icon.style.fill = 'none';
                        icon.style.color = '';
                    }
                });
            });

            // Alpine.js-like functionality for demo
            const templateElements = document.querySelectorAll('template[x-for]');
            templateElements.forEach(template => {
                const parent = template.parentNode;
                const match = template.getAttribute('x-for').match(/i in (\d+)/);
                if (match) {
                    const count = parseInt(match[1]);
                    for (let i = 0; i < count; i++) {
                        const clone = document.importNode(template.content, true);
                        parent.insertBefore(clone, template);
                    }
                }
            });
        });

        function toggleLike(event) {
            const icon = event.currentTarget.querySelector('i');
            if (icon.getAttribute('data-feather') === 'heart') {
                feather.icons['heart'].replace(icon);
                icon.classList.add('post-like-animation');
                icon.style.fill = 'red';
                icon.style.color = 'red';
                setTimeout(() => {
                    icon.classList.remove('post-like-animation');
                }, 500);
            } else {
                feather.icons['heart'].replace(icon);
                icon.style.fill = 'none';
                icon.style.color = '';
            }
        }
    </script>
</body>
</html>