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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Hi - Digital Greeting Experience</title>
|
| 7 |
+
|
| 8 |
+
<!-- Importing Remix Icon for modern UI icons -->
|
| 9 |
+
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
| 10 |
+
|
| 11 |
+
<style>
|
| 12 |
+
/*
|
| 13 |
+
* MODERN CSS VARIABLES & RESET
|
| 14 |
+
*/
|
| 15 |
+
:root {
|
| 16 |
+
--bg-dark: #0f172a;
|
| 17 |
+
--bg-card: rgba(30, 41, 59, 0.7);
|
| 18 |
+
--primary: #6366f1;
|
| 19 |
+
--primary-glow: rgba(99, 102, 241, 0.5);
|
| 20 |
+
--accent: #ec4899;
|
| 21 |
+
--text-main: #f8fafc;
|
| 22 |
+
--text-muted: #94a3b8;
|
| 23 |
+
--glass-border: 1px solid rgba(255, 255, 255, 0.1);
|
| 24 |
+
--font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
| 25 |
+
--radius-lg: 24px;
|
| 26 |
+
--radius-md: 12px;
|
| 27 |
+
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
* {
|
| 31 |
+
box-sizing: border-box;
|
| 32 |
+
margin: 0;
|
| 33 |
+
padding: 0;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
body {
|
| 37 |
+
font-family: var(--font-main);
|
| 38 |
+
background-color: var(--bg-dark);
|
| 39 |
+
background-image:
|
| 40 |
+
radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.2) 0%, transparent 40%),
|
| 41 |
+
radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 40%);
|
| 42 |
+
color: var(--text-main);
|
| 43 |
+
min-height: 100vh;
|
| 44 |
+
display: flex;
|
| 45 |
+
flex-direction: column;
|
| 46 |
+
overflow-x: hidden;
|
| 47 |
+
line-height: 1.6;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/*
|
| 51 |
+
* LAYOUT UTILITIES
|
| 52 |
+
*/
|
| 53 |
+
.container {
|
| 54 |
+
max-width: 1200px;
|
| 55 |
+
margin: 0 auto;
|
| 56 |
+
padding: 0 20px;
|
| 57 |
+
width: 100%;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
header {
|
| 61 |
+
padding: 20px 0;
|
| 62 |
+
display: flex;
|
| 63 |
+
justify-content: space-between;
|
| 64 |
+
align-items: center;
|
| 65 |
+
backdrop-filter: blur(10px);
|
| 66 |
+
position: sticky;
|
| 67 |
+
top: 0;
|
| 68 |
+
z-index: 100;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.logo {
|
| 72 |
+
font-weight: 700;
|
| 73 |
+
font-size: 1.5rem;
|
| 74 |
+
letter-spacing: -0.5px;
|
| 75 |
+
display: flex;
|
| 76 |
+
align-items: center;
|
| 77 |
+
gap: 10px;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.logo span {
|
| 81 |
+
color: var(--primary);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/*
|
| 85 |
+
* HERO SECTION
|
| 86 |
+
*/
|
| 87 |
+
.hero {
|
| 88 |
+
flex: 1;
|
| 89 |
+
display: flex;
|
| 90 |
+
flex-direction: column;
|
| 91 |
+
justify-content: center;
|
| 92 |
+
align-items: center;
|
| 93 |
+
text-align: center;
|
| 94 |
+
padding: 60px 0;
|
| 95 |
+
position: relative;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.hero h1 {
|
| 99 |
+
font-size: clamp(3rem, 8vw, 6rem);
|
| 100 |
+
font-weight: 800;
|
| 101 |
+
line-height: 1.1;
|
| 102 |
+
margin-bottom: 20px;
|
| 103 |
+
background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
|
| 104 |
+
-webkit-background-clip: text;
|
| 105 |
+
-webkit-text-fill-color: transparent;
|
| 106 |
+
animation: fadeInDown 1s ease-out;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.hero p {
|
| 110 |
+
font-size: 1.25rem;
|
| 111 |
+
color: var(--text-muted);
|
| 112 |
+
max-width: 600px;
|
| 113 |
+
margin-bottom: 40px;
|
| 114 |
+
animation: fadeInUp 1s ease-out 0.2s backwards;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
/*
|
| 118 |
+
* CONTROLS SECTION
|
| 119 |
+
*/
|
| 120 |
+
.controls {
|
| 121 |
+
display: flex;
|
| 122 |
+
gap: 20px;
|
| 123 |
+
flex-wrap: wrap;
|
| 124 |
+
justify-content: center;
|
| 125 |
+
margin-bottom: 50px;
|
| 126 |
+
animation: fadeInUp 1s ease-out 0.4s backwards;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.input-group {
|
| 130 |
+
position: relative;
|
| 131 |
+
display: flex;
|
| 132 |
+
align-items: center;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.input-group i {
|
| 136 |
+
position: absolute;
|
| 137 |
+
left: 20px;
|
| 138 |
+
color: var(--text-muted);
|
| 139 |
+
font-size: 1.2rem;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
input[type="text"] {
|
| 143 |
+
background: var(--bg-card);
|
| 144 |
+
border: var(--glass-border);
|
| 145 |
+
padding: 16px 20px 16px 50px;
|
| 146 |
+
border-radius: 50px;
|
| 147 |
+
color: white;
|
| 148 |
+
font-size: 1rem;
|
| 149 |
+
width: 300px;
|
| 150 |
+
backdrop-filter: blur(12px);
|
| 151 |
+
transition: var(--transition);
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
input[type="text"]:focus {
|
| 155 |
+
outline: none;
|
| 156 |
+
border-color: var(--primary);
|
| 157 |
+
box-shadow: 0 0 20px var(--primary-glow);
|
| 158 |
+
width: 350px;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
button.primary-btn {
|
| 162 |
+
background: linear-gradient(135deg, var(--primary), var(--accent));
|
| 163 |
+
border: none;
|
| 164 |
+
padding: 16px 32px;
|
| 165 |
+
border-radius: 50px;
|
| 166 |
+
color: white;
|
| 167 |
+
font-weight: 600;
|
| 168 |
+
font-size: 1rem;
|
| 169 |
+
cursor: pointer;
|
| 170 |
+
display: flex;
|
| 171 |
+
align-items: center;
|
| 172 |
+
gap: 8px;
|
| 173 |
+
transition: var(--transition);
|
| 174 |
+
box-shadow: 0 10px 25px -5px var(--primary-glow);
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
button.primary-btn:hover {
|
| 178 |
+
transform: translateY(-2px);
|
| 179 |
+
box-shadow: 0 15px 30px -5px var(--primary-glow);
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
button.primary-btn:active {
|
| 183 |
+
transform: translateY(0);
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
/*
|
| 187 |
+
* GALLERY / CARDS GRID
|
| 188 |
+
*/
|
| 189 |
+
.gallery {
|
| 190 |
+
display: grid;
|
| 191 |
+
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
| 192 |
+
gap: 30px;
|
| 193 |
+
padding-bottom: 60px;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
/*
|
| 197 |
+
* CARD COMPONENT
|
| 198 |
+
*/
|
| 199 |
+
.card {
|
| 200 |
+
background: var(--bg-card);
|
| 201 |
+
border: var(--glass-border);
|
| 202 |
+
border-radius: var(--radius-lg);
|
| 203 |
+
padding: 30px;
|
| 204 |
+
position: relative;
|
| 205 |
+
overflow: hidden;
|
| 206 |
+
backdrop-filter: blur(12px);
|
| 207 |
+
transition: var(--transition);
|
| 208 |
+
display: flex;
|
| 209 |
+
flex-direction: column;
|
| 210 |
+
align-items: center;
|
| 211 |
+
text-align: center;
|
| 212 |
+
animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
|
| 213 |
+
opacity: 0;
|
| 214 |
+
transform: scale(0.8);
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
.card:hover {
|
| 218 |
+
transform: translateY(-5px);
|
| 219 |
+
border-color: rgba(255, 255, 255, 0.2);
|
| 220 |
+
box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
.card-avatar {
|
| 224 |
+
width: 80px;
|
| 225 |
+
height: 80px;
|
| 226 |
+
border-radius: 50%;
|
| 227 |
+
background: linear-gradient(135deg, var(--primary), var(--accent));
|
| 228 |
+
margin-bottom: 20px;
|
| 229 |
+
display: flex;
|
| 230 |
+
align-items: center;
|
| 231 |
+
justify-content: center;
|
| 232 |
+
font-size: 2rem;
|
| 233 |
+
box-shadow: 0 5px 15px var(--primary-glow);
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
.card h3 {
|
| 237 |
+
font-size: 1.5rem;
|
| 238 |
+
margin-bottom: 10px;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
.card p {
|
| 242 |
+
color: var(--text-muted);
|
| 243 |
+
font-size: 0.95rem;
|
| 244 |
+
margin-bottom: 20px;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
.card-footer {
|
| 248 |
+
margin-top: auto;
|
| 249 |
+
width: 100%;
|
| 250 |
+
padding-top: 20px;
|
| 251 |
+
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
| 252 |
+
display: flex;
|
| 253 |
+
justify-content: space-between;
|
| 254 |
+
align-items: center;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.action-btn {
|
| 258 |
+
background: rgba(255, 255, 255, 0.1);
|
| 259 |
+
border: none;
|
| 260 |
+
width: 40px;
|
| 261 |
+
height: 40px;
|
| 262 |
+
border-radius: 50%;
|
| 263 |
+
color: white;
|
| 264 |
+
cursor: pointer;
|
| 265 |
+
display: flex;
|
| 266 |
+
align-items: center;
|
| 267 |
+
justify-content: center;
|
| 268 |
+
transition: var(--transition);
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.action-btn:hover {
|
| 272 |
+
background: white;
|
| 273 |
+
color: var(--bg-dark);
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
/*
|
| 277 |
+
* ANIMATIONS
|
| 278 |
+
*/
|
| 279 |
+
@keyframes fadeInDown {
|
| 280 |
+
from { opacity: 0; transform: translateY(-20px); }
|
| 281 |
+
to { opacity: 1; transform: translateY(0); }
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
@keyframes fadeInUp {
|
| 285 |
+
from { opacity: 0; transform: translateY(20px); }
|
| 286 |
+
to { opacity: 1; transform: translateY(0); }
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
@keyframes popIn {
|
| 290 |
+
to { opacity: 1; transform: scale(1); }
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
/*
|
| 294 |
+
* TOAST NOTIFICATION
|
| 295 |
+
*/
|
| 296 |
+
.toast {
|
| 297 |
+
position: fixed;
|
| 298 |
+
bottom: 30px;
|
| 299 |
+
right: 30px;
|
| 300 |
+
background: rgba(15, 23, 42, 0.9);
|
| 301 |
+
border: 1px solid var(--primary);
|
| 302 |
+
color: white;
|
| 303 |
+
padding: 16px 24px;
|
| 304 |
+
border-radius: var(--radius-md);
|
| 305 |
+
display: flex;
|
| 306 |
+
align-items: center;
|
| 307 |
+
gap: 12px;
|
| 308 |
+
transform: translateY(100px);
|
| 309 |
+
opacity: 0;
|
| 310 |
+
transition: var(--transition);
|
| 311 |
+
z-index: 1000;
|
| 312 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
.toast.show {
|
| 316 |
+
transform: translateY(0);
|
| 317 |
+
opacity: 1;
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
/*
|
| 321 |
+
* FOOTER
|
| 322 |
+
*/
|
| 323 |
+
footer {
|
| 324 |
+
text-align: center;
|
| 325 |
+
padding: 40px;
|
| 326 |
+
color: var(--text-muted);
|
| 327 |
+
font-size: 0.9rem;
|
| 328 |
+
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
.footer-link {
|
| 332 |
+
color: var(--primary);
|
| 333 |
+
text-decoration: none;
|
| 334 |
+
font-weight: 600;
|
| 335 |
+
display: inline-flex;
|
| 336 |
+
align-items: center;
|
| 337 |
+
gap: 5px;
|
| 338 |
+
transition: var(--transition);
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.footer-link:hover {
|
| 342 |
+
color: var(--accent);
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
/* Responsive */
|
| 346 |
+
@media (max-width: 600px) {
|
| 347 |
+
.hero h1 { font-size: 3rem; }
|
| 348 |
+
input[type="text"] { width: 100%; }
|
| 349 |
+
input[type="text"]:focus { width: 100%; }
|
| 350 |
+
.controls { flex-direction: column; align-items: stretch; }
|
| 351 |
+
}
|
| 352 |
+
</style>
|
| 353 |
+
</head>
|
| 354 |
+
<body>
|
| 355 |
+
|
| 356 |
+
<header>
|
| 357 |
+
<div class="container">
|
| 358 |
+
<div class="logo">
|
| 359 |
+
<i class="ri-code-s-slash-line"></i>
|
| 360 |
+
Hi<span>App</span>
|
| 361 |
+
</div>
|
| 362 |
+
</div>
|
| 363 |
+
</header>
|
| 364 |
+
|
| 365 |
+
<main class="container">
|
| 366 |
+
<section class="hero">
|
| 367 |
+
<h1>Hi, Welcome!</h1>
|
| 368 |
+
<p>Generate unique, animated greeting cards instantly using pure HTML, CSS, and JavaScript.</p>
|
| 369 |
+
|
| 370 |
+
<div class="controls">
|
| 371 |
+
<div class="input-group">
|
| 372 |
+
<i class="ri-user-smile-line"></i>
|
| 373 |
+
<input type="text" id="nameInput" placeholder="Enter your name..." value="Friend">
|
| 374 |
+
</div>
|
| 375 |
+
<button class="primary-btn" onclick="generateCard()">
|
| 376 |
+
<i class="ri-magic-line"></i> Generate Card
|
| 377 |
+
</button>
|
| 378 |
+
</div>
|
| 379 |
+
</section>
|
| 380 |
+
|
| 381 |
+
<section class="gallery" id="cardGallery">
|
| 382 |
+
<!-- Cards will be injected here via JS -->
|
| 383 |
+
</section>
|
| 384 |
+
</main>
|
| 385 |
+
|
| 386 |
+
<footer>
|
| 387 |
+
<div class="container">
|
| 388 |
+
<p>© 2023 Hi App. Built with anycoder</p>
|
| 389 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="footer-link">
|
| 390 |
+
<i class="ri-github-fill"></i> Built with anycoder
|
| 391 |
+
</a>
|
| 392 |
+
</div>
|
| 393 |
+
</footer>
|
| 394 |
+
|
| 395 |
+
<!-- Toast Notification Element -->
|
| 396 |
+
<div class="toast" id="toast">
|
| 397 |
+
<i class="ri-checkbox-circle-line" style="color: #4ade80; font-size: 1.2rem;"></i>
|
| 398 |
+
<span id="toastMessage">Card Generated!</span>
|
| 399 |
+
</div>
|
| 400 |
+
|
| 401 |
+
<script>
|
| 402 |
+
// Data for greetings to make the app feel "alive"
|
| 403 |
+
const greetings = [
|
| 404 |
+
"Hello there!",
|
| 405 |
+
"Greetings from the code!",
|
| 406 |
+
"Welcome aboard!",
|
| 407 |
+
"Nice to meet you!",
|
| 408 |
+
"You look great today!",
|
| 409 |
+
"Let's build something cool!",
|
| 410 |
+
"Stay awesome!"
|
| 411 |
+
];
|
| 412 |
+
|
| 413 |
+
const cardGallery = document.getElementById('cardGallery');
|
| 414 |
+
const nameInput = document.getElementById('nameInput');
|
| 415 |
+
const toast = document.getElementById('toast');
|
| 416 |
+
const toastMessage = document.getElementById('toastMessage');
|
| 417 |
+
|
| 418 |
+
// Initialize with default card
|
| 419 |
+
window.addEventListener('DOMContentLoaded', () => {
|
| 420 |
+
generateCard();
|
| 421 |
+
});
|
| 422 |
+
|
| 423 |
+
function generateCard() {
|
| 424 |
+
const name = nameInput.value.trim() || "Friend";
|
| 425 |
+
const greeting = greetings[Math.floor(Math.random() * greetings.length)];
|
| 426 |
+
|
| 427 |
+
// Create card element
|
| 428 |
+
const card = document.createElement('div');
|
| 429 |
+
card.className = 'card';
|
| 430 |
+
|
| 431 |
+
// Randomize animation delay slightly for variety
|
| 432 |
+
const delay = Math.random() * 0.2;
|
| 433 |
+
|
| 434 |
+
// Generate a random color for the avatar
|
| 435 |
+
const hue = Math.floor(Math.random() * 360);
|
| 436 |
+
const avatarColor = `hsl(${hue}, 70%, 60%)`;
|
| 437 |
+
|
| 438 |
+
card.innerHTML = `
|
| 439 |
+
<div class="card-avatar" style="background: linear-gradient(135deg, ${avatarColor}, var(--accent));">
|
| 440 |
+
<i class="ri-sparkling-fill"></i>
|
| 441 |
+
</div>
|
| 442 |
+
<h3>Hi, ${name}!</h3>
|
| 443 |
+
<p>${greeting}</p>
|
| 444 |
+
<div class="card-footer">
|
| 445 |
+
<span style="font-size: 0.8rem; color: var(--text-muted);">#${Math.floor(Math.random() * 1000)}</span>
|
| 446 |
+
<div style="display: flex; gap: 10px;">
|
| 447 |
+
<button class="action-btn" onclick="copyCard(this)" title="Copy Text">
|
| 448 |
+
<i class="ri-file-copy-line"></i>
|
| 449 |
+
</button>
|
| 450 |
+
<button class="action-btn" onclick="deleteCard(this)" title="Delete">
|
| 451 |
+
<i class="ri-delete-bin-line"></i>
|
| 452 |
+
</button>
|
| 453 |
+
</div>
|
| 454 |
+
</div>
|
| 455 |
+
`;
|
| 456 |
+
|
| 457 |
+
// Insert at the beginning
|
| 458 |
+
cardGallery.insertBefore(card, cardGallery.firstChild);
|
| 459 |
+
|
| 460 |
+
showToast(`Card created for ${name}`);
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
function deleteCard(btn) {
|
| 464 |
+
const card = btn.closest('.card');
|
| 465 |
+
card.style.transform = 'scale(0.8)';
|
| 466 |
+
card.style.opacity = '0';
|
| 467 |
+
setTimeout(() => {
|
| 468 |
+
card.remove();
|
| 469 |
+
}, 300);
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
function copyCard(btn) {
|
| 473 |
+
const card = btn.closest('.card');
|
| 474 |
+
const name = card.querySelector('h3').innerText;
|
| 475 |
+
const text = `${name}\n${card.querySelector('p').innerText}`;
|
| 476 |
+
|
| 477 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 478 |
+
showToast("Copied to clipboard!");
|
| 479 |
+
});
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
function showToast(message) {
|
| 483 |
+
toastMessage.innerText = message;
|
| 484 |
+
toast.classList.add('show');
|
| 485 |
+
|
| 486 |
+
setTimeout(() => {
|
| 487 |
+
toast.classList.remove('show');
|
| 488 |
+
}, 3000);
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
// Allow "Enter" key to generate card
|
| 492 |
+
nameInput.addEventListener('keypress', function (e) {
|
| 493 |
+
if (e.key === 'Enter') {
|
| 494 |
+
generateCard();
|
| 495 |
+
}
|
| 496 |
+
});
|
| 497 |
+
</script>
|
| 498 |
+
</body>
|
| 499 |
+
</html>
|