Spaces:
Running
Running
i want you to understand this code that i give you
Browse files- README.md +9 -5
- index.html +550 -18
README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: LinkCraft Pro ✨
|
| 3 |
+
colorFrom: blue
|
| 4 |
+
colorTo: purple
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
| 14 |
+
|
index.html
CHANGED
|
@@ -1,19 +1,551 @@
|
|
| 1 |
-
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
|
| 2 |
+
<!DOCTYPE html>
|
| 3 |
+
<html lang="en">
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>Profile Builder - WYSIWYG Link in Bio</title>
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 13 |
+
body {
|
| 14 |
+
font-family: 'Inter', sans-serif;
|
| 15 |
+
}
|
| 16 |
+
.glass-card {
|
| 17 |
+
background: rgba(255, 255, 255, 0.08);
|
| 18 |
+
backdrop-filter: blur(10px);
|
| 19 |
+
-webkit-backdrop-filter: blur(10px);
|
| 20 |
+
border-radius: 12px;
|
| 21 |
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
| 22 |
+
}
|
| 23 |
+
.gradient-text {
|
| 24 |
+
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
|
| 25 |
+
-webkit-background-clip: text;
|
| 26 |
+
background-clip: text;
|
| 27 |
+
color: transparent;
|
| 28 |
+
}
|
| 29 |
+
.social-icon-placeholder {
|
| 30 |
+
width: 12px;
|
| 31 |
+
height: 12px;
|
| 32 |
+
border-radius: 50%;
|
| 33 |
+
background: #3b82f6;
|
| 34 |
+
margin: 0 2px;
|
| 35 |
+
display: inline-block;
|
| 36 |
+
}
|
| 37 |
+
.editable {
|
| 38 |
+
cursor: pointer;
|
| 39 |
+
transition: all 0.3s ease;
|
| 40 |
+
min-height: 1.2em;
|
| 41 |
+
}
|
| 42 |
+
.editable:focus {
|
| 43 |
+
outline: none;
|
| 44 |
+
background: transparent;
|
| 45 |
+
border-radius: 4px;
|
| 46 |
+
}
|
| 47 |
+
.editable:hover {
|
| 48 |
+
background: transparent;
|
| 49 |
+
border-radius: 4px;
|
| 50 |
+
}
|
| 51 |
+
.editable:empty:before {
|
| 52 |
+
content: attr(data-placeholder);
|
| 53 |
+
color: rgba(255, 255, 255, 0.6);
|
| 54 |
+
}
|
| 55 |
+
.editable:focus {
|
| 56 |
+
background: transparent !important;
|
| 57 |
+
border: none !important;
|
| 58 |
+
outline: none !important;
|
| 59 |
+
}
|
| 60 |
+
.editable:hover {
|
| 61 |
+
background: transparent !important;
|
| 62 |
+
}
|
| 63 |
+
#editableName {
|
| 64 |
+
background: transparent !important;
|
| 65 |
+
border: none !important;
|
| 66 |
+
outline: none !important;
|
| 67 |
+
z-index: 20;
|
| 68 |
+
position: relative;
|
| 69 |
+
}
|
| 70 |
+
.social-dropdown {
|
| 71 |
+
display: none;
|
| 72 |
+
position: absolute;
|
| 73 |
+
background: rgba(0, 0, 0, 0.95);
|
| 74 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 75 |
+
border-radius: 8px;
|
| 76 |
+
padding: 8px;
|
| 77 |
+
z-index: 1000;
|
| 78 |
+
min-width: 200px;
|
| 79 |
+
max-height: 200px;
|
| 80 |
+
overflow-y: auto;
|
| 81 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
| 82 |
+
bottom: 100%;
|
| 83 |
+
left: 50%;
|
| 84 |
+
transform: translateX(-50%);
|
| 85 |
+
margin-bottom: 8px;
|
| 86 |
+
}
|
| 87 |
+
.social-option {
|
| 88 |
+
display: flex;
|
| 89 |
+
align-items: center;
|
| 90 |
+
padding: 8px 12px;
|
| 91 |
+
margin: 2px 0;
|
| 92 |
+
border-radius: 6px;
|
| 93 |
+
transition: all 0.2s ease;
|
| 94 |
+
cursor: pointer;
|
| 95 |
+
color: white;
|
| 96 |
+
text-decoration: none;
|
| 97 |
+
}
|
| 98 |
+
.social-option:hover {
|
| 99 |
+
background: rgba(59, 130, 246, 0.3);
|
| 100 |
+
}
|
| 101 |
+
.social-option i {
|
| 102 |
+
margin-right: 10px;
|
| 103 |
+
width: 20px;
|
| 104 |
+
height: 20px;
|
| 105 |
+
}
|
| 106 |
+
.image-upload-container {
|
| 107 |
+
position: relative;
|
| 108 |
+
cursor: pointer;
|
| 109 |
+
}
|
| 110 |
+
.image-upload-overlay {
|
| 111 |
+
position: absolute;
|
| 112 |
+
top: 0;
|
| 113 |
+
left: 0;
|
| 114 |
+
right: 0;
|
| 115 |
+
bottom: 0;
|
| 116 |
+
background: rgba(0, 0, 0, 0.7);
|
| 117 |
+
display: flex;
|
| 118 |
+
align-items: center;
|
| 119 |
+
justify-content: center;
|
| 120 |
+
opacity: 0;
|
| 121 |
+
transition: opacity 0.3s ease;
|
| 122 |
+
border-radius: 50%;
|
| 123 |
+
}
|
| 124 |
+
.image-upload-container:hover .image-upload-overlay {
|
| 125 |
+
opacity: 1;
|
| 126 |
+
}
|
| 127 |
+
</style>
|
| 128 |
+
</head>
|
| 129 |
+
<body class="bg-gray-900 text-white min-h-screen">
|
| 130 |
+
<!-- Builder Controls -->
|
| 131 |
+
<div class="fixed top-4 right-4 z-50">
|
| 132 |
+
<button id="saveProfile" class="bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-full text-sm font-medium transition">
|
| 133 |
+
Save Profile
|
| 134 |
+
</button>
|
| 135 |
+
</div>
|
| 136 |
+
|
| 137 |
+
<!-- Hero Section -->
|
| 138 |
+
<div id="vanta-bg" class="min-h-screen flex items-center justify-center px-4">
|
| 139 |
+
<div class="glass-card p-6 max-w-md w-full mx-auto text-center" style="aspect-ratio: 9/19; max-height: 95vh;">
|
| 140 |
+
<div class="flex flex-col justify-center h-full">
|
| 141 |
+
<!-- Profile Image Upload -->
|
| 142 |
+
<div class="image-upload-container w-56 h-56 mx-auto mb-6 rounded-full overflow-hidden border-4 border-indigo-500 border-dashed">
|
| 143 |
+
<img id="profileImage" src="http://static.photos/technology/320x240/42" alt="Profile" class="w-full h-full object-cover">
|
| 144 |
+
<div class="image-upload-overlay">
|
| 145 |
+
<span class="text-white text-sm font-medium">Click to Upload</span>
|
| 146 |
+
</div>
|
| 147 |
+
<input type="file" id="imageUpload" accept="image/*" class="hidden">
|
| 148 |
+
</div>
|
| 149 |
+
<!-- Editable Name -->
|
| 150 |
+
<div class="relative mb-3">
|
| 151 |
+
<h1 id="editableName" class="text-3xl font-bold text-white text-center min-h-[1.5em] px-2 py-1 gradient-text" contenteditable="true" data-placeholder="Tap to Add your Name">Tap to Add your Name</h1>
|
| 152 |
+
</div>
|
| 153 |
+
<!-- Contact Button -->
|
| 154 |
+
<div class="relative mb-4 w-3/5 mx-auto">
|
| 155 |
+
<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>
|
| 156 |
+
</div>
|
| 157 |
+
<!-- Editable Title -->
|
| 158 |
+
<p id="editableTitle" class="text-xl text-gray-300 mb-4 editable" contenteditable="true" data-placeholder="Tap to Add your Title"></p>
|
| 159 |
+
<!-- Editable Description -->
|
| 160 |
+
<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>
|
| 161 |
+
<!-- Social Media Section -->
|
| 162 |
+
<div class="mb-8">
|
| 163 |
+
<div class="flex justify-center flex-wrap gap-3 mb-4" id="socialIconsContainer">
|
| 164 |
+
<!-- Social media icons will be added here -->
|
| 165 |
+
<div class="flex items-center justify-center space-x-1 mb-2 w-full">
|
| 166 |
+
<span class="social-icon-placeholder"></span>
|
| 167 |
+
<span class="social-icon-placeholder"></span>
|
| 168 |
+
<span class="social-icon-placeholder"></span>
|
| 169 |
+
<span class="text-xs text-gray-400">Click + to add social media</span>
|
| 170 |
+
</div>
|
| 171 |
+
<!-- Plus button for adding social media -->
|
| 172 |
+
<div class="relative">
|
| 173 |
+
<button id="addSocialButton" class="w-12 h-12 rounded-full bg-indigo-600 hover:bg-indigo-700 flex items-center justify-center transition">
|
| 174 |
+
<i data-feather="plus" class="w-5 h-5"></i>
|
| 175 |
+
</button>
|
| 176 |
+
<div id="socialDropdown" class="social-dropdown">
|
| 177 |
+
<a class="social-option" data-platform="instagram">
|
| 178 |
+
<i data-feather="instagram"></i> Instagram
|
| 179 |
+
</a>
|
| 180 |
+
<a class="social-option" data-platform="facebook">
|
| 181 |
+
<i data-feather="facebook"></i> Facebook
|
| 182 |
+
</a>
|
| 183 |
+
<a class="social-option" data-platform="twitter">
|
| 184 |
+
<i data-feather="twitter"></i> Twitter
|
| 185 |
+
</a>
|
| 186 |
+
<a class="social-option" data-platform="tiktok">
|
| 187 |
+
<i data-feather="video"></i> TikTok
|
| 188 |
+
</a>
|
| 189 |
+
<a class="social-option" data-platform="youtube">
|
| 190 |
+
<i data-feather="youtube"></i> YouTube
|
| 191 |
+
</a>
|
| 192 |
+
<a class="social-option" data-platform="linkedin">
|
| 193 |
+
<i data-feather="linkedin"></i> LinkedIn
|
| 194 |
+
</a>
|
| 195 |
+
<a class="social-option" data-platform="snapchat">
|
| 196 |
+
<i data-feather="camera"></i> Snapchat
|
| 197 |
+
</a>
|
| 198 |
+
<a class="social-option" data-platform="pinterest">
|
| 199 |
+
<i data-feather="image"></i> Pinterest
|
| 200 |
+
</a>
|
| 201 |
+
<a class="social-option" data-platform="reddit">
|
| 202 |
+
<i data-feather="message-circle"></i> Reddit
|
| 203 |
+
</a>
|
| 204 |
+
<a class="social-option" data-platform="github">
|
| 205 |
+
<i data-feather="github"></i> GitHub
|
| 206 |
+
</a>
|
| 207 |
+
</div>
|
| 208 |
+
</div>
|
| 209 |
+
</div>
|
| 210 |
+
</div>
|
| 211 |
+
<!-- Action Buttons -->
|
| 212 |
+
<div class="flex justify-center space-x-3 mt-auto">
|
| 213 |
+
<button class="px-4 py-2 bg-indigo-600 rounded-full hover:bg-indigo-700 transition text-sm">Projects</button>
|
| 214 |
+
<button class="px-4 py-2 border border-indigo-500 rounded-full hover:bg-indigo-900/30 transition text-sm">About Me</button>
|
| 215 |
+
</div>
|
| 216 |
+
</div>
|
| 217 |
+
</div>
|
| 218 |
+
</div>
|
| 219 |
+
<!-- Scripts -->
|
| 220 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
|
| 221 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
|
| 222 |
+
<script>
|
| 223 |
+
VANTA.GLOBE({
|
| 224 |
+
el: "#vanta-bg",
|
| 225 |
+
mouseControls: true,
|
| 226 |
+
touchControls: true,
|
| 227 |
+
gyroControls: false,
|
| 228 |
+
minHeight: 200.00,
|
| 229 |
+
minWidth: 200.00,
|
| 230 |
+
scale: 1.00,
|
| 231 |
+
scaleMobile: 1.00,
|
| 232 |
+
color: 0x3b82f6,
|
| 233 |
+
backgroundColor: 0x111827,
|
| 234 |
+
size: 0.8
|
| 235 |
+
});
|
| 236 |
+
|
| 237 |
+
feather.replace();
|
| 238 |
+
|
| 239 |
+
// Smooth scrolling for anchor links
|
| 240 |
+
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
| 241 |
+
anchor.addEventListener('click', function (e) {
|
| 242 |
+
e.preventDefault();
|
| 243 |
+
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
| 244 |
+
behavior: 'smooth'
|
| 245 |
+
});
|
| 246 |
+
});
|
| 247 |
+
});
|
| 248 |
+
|
| 249 |
+
// Image upload functionality
|
| 250 |
+
document.getElementById('imageUpload').addEventListener('change', function(e) {
|
| 251 |
+
const file = e.target.files[0];
|
| 252 |
+
if (file) {
|
| 253 |
+
const reader = new FileReader();
|
| 254 |
+
reader.onload = function(e) {
|
| 255 |
+
document.getElementById('profileImage').src = e.target.result;
|
| 256 |
+
}
|
| 257 |
+
reader.readAsDataURL(file);
|
| 258 |
+
}
|
| 259 |
+
});
|
| 260 |
+
|
| 261 |
+
// Make image container clickable
|
| 262 |
+
document.querySelector('.image-upload-container').addEventListener('click', function() {
|
| 263 |
+
document.getElementById('imageUpload').click();
|
| 264 |
+
});
|
| 265 |
+
// Social media dropdown functionality
|
| 266 |
+
document.getElementById('addSocialButton').addEventListener('click', function(e) {
|
| 267 |
+
e.stopPropagation();
|
| 268 |
+
const dropdown = document.getElementById('socialDropdown');
|
| 269 |
+
dropdown.style.display = dropdown.style.display === 'block' ? 'none' : 'block';
|
| 270 |
+
});
|
| 271 |
+
|
| 272 |
+
// Close dropdown when clicking outside
|
| 273 |
+
document.addEventListener('click', function(e) {
|
| 274 |
+
if (!e.target.closest('#socialDropdown') && !e.target.closest('#addSocialButton')) {
|
| 275 |
+
document.getElementById('socialDropdown').style.display = 'none';
|
| 276 |
+
}
|
| 277 |
+
});
|
| 278 |
+
// Initialize placeholder functionality for all editable elements except heading
|
| 279 |
+
document.querySelectorAll('.editable').forEach(editable => {
|
| 280 |
+
// Clear placeholder text when focusing
|
| 281 |
+
editable.addEventListener('focus', function() {
|
| 282 |
+
if (this.textContent === this.getAttribute('data-placeholder')) {
|
| 283 |
+
this.textContent = '';
|
| 284 |
+
}
|
| 285 |
+
this.style.background = 'transparent';
|
| 286 |
+
});
|
| 287 |
+
|
| 288 |
+
// Restore placeholder if empty when blurring
|
| 289 |
+
editable.addEventListener('blur', function() {
|
| 290 |
+
if (this.textContent.trim() === '') {
|
| 291 |
+
this.textContent = this.getAttribute('data-placeholder');
|
| 292 |
+
}
|
| 293 |
+
this.style.background = 'transparent';
|
| 294 |
+
});
|
| 295 |
+
});
|
| 296 |
+
// Special handling for heading element
|
| 297 |
+
const editableName = document.getElementById('editableName');
|
| 298 |
+
editableName.addEventListener('focus', function() {
|
| 299 |
+
if (this.textContent === this.getAttribute('data-placeholder')) {
|
| 300 |
+
this.textContent = '';
|
| 301 |
+
}
|
| 302 |
+
this.style.background = 'transparent';
|
| 303 |
+
this.style.border = 'none';
|
| 304 |
+
this.style.outline = 'none';
|
| 305 |
+
});
|
| 306 |
+
|
| 307 |
+
editableName.addEventListener('blur', function() {
|
| 308 |
+
if (this.textContent.trim() === '') {
|
| 309 |
+
this.textContent = this.getAttribute('data-placeholder');
|
| 310 |
+
}
|
| 311 |
+
this.style.background = 'transparent';
|
| 312 |
+
this.style.border = 'none';
|
| 313 |
+
this.style.outline = 'none';
|
| 314 |
+
});
|
| 315 |
+
|
| 316 |
+
// Force clear any existing background/border styles
|
| 317 |
+
editableName.style.background = 'transparent';
|
| 318 |
+
editableName.style.border = 'none';
|
| 319 |
+
editableName.style.outline = 'none';
|
| 320 |
+
function addSocialIcon(platform, handle) {
|
| 321 |
+
const container = document.getElementById('socialIconsContainer');
|
| 322 |
+
|
| 323 |
+
// Create social icon element
|
| 324 |
+
const iconWrapper = document.createElement('div');
|
| 325 |
+
iconWrapper.className = 'relative group';
|
| 326 |
+
|
| 327 |
+
const icon = document.createElement('a');
|
| 328 |
+
icon.href = getSocialUrl(platform, handle);
|
| 329 |
+
icon.target = '_blank';
|
| 330 |
+
icon.className = 'w-12 h-12 rounded-full bg-gray-800 hover:bg-indigo-600 flex items-center justify-center transition transform hover:scale-110';
|
| 331 |
+
icon.innerHTML = `<i data-feather="${getFeatherIconName(platform)}" class="w-5 h-5"></i>`;
|
| 332 |
+
|
| 333 |
+
// Add remove button
|
| 334 |
+
const removeBtn = document.createElement('button');
|
| 335 |
+
removeBtn.className = 'absolute -top-1 -right-1 w-4 h-4 bg-red-500 rounded-full text-white text-xs flex items-center justify-center opacity-0 group-hover:opacity-100 transition';
|
| 336 |
+
removeBtn.innerHTML = '×';
|
| 337 |
+
removeBtn.onclick = function(e) {
|
| 338 |
+
e.preventDefault();
|
| 339 |
+
e.stopPropagation();
|
| 340 |
+
container.removeChild(iconWrapper);
|
| 341 |
+
};
|
| 342 |
+
|
| 343 |
+
iconWrapper.appendChild(icon);
|
| 344 |
+
iconWrapper.appendChild(removeBtn);
|
| 345 |
+
|
| 346 |
+
// Insert before the plus button
|
| 347 |
+
const addButton = document.getElementById('addSocialButton').parentNode;
|
| 348 |
+
container.insertBefore(iconWrapper, addButton);
|
| 349 |
+
|
| 350 |
+
feather.replace();
|
| 351 |
+
}
|
| 352 |
+
function getFeatherIconName(platform) {
|
| 353 |
+
const iconMap = {
|
| 354 |
+
instagram: 'instagram',
|
| 355 |
+
facebook: 'facebook',
|
| 356 |
+
twitter: 'twitter',
|
| 357 |
+
tiktok: 'video',
|
| 358 |
+
youtube: 'youtube',
|
| 359 |
+
linkedin: 'linkedin',
|
| 360 |
+
snapchat: 'camera',
|
| 361 |
+
pinterest: 'image',
|
| 362 |
+
reddit: 'message-circle',
|
| 363 |
+
github: 'github'
|
| 364 |
+
};
|
| 365 |
+
return iconMap[platform] || 'link';
|
| 366 |
+
}
|
| 367 |
+
function getSocialUrl(platform, handle) {
|
| 368 |
+
const urls = {
|
| 369 |
+
instagram: `https://instagram.com/${handle}`,
|
| 370 |
+
facebook: `https://facebook.com/${handle}`,
|
| 371 |
+
twitter: `https://twitter.com/${handle}`,
|
| 372 |
+
tiktok: `https://tiktok.com/@${handle}`,
|
| 373 |
+
youtube: `https://youtube.com/@${handle}`,
|
| 374 |
+
linkedin: `https://linkedin.com/in/${handle}`,
|
| 375 |
+
snapchat: `https://snapchat.com/add/${handle}`,
|
| 376 |
+
pinterest: `https://pinterest.com/${handle}`,
|
| 377 |
+
reddit: `https://reddit.com/user/${handle}`,
|
| 378 |
+
github: `https://github.com/${handle}`
|
| 379 |
+
};
|
| 380 |
+
return urls[platform] || '#';
|
| 381 |
+
}
|
| 382 |
+
// Update contact button href when editing
|
| 383 |
+
document.getElementById('contactButton').addEventListener('input', function() {
|
| 384 |
+
const phoneNumber = this.textContent.replace(/[^\d+]/g, '');
|
| 385 |
+
this.href = `tel:${phoneNumber}`;
|
| 386 |
+
});
|
| 387 |
+
// Social media platform selection
|
| 388 |
+
document.querySelectorAll('.social-option').forEach(option => {
|
| 389 |
+
option.addEventListener('click', function(e) {
|
| 390 |
+
e.preventDefault();
|
| 391 |
+
const platform = this.getAttribute('data-platform');
|
| 392 |
+
|
| 393 |
+
// Create modal for handle input
|
| 394 |
+
const modal = document.createElement('div');
|
| 395 |
+
modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50';
|
| 396 |
+
modal.innerHTML = `
|
| 397 |
+
<div class="bg-gray-800 p-6 rounded-lg max-w-sm w-full mx-4">
|
| 398 |
+
<h3 class="text-lg font-medium mb-4">Add your ${platform} handle</h3>
|
| 399 |
+
<input type="text" id="handleInput" class="w-full bg-gray-700 border border-gray-600 rounded px-3 py-2 mb-4 text-white" placeholder="Your handle">
|
| 400 |
+
<div class="flex justify-end space-x-2">
|
| 401 |
+
<button id="cancelHandle" class="px-4 py-2 text-gray-300 hover:text-white">Cancel</button>
|
| 402 |
+
<button id="saveHandle" class="px-4 py-2 bg-indigo-600 rounded hover:bg-indigo-700">Add</button>
|
| 403 |
+
</div>
|
| 404 |
+
</div>
|
| 405 |
+
`;
|
| 406 |
+
document.body.appendChild(modal);
|
| 407 |
+
|
| 408 |
+
const handleInput = document.getElementById('handleInput');
|
| 409 |
+
const cancelBtn = document.getElementById('cancelHandle');
|
| 410 |
+
const saveBtn = document.getElementById('saveHandle');
|
| 411 |
+
|
| 412 |
+
handleInput.focus();
|
| 413 |
+
|
| 414 |
+
cancelBtn.addEventListener('click', function() {
|
| 415 |
+
document.body.removeChild(modal);
|
| 416 |
+
});
|
| 417 |
+
|
| 418 |
+
saveBtn.addEventListener('click', function() {
|
| 419 |
+
const handle = handleInput.value.trim();
|
| 420 |
+
if (handle) {
|
| 421 |
+
addSocialIcon(platform, handle);
|
| 422 |
+
// Remove placeholder dots
|
| 423 |
+
const placeholderDots = document.querySelectorAll('.social-icon-placeholder');
|
| 424 |
+
if (placeholderDots.length > 0) {
|
| 425 |
+
const placeholderContainer = placeholderDots[0].parentNode;
|
| 426 |
+
if (placeholderContainer) {
|
| 427 |
+
placeholderContainer.remove();
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
}
|
| 431 |
+
document.body.removeChild(modal);
|
| 432 |
+
document.getElementById('socialDropdown').style.display = 'none';
|
| 433 |
+
});
|
| 434 |
+
|
| 435 |
+
// Close modal when clicking outside
|
| 436 |
+
modal.addEventListener('click', function(e) {
|
| 437 |
+
if (e.target === modal) {
|
| 438 |
+
document.body.removeChild(modal);
|
| 439 |
+
}
|
| 440 |
+
});
|
| 441 |
+
|
| 442 |
+
// Handle Enter key
|
| 443 |
+
handleInput.addEventListener('keypress', function(e) {
|
| 444 |
+
if (e.key === 'Enter') {
|
| 445 |
+
saveBtn.click();
|
| 446 |
+
}
|
| 447 |
+
});
|
| 448 |
+
});
|
| 449 |
+
});
|
| 450 |
+
function addSocialIcon(platform, handle) {
|
| 451 |
+
const container = document.getElementById('socialIconsContainer');
|
| 452 |
+
|
| 453 |
+
// Create social icon element
|
| 454 |
+
const iconWrapper = document.createElement('div');
|
| 455 |
+
iconWrapper.className = 'relative group';
|
| 456 |
+
|
| 457 |
+
const icon = document.createElement('a');
|
| 458 |
+
icon.href = getSocialUrl(platform, handle);
|
| 459 |
+
icon.target = '_blank';
|
| 460 |
+
icon.className = 'w-12 h-12 rounded-full bg-gray-800 hover:bg-indigo-600 flex items-center justify-center transition transform hover:scale-110';
|
| 461 |
+
icon.innerHTML = `<i data-feather="${getFeatherIconName(platform)}" class="w-5 h-5"></i>`;
|
| 462 |
+
|
| 463 |
+
// Add remove button
|
| 464 |
+
const removeBtn = document.createElement('button');
|
| 465 |
+
removeBtn.className = 'absolute -top-1 -right-1 w-4 h-4 bg-red-500 rounded-full text-white text-xs flex items-center justify-center opacity-0 group-hover:opacity-100 transition';
|
| 466 |
+
removeBtn.innerHTML = '×';
|
| 467 |
+
removeBtn.onclick = function(e) {
|
| 468 |
+
e.preventDefault();
|
| 469 |
+
e.stopPropagation();
|
| 470 |
+
container.removeChild(iconWrapper);
|
| 471 |
+
};
|
| 472 |
+
|
| 473 |
+
iconWrapper.appendChild(icon);
|
| 474 |
+
iconWrapper.appendChild(removeBtn);
|
| 475 |
+
|
| 476 |
+
// Insert before the plus button
|
| 477 |
+
const addButton = document.getElementById('addSocialButton').parentNode;
|
| 478 |
+
container.insertBefore(iconWrapper, addButton);
|
| 479 |
+
|
| 480 |
+
feather.replace();
|
| 481 |
+
}
|
| 482 |
+
function getFeatherIconName(platform) {
|
| 483 |
+
const iconMap = {
|
| 484 |
+
instagram: 'instagram',
|
| 485 |
+
facebook: 'facebook',
|
| 486 |
+
twitter: 'twitter',
|
| 487 |
+
tiktok: 'video',
|
| 488 |
+
youtube: 'youtube',
|
| 489 |
+
linkedin: 'linkedin',
|
| 490 |
+
snapchat: 'camera',
|
| 491 |
+
pinterest: 'image',
|
| 492 |
+
reddit: 'message-circle',
|
| 493 |
+
github: 'github'
|
| 494 |
+
};
|
| 495 |
+
return iconMap[platform] || 'link';
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
function getSocialUrl(platform, handle) {
|
| 499 |
+
const urls = {
|
| 500 |
+
instagram: `https://instagram.com/${handle}`,
|
| 501 |
+
facebook: `https://facebook.com/${handle}`,
|
| 502 |
+
twitter: `https://twitter.com/${handle}`,
|
| 503 |
+
tiktok: `https://tiktok.com/@${handle}`,
|
| 504 |
+
youtube: `https://youtube.com/@${handle}`,
|
| 505 |
+
linkedin: `https://linkedin.com/in/${handle}`,
|
| 506 |
+
snapchat: `https://snapchat.com/add/${handle}`,
|
| 507 |
+
pinterest: `https://pinterest.com/${handle}`,
|
| 508 |
+
reddit: `https://reddit.com/user/${handle}`,
|
| 509 |
+
github: `https://github.com/${handle}`
|
| 510 |
+
};
|
| 511 |
+
return urls[platform] || '#';
|
| 512 |
+
}
|
| 513 |
+
// Save profile functionality
|
| 514 |
+
document.getElementById('saveProfile').addEventListener('click', function() {
|
| 515 |
+
const profileData = {
|
| 516 |
+
name: document.getElementById('editableName').textContent,
|
| 517 |
+
title: document.getElementById('editableTitle').textContent,
|
| 518 |
+
description: document.getElementById('editableDescription').textContent,
|
| 519 |
+
phone: document.getElementById('contactButton').textContent,
|
| 520 |
+
image: document.getElementById('profileImage').src
|
| 521 |
+
};
|
| 522 |
+
localStorage.setItem('profileData', JSON.stringify(profileData));
|
| 523 |
+
alert('Profile saved successfully!');
|
| 524 |
+
});
|
| 525 |
+
// Load saved profile
|
| 526 |
+
const savedProfile = localStorage.getItem('profileData');
|
| 527 |
+
if (savedProfile) {
|
| 528 |
+
const profileData = JSON.parse(savedProfile);
|
| 529 |
+
|
| 530 |
+
// Set content only if it's not empty or placeholder
|
| 531 |
+
if (profileData.name && profileData.name !== 'Tap to Add your Name') {
|
| 532 |
+
document.getElementById('editableName').textContent = profileData.name;
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
if (profileData.title && profileData.title !== 'Tap to Add your Title') {
|
| 536 |
+
document.getElementById('editableTitle').textContent = profileData.title;
|
| 537 |
+
}
|
| 538 |
+
if (profileData.description && profileData.description !== 'Tap to Add a Description about Yourself') {
|
| 539 |
+
document.getElementById('editableDescription').textContent = profileData.description;
|
| 540 |
+
}
|
| 541 |
+
if (profileData.phone && profileData.phone !== 'Tap to Add Phone Number') {
|
| 542 |
+
document.getElementById('contactButton').textContent = profileData.phone;
|
| 543 |
+
document.getElementById('contactButton').href = `tel:${profileData.phone.replace(/[^\d+]/g, '')}`;
|
| 544 |
+
}
|
| 545 |
+
if (profileData.image && profileData.image !== 'http://static.photos/technology/320x240/42') {
|
| 546 |
+
document.getElementById('profileImage').src = profileData.image;
|
| 547 |
+
}
|
| 548 |
+
}
|
| 549 |
+
</script>
|
| 550 |
+
</body>
|
| 551 |
</html>
|