askrobots / dbbasic-web-native
Public
100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.
danq9
Add canonical.html v1.0 - The single source of truth for usability standards
fb6e650
1 year ago
History
demo-blog.html · 23.7 KB · 671 lines
| 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>TechBlog - Modern Web Development</title> |
| 7 | <script src="semantic-components.js"></script> |
| 8 | <style> |
| 9 | * { |
| 10 | margin: 0; |
| 11 | padding: 0; |
| 12 | box-sizing: border-box; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | background: #000; |
| 17 | color: #fff; |
| 18 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 19 | line-height: 1.6; |
| 20 | } |
| 21 | |
| 22 | /* Header */ |
| 23 | .header { |
| 24 | background: #1c1c1e; |
| 25 | border-bottom: 1px solid #3a3a3c; |
| 26 | padding: 20px 0; |
| 27 | position: sticky; |
| 28 | top: 0; |
| 29 | z-index: 100; |
| 30 | } |
| 31 | |
| 32 | .header-content { |
| 33 | max-width: 1200px; |
| 34 | margin: 0 auto; |
| 35 | padding: 0 32px; |
| 36 | display: flex; |
| 37 | align-items: center; |
| 38 | justify-content: space-between; |
| 39 | } |
| 40 | |
| 41 | .logo { |
| 42 | font-size: 24px; |
| 43 | font-weight: 700; |
| 44 | color: #409cff; |
| 45 | } |
| 46 | |
| 47 | .nav-links { |
| 48 | display: flex; |
| 49 | gap: 32px; |
| 50 | align-items: center; |
| 51 | } |
| 52 | |
| 53 | .nav-link { |
| 54 | color: #ebebf5; |
| 55 | text-decoration: none; |
| 56 | transition: color 0.2s; |
| 57 | } |
| 58 | |
| 59 | .nav-link:hover { |
| 60 | color: #409cff; |
| 61 | } |
| 62 | |
| 63 | /* Hero */ |
| 64 | .hero { |
| 65 | max-width: 1200px; |
| 66 | margin: 0 auto; |
| 67 | padding: 80px 32px; |
| 68 | } |
| 69 | |
| 70 | .hero-title { |
| 71 | font-size: 56px; |
| 72 | font-weight: 800; |
| 73 | margin-bottom: 24px; |
| 74 | line-height: 1.1; |
| 75 | background: linear-gradient(135deg, #409cff 0%, #30d158 100%); |
| 76 | -webkit-background-clip: text; |
| 77 | -webkit-text-fill-color: transparent; |
| 78 | background-clip: text; |
| 79 | } |
| 80 | |
| 81 | .hero-subtitle { |
| 82 | font-size: 20px; |
| 83 | color: #8e8e93; |
| 84 | margin-bottom: 32px; |
| 85 | } |
| 86 | |
| 87 | .hero-actions { |
| 88 | display: flex; |
| 89 | gap: 16px; |
| 90 | } |
| 91 | |
| 92 | /* Main Content */ |
| 93 | .container { |
| 94 | max-width: 1200px; |
| 95 | margin: 0 auto; |
| 96 | padding: 0 32px 80px; |
| 97 | } |
| 98 | |
| 99 | .content-grid { |
| 100 | display: grid; |
| 101 | grid-template-columns: 2fr 1fr; |
| 102 | gap: 48px; |
| 103 | } |
| 104 | |
| 105 | /* Featured Post */ |
| 106 | .featured-post { |
| 107 | background: #1c1c1e; |
| 108 | border-radius: 16px; |
| 109 | overflow: hidden; |
| 110 | margin-bottom: 48px; |
| 111 | } |
| 112 | |
| 113 | .featured-image { |
| 114 | width: 100%; |
| 115 | height: 400px; |
| 116 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 117 | display: flex; |
| 118 | align-items: center; |
| 119 | justify-content: center; |
| 120 | font-size: 64px; |
| 121 | } |
| 122 | |
| 123 | .featured-content { |
| 124 | padding: 32px; |
| 125 | } |
| 126 | |
| 127 | .post-meta { |
| 128 | display: flex; |
| 129 | gap: 16px; |
| 130 | margin-bottom: 16px; |
| 131 | flex-wrap: wrap; |
| 132 | } |
| 133 | |
| 134 | .post-title { |
| 135 | font-size: 32px; |
| 136 | font-weight: 700; |
| 137 | margin-bottom: 16px; |
| 138 | line-height: 1.2; |
| 139 | } |
| 140 | |
| 141 | .post-excerpt { |
| 142 | color: #8e8e93; |
| 143 | font-size: 16px; |
| 144 | margin-bottom: 24px; |
| 145 | } |
| 146 | |
| 147 | /* Blog Posts */ |
| 148 | .blog-posts { |
| 149 | display: flex; |
| 150 | flex-direction: column; |
| 151 | gap: 32px; |
| 152 | } |
| 153 | |
| 154 | .post-card { |
| 155 | background: #1c1c1e; |
| 156 | border-radius: 12px; |
| 157 | overflow: hidden; |
| 158 | transition: transform 0.2s; |
| 159 | } |
| 160 | |
| 161 | .post-card:hover { |
| 162 | transform: translateY(-4px); |
| 163 | } |
| 164 | |
| 165 | .post-image { |
| 166 | width: 100%; |
| 167 | height: 200px; |
| 168 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 169 | display: flex; |
| 170 | align-items: center; |
| 171 | justify-content: center; |
| 172 | font-size: 48px; |
| 173 | } |
| 174 | |
| 175 | .post-content { |
| 176 | padding: 24px; |
| 177 | } |
| 178 | |
| 179 | .post-content .post-title { |
| 180 | font-size: 24px; |
| 181 | margin-bottom: 12px; |
| 182 | } |
| 183 | |
| 184 | /* Sidebar */ |
| 185 | .sidebar { |
| 186 | position: sticky; |
| 187 | top: 100px; |
| 188 | height: fit-content; |
| 189 | } |
| 190 | |
| 191 | .widget { |
| 192 | background: #1c1c1e; |
| 193 | border-radius: 12px; |
| 194 | padding: 24px; |
| 195 | margin-bottom: 24px; |
| 196 | } |
| 197 | |
| 198 | .widget-title { |
| 199 | font-size: 18px; |
| 200 | font-weight: 600; |
| 201 | margin-bottom: 20px; |
| 202 | } |
| 203 | |
| 204 | .author-box { |
| 205 | text-align: center; |
| 206 | } |
| 207 | |
| 208 | .author-avatar { |
| 209 | width: 80px; |
| 210 | height: 80px; |
| 211 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 212 | border-radius: 40px; |
| 213 | margin: 0 auto 16px; |
| 214 | display: flex; |
| 215 | align-items: center; |
| 216 | justify-content: center; |
| 217 | font-size: 32px; |
| 218 | } |
| 219 | |
| 220 | .author-name { |
| 221 | font-size: 18px; |
| 222 | font-weight: 600; |
| 223 | margin-bottom: 8px; |
| 224 | } |
| 225 | |
| 226 | .author-bio { |
| 227 | color: #8e8e93; |
| 228 | font-size: 14px; |
| 229 | margin-bottom: 16px; |
| 230 | } |
| 231 | |
| 232 | .category-list { |
| 233 | list-style: none; |
| 234 | } |
| 235 | |
| 236 | .category-item { |
| 237 | padding: 12px 0; |
| 238 | border-bottom: 1px solid #3a3a3c; |
| 239 | display: flex; |
| 240 | justify-content: space-between; |
| 241 | align-items: center; |
| 242 | } |
| 243 | |
| 244 | .category-item:last-child { |
| 245 | border-bottom: none; |
| 246 | } |
| 247 | |
| 248 | .category-link { |
| 249 | color: #ebebf5; |
| 250 | text-decoration: none; |
| 251 | transition: color 0.2s; |
| 252 | } |
| 253 | |
| 254 | .category-link:hover { |
| 255 | color: #409cff; |
| 256 | } |
| 257 | |
| 258 | .tag-cloud { |
| 259 | display: flex; |
| 260 | flex-wrap: wrap; |
| 261 | gap: 8px; |
| 262 | } |
| 263 | |
| 264 | /* Newsletter */ |
| 265 | .newsletter { |
| 266 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 267 | border-radius: 12px; |
| 268 | padding: 32px; |
| 269 | text-align: center; |
| 270 | margin-bottom: 48px; |
| 271 | } |
| 272 | |
| 273 | .newsletter-title { |
| 274 | font-size: 24px; |
| 275 | font-weight: 700; |
| 276 | margin-bottom: 12px; |
| 277 | } |
| 278 | |
| 279 | .newsletter-text { |
| 280 | margin-bottom: 20px; |
| 281 | opacity: 0.9; |
| 282 | } |
| 283 | |
| 284 | .newsletter-form { |
| 285 | display: flex; |
| 286 | gap: 12px; |
| 287 | max-width: 400px; |
| 288 | margin: 0 auto; |
| 289 | } |
| 290 | |
| 291 | /* Footer */ |
| 292 | .footer { |
| 293 | background: #1c1c1e; |
| 294 | border-top: 1px solid #3a3a3c; |
| 295 | padding: 48px 32px; |
| 296 | } |
| 297 | |
| 298 | .footer-content { |
| 299 | max-width: 1200px; |
| 300 | margin: 0 auto; |
| 301 | display: grid; |
| 302 | grid-template-columns: repeat(3, 1fr); |
| 303 | gap: 48px; |
| 304 | } |
| 305 | |
| 306 | .footer-section h3 { |
| 307 | font-size: 16px; |
| 308 | margin-bottom: 16px; |
| 309 | } |
| 310 | |
| 311 | .footer-links { |
| 312 | list-style: none; |
| 313 | } |
| 314 | |
| 315 | .footer-links li { |
| 316 | margin-bottom: 12px; |
| 317 | } |
| 318 | |
| 319 | .footer-links a { |
| 320 | color: #8e8e93; |
| 321 | text-decoration: none; |
| 322 | transition: color 0.2s; |
| 323 | } |
| 324 | |
| 325 | .footer-links a:hover { |
| 326 | color: #409cff; |
| 327 | } |
| 328 | |
| 329 | .social-links { |
| 330 | display: flex; |
| 331 | gap: 12px; |
| 332 | } |
| 333 | |
| 334 | /* Responsive */ |
| 335 | @media (max-width: 768px) { |
| 336 | .hero-title { |
| 337 | font-size: 36px; |
| 338 | } |
| 339 | |
| 340 | .content-grid { |
| 341 | grid-template-columns: 1fr; |
| 342 | } |
| 343 | |
| 344 | .sidebar { |
| 345 | position: relative; |
| 346 | top: 0; |
| 347 | } |
| 348 | |
| 349 | .footer-content { |
| 350 | grid-template-columns: 1fr; |
| 351 | } |
| 352 | |
| 353 | .nav-links { |
| 354 | display: none; |
| 355 | } |
| 356 | } |
| 357 | </style> |
| 358 | </head> |
| 359 | <body> |
| 360 | <!-- Header --> |
| 361 | <header class="header"> |
| 362 | <div class="header-content"> |
| 363 | <div class="logo">📝 TechBlog</div> |
| 364 | <nav class="nav-links"> |
| 365 | <a href="#" class="nav-link">Home</a> |
| 366 | <a href="#" class="nav-link">Articles</a> |
| 367 | <a href="#" class="nav-link">About</a> |
| 368 | <semantic-action intent="primary">Subscribe</semantic-action> |
| 369 | </nav> |
| 370 | </div> |
| 371 | </header> |
| 372 | |
| 373 | <!-- Hero --> |
| 374 | <section class="hero"> |
| 375 | <semantic-breadcrumb separator="›"> |
| 376 | <breadcrumb-item href="/">Home</breadcrumb-item> |
| 377 | <breadcrumb-item href="/blog">Blog</breadcrumb-item> |
| 378 | <breadcrumb-item>Web Development</breadcrumb-item> |
| 379 | </semantic-breadcrumb> |
| 380 | |
| 381 | <h1 class="hero-title">Discover Modern Web Development</h1> |
| 382 | <p class="hero-subtitle"> |
| 383 | Tutorials, insights, and best practices for building amazing web applications with the latest technologies. |
| 384 | </p> |
| 385 | <div class="hero-actions"> |
| 386 | <semantic-action intent="primary">Latest Articles</semantic-action> |
| 387 | <semantic-action intent="secondary">Browse Topics</semantic-action> |
| 388 | </div> |
| 389 | </section> |
| 390 | |
| 391 | <!-- Newsletter --> |
| 392 | <div class="container"> |
| 393 | <div class="newsletter"> |
| 394 | <h2 class="newsletter-title">Stay Updated</h2> |
| 395 | <p class="newsletter-text">Get the latest articles delivered to your inbox every week.</p> |
| 396 | <div class="newsletter-form"> |
| 397 | <semantic-input type="email" placeholder="your@email.com" intent="neutral" style="flex: 1;"></semantic-input> |
| 398 | <semantic-action intent="success">Subscribe</semantic-action> |
| 399 | </div> |
| 400 | </div> |
| 401 | |
| 402 | <div class="content-grid"> |
| 403 | <!-- Main Content --> |
| 404 | <main> |
| 405 | <!-- Featured Post --> |
| 406 | <article class="featured-post"> |
| 407 | <div class="featured-image">🚀</div> |
| 408 | <div class="featured-content"> |
| 409 | <div class="post-meta"> |
| 410 | <semantic-badge intent="primary">Featured</semantic-badge> |
| 411 | <semantic-badge intent="neutral" variant="outline">Web Components</semantic-badge> |
| 412 | <span style="color: #8e8e93; font-size: 14px;">March 15, 2025 · 8 min read</span> |
| 413 | </div> |
| 414 | <h2 class="post-title">Building Modern UI Components with Web Standards</h2> |
| 415 | <p class="post-excerpt"> |
| 416 | Learn how to create reusable, performant UI components using native Web Components API. |
| 417 | No frameworks required - just vanilla JavaScript and web standards that work everywhere. |
| 418 | </p> |
| 419 | <semantic-action intent="primary" id="btn-read-more">Read Full Article</semantic-action> |
| 420 | </div> |
| 421 | </article> |
| 422 | |
| 423 | <!-- Recent Posts --> |
| 424 | <h2 style="font-size: 28px; margin-bottom: 32px;">Recent Articles</h2> |
| 425 | <div class="blog-posts"> |
| 426 | <article class="post-card"> |
| 427 | <div class="post-image">⚡</div> |
| 428 | <div class="post-content"> |
| 429 | <div class="post-meta"> |
| 430 | <semantic-badge intent="success" variant="subtle">Performance</semantic-badge> |
| 431 | <span style="color: #8e8e93; font-size: 14px;">March 12, 2025</span> |
| 432 | </div> |
| 433 | <h3 class="post-title">Optimizing Web Performance in 2025</h3> |
| 434 | <p class="post-excerpt"> |
| 435 | Discover the latest techniques for building lightning-fast websites that provide |
| 436 | exceptional user experiences across all devices. |
| 437 | </p> |
| 438 | <semantic-action intent="secondary">Read More →</semantic-action> |
| 439 | </div> |
| 440 | </article> |
| 441 | |
| 442 | <article class="post-card"> |
| 443 | <div class="post-image" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">🎨</div> |
| 444 | <div class="post-content"> |
| 445 | <div class="post-meta"> |
| 446 | <semantic-badge intent="warning" variant="subtle">Design</semantic-badge> |
| 447 | <span style="color: #8e8e93; font-size: 14px;">March 10, 2025</span> |
| 448 | </div> |
| 449 | <h3 class="post-title">Modern CSS Techniques for Beautiful UIs</h3> |
| 450 | <p class="post-excerpt"> |
| 451 | Explore cutting-edge CSS features like container queries, cascade layers, and |
| 452 | color-mix() to create stunning designs. |
| 453 | </p> |
| 454 | <semantic-action intent="secondary">Read More →</semantic-action> |
| 455 | </div> |
| 456 | </article> |
| 457 | |
| 458 | <article class="post-card"> |
| 459 | <div class="post-image" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">🔒</div> |
| 460 | <div class="post-content"> |
| 461 | <div class="post-meta"> |
| 462 | <semantic-badge intent="danger" variant="subtle">Security</semantic-badge> |
| 463 | <span style="color: #8e8e93; font-size: 14px;">March 8, 2025</span> |
| 464 | </div> |
| 465 | <h3 class="post-title">Web Security Best Practices</h3> |
| 466 | <p class="post-excerpt"> |
| 467 | Protect your applications from common vulnerabilities with these essential |
| 468 | security practices and tools. |
| 469 | </p> |
| 470 | <semantic-action intent="secondary">Read More →</semantic-action> |
| 471 | </div> |
| 472 | </article> |
| 473 | </div> |
| 474 | |
| 475 | <!-- Load More --> |
| 476 | <div style="margin-top: 48px; text-align: center;"> |
| 477 | <semantic-action intent="secondary">Load More Articles</semantic-action> |
| 478 | </div> |
| 479 | </main> |
| 480 | |
| 481 | <!-- Sidebar --> |
| 482 | <aside class="sidebar"> |
| 483 | <!-- Author Box --> |
| 484 | <div class="widget author-box"> |
| 485 | <div class="author-avatar">👨💻</div> |
| 486 | <div class="author-name">Alex Johnson</div> |
| 487 | <p class="author-bio"> |
| 488 | Full-stack developer, tech writer, and open source contributor passionate about modern web technologies. |
| 489 | </p> |
| 490 | <semantic-action intent="primary" style="width: 100%;">Follow</semantic-action> |
| 491 | </div> |
| 492 | |
| 493 | <!-- Categories --> |
| 494 | <div class="widget"> |
| 495 | <h3 class="widget-title">Categories</h3> |
| 496 | <ul class="category-list"> |
| 497 | <li class="category-item"> |
| 498 | <a href="#" class="category-link">Web Development</a> |
| 499 | <semantic-badge intent="neutral" size="small">24</semantic-badge> |
| 500 | </li> |
| 501 | <li class="category-item"> |
| 502 | <a href="#" class="category-link">JavaScript</a> |
| 503 | <semantic-badge intent="neutral" size="small">18</semantic-badge> |
| 504 | </li> |
| 505 | <li class="category-item"> |
| 506 | <a href="#" class="category-link">CSS</a> |
| 507 | <semantic-badge intent="neutral" size="small">15</semantic-badge> |
| 508 | </li> |
| 509 | <li class="category-item"> |
| 510 | <a href="#" class="category-link">Performance</a> |
| 511 | <semantic-badge intent="neutral" size="small">12</semantic-badge> |
| 512 | </li> |
| 513 | <li class="category-item"> |
| 514 | <a href="#" class="category-link">Security</a> |
| 515 | <semantic-badge intent="neutral" size="small">8</semantic-badge> |
| 516 | </li> |
| 517 | </ul> |
| 518 | </div> |
| 519 | |
| 520 | <!-- Popular Tags --> |
| 521 | <div class="widget"> |
| 522 | <h3 class="widget-title">Popular Tags</h3> |
| 523 | <div class="tag-cloud"> |
| 524 | <semantic-badge intent="primary" variant="outline">Web Components</semantic-badge> |
| 525 | <semantic-badge intent="success" variant="outline">React</semantic-badge> |
| 526 | <semantic-badge intent="warning" variant="outline">TypeScript</semantic-badge> |
| 527 | <semantic-badge intent="neutral" variant="outline">Node.js</semantic-badge> |
| 528 | <semantic-badge intent="primary" variant="outline">HTML5</semantic-badge> |
| 529 | <semantic-badge intent="success" variant="outline">CSS3</semantic-badge> |
| 530 | <semantic-badge intent="danger" variant="outline">API Design</semantic-badge> |
| 531 | </div> |
| 532 | </div> |
| 533 | |
| 534 | <!-- Recent Comments --> |
| 535 | <div class="widget"> |
| 536 | <h3 class="widget-title">Recent Discussions</h3> |
| 537 | <semantic-disclosure> |
| 538 | <div slot="summary">3 new comments on "Building Modern UI Components"</div> |
| 539 | <div slot="content"> |
| 540 | <div style="padding: 12px 0; border-bottom: 1px solid #3a3a3c;"> |
| 541 | <div style="font-weight: 600; margin-bottom: 4px;">Sarah M.</div> |
| 542 | <p style="color: #8e8e93; font-size: 14px;">Great article! I've been looking for a guide like this.</p> |
| 543 | </div> |
| 544 | <div style="padding: 12px 0; border-bottom: 1px solid #3a3a3c;"> |
| 545 | <div style="font-weight: 600; margin-bottom: 4px;">Mike R.</div> |
| 546 | <p style="color: #8e8e93; font-size: 14px;">The performance tips were super helpful, thanks!</p> |
| 547 | </div> |
| 548 | <div style="padding: 12px 0;"> |
| 549 | <div style="font-weight: 600; margin-bottom: 4px;">Emma L.</div> |
| 550 | <p style="color: #8e8e93; font-size: 14px;">Can you do a follow-up on Shadow DOM?</p> |
| 551 | </div> |
| 552 | </div> |
| 553 | </semantic-disclosure> |
| 554 | </div> |
| 555 | </aside> |
| 556 | </div> |
| 557 | </div> |
| 558 | |
| 559 | <!-- Footer --> |
| 560 | <footer class="footer"> |
| 561 | <div class="footer-content"> |
| 562 | <div class="footer-section"> |
| 563 | <h3>About TechBlog</h3> |
| 564 | <p style="color: #8e8e93; margin-bottom: 16px;"> |
| 565 | A community-driven platform sharing knowledge about modern web development, design, and technology. |
| 566 | </p> |
| 567 | <div class="social-links"> |
| 568 | <semantic-action intent="secondary" size="small">Twitter</semantic-action> |
| 569 | <semantic-action intent="secondary" size="small">GitHub</semantic-action> |
| 570 | <semantic-action intent="secondary" size="small">LinkedIn</semantic-action> |
| 571 | </div> |
| 572 | </div> |
| 573 | |
| 574 | <div class="footer-section"> |
| 575 | <h3>Quick Links</h3> |
| 576 | <ul class="footer-links"> |
| 577 | <li><a href="#">Home</a></li> |
| 578 | <li><a href="#">All Articles</a></li> |
| 579 | <li><a href="#">Categories</a></li> |
| 580 | <li><a href="#">About</a></li> |
| 581 | <li><a href="#">Contact</a></li> |
| 582 | </ul> |
| 583 | </div> |
| 584 | |
| 585 | <div class="footer-section"> |
| 586 | <h3>Resources</h3> |
| 587 | <ul class="footer-links"> |
| 588 | <li><a href="#">Documentation</a></li> |
| 589 | <li><a href="#">Tutorials</a></li> |
| 590 | <li><a href="#">Newsletter Archive</a></li> |
| 591 | <li><a href="#">Privacy Policy</a></li> |
| 592 | <li><a href="#">Terms of Service</a></li> |
| 593 | </ul> |
| 594 | </div> |
| 595 | </div> |
| 596 | <div style="text-align: center; margin-top: 32px; padding-top: 32px; border-top: 1px solid #3a3a3c; color: #8e8e93;"> |
| 597 | <p>© 2025 TechBlog. Built with Semantic Components.</p> |
| 598 | </div> |
| 599 | </footer> |
| 600 | |
| 601 | <!-- Read More Modal --> |
| 602 | <semantic-modal id="modal-article"> |
| 603 | <div slot="header"> |
| 604 | <h3 style="font-size: 24px; margin: 0;">Building Modern UI Components with Web Standards</h3> |
| 605 | </div> |
| 606 | <div slot="body" style="line-height: 1.8;"> |
| 607 | <div style="margin-bottom: 20px;"> |
| 608 | <semantic-badge intent="primary">Featured</semantic-badge> |
| 609 | <semantic-badge intent="neutral" variant="outline">Web Components</semantic-badge> |
| 610 | </div> |
| 611 | |
| 612 | <p style="margin-bottom: 16px;"> |
| 613 | Web Components are a suite of different technologies that allow you to create reusable custom elements |
| 614 | with their functionality encapsulated away from the rest of your code. |
| 615 | </p> |
| 616 | |
| 617 | <h4 style="font-size: 18px; margin: 24px 0 12px 0;">Why Web Components?</h4> |
| 618 | <p style="margin-bottom: 16px;"> |
| 619 | Unlike framework-specific components, Web Components work everywhere. They're built on web standards |
| 620 | and supported natively by all modern browsers. |
| 621 | </p> |
| 622 | |
| 623 | <semantic-tabs style="margin: 24px 0;"> |
| 624 | <tab-item label="Benefits" active></tab-item> |
| 625 | <tab-item label="Use Cases"></tab-item> |
| 626 | <tab-item label="Browser Support"></tab-item> |
| 627 | </semantic-tabs> |
| 628 | |
| 629 | <ul style="margin: 16px 0; padding-left: 24px;"> |
| 630 | <li>No framework dependencies</li> |
| 631 | <li>True encapsulation with Shadow DOM</li> |
| 632 | <li>Reusable across projects</li> |
| 633 | <li>Standards-based and future-proof</li> |
| 634 | </ul> |
| 635 | |
| 636 | <semantic-progress value="100" intent="success" style="margin: 24px 0;"></semantic-progress> |
| 637 | |
| 638 | <p style="color: #8e8e93; font-size: 14px;"> |
| 639 | This article is part of our Modern Web Development series. |
| 640 | <semantic-popover position="top" content="Click to see more articles in this series" trigger="hover"> |
| 641 | <span slot="trigger" style="color: #409cff; cursor: help; text-decoration: underline;">Learn more</span> |
| 642 | </semantic-popover> |
| 643 | </p> |
| 644 | </div> |
| 645 | <div slot="footer"> |
| 646 | <div style="display: flex; gap: 12px; justify-content: flex-end;"> |
| 647 | <semantic-action intent="secondary" onclick="document.getElementById('modal-article').close()">Close</semantic-action> |
| 648 | <semantic-action intent="primary" onclick="document.getElementById('modal-article').close()">Share Article</semantic-action> |
| 649 | </div> |
| 650 | </div> |
| 651 | </semantic-modal> |
| 652 | |
| 653 | <script> |
| 654 | // Open article modal |
| 655 | document.getElementById('btn-read-more').addEventListener('click', () => { |
| 656 | document.getElementById('modal-article').open(); |
| 657 | }); |
| 658 | |
| 659 | // Smooth scroll for navigation |
| 660 | document.querySelectorAll('a[href^="#"]').forEach(anchor => { |
| 661 | anchor.addEventListener('click', function (e) { |
| 662 | e.preventDefault(); |
| 663 | const target = document.querySelector(this.getAttribute('href')); |
| 664 | if (target) { |
| 665 | target.scrollIntoView({ behavior: 'smooth' }); |
| 666 | } |
| 667 | }); |
| 668 | }); |
| 669 | </script> |
| 670 | </body> |
| 671 | </html> |