It looks like this is a web page, not a feed. I looked for a feed associated with this page, but couldn't find one. Please enter the address of your feed to validate.

Source: https://Www.Genshinzone.cc/

  1. <!DOCTYPE html>
  2.  
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8"/>
  6. <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
  7. <title>GenshinZone | Genshin Impact Game Blog</title>
  8. <meta content="GenshinZone is a dedicated Genshin Impact blog platform, providing the latest guides, character builds, weapon recommendations, in-depth exploration, and version previews. Your one-stop destination for all Genshin Impact news and strategies!" name="description"/>
  9. <meta content=",game guides,Genshin Impact guides,character builds,weapon builds,miHoYo,Genshin news,Genshin tips,game strategies,version updates,open world games,anime games" name="keywords"/>
  10. <link href="https://www.genshinzone.cc/" rel="canonical"/>
  11. <style>
  12.        /* Global Styles */
  13.        :root {
  14.            --primary: #64b2e3;
  15.            --secondary: #f9c639;
  16.            --accent: #ec6d77;
  17.            --dark: #2c3e50;
  18.            --light: #f7f8fc;
  19.            --anemo: #73dbc8;
  20.            --geo: #f1b94b;
  21.            --electro: #af7ee7;
  22.            --dendro: #a6c938;
  23.            --hydro: #21a1d5;
  24.            --pyro: #ef6a4c;
  25.            --cryo: #a0d8f1;
  26.        }
  27.  
  28.        * {
  29.            margin: 0;
  30.            padding: 0;
  31.            box-sizing: border-box;
  32.            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  33.        }
  34.  
  35.        body {
  36.            background-color: var(--light);
  37.            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="%23f7f8fc" width="50" height="50" x="0" y="0"/><rect fill="%23eef0f7" width="50" height="50" x="50" y="0"/><rect fill="%23eef0f7" width="50" height="50" x="0" y="50"/><rect fill="%23f7f8fc" width="50" height="50" x="50" y="50"/></svg>');
  38.            color: var(--dark);
  39.        }
  40.  
  41.        .container {
  42.            max-width: 1200px;
  43.            margin: 0 auto;
  44.            padding: 0 20px;
  45.        }
  46.  
  47.        a {
  48.            text-decoration: none;
  49.            color: var(--primary);
  50.            transition: all 0.3s ease;
  51.        }
  52.  
  53.        a:hover {
  54.            color: var(--accent);
  55.        }
  56.  
  57.        button {
  58.            cursor: pointer;
  59.            border: none;
  60.            border-radius: 25px;
  61.            padding: 10px 25px;
  62.            font-weight: bold;
  63.            transition: all 0.3s ease;
  64.            background-color: var(--primary);
  65.            color: white;
  66.        }
  67.  
  68.        button:hover {
  69.            background-color: var(--accent);
  70.            transform: translateY(-2px);
  71.            box-shadow: 0 5px 15px rgba(236, 109, 119, 0.4);
  72.        }
  73.  
  74.        /* Header Styles */
  75.        header {
  76.            background: linear-gradient(135deg, #73dbc8, #21a1d5, #af7ee7);
  77.            color: white;
  78.            padding: 20px 0;
  79.            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  80.            position: relative;
  81.            overflow: hidden;
  82.        }
  83.  
  84.        header::before {
  85.            content: '';
  86.            position: absolute;
  87.            width: 100%;
  88.            height: 100%;
  89.            top: 0;
  90.            left: 0;
  91.            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="25" cy="25" r="10" fill="%23ffffff10"/><circle cx="75" cy="75" r="15" fill="%23ffffff10"/><circle cx="75" cy="25" r="5" fill="%23ffffff10"/><circle cx="25" cy="75" r="8" fill="%23ffffff10"/></svg>');
  92.            opacity: 0.3;
  93.        }
  94.  
  95.        .navbar {
  96.            display: flex;
  97.            justify-content: space-between;
  98.            align-items: center;
  99.        }
  100.  
  101.        .logo {
  102.            font-size: 24px;
  103.            font-weight: bold;
  104.            color: white;
  105.            display: flex;
  106.            align-items: center;
  107.        }
  108.  
  109.        .logo img {
  110.            height: 40px;
  111.            margin-right: 10px;
  112.        }
  113.  
  114.        nav ul {
  115.            display: flex;
  116.            list-style: none;
  117.        }
  118.  
  119.        nav ul li {
  120.            margin-left: 30px;
  121.        }
  122.  
  123.        nav ul li a {
  124.            color: white;
  125.            font-weight: bold;
  126.            position: relative;
  127.        }
  128.  
  129.        nav ul li a::after {
  130.            content: '';
  131.            position: absolute;
  132.            bottom: -5px;
  133.            left: 0;
  134.            width: 0;
  135.            height: 2px;
  136.            background-color: var(--secondary);
  137.            transition: width 0.3s ease;
  138.        }
  139.  
  140.        nav ul li a.active::after,
  141.        nav ul li a:hover::after {
  142.            width: 100%;
  143.        }
  144.  
  145.        .hero {
  146.            display: flex;
  147.            align-items: center;
  148.            padding: 60px 0;
  149.        }
  150.  
  151.        .hero-content {
  152.            flex: 1;
  153.        }
  154.  
  155.        .hero h1 {
  156.            font-size: 48px;
  157.            margin-bottom: 20px;
  158.            line-height: 1.2;
  159.            position: relative;
  160.            z-index: 1;
  161.        }
  162.  
  163.        .hero h1::after {
  164.            content: '';
  165.            position: absolute;
  166.            width: 60px;
  167.            height: 6px;
  168.            background-color: var(--secondary);
  169.            bottom: -10px;
  170.            left: 0;
  171.            border-radius: 3px;
  172.        }
  173.  
  174.        .hero p {
  175.            font-size: 18px;
  176.            margin-bottom: 30px;
  177.            line-height: 1.6;
  178.            max-width: 600px;
  179.        }
  180.  
  181.        .hero-buttons {
  182.            display: flex;
  183.            gap: 15px;
  184.        }
  185.  
  186.        .hero-image {
  187.            flex: 1;
  188.            display: flex;
  189.            justify-content: flex-end;
  190.            position: relative;
  191.        }
  192.  
  193.        .hero-image img {
  194.            max-width: 100%;
  195.            border-radius: 10px;
  196.            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  197.            transform: perspective(1000px) rotateY(-10deg);
  198.            transition: transform 0.5s ease;
  199.        }
  200.  
  201.        .hero-image img:hover {
  202.            transform: perspective(1000px) rotateY(0);
  203.        }
  204.  
  205.        /* Main Content Styles */
  206.        main {
  207.            padding: 60px 0;
  208.        }
  209.        
  210.        .content-section {
  211.            margin-bottom: 80px;
  212.        }
  213.  
  214.        .section-title {
  215.            text-align: center;
  216.            margin-bottom: 50px;
  217.            position: relative;
  218.        }
  219.  
  220.        .section-title h2 {
  221.            font-size: 36px;
  222.            display: inline-block;
  223.            padding-bottom: 10px;
  224.            position: relative;
  225.        }
  226.  
  227.        .section-title h2::after {
  228.            content: '';
  229.            position: absolute;
  230.            width: 60%;
  231.            height: 4px;
  232.            background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  233.            left: 20%;
  234.            bottom: 0;
  235.            border-radius: 2px;
  236.        }
  237.  
  238.        .section-title p {
  239.            color: #777;
  240.            font-size: 18px;
  241.            max-width: 700px;
  242.            margin: 15px auto 0;
  243.        }
  244.  
  245.        /* Articles Grid */
  246.        .article-grid {
  247.            display: grid;
  248.            grid-template-columns: repeat(3, 1fr);
  249.            gap: 30px;
  250.        }
  251.  
  252.        .article-card {
  253.            background-color: white;
  254.            border-radius: 15px;
  255.            overflow: hidden;
  256.            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  257.            transition: all 0.3s ease;
  258.            position: relative;
  259.            display: flex;
  260.            flex-direction: column;
  261.        }
  262.  
  263.        .article-card:hover {
  264.            transform: translateY(-10px);
  265.            box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
  266.        }
  267.  
  268.        .article-image {
  269.            height: 200px;
  270.            overflow: hidden;
  271.        }
  272.  
  273.        .article-image img {
  274.            width: 100%;
  275.            height: 100%;
  276.            object-fit: cover;
  277.            transition: transform 0.5s ease;
  278.        }
  279.  
  280.        .article-card:hover .article-image img {
  281.            transform: scale(1.1);
  282.        }
  283.  
  284.        .article-category {
  285.            position: absolute;
  286.            top: 15px;
  287.            right: 15px;
  288.            background-color: var(--secondary);
  289.            color: white;
  290.            padding: 5px 15px;
  291.            border-radius: 20px;
  292.            font-size: 12px;
  293.            font-weight: bold;
  294.            box-shadow: 0 3px 10px rgba(249, 198, 57, 0.4);
  295.            text-transform: capitalize;
  296.        }
  297.  
  298.        .article-content {
  299.            padding: 20px;
  300.            position: relative;
  301.            flex-grow: 1;
  302.            display: flex;
  303.            flex-direction: column;
  304.        }
  305.  
  306.        .article-meta {
  307.            display: flex;
  308.            align-items: center;
  309.            margin-bottom: 10px;
  310.            font-size: 13px;
  311.            color: #777;
  312.        }
  313.  
  314.        .article-meta span {
  315.            display: flex;
  316.            align-items: center;
  317.            margin-right: 15px;
  318.        }
  319.  
  320.        .article-meta i {
  321.            margin-right: 5px;
  322.        }
  323.  
  324.        .article-content h3 {
  325.            font-size: 20px;
  326.            margin-bottom: 10px;
  327.            line-height: 1.4;
  328.            flex-grow: 1;
  329.        }
  330.        
  331.        .article-content h3 a {
  332.            color: var(--dark);
  333.        }
  334.        
  335.        .article-content h3 a:hover {
  336.            color: var(--primary);
  337.        }
  338.  
  339.        .article-content p {
  340.            color: #555;
  341.            margin-bottom: 20px;
  342.            line-height: 1.5;
  343.            font-size: 15px;
  344.        }
  345.  
  346.        .read-more {
  347.            font-weight: bold;
  348.            font-size: 14px;
  349.            display: inline-flex;
  350.            align-items: center;
  351.            margin-top: auto;
  352.        }
  353.  
  354.        .read-more i {
  355.            margin-left: 5px;
  356.            transition: transform 0.3s ease;
  357.        }
  358.  
  359.        .read-more:hover i {
  360.            transform: translateX(5px);
  361.        }
  362.        
  363.        /* Popular Tags Section */
  364.        .popular-tags-section {
  365.            margin-bottom: 80px;
  366.            padding: 40px 0;
  367.            background-color: #fff;
  368.            border-radius: 20px;
  369.            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  370.        }
  371.  
  372.        .popular-tags {
  373.            display: flex;
  374.            flex-wrap: wrap;
  375.            gap: 10px;
  376.            margin-bottom: 20px;
  377.            justify-content: center;
  378.        }
  379.  
  380.        .tag {
  381.            background-color: var(--light);
  382.            color: var(--dark);
  383.            padding: 8px 18px;
  384.            border-radius: 20px;
  385.            font-size: 14px;
  386.            transition: all 0.3s ease;
  387.        }
  388.  
  389.        .tag:hover {
  390.            background-color: var(--primary);
  391.            color: white;
  392.            transform: translateY(-2px);
  393.        }
  394.  
  395.        /* Newsletter Section */
  396.        .newsletter {
  397.            background-color: var(--dark);
  398.            color: white;
  399.            border-radius: 20px;
  400.            padding: 50px;
  401.            margin-bottom: 80px;
  402.            position: relative;
  403.            overflow: hidden;
  404.            text-align: center;
  405.        }
  406.  
  407.        .newsletter::before {
  408.            content: '';
  409.            position: absolute;
  410.            top: 0;
  411.            left: 0;
  412.            width: 100%;
  413.            height: 100%;
  414.            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="4" fill="%23ffffff10"/><circle cx="60" cy="60" r="8" fill="%23ffffff10"/><circle cx="80" cy="20" r="6" fill="%23ffffff10"/><circle cx="40" cy="80" r="4" fill="%23ffffff10"/></svg>');
  415.            opacity: 0.3;
  416.        }
  417.  
  418.        .newsletter h2 {
  419.            font-size: 32px;
  420.            margin-bottom: 15px;
  421.            position: relative;
  422.            display: inline-block;
  423.            padding-bottom: 10px;
  424.        }
  425.  
  426.        .newsletter h2::after {
  427.            content: '';
  428.            position: absolute;
  429.            width: 60%;
  430.            height: 4px;
  431.            background-color: var(--secondary);
  432.            bottom: 0;
  433.            left: 50%;
  434.            transform: translateX(-50%);
  435.            border-radius: 2px;
  436.        }
  437.  
  438.        .newsletter p {
  439.            font-size: 16px;
  440.            margin: 0 auto 30px;
  441.            max-width: 600px;
  442.            line-height: 1.6;
  443.        }
  444.  
  445.        .newsletter-form {
  446.            display: flex;
  447.            max-width: 600px;
  448.            position: relative;
  449.            margin: 0 auto;
  450.        }
  451.  
  452.        .newsletter-form input {
  453.            flex: 1;
  454.            padding: 15px 20px;
  455.            border: none;
  456.            border-radius: 30px;
  457.            font-size: 16px;
  458.            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  459.        }
  460.  
  461.        .newsletter-form button {
  462.            position: absolute;
  463.            right: 5px;
  464.            top: 5px;
  465.            height: calc(100% - 10px);
  466.            border-radius: 25px;
  467.            background: linear-gradient(135deg, var(--primary), var(--accent));
  468.        }
  469.  
  470.        .newsletter-form button:hover {
  471.            background: linear-gradient(135deg, var(--accent), var(--primary));
  472.        }
  473.        
  474.        #subscribe-toast {
  475.            position: fixed;
  476.            bottom: 30px;
  477.            left: 50%;
  478.            transform: translateX(-50%);
  479.            background-color: var(--accent);
  480.            color: white;
  481.            padding: 15px 30px;
  482.            border-radius: 50px;
  483.            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  484.            z-index: 9999;
  485.            opacity: 0;
  486.            visibility: hidden;
  487.            transition: opacity 0.5s, visibility 0.5s, bottom 0.5s;
  488.        }
  489.        #subscribe-toast.show {
  490.            opacity: 1;
  491.            visibility: visible;
  492.            bottom: 50px;
  493.        }
  494.  
  495.        /* Footer Styles */
  496.        footer {
  497.            background-color: var(--dark);
  498.            color: white;
  499.            padding: 60px 0 30px;
  500.            position: relative;
  501.        }
  502.  
  503.        footer::before {
  504.            content: '';
  505.            position: absolute;
  506.            top: 0;
  507.            left: 0;
  508.            right: 0;
  509.            height: 5px;
  510.            background: linear-gradient(90deg, var(--anemo), var(--geo), var(--electro), var(--dendro), var(--hydro), var(--pyro), var(--cryo));
  511.        }
  512.  
  513.        .footer-content {
  514.            display: grid;
  515.            grid-template-columns: repeat(3, 1fr);
  516.            gap: 40px;
  517.            margin-bottom: 40px;
  518.        }
  519.  
  520.        .footer-heading {
  521.            font-size: 18px;
  522.            margin-bottom: 20px;
  523.            position: relative;
  524.            padding-bottom: 10px;
  525.        }
  526.  
  527.        .footer-heading::after {
  528.            content: '';
  529.            position: absolute;
  530.            width: 30px;
  531.            height: 3px;
  532.            background-color: var(--secondary);
  533.            bottom: 0;
  534.            left: 0;
  535.            border-radius: 2px;
  536.        }
  537.  
  538.        .footer-links {
  539.            list-style: none;
  540.        }
  541.  
  542.        .footer-links li {
  543.            margin-bottom: 10px;
  544.            color: #aaa;
  545.            transition: all 0.3s ease;
  546.        }
  547.        
  548.        .footer-links li:hover {
  549.            color: white;
  550.            transform: translateX(5px);
  551.        }
  552.  
  553.        .footer-bottom {
  554.            text-align: center;
  555.            padding-top: 30px;
  556.            border-top: 1px solid rgba(255, 255, 255, 0.1);
  557.            color: #aaa;
  558.            font-size: 14px;
  559.        }
  560.  
  561.        @media (max-width: 1024px) {
  562.            .article-grid {
  563.                grid-template-columns: repeat(2, 1fr);
  564.            }
  565.            .footer-content {
  566.                grid-template-columns: 1fr 1fr;
  567.            }
  568.        }
  569.  
  570.        @media (max-width: 768px) {
  571.            .hero {
  572.                flex-direction: column;
  573.                text-align: center;
  574.            }
  575.  
  576.            .hero h1::after {
  577.                left: 50%;
  578.                transform: translateX(-50%);
  579.            }
  580.  
  581.            .hero p {
  582.                margin: 0 auto 30px;
  583.            }
  584.  
  585.            .hero-buttons {
  586.                justify-content: center;
  587.            }
  588.  
  589.            .hero-image {
  590.                margin-top: 40px;
  591.                justify-content: center;
  592.            }
  593.  
  594.            .article-grid,
  595.            .footer-content {
  596.                grid-template-columns: 1fr;
  597.            }
  598.  
  599.            .newsletter {
  600.                padding: 30px 20px;
  601.            }
  602.  
  603.            .newsletter-form {
  604.                flex-direction: column;
  605.                gap: 15px;
  606.            }
  607.  
  608.            .newsletter-form button {
  609.                position: static;
  610.                width: 100%;
  611.                height: auto;
  612.            }
  613.        }
  614.    </style>
  615. <script type="application/ld+json">{
  616.  "@context": "https://schema.org",
  617.  "@type": "WebSite",
  618.  "name": "GenshinZone",
  619.  "url": "https://www.genshinzone.cc",
  620.  "publisher": {
  621.    "@type": "Organization",
  622.    "@id": "https://www.genshinzone.cc/#website",
  623.    "name": "GenshinZone",
  624.    "url": "https://www.genshinzone.cc",
  625.    "description": "GenshinZone is a dedicated Genshin Impact blog platform, providing the latest guides, character builds, weapon recommendations, in-depth exploration, and version previews. Your one-stop destination for all Genshin Impact news and strategies!",
  626.    "foundingDate": "2023",
  627.    "logo": {
  628.      "@type": "ImageObject",
  629.      "url": "https://www.genshinzone.cc/game_logo.png",
  630.      "caption": "GenshinZone Logo"
  631.    }
  632.  }
  633. }</script></head>
  634. <body>
  635. <header>
  636. <div class="container">
  637. <div class="navbar">
  638. <a class="logo" href="/">
  639. <img alt="GenshinZone" src="/game_logo.png"/>
  640.                    GenshinZone
  641.                </a>
  642. <nav>
  643. <ul id="navbar-links">
  644. <!-- Dynamic content will be injected here -->
  645. </ul>
  646. </nav>
  647. </div>
  648. <div class="hero">
  649. <div class="hero-content">
  650. <h1>Your Guide to the World of Genshin Impact</h1>
  651. <p>Explore the latest strategies, character builds, and updates for Genshin Impact. Join our community of travelers and enhance your adventure through the seven nations.</p>
  652. <div class="hero-buttons">
  653. <button id="start-exploring-btn">Start Exploring</button>
  654. </div>
  655. </div>
  656. <div class="hero-image">
  657. <img alt="Genshin Impact Hero Image" src="/images/common/998edd80df4d148b84ae984f351f1360.jpg"/>
  658. </div>
  659. </div>
  660. </div>
  661. </header>
  662. <main>
  663. <div class="container">
  664. <!-- Section 1: Featured Contents -->
  665. <section class="content-section" id="featured-contents-section">
  666. <div class="section-title">
  667. <h2>Featured Contents</h2>
  668. <p>Catch up with our most popular guides and news about the game's ever-expanding universe</p>
  669. </div>
  670. <div class="article-grid" id="latest_all-grid">
  671. <!-- JS will populate this -->
  672. </div>
  673. </section>
  674. <!-- Section 2: Latest News -->
  675. <section class="content-section" id="latest-news-section">
  676. <div class="section-title">
  677. <h2>Latest News</h2>
  678. <p>Stay current with the newest content and changes coming to the game</p>
  679. </div>
  680. <div class="article-grid" id="latest_news-grid">
  681. <!-- JS will populate this -->
  682. </div>
  683. </section>
  684. <!-- Section 3: Popular Guides -->
  685. <section class="content-section" id="popular-guides-section">
  686. <div class="section-title">
  687. <h2>Popular Guides</h2>
  688. <p>Explore key characters and strategies that define the gaming experience</p>
  689. </div>
  690. <div class="article-grid" id="latest_guides-grid">
  691. <!-- JS will populate this -->
  692. </div>
  693. </section>
  694. <!-- Section 4: Hot Articles -->
  695. <section class="content-section" id="hot-articles-section">
  696. <div class="section-title">
  697. <h2>Hot Articles</h2>
  698. <p>Discover trending topics and in-depth analysis from our community</p>
  699. </div>
  700. <div class="article-grid" id="latest_articles-grid">
  701. <!-- JS will populate this -->
  702. </div>
  703. </section>
  704. <!-- Section 5: Popular Tags -->
  705. <section class="popular-tags-section">
  706. <div class="section-title">
  707. <h2>Popular Tags</h2>
  708. <p>Find content by browsing the most popular tags in our community</p>
  709. </div>
  710. <div class="popular-tags" id="popular-tags-container">
  711. <!-- JS will populate this -->
  712. </div>
  713. </section>
  714. <section class="newsletter">
  715. <h2>Subscribe To Our Newsletter</h2>
  716. <p>Stay up to date with the latest news, guides, and exclusive content. Join our community and never miss an update!</p>
  717. <form class="newsletter-form">
  718. <input placeholder="Enter your email address" type="email"/>
  719. <button type="submit">Subscribe</button>
  720. </form>
  721. </section>
  722. </div>
  723. </main>
  724. <footer>
  725. <div class="container">
  726. <div class="footer-content" id="footer-content-container">
  727. <!-- Dynamic content will be injected here -->
  728. </div>
  729. <div class="footer-bottom">
  730. <p id="copyright-text"></p>
  731. </div>
  732. </div>
  733. </footer>
  734. <script>
  735.    document.addEventListener('DOMContentLoaded', () => {
  736.        const dataUrl = '/data/index.json';
  737.  
  738.        // --- UTILITY FUNCTIONS ---
  739.        const fetchData = async () => {
  740.            try {
  741.                const response = await fetch(dataUrl);
  742.                if (!response.ok) {
  743.                    throw new Error(`HTTP error! status: ${response.status}`);
  744.                }
  745.                return await response.json();
  746.            } catch (error) {
  747.                console.error("Could not fetch data:", error);
  748.                return null;
  749.            }
  750.        };
  751.  
  752.        const showToast = (message) => {
  753.            let toast = document.getElementById('subscribe-toast');
  754.            if (!toast) {
  755.                toast = document.createElement('div');
  756.                toast.id = 'subscribe-toast';
  757.                document.body.appendChild(toast);
  758.            }
  759.            toast.textContent = message;
  760.            toast.classList.add('show');
  761.            setTimeout(() => {
  762.                toast.classList.remove('show');
  763.            }, 3000);
  764.        };
  765.  
  766.        // --- POPULATION FUNCTIONS ---
  767.        const populateNavigation = (navItems) => {
  768.            const navList = document.getElementById('navbar-links');
  769.            if (!navList || !navItems) return;
  770.            navList.innerHTML = '';
  771.            const currentPage = window.location.pathname;
  772.  
  773.            navItems.forEach(item => {
  774.                const li = document.createElement('li');
  775.                const a = document.createElement('a');
  776.                a.textContent = item.label.charAt(0).toUpperCase() + item.label.slice(1).toLowerCase();
  777.                a.href = item.link;
  778.  
  779.                if (item.link === currentPage || (item.link === '/' && (currentPage === '/index.html' || currentPage === '/'))) {
  780.                    a.classList.add('active');
  781.                }
  782.                
  783.                li.appendChild(a);
  784.                navList.appendChild(li);
  785.            });
  786.        };
  787.        
  788.        const populateArticles = (key, articles) => {
  789.            const grid = document.getElementById(`${key}-grid`);
  790.            if (!grid || !articles) return;
  791.            grid.innerHTML = '';
  792.  
  793.            articles.slice(0, 3).forEach(article => { // Displaying 3 per section for a clean look
  794.                const articleCard = `
  795.                    <article class="article-card">
  796.                        <a href="${article.link}" class="article-image-link">
  797.                            <div class="article-image">
  798.                                <img src="${article.image}" alt="${article.title}">
  799.                            </div>
  800.                        </a>
  801.                        <span class="article-category">${article.category.replace(/_/g, ' ')}</span>
  802.                        <div class="article-content">
  803.                            <div class="article-meta">
  804.                                <span><i>👤</i> By ${article.author}</span>
  805.                                <span><i>🕒</i> ${new Date(article.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}</span>
  806.                            </div>
  807.                            <h3><a href="${article.link}">${article.title}</a></h3>
  808.                            <p>${article.excerpt}</p>
  809.                            <a href="${article.link}" class="read-more">Read More <i>→</i></a>
  810.                        </div>
  811.                    </article>
  812.                `;
  813.                grid.innerHTML += articleCard;
  814.            });
  815.        };
  816.        
  817.        const populateTags = (tags) => {
  818.            const container = document.getElementById('popular-tags-container');
  819.            if (!container || !tags) return;
  820.            container.innerHTML = '';
  821.            tags.forEach(tag => {
  822.                const a = document.createElement('a');
  823.                a.href = tag.link;
  824.                a.className = 'tag';
  825.                a.textContent = `#${tag.name}`;
  826.                container.appendChild(a);
  827.            });
  828.        };
  829.  
  830.        const populateFooter = (footerColumns, copyright) => {
  831.            const container = document.getElementById('footer-content-container');
  832.            const copyrightEl = document.getElementById('copyright-text');
  833.  
  834.            if (container && footerColumns) {
  835.                container.innerHTML = '';
  836.                
  837.                const aboutDiv = document.createElement('div');
  838.                aboutDiv.innerHTML = `
  839.                    <h4 class="footer-heading">About US</h4>
  840.                    <ul class="footer-links">
  841.                       ${footerColumns[0].contents.map(item => `<li>${item}</li>`).join('')}
  842.                    </ul>`;
  843.                container.appendChild(aboutDiv);
  844.  
  845.                footerColumns.slice(1).forEach(column => {
  846.                    const div = document.createElement('div');
  847.                    let contentHtml = `<h4 class="footer-heading">${column.title}</h4>`;
  848.                    if (column.contents && column.contents.length > 0) {
  849.                        contentHtml += `<ul class="footer-links">`;
  850.                        column.contents.forEach(item => {
  851.                            contentHtml += `<li>${item}</li>`;
  852.                        });
  853.                        contentHtml += `</ul>`;
  854.                    }
  855.                    div.innerHTML = contentHtml;
  856.                    container.appendChild(div);
  857.                });
  858.            }
  859.  
  860.            if (copyrightEl && copyright) {
  861.                copyrightEl.textContent = copyright;
  862.            }
  863.        };
  864.  
  865.        // --- EVENT LISTENERS & UI ENHANCEMENTS ---
  866.        const addEventListeners = () => {
  867.            // Start Exploring Button
  868.            const startExploringBtn = document.getElementById('start-exploring-btn');
  869.            if (startExploringBtn) {
  870.                startExploringBtn.addEventListener('click', (e) => {
  871.                    e.preventDefault();
  872.                    const firstSection = document.querySelector('.content-section');
  873.                    if (firstSection) {
  874.                        firstSection.scrollIntoView({ behavior: 'smooth' });
  875.                    }
  876.                });
  877.            }
  878.  
  879.            // Newsletter Form
  880.            const newsletterForm = document.querySelector('.newsletter-form');
  881.            if (newsletterForm) {
  882.                newsletterForm.addEventListener('submit', (e) => {
  883.                    e.preventDefault();
  884.                    const emailInput = newsletterForm.querySelector('input[type="email"]');
  885.                    if (!emailInput.value || !emailInput.value.includes('@') || !emailInput.value.includes('.')) {
  886.                        showToast('Please enter a valid email address.');
  887.                        return;
  888.                    }
  889.                    showToast('Subscribe successful');
  890.                    newsletterForm.reset();
  891.                });
  892.            }
  893.  
  894.            // Article hover animations
  895.            document.addEventListener('mouseover', event => {
  896.                const card = event.target.closest('.article-card');
  897.                if (card) {
  898.                    const category = card.querySelector('.article-category');
  899.                    if (category) {
  900.                        category.style.transform = 'translateY(-5px)';
  901.                        category.style.boxShadow = '0 5px 15px rgba(249, 198, 57, 0.6)';
  902.                    }
  903.                }
  904.            });
  905.            document.addEventListener('mouseout', event => {
  906.                const card = event.target.closest('.article-card');
  907.                if (card) {
  908.                    const category = card.querySelector('.article-category');
  909.                    if (category) {
  910.                        category.style.transform = 'translateY(0)';
  911.                        category.style.boxShadow = '0 3px 10px rgba(249, 198, 57, 0.4)';
  912.                    }
  913.                }
  914.            });
  915.  
  916.            // Sticky header on scroll
  917.            const navbar = document.querySelector('.navbar');
  918.            const header = document.querySelector('header');
  919.            if (navbar && header) {
  920.                const headerHeight = header.offsetHeight;
  921.                window.addEventListener('scroll', () => {
  922.                    if (window.scrollY > headerHeight) {
  923.                        navbar.style.position = 'fixed';
  924.                        navbar.style.top = '0';
  925.                        navbar.style.left = '0';
  926.                        navbar.style.right = '0';
  927.                        navbar.style.backgroundColor = 'rgba(44, 62, 80, 0.95)';
  928.                        navbar.style.padding = '10px 20px';
  929.                        navbar.style.zIndex = '1000';
  930.                        navbar.style.boxShadow = '0 5px 15px rgba(0, 0, 0, 0.1)';
  931.                        navbar.style.transition = 'all 0.3s ease';
  932.                        // Add padding to body to prevent content from jumping
  933.                        if (document.body.style.paddingTop !== navbar.offsetHeight + 'px') {
  934.                            document.body.style.paddingTop = navbar.offsetHeight + 'px';
  935.                        }
  936.                    } else {
  937.                        navbar.style.position = 'relative'; // Changed from static
  938.                        navbar.style.backgroundColor = 'transparent';
  939.                        navbar.style.padding = '0';
  940.                        navbar.style.boxShadow = 'none';
  941.                        document.body.style.paddingTop = '0';
  942.                    }
  943.                });
  944.            }
  945.        };
  946.  
  947.        // --- INITIALIZATION ---
  948.        const init = async () => {
  949.            const data = await fetchData();
  950.            if (data) {
  951.                populateNavigation(data.navigation);
  952.                populateArticles('latest_all', data.latest_all);
  953.                populateArticles('latest_news', data.latest_news);
  954.                populateArticles('latest_guides', data.latest_guides);
  955.                populateArticles('latest_articles', data.latest_articles);
  956.                populateTags(data.tag);
  957.                populateFooter(data.footer, data.copyright);
  958.            }
  959.            addEventListeners();
  960.            
  961.            // Hero load animation
  962.            const heroContent = document.querySelector('.hero-content');
  963.            const heroImage = document.querySelector('.hero-image');
  964.            if (heroContent && heroImage) {
  965.                heroContent.style.opacity = '0';
  966.                heroImage.style.opacity = '0';
  967.                heroContent.style.transform = 'translateY(50px)';
  968.                heroImage.style.transform = 'perspective(1000px) rotateY(-10deg) translateX(50px)';
  969.                
  970.                setTimeout(() => {
  971.                    heroContent.style.transition = 'all 1s ease';
  972.                    heroContent.style.opacity = '1';
  973.                    heroContent.style.transform = 'translateY(0)';
  974.                }, 300);
  975.                
  976.                setTimeout(() => {
  977.                    heroImage.style.transition = 'all 1s ease';
  978.                    heroImage.style.opacity = '1';
  979.                    heroImage.style.transform = 'perspective(1000px) rotateY(-10deg) translateX(0)';
  980.                }, 600);
  981.            }
  982.        };
  983.  
  984.        init();
  985.    });
  986.    </script>
  987. </body>
  988. </html>
Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda