search

December Magic

Jan 05, 2025 am 08:50 AM

This is a submission for Frontend Challenge - December Edition, Glam Up My Markup: Winter Solstice

What I Built

I created "December Magic", a responsive and visually captivating landing page celebrating the wonders of December. My goal was to combine the warmth of the season with an interactive user experience. The landing page features:

- A sticky navigation bar for easy access to different sections.
- A countdown timer to New Year 2025, adding a sense of anticipation.
- Sections highlighting winter phenomena, holiday celebrations, and cultural traditions.
- A beautiful background with a "snow overlay" effect to immerse users in the winter theme

.
Through this project, I aimed to enhance my frontend development skills while embracing the festive spirit.

Live Demo of the Project
_Source Code on GitHub--->

CodePen:

_

`


<br>


<p></p><br>
  <meta charset="UTF-8"><br>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"><br>
  <title>December - A Month of Wonder</title><br>
  <link rel="stylesheet" href="style.css">

<p></p>

<p></p><br>
  <div>

<p><nav>
    <div class="nav-container">
<br>
      <a href="#">
      <div class="nav-links">
<br>
        <a href="#winter-section">Winter</a><br>
        <a href="#holidays-section">Holidays</a><br>
        <a href="#traditions-section">Traditions</a><br>
        <a href="#about-section">About</a><br>
      </div>
<br>
    </a>
</div>
<br>
  </nav></p>

<p><header><br>
    <h1 id="December-Magic">December Magic</h1>
<br>
    <div>
      Countdown to New Year 2025<br>
    </div>
<br>
    <div>
      <div class="countdown-box">
<br>
        <div>
        <div class="countdown-label">Days</div>
<br>
      </div>
<br>
      <div>
        <div class="countdown-number">
        <div class="countdown-label">Hours</div>
<br>
      </div>
<br>
      <div>
        <div class="countdown-number">
        <div class="countdown-label">Minutes</div>
<br>
      </div>
<br>
      <div>
        <div class="countdown-number">
        <div class="countdown-label">Seconds</div>
<br>
      </div>
<br>
    </div>
<br>
  

<p><main>
    <section class="section">
      <h2 id="Winter-Wonder">Winter Wonder</h2>
<br>
      <p>
        December heralds the arrival of winter in the Northern Hemisphere, transforming landscapes into pristine wonderlands. This section explores the natural phenomena and celestial events that make December uniquely beautiful.<br>
      </p>
<br>
      <div>
        <div class="nature-item">
<br>
          <h3 id="Winter-Solstice">Winter Solstice</h3>
<br>
          <p>December 21st marks the shortest day of the year, a pivotal moment in Earth's annual journey around the sun. This astronomical event has been celebrated by cultures worldwide for millennia.</p>
<br>
        </div>
<br>
        <div>
          <h3 id="Snowy-Landscapes">Snowy Landscapes</h3>
<br>
          <p>Experience the tranquil beauty of snow-covered landscapes, where every branch and surface is decorated with nature's own crystalline artwork.</p>
<br>
        </div>
<br>
        <div>
          <h3 id="Frost-Patterns">Frost Patterns</h3>
<br>
          <p>Discover the intricate patterns of frost that transform windows and leaves into natural masterpieces, each design unique and ephemeral.</p>
<br>
        </div>
<br>
      </div>
<br>
    </section></main></p>

<pre class="brush:php;toolbar:false"><section class="section">

<p></p>

<p><footer><br>
    <p>Embrace the magic of December ❄️</p>
<br>
  </footer></p>

<p><script src="script.js"></script></p>

<p></p>

<p></p></section>

* {<br>
  margin: 0;<br>
  padding: 0;<br>
  box-sizing: border-box;<br>
  font-family: "Arial", sans-serif;<br>
}

<p>body {<br>
  background-image: url("/api/placeholder/1920/1080");<br>
  background-size: cover;<br>
  background-attachment: fixed;<br>
  background-position: center;<br>
  color: #fff;<br>
  min-height: 100vh;<br>
}</p>

<p>.navbar {<br>
  background: rgba(0, 0, 0, 0.8);<br>
  padding: 1rem 0;<br>
  position: sticky;<br>
  top: 0;<br>
  z-index: 1000;<br>
}</p>

<p>.nav-container {<br>
  max-width: 1200px;<br>
  margin: 0 auto;<br>
  display: flex;<br>
  justify-content: space-between;<br>
  align-items: center;<br>
  padding: 0 2rem;<br>
}</p>

<p>.nav-logo {<br>
  font-size: 1.5rem;<br>
  font-weight: bold;<br>
  color: #ff9999;<br>
  text-decoration: none;<br>
}</p>

<p>.nav-links {<br>
  display: flex;<br>
  gap: 2rem;<br>
}</p>

<p>.nav-links a {<br>
  color: #fff;<br>
  text-decoration: none;<br>
  padding: 0.5rem 1rem;<br>
  border-radius: 5px;<br>
  transition: background-color 0.3s;<br>
}</p>

<p>.nav-links a:hover {<br>
  background-color: rgba(255, 255, 255, 0.1);<br>
}</p>

<p>header {<br>
  text-align: center;<br>
  padding: 4rem 2rem;<br>
  background: rgba(0, 0, 0, 0.5);<br>
}</p>

<p>h1 {<br>
  font-size: 3rem;<br>
  margin-bottom: 1rem;<br>
  color: #e6e6ff;<br>
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);<br>
}</p>

<p>.countdown {<br>
  font-size: 1.5rem;<br>
  margin: 1rem 0;<br>
  padding: 1rem;<br>
  background: rgba(255, 255, 255, 0.1);<br>
  border-radius: 10px;<br>
}</p>

<p>.countdown-container {<br>
  display: flex;<br>
  justify-content: center;<br>
  gap: 2rem;<br>
  margin: 1.5rem 0;<br>
}</p>

<p>.countdown-box {<br>
  background: rgba(255, 255, 255, 0.1);<br>
  padding: 1rem;<br>
  border-radius: 10px;<br>
  min-width: 100px;<br>
  text-align: center;<br>
}</p>

<p>.countdown-number {<br>
  font-size: 2.5rem;<br>
  font-weight: bold;<br>
  color: #ff9999;<br>
  margin-bottom: 0.5rem;<br>
}</p>

<p>.countdown-label {<br>
  font-size: 0.9rem;<br>
  color: #fff;<br>
  text-transform: uppercase;<br>
  letter-spacing: 1px;<br>
}</p>

<p>.main-content {<br>
  max-width: 1200px;<br>
  margin: 0 auto;<br>
  padding: 2rem;<br>
}</p>

<p>.section {<br>
  background: rgba(0, 0, 0, 0.7);<br>
  margin: 2rem 0;<br>
  padding: 2rem;<br>
  border-radius: 15px;<br>
}</p>

<p>.section-description {<br>
  color: #ccc;<br>
  margin-bottom: 1.5rem;<br>
  line-height: 1.6;<br>
}</p>

<p>h2 {<br>
  color: #ff9999;<br>
  margin-bottom: 1rem;<br>
  padding-bottom: 0.5rem;<br>
  border-bottom: 2px solid rgba(255, 153, 153, 0.3);<br>
}</p>

<p>.holiday-card {<br>
  background: rgba(255, 255, 255, 0.1);<br>
  padding: 1.5rem;<br>
  margin: 1rem 0;<br>
  border-radius: 10px;<br>
}</p>

<p>.nature-gallery {<br>
  display: grid;<br>
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));<br>
  gap: 1.5rem;<br>
  margin-top: 1rem;<br>
}</p>

<p>.nature-item {<br>
  background: rgba(255, 255, 255, 0.1);<br>
  padding: 1.5rem;<br>
  border-radius: 10px;<br>
  text-align: center;<br>
}</p>

<p>.festival-list {<br>
  list-style: none;<br>
}</p>

<p>.festival-list li {<br>
  margin: 1rem 0;<br>
  padding: 1rem;<br>
  background: rgba(255, 255, 255, 0.1);<br>
  border-radius: 10px;<br>
}</p>

<p>footer {<br>
  text-align: center;<br>
  padding: 2rem;<br>
  background: rgba(0, 0, 0, 0.8);<br>
  margin-top: 3rem;<br>
}</p>

<p>.snow-overlay {<br>
  position: fixed;<br>
  top: 0;<br>
  left: 0;<br>
  width: 100%;<br>
  height: 100%;<br>
  background-image: radial-gradient(<br>
      2px 2px at 20px 30px,<br>
      #fff,<br>
      rgba(0, 0, 0, 0)<br>
    ),<br>
    radial-gradient(2px 2px at 40px 70px, #fff, rgba(0, 0, 0, 0)),<br>
    radial-gradient(2px 2px at 50px 160px, #fff, rgba(0, 0, 0, 0)),<br>
    radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)),<br>
    radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0)),<br>
    radial-gradient(2px 2px at 160px 120px, #fff, rgba(0, 0, 0, 0));<br>
  background-repeat: repeat;<br>
  pointer-events: none;<br>
  z-index: 1;<br>
  opacity: 0.4;<br>
}<br>
</p>

function updateCountdown() {<br>
  const now = new Date();<br>
  const newYear = new Date(2025, 0, 1); // January 1, 2025<br>
  const diff = newYear - now;

<p>const days = Math.floor(diff / (1000 * 60 * 60 * 24));<br>
  const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));<br>
  const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));<br>
  const seconds = Math.floor((diff % (1000 * 60)) / 1000);</p>

<p>document.getElementById("days").textContent = days<br>
    .toString()<br>
    .padStart(2, "0");<br>
  document.getElementById("hours").textContent = hours<br>
    .toString()<br>
    .padStart(2, "0");<br>
  document.getElementById("minutes").textContent = minutes<br>
    .toString()<br>
    .padStart(2, "0");<br>
  document.getElementById("seconds").textContent = seconds<br>
    .toString()<br>
    .padStart(2, "0");<br>
}</p>

<p>setInterval(updateCountdown, 1000);<br>
updateCountdown();<br>
</p>

`

December Magic

December Magic

December Magic

December Magic

December Magic

December Magic

Journey
This project was an exciting exploration of frontend technologies, including HTML, CSS, and JavaScript. Here’s what I learned and achieved:

Challenges and Solutions:
Countdown Timer: Implementing the countdown timer required learning how to calculate and display dynamic time differences using JavaScript.
Design Consistency: Ensuring a uniform look across devices taught me to pay attention to responsive design principles.
Interactive Elements: Hover effects and transitions helped improve user engagement.
Highlights:
CSS Snow Overlay: Creating a subtle snowfall effect with CSS radial gradients was a fun way to bring the magic of winter to life.
Dynamic Sections: Using a grid layout for the "Nature Gallery" made the page visually appealing and adaptive to screen sizes.
What’s Next:
Add festive animations, such as glowing lights for the holidays.
Include user interaction features like a "Write Your Wish" section for New Year resolutions.
This project was an incredible learning experience, and I’m thrilled to share it with the community. Feedback is welcome!

The above is the detailed content of December Magic. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Moving from Vanilla JavaScript to a Reusable Vue ComponentMoving from Vanilla JavaScript to a Reusable Vue ComponentApr 11, 2025 am 09:40 AM

I recently wrote an article explaining how you can create a countdown timer using HTML, CSS and JavaScript. Now, let’s look at how we

Design Systems BlogathonDesign Systems BlogathonApr 11, 2025 am 09:38 AM

It was fun watching a bunch of back and forth blogging between a bunch of smart people quoting a bunch of smart people last week. If you missed it, you might

Fixed Headers and Jump Links? The Solution is scroll-margin-topFixed Headers and Jump Links? The Solution is scroll-margin-topApr 11, 2025 am 09:35 AM

The problem: you click a jump link like Jump which links to something like Header.

Centering a div That Maintains Aspect-Ratio When There's Body MarginCentering a div That Maintains Aspect-Ratio When There's Body MarginApr 11, 2025 am 09:31 AM

Andrew Welch had a little CSS challenge the other day to make an ordinary div:

Select an Element with a Non-Empty AttributeSelect an Element with a Non-Empty AttributeApr 11, 2025 am 09:30 AM

Short answer:

Is Having an RSS Feed Just Giving Content Away for Free?Is Having an RSS Feed Just Giving Content Away for Free?Apr 11, 2025 am 09:28 AM

I mean, kinda.

Web Component for a Code BlockWeb Component for a Code BlockApr 11, 2025 am 09:25 AM

We'll get to that, but first, a long-winded introduction.

CSS4CSS4Apr 11, 2025 am 09:23 AM

What is CSS4? Is it a real thing? I hate to break it to you, but not really. But maybe we could make it a thing? CSS3 was successful, so why not keep that train rolling like they do in JavaScript?

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),