DEV Community

HARUN NZAI
HARUN NZAI

Posted on

Winter Solstice Celebrations.

Winter Solstice Celebrations: Exploring Science, Traditions, and Culture

Project Overview

This project showcases an interactive and visually appealing web page dedicated to the Winter Solstice. It delves into its scientific significance, cultural importance, and traditions celebrated worldwide. The goal is to create a stunning and interactive experience, blending modern design with meaningful content.


Demo

You can preview the live version of the Winter Solstice project and access the source code below:

Live Demo Link

GitHub Repository


Journey

The inspiration for this project came from the universal significance of the solstice. I wanted to present both scientific facts and cultural diversity through a modern and engaging interface. The project allowed me to:

Enhance my frontend skills using HTML, CSS, and JavaScript.

Experiment with smooth animations, responsive design, and interactive elements.

Learn about optimizing user navigation with smooth scrolling and dynamic buttons.

Here’s how the project evolved:

  1. HTML: Structured content for clarity and semantic accuracy.

  2. CSS: Enhanced the design with gradient backgrounds, animations, and responsive layouts.

  3. JavaScript: Brought the page to life with interactive navigation and scroll-triggered effects.

I am proud of the smooth animations, responsive design, and scroll-to-top feature, which ensure a delightful user experience. Future improvements could include adding a carousel of solstice imagery or integrating API-based data for live solstice tracking.


Code

HTML

<!DOCTYPE html>




Winter Solstice Celebrations





Winter Solstice


Explore the Science, Traditions, and Global Celebrations


Start Exploring




<main>
    <section id="introduction" class="fade-in">
        <h2>Introduction</h2>
        <p>The winter solstice is the shortest day and longest night of the year. It has inspired traditions worldwide, celebrating the triumph of light over darkness.</p>
    </section>

    <section id="science" class="fade-in">
        <h2>The Science</h2>
        <p>Caused by the Earth's axial tilt, the solstice is a moment when the Sun reaches its lowest or highest point in the sky, marking a pivotal astronomical event.</p>
    </section>

    <section id="hemispheres" class="fade-in">
        <h2>Hemispheres Experience</h2>
        <p>While the Northern Hemisphere associates the solstice with winter, the Southern Hemisphere experiences summer celebrations.</p>
    </section>

    <section id="celebrations" class="fade-in">
        <h2>Global Celebrations</h2>
        <p>From bonfires to festive dances, the solstice is celebrated globally as a time of renewal and hope.</p>
    </section>

    <section id="traditions" class="fade-in">
        <h2>Traditions</h2>
        <ul>
            <li>Lighting fires to symbolize light overcoming darkness.</li>
            <li>Feasting to strengthen community bonds.</li>
            <li>Exchanging gifts to celebrate goodwill.</li>
        </ul>
    </section>

    <section id="conclusion" class="fade-in">
        <h2>Conclusion</h2>
        <p>The winter solstice unites us through themes of renewal, hope, and celebration. Join us in embracing the wonder of this celestial event.</p>
    </section>
</main>

<footer id="main-footer">
    <p>&copy; 2024 Winter Solstice</p>
    <button id="scrollTopBtn">Back to Top</button>
</footer>

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

CSS

/* Base Reset */

  • { margin: 0; padding: 0; box-sizing: border-box; }

/* Fonts and Colors */
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
background: linear-gradient(to bottom, #001f3f, #1c1c1c);
color: #fff;
}

header {
position: relative;
text-align: center;
color: #fff;
background: url('header-bg.jpg') no-repeat center center/cover;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.header-overlay {
background: rgba(0, 0, 0, 0.5);
padding: 20px;
border-radius: 8px;
}

header h1 {
font-size: 3rem;
margin-bottom: 10px;
}

header p {
font-size: 1.2rem;
margin-bottom: 20px;
}

.btn {
padding: 10px 20px;
font-size: 1.1rem;
color: #001f3f;
background: #ffcc00;
border: none;
border-radius: 5px;
cursor: pointer;
transition: all 0.3s ease;
}

.btn:hover {
background: #e0ac00;
}

main section {
padding: 40px 20px;
max-width: 800px;
margin: 20px auto;
background: rgba(255, 255, 255, 0.1);
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Animations */
.fade-in {
opacity: 0;
transform: translateY(20px);
animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
to {
opacity: 1;
transform: translateY(0);
}
}

footer {
text-align: center;
padding: 10px 0;
background: #111;
color: #fff;
}

scrollTopBtn {

position: fixed;
bottom: 20px;
right: 20px;
padding: 10px 15px;
background: #ffcc00;
color: #001f3f;
border: none;
border-radius: 50%;
cursor: pointer;
display: none;
transition: all 0.3s ease;

}


JavaScript

// Smooth Scroll to Sections
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});

// Scroll-to-Top Button
const scrollTopBtn = document.getElementById('scrollTopBtn');
window.addEventListener('scroll', () => {
if (window.scrollY > 300) {
scrollTopBtn.style.display = 'block';
} else {
scrollTopBtn.style.display = 'none';
}
});

scrollTopBtn.addEventListener('click', () => {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});


Conclusion

This project reflects the significance of the Winter Solstice while leveraging modern web technologies to provide an engaging user experience. It demonstrates creative design, interactive navigation, and responsive functionality, making it a strong contender in the challenge.Thank you so much for this opportunity,hope you will consider my submission.

Top comments (2)

Collapse
 
hanzlabaig profile image
Hanzla Baig

I recommend you that make the completely website and then deploy it on the netlify, vercel or the github

Collapse
 
hanzlabaig profile image
Hanzla Baig

.