Skip to content

niktariy/Tropical-Summer

Repository files navigation

Tropical Summer - Event website Hero Section

Адаптивная веб-страница с динамической сменой темы в зависимости от времени суток.

Responsive web page that changes theme colors depending on the time of the day.

🔗 Demo


О проекте / About the Project

Русский: Проект создан по вдохновению от дизайна Divan Raj и реализует адаптивную веб-страницу, которая автоматически меняет цветовую палитру в зависимости от времени суток: утро, день, вечер.

English: The project was inspired by the design of Divan Raj and implements a responsive web page that automatically changes its color palette depending on the time of day: morning, day, evening.

Desctop design - pink variant Adaptive design - orange variant, mobile menu
Mobile design 3 variants: pink, lilac, orange

Особенности / Features

Особенность / Feature Описание / Description
Адаптивный дизайн Корректное отображение на всех устройствах: мобильные, планшеты, десктопы.
Responsive Design Correct display on all devices: mobile, tablet, desktop.
Динамическая смена темы Автоматическая смена цветовой палитры в зависимости от времени суток.
Dynamic Theme Switching Automatic color palette change depending on the time of day.
Sass Использование препроцессора для удобного управления стилями и переменными.
Sass Using a preprocessor for convenient style and variable management.
Минималистичный дизайн Современный и стильный вид с акцентом на графике и социальных ссылках.
Minimalist Design Modern and stylish look with a focus on graphics and social links.

Техническая реализация / Technical Implementation

1. Смена темы по времени суток / Dynamic Theme Switching

Смена темы реализована с помощью JavaScript / Theme switching is implemented using JavaScript

  1. Определение текущего времени / Determine the current time:
    const hour = new Date().getHours();
  2. Установка класса для <body> в зависимости от времени / Set a class for based on time:
    if (hour >= 5 && hour < 12) {
      document.body.classList.add('morning');
    } else if (hour >= 12 && hour < 18) {
      document.body.classList.add('day');
    } else {
      document.body.classList.add('evening');
    }
  3. CSS-стили для каждой темы / CSS styles for each theme:
    body.morning {
      --bg-color: #f8e8d1;
      --text-color: #333;
      --accent-color: #ff9a8b;
    }

2. Адаптивность / Responsive Design

Адаптивность реализована с помощью медиа-запросов в CSS / Responsive design is implemented using media queries in CSS:

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    align-items: center;
  }
  .flower {
    width: 80%;
  }
}

Лицензия / License

Этот проект лицензируется по Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) License.

🔗 Посмотреть полный текст лицензии 🔗 View full license text

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •