Загрузка данных


JS
document.addEventListener('DOMContentLoaded', () => {
  console.log('Приложение загружено и готово к работе!');

  const button = document.getElementById('actionBtn');

  if (button) {
    button.addEventListener('click', () => {
      alert('писи попы какашечки')
    });
  }
});

HTML
<!doctype html>
<html lang="ru">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Мое веб-приложение</title>
    <link rel="stylesheet" href="css/style.css" />
  </head>
  <body>
    <header>
      <h1>Привет, мир!</h1>
      <nav>
        <ul>
          <li><a href="#">Главная</a></li>
          <li><a href="#">О нас</a></li>
          <li><a href="#">Контакты</a></li>
        </ul>
      </nav>
    </header>

    <main>
<article class="card">        <img           class="card__image"           src="assets/images/simple_photo.jpg"           alt="Пейзаж на фотографии"         />         <div class="card__content">           <p class="card__eyebrow">Вдохновение рядом</p>           <h2 class="card__title">Откройте для себя новое</h2>           <p class="card__description">             Иногда достаточно остановиться на мгновение, чтобы заметить красоту вокруг.           </p>           <button id="actionBtn" type="button">Нажми меня</button>         </div>       </article>
    </main>

    <footer>
      <p>&copy;2026 Мое веб-приложение</p>
    </footer>

    <script src="js/app.js"></script>
  </body>
</html>


CSS
base.css
/* Сброс стилей и базовые настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

font.css
/* Подключение шрифтов */
@font-face {
    font-family: 'MyCustomFont';
    src: url('../../assets/fonts/MyFont.woff2') format('woff2'), /* Рекомендуемый формат */
         url('../../assets/fonts/MyFont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Улучшает загрузку */
}

body {
    font-family: 'MyCustomFont', Arial, sans-serif;
}

button.css
button {  
  display: inline-block;   
  padding: 12px 20px;   
  border: 0;   
  border-radius: 8px;   
  background: #246b58;   
  color: #fff;   
  cursor: pointer;   
  font: inherit;   
  font-weight: 600;   
  transition: background-color 0.2s ease, transform 0.2s ease;
 }  

 button:hover {   
  background: #1b5545;   
  transform: translateY(-1px); 
}  

button:focus-visible {   
  outline: 3px solid #9bcabb;   
  outline-offset: 3px; 
}

card.css

.card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  overflow: hidden;
  width: 100%;
  background: #fff;
  border: 1px solid #e5ebe8;
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(30, 55, 46, 0.09);
  
.card:hover {
  transform: translateY(-5px);
}
}
.card__image {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

.card__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
}

.card__eyebrow {
  margin-bottom: 12px;
  color: #347a68;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card__title {
  margin-bottom: 16px;
  color: #1b3029;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.card__description {
  margin-bottom: 24px;
  color: #64716c;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .card {
    grid-template-columns: 1fr;
  }

  .card__image {
    height: 260px;
    min-height: 0;
  }
}

components.css
@import 'card.css'; 
@import 'button.css'; 

section {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: background 0.3s ease;
}

button:hover {
    background: #0056b3;
}


style.css
/* Главный файл стилей */

/* 1. Шрифты */
@import 'base/fonts.css';

/* 2. Базовые настройки (Reset, Body) */
@import 'base/base.css';

/* 3. Макет (Header, Footer, Grid/Flex containers) */
@import 'layout/layout.css';

/* 4. Компоненты (Buttons, Cards, Forms) */
@import 'components/components.css';