File size: 15,470 Bytes
9b6d1ca
91bec68
 
 
 
 
9b6d1ca
86ba311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b6d1ca
 
 
289761f
9b6d1ca
418e913
 
 
 
 
9b6d1ca
90bfe7d
9b6d1ca
 
90bfe7d
289761f
 
 
 
9b6d1ca
 
289761f
9b6d1ca
 
90bfe7d
9b6d1ca
90bfe7d
 
 
289761f
90bfe7d
 
 
 
289761f
90bfe7d
289761f
 
 
 
 
 
 
 
 
 
 
 
9b6d1ca
289761f
 
 
 
 
 
9b6d1ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86ba311
91bec68
86ba311
9b6d1ca
 
 
 
 
 
 
86ba311
 
4037316
 
9b6d1ca
 
 
 
 
 
 
741bd9d
9b6d1ca
289761f
9b6d1ca
 
289761f
741bd9d
289761f
 
9b6d1ca
289761f
 
9b6d1ca
 
 
 
 
 
 
90bfe7d
289761f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b6d1ca
289761f
9b6d1ca
 
c22ac1a
9b6d1ca
 
741bd9d
9b6d1ca
86ba311
4037316
db2e9cc
86ba311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418e913
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289761f
 
418e913
 
 
 
 
 
 
 
 
289761f
 
 
 
 
 
 
90bfe7d
289761f
 
 
 
 
 
 
90bfe7d
289761f
 
 
418e913
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289761f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418e913
289761f
39a5719
a84dee5
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
336
337
338
339
340
341
342
343
344
345
346
347

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Profile Builder - WYSIWYG Link in Bio</title>
    <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>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        body {
            font-family: 'Inter', sans-serif;
        }
        .glass-card {
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.18);
        }
        .gradient-text {
            background: linear-gradient(90deg, #3b82f6, #8b5cf6);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        .editable {
            cursor: pointer;
            transition: all 0.3s ease;
            min-height: 1.2em;
        }
        .editable:focus {
            outline: none;
            background: transparent;
            border-radius: 4px;
        }
        .editable:hover {
            background: transparent;
            border-radius: 4px;
        }
.editable:empty:before {
            content: attr(data-placeholder);
            color: rgba(255, 255, 255, 0.6);
        }
        .social-dropdown {
            display: none;
            position: absolute;
            background: rgba(0, 0, 0, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            padding: 8px;
            z-index: 1000;
            min-width: 200px;
            max-height: 200px;
            overflow-y: auto;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            margin-bottom: 8px;
        }
.social-option {
            display: flex;
            align-items: center;
            padding: 8px 12px;
            margin: 2px 0;
            border-radius: 6px;
            transition: all 0.2s ease;
            cursor: pointer;
            color: white;
            text-decoration: none;
        }
        .social-option:hover {
            background: rgba(59, 130, 246, 0.3);
        }
        .social-option i {
            margin-right: 10px;
            width: 20px;
            height: 20px;
        }
.image-upload-container {
            position: relative;
            cursor: pointer;
        }
        .image-upload-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s ease;
            border-radius: 50%;
        }
        .image-upload-container:hover .image-upload-overlay {
            opacity: 1;
        }
    </style>
</head>
<body class="bg-gray-900 text-white min-h-screen">
    <!-- Builder Controls -->
    <div class="fixed top-4 right-4 z-50">
        <button id="saveProfile" class="bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-full text-sm font-medium transition">
            Save Profile
        </button>
    </div>

    <!-- Hero Section -->
    <div id="vanta-bg" class="min-h-screen flex items-center justify-center px-4">
        <div class="glass-card p-6 max-w-md w-full mx-auto text-center" style="aspect-ratio: 9/19; max-height: 95vh;">
            <div class="flex flex-col justify-center h-full">
                <!-- Profile Image Upload -->
                <div class="image-upload-container w-56 h-56 mx-auto mb-6 rounded-full overflow-hidden border-4 border-indigo-500 border-dashed">
                    <img id="profileImage" src="http://static.photos/technology/320x240/42" alt="Profile" class="w-full h-full object-cover">
                    <div class="image-upload-overlay">
                        <span class="text-white text-sm font-medium">Click to Upload</span>
                    </div>
                    <input type="file" id="imageUpload" accept="image/*" class="hidden">
                </div>
                <!-- Editable Name -->
                <h1 id="editableName" class="text-3xl font-bold mb-3 gradient-text editable" contenteditable="true" data-placeholder="Tap to Add your Name"></h1>
                <!-- Contact Button -->
                <div class="relative mb-4 w-3/5 mx-auto">
                    <a id="contactButton" href="tel:" class="px-4 py-2 border border-indigo-500 rounded-full hover:bg-indigo-900/30 transition text-xs w-full block editable" contenteditable="true" data-placeholder="Tap to Add Phone Number"></a>
                </div>
                <!-- Editable Title -->
                <p id="editableTitle" class="text-xl text-gray-300 mb-4 editable" contenteditable="true" data-placeholder="Tap to Add your Title"></p>
                <!-- Editable Description -->
                <p id="editableDescription" class="text-base text-gray-400 mb-8 px-2 editable" contenteditable="true" data-placeholder="Tap to Add a Description about Yourself"></p>
<!-- Social Media Section -->
                <div class="mb-8">
                    <div class="flex justify-center space-x-4 mb-4" id="socialIconsContainer">
                        <!-- Social icons will be added here dynamically -->
                    </div>
                    <button id="addSocialButton" class="bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-full text-sm transition">
                        + Add Social Media
                    </button>
                    <div id="socialDropdown" class="social-dropdown">
                        <a class="social-option" data-platform="instagram">
                            <i data-feather="instagram"></i> Instagram
                        </a>
                        <a class="social-option" data-platform="facebook">
                            <i data-feather="facebook"></i> Facebook
                        </a>
                        <a class="social-option" data-platform="twitter">
                            <i data-feather="twitter"></i> Twitter
                        </a>
                        <a class="social-option" data-platform="tiktok">
                            <i data-feather="video"></i> TikTok
                        </a>
                        <a class="social-option" data-platform="youtube">
                            <i data-feather="youtube"></i> YouTube
                        </a>
                        <a class="social-option" data-platform="linkedin">
                            <i data-feather="linkedin"></i> LinkedIn
                        </a>
                        <a class="social-option" data-platform="snapchat">
                            <i data-feather="camera"></i> Snapchat
                        </a>
                        <a class="social-option" data-platform="pinterest">
                            <i data-feather="image"></i> Pinterest
                        </a>
                        <a class="social-option" data-platform="reddit">
                            <i data-feather="message-circle"></i> Reddit
                        </a>
                        <a class="social-option" data-platform="github">
                            <i data-feather="github"></i> GitHub
                        </a>
                    </div>
</div>
                
                <!-- Action Buttons -->
                <div class="flex justify-center space-x-3 mt-auto">
                    <button class="px-4 py-2 bg-indigo-600 rounded-full hover:bg-indigo-700 transition text-sm">Projects</button>
                    <button class="px-4 py-2 border border-indigo-500 rounded-full hover:bg-indigo-900/30 transition text-sm">About Me</button>
                </div>
            </div>
        </div>
    </div>
<!-- Scripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
    <script>
        VANTA.GLOBE({
            el: "#vanta-bg",
            mouseControls: true,
            touchControls: true,
            gyroControls: false,
            minHeight: 200.00,
            minWidth: 200.00,
            scale: 1.00,
            scaleMobile: 1.00,
            color: 0x3b82f6,
            backgroundColor: 0x111827,
            size: 0.8
        });
        
        feather.replace();
        
        // Smooth scrolling for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });

        // Image upload functionality
        document.getElementById('imageUpload').addEventListener('change', function(e) {
            const file = e.target.files[0];
            if (file) {
                const reader = new FileReader();
                reader.onload = function(e) {
                    document.getElementById('profileImage').src = e.target.result;
                }
                reader.readAsDataURL(file);
            }
        });

        // Make image container clickable
        document.querySelector('.image-upload-container').addEventListener('click', function() {
            document.getElementById('imageUpload').click();
        });

        // Social media dropdown functionality
        document.getElementById('addSocialButton').addEventListener('click', function() {
            const dropdown = document.getElementById('socialDropdown');
            dropdown.style.display = dropdown.style.display === 'block' ? 'none' : 'block';
        });

        // Close dropdown when clicking outside
        document.addEventListener('click', function(e) {
            if (!e.target.closest('#socialDropdown') && !e.target.closest('#addSocialButton')) {
                document.getElementById('socialDropdown').style.display = 'none';
            }
        });
        // Social media platform selection
        document.querySelectorAll('.social-option').forEach(option => {
            option.addEventListener('click', function(e) {
                e.preventDefault();
                const platform = this.getAttribute('data-platform');
                const handle = prompt(`Enter your ${platform} handle:`);
                if (handle) {
                    addSocialIcon(platform, handle);
                }
                document.getElementById('socialDropdown').style.display = 'none';
            });
        });

        // Initialize placeholder functionality
        document.querySelectorAll('.editable').forEach(editable => {
            // Clear placeholder text when focusing
            editable.addEventListener('focus', function() {
                if (this.textContent === this.getAttribute('data-placeholder')) {
                    this.textContent = '';
                }
                this.style.background = 'transparent';
            });
            
            // Restore placeholder if empty when blurring
            editable.addEventListener('blur', function() {
                if (this.textContent.trim() === '') {
                    this.textContent = '';
                }
                this.style.background = 'transparent';
            });
        });
function addSocialIcon(platform, handle) {
            const container = document.getElementById('socialIconsContainer');
            const icon = document.createElement('a');
            icon.href = getSocialUrl(platform, handle);
            icon.target = '_blank';
            icon.className = 'text-gray-400 hover:text-white transition';
            icon.innerHTML = `<i data-feather="${platform}"></i>`;
            container.appendChild(icon);
            feather.replace();
        }

        function getSocialUrl(platform, handle) {
            const urls = {
                instagram: `https://instagram.com/${handle}`,
                facebook: `https://facebook.com/${handle}`,
                twitter: `https://twitter.com/${handle}`,
                tiktok: `https://tiktok.com/@${handle}`,
                youtube: `https://youtube.com/@${handle}`,
                linkedin: `https://linkedin.com/in/${handle}`,
                snapchat: `https://snapchat.com/add/${handle}`,
                pinterest: `https://pinterest.com/${handle}`,
                reddit: `https://reddit.com/user/${handle}`,
                github: `https://github.com/${handle}`
            };
            return urls[platform] || '#';
        }

        // Update contact button href when editing
        document.getElementById('contactButton').addEventListener('input', function() {
            const phoneNumber = this.textContent.replace(/[^\d+]/g, '');
            this.href = `tel:${phoneNumber}`;
        });

        // Save profile functionality
        document.getElementById('saveProfile').addEventListener('click', function() {
            const profileData = {
                name: document.getElementById('editableName').textContent,
                title: document.getElementById('editableTitle').textContent,
                description: document.getElementById('editableDescription').textContent,
                phone: document.getElementById('contactButton').textContent,
                image: document.getElementById('profileImage').src
            };
            localStorage.setItem('profileData', JSON.stringify(profileData));
            alert('Profile saved successfully!');
        });
        // Load saved profile
        const savedProfile = localStorage.getItem('profileData');
        if (savedProfile) {
            const profileData = JSON.parse(savedProfile);
            
            // Set content only if it's not empty or placeholder
            if (profileData.name && profileData.name !== 'Tap to Add your Name') {
                document.getElementById('editableName').textContent = profileData.name;
            }
            if (profileData.title && profileData.title !== 'Tap to Add your Title') {
                document.getElementById('editableTitle').textContent = profileData.title;
            }
            if (profileData.description && profileData.description !== 'Tap to Add a Description about Yourself') {
                document.getElementById('editableDescription').textContent = profileData.description;
            }
            if (profileData.phone && profileData.phone !== 'Tap to Add Phone Number') {
                document.getElementById('contactButton').textContent = profileData.phone;
                document.getElementById('contactButton').href = `tel:${profileData.phone.replace(/[^\d+]/g, '')}`;
            }
            if (profileData.image && profileData.image !== 'http://static.photos/technology/320x240/42') {
                document.getElementById('profileImage').src = profileData.image;
            }
        }
</script>
</body>
</html>