Создано интерактивное приложение для занятий по методу Дейвиса
This commit is contained in:
parent
b0a83fc1e2
commit
26d15d1462
173
AGENTS.md
Normal file
173
AGENTS.md
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<!-- vibe42-agents-version: v3-guided-2026-06-01 -->
|
||||||
|
# Vibe42 — учебная песочница для лендингов
|
||||||
|
|
||||||
|
Workspace юзера `samal_iskakova`. Это **учебная среда**, где обычные люди (не разработчики) пробуют сделать свой первый сайт.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 ТВОЯ РОЛЬ
|
||||||
|
|
||||||
|
Ты — **гид и помощник**, а не слепой исполнитель. Цель сессии — чтобы юзер вышел с:
|
||||||
|
1. **рабочим лендингом**, опубликованным по адресу `https://pages.git.vibe42.kz/samal_iskakova/<repo>/`,
|
||||||
|
2. ощущением «это было легко» — без серверов, БД, токенов, конфигов.
|
||||||
|
|
||||||
|
Юзер не разработчик. Ему важен **результат, который видно в браузере**, а не код.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🗺 СЦЕНАРИЙ ПЕРВОГО ЗАХОДА (юзер только зашёл, ещё ничего нет)
|
||||||
|
|
||||||
|
1. Поздоровайся коротко: «Привет! Тут за 10 минут собираем лендинг и публикуем его в интернете. О чём хочешь сделать?»
|
||||||
|
2. Если он не знает — предложи **4 конкретных идеи** (выбирай близкие к нему, не абстрактные):
|
||||||
|
- Промо хобби (фотография / музыка / спорт)
|
||||||
|
- Резюме / personal page с контактами
|
||||||
|
- Афиша мероприятия (концерт, день рождения, мастер-класс)
|
||||||
|
- Меню заведения / прайс услуг
|
||||||
|
- Лендинг продукта или будущего проекта (waitlist)
|
||||||
|
3. Уточни **2 короткие детали**: стиль (тёмный/светлый/яркий) и главную цель (рассказать / собрать заявку / показать работы).
|
||||||
|
4. Сразу делай `./new-project <name>` и собирай страницу. Не спрашивай разрешения на каждый шаг.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💬 ЕСЛИ ЮЗЕР ОТВЕЧАЕТ РАСПЛЫВЧАТО
|
||||||
|
|
||||||
|
Юзер говорит «сделай что-нибудь» / «ну хз» / «сюрприз» → **не делай ничего абстрактного**.
|
||||||
|
|
||||||
|
Скажи: «Давай определимся, я задам 3 коротких вопроса:
|
||||||
|
1. Это для тебя лично, для проекта/бизнеса, или для события?
|
||||||
|
2. Главная цель — рассказать о чём-то / собрать заявку / показать портфолио?
|
||||||
|
3. Любимое настроение — строгое тёмное, лёгкое светлое, яркое цветное?»
|
||||||
|
|
||||||
|
После ответов **сразу** предложи 2 конкретных варианта названия+структуры. Дай выбрать и иди делать.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚫 ЕСЛИ ЮЗЕР ХОЧЕТ СЛОЖНОЕ — ПЕРЕФОРМУЛИРУЙ В ЛЕНДИНГ
|
||||||
|
|
||||||
|
| Запрос | Что делаем вместо |
|
||||||
|
|--------|-------------------|
|
||||||
|
| «магазин с корзиной» | лендинг с товарами + кнопка «купить» = ссылка на WhatsApp / Telegram |
|
||||||
|
| «соцсеть» | лендинг будущего проекта + waitlist-форма (Formspree / Getform) |
|
||||||
|
| «блог с админкой» | personal-page + ссылки на статьи в Telegram/Medium |
|
||||||
|
| «приложение для записи» | лендинг услуги + ссылка на Calendly / WhatsApp |
|
||||||
|
| «сайт с входом юзеров» | публичный лендинг без логина (нам логин не нужен) |
|
||||||
|
| «бот в Telegram» | лендинг с описанием бота + кнопка `t.me/...` |
|
||||||
|
|
||||||
|
**Не говори «это невозможно».** Скажи: «У нас песочница только для статических сайтов. Давай сделаем лендинг, который покажет твою идею — а кнопки/формы свяжем с готовыми сервисами (WhatsApp, Telegram, Formspree)». Юзер счастлив, результат за 15 минут.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📐 ШАБЛОНЫ СТРАНИЦ (выбирай под идею юзера)
|
||||||
|
|
||||||
|
### A — Промо продукта/услуги
|
||||||
|
**Секции:** Hero (заголовок + подзаголовок + CTA-кнопка) → 3-4 преимущества (иконка emoji + текст) → социальное доказательство (отзыв или цифра) → CTA (кнопка/телефон/мессенджер).
|
||||||
|
|
||||||
|
### B — Personal / резюме
|
||||||
|
**Секции:** Hero (фото-аватарка + имя + одна фраза «кто я») → О себе (1-2 абзаца) → 3-5 карточек проектов/опыта → Контакты (email, telegram, github как ссылки-кнопки).
|
||||||
|
|
||||||
|
### C — Афиша мероприятия
|
||||||
|
**Секции:** Hero (название + дата + место крупно) → Программа (список с временем) → Локация (картинка-placeholder + адрес) → Регистрация (форма Formspree или контакт).
|
||||||
|
|
||||||
|
### D — Меню / прайс
|
||||||
|
**Секции:** Hero (название + слоган) → Меню/прайс (категории с ценами) → Контакты (телефон, адрес, часы работы, карта-картинка).
|
||||||
|
|
||||||
|
### E — Waitlist для будущего проекта
|
||||||
|
**Секции:** Hero (название проекта + одна фраза + email-форма) → 3 фичи «что будет» → FAQ (3 пункта) → CTA (та же email-форма).
|
||||||
|
|
||||||
|
Все шаблоны — **одна страница, прокрутка вниз**. Никаких роутов, ничего динамического.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚡ РИТУАЛ ПОСЛЕ ПЕРВОГО ЗАПУСКА
|
||||||
|
|
||||||
|
Как только готов первый рабочий вариант (даже грубый):
|
||||||
|
|
||||||
|
1. **Сразу запушь:**
|
||||||
|
```bash
|
||||||
|
git add -A
|
||||||
|
git commit -m "v1"
|
||||||
|
git push origin HEAD:pages
|
||||||
|
```
|
||||||
|
2. **ОБЯЗАТЕЛЬНО** дай юзеру ссылку **жирно**:
|
||||||
|
> 🎉 Готово! Твой лендинг здесь: **https://pages.git.vibe42.kz/samal_iskakova/<repo>/**
|
||||||
|
3. Скажи: «Открой в новой вкладке, посмотри. Что хочешь поменять?»
|
||||||
|
4. Дальше короткие итерации: правка → push → новый URL-показ. Каждые 2-3 правки — push.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ ЖЕЛЕЗНЫЕ ПРАВИЛА (НЕ нарушать никогда)
|
||||||
|
|
||||||
|
1. **Только статика — HTML + CSS + JS в браузере.**
|
||||||
|
2. **Никакого бэкенда.** Никаких Node/Express/FastAPI/Django/PHP/Go-серверов. Никаких БД. Никакого Redis.
|
||||||
|
3. **Никакой аутентификации / OAuth / JWT.**
|
||||||
|
4. **Никакого Docker, nginx, sudo, системных настроек.**
|
||||||
|
5. **Никаких тяжёлых сборщиков** (`npm install` дерево на 500МБ). Tailwind — только через CDN.
|
||||||
|
6. **НИКОГДА `git init` в workspace root (`/workspaces/samal_iskakova`)** — это папка-контейнер юзера, не репозиторий.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ ВСЕГДА работай через `./new-project`
|
||||||
|
|
||||||
|
Если юзер сказал «сделай сайт NAME» / «создай проект NAME»:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /workspaces/samal_iskakova
|
||||||
|
./new-project NAME # создаёт repo в Gitea + клонит локально в ./NAME/
|
||||||
|
cd NAME
|
||||||
|
# теперь создавай index.html / style.css / script.js внутри ./NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
`./new-project` сам создаёт repo, клонит, и копирует туда `AGENTS.md` + `design.md`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🌐 Git и публикация
|
||||||
|
|
||||||
|
**НЕТ GitHub.** Self-hosted git: **https://git.vibe42.kz**
|
||||||
|
|
||||||
|
- Профиль юзера: https://git.vibe42.kz/samal_iskakova
|
||||||
|
- Pages (живые лендинги): https://pages.git.vibe42.kz/samal_iskakova/<repo>/
|
||||||
|
- Креды уже в `/workspaces/samal_iskakova/.git-credentials` — git push/clone работают без пароля
|
||||||
|
- **НЕ спрашивай юзера про GitHub URL / токен** — их не нужно
|
||||||
|
|
||||||
|
### Опубликовать лендинг
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add -A
|
||||||
|
git commit -m "site"
|
||||||
|
git push origin HEAD:pages
|
||||||
|
```
|
||||||
|
|
||||||
|
Ветка **`pages`** (Caddy её обслуживает; `gh-pages` тоже работает как fallback). Push → лендинг доступен мгновенно.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Когда что-то идёт не так
|
||||||
|
|
||||||
|
- **Pages 404** → запушь ветку `pages` снова: `git push origin HEAD:pages -f`
|
||||||
|
- **Не дёргай Gitea API типа `/repos/.../pages`, `/settings/pages`, `/deploy_keys`** — их нет
|
||||||
|
- **Не пытайся «настроить Pages через UI Gitea»** — Pages у нас работают только через push в ветку `pages`
|
||||||
|
- Запуталось — сделай новый чистый проект через `./new-project NAME-v2`, перенеси туда работающий index.html
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ❌ Чего НЕ делать НИКОГДА
|
||||||
|
|
||||||
|
- ❌ `git init` в workspace root
|
||||||
|
- ❌ `npm install` с прод-зависимостями (express/mongoose/pg/prisma/next/nuxt)
|
||||||
|
- ❌ Создавать `server.js` / `app.py` / `main.go` как backend
|
||||||
|
- ❌ Использовать `gh` CLI или GitHub API
|
||||||
|
- ❌ Вызывать Gitea Pages-API (его нет)
|
||||||
|
- ❌ Долгое отлаживание Pages — почти всегда решение «push HEAD:pages»
|
||||||
|
- ❌ Просить юзера ввести токен/URL/пароль — всё уже настроено
|
||||||
|
- ❌ Задавать юзеру 10 вопросов подряд (максимум 2-3 за раз)
|
||||||
|
- ❌ Показывать юзеру голый код больше 1 раза — ему важен результат, а не как написано
|
||||||
|
- ❌ Предлагать «давай сначала дизайн в Figma» — мы делаем сразу в HTML
|
||||||
|
- ❌ Говорить «это сложно» — переформулируй в простое
|
||||||
|
- ❌ Зависать в обсуждениях — сделай первый вариант грубо, потом итерируй
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎨 design.md
|
||||||
|
|
||||||
|
Рядом лежит `design.md` с готовой палитрой, типографикой и стартер-шаблоном `index.html`. **Начинай с него.** Не выдумывай новые цвета — модифицируй существующие.
|
||||||
110
design.md
Normal file
110
design.md
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<!-- vibe42-design-version: v1-2026-06-01 -->
|
||||||
|
# Design system — Vibe42 песочница
|
||||||
|
|
||||||
|
Базовые цвета и типографика для лендингов. Можно отклоняться, но начинай с этого.
|
||||||
|
|
||||||
|
## Палитра
|
||||||
|
|
||||||
|
| Token | Hex | Использование |
|
||||||
|
|-------|-----|---------------|
|
||||||
|
| `--ink` | `#0F1218` | Тёмный фон / основной текст |
|
||||||
|
| `--cyan` | `#00E5FF` | Основной акцент (кнопки, лого) |
|
||||||
|
| `--cyan-50` | `#E8FCFF` | Светлая подложка для акцентов |
|
||||||
|
| `--white` | `#FFFFFF` | Основной фон |
|
||||||
|
| `--gray-500` | `#5B6573` | Вторичный текст |
|
||||||
|
| `--gray-100` | `#F2F4F7` | Сепараторы / тонкие фоны |
|
||||||
|
|
||||||
|
## Типографика
|
||||||
|
|
||||||
|
```css
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
|
||||||
|
```
|
||||||
|
|
||||||
|
| Уровень | Размер | Вес | line-height |
|
||||||
|
|---------|--------|-----|-------------|
|
||||||
|
| h1 (hero) | 56px | 800 | 1.05 |
|
||||||
|
| h2 (section) | 36px | 700 | 1.15 |
|
||||||
|
| h3 | 22px | 700 | 1.3 |
|
||||||
|
| body | 17px | 400 | 1.6 |
|
||||||
|
| small | 14px | 400 | 1.5 |
|
||||||
|
|
||||||
|
На мобиле — h1 уменьши до 36px, h2 до 28px.
|
||||||
|
|
||||||
|
## Лейаут
|
||||||
|
|
||||||
|
- max-width контента: **1140px** (контейнер с padding по бокам)
|
||||||
|
- секция: `padding: 80px 24px` (мобила: `48px 20px`)
|
||||||
|
- gap между блоками внутри секции: `24-32px`
|
||||||
|
- border-radius: `8px` (кнопки, карточки), `16px` (большие карточки)
|
||||||
|
|
||||||
|
## Кнопки
|
||||||
|
|
||||||
|
```css
|
||||||
|
.btn-primary {
|
||||||
|
background: var(--cyan); color: var(--ink);
|
||||||
|
padding: 14px 28px; border-radius: 8px;
|
||||||
|
font-weight: 700; text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.btn-secondary {
|
||||||
|
background: transparent; color: var(--ink);
|
||||||
|
border: 2px solid var(--ink);
|
||||||
|
padding: 12px 26px; border-radius: 8px;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Стартер `index.html`
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>Мой проект</title>
|
||||||
|
<style>
|
||||||
|
:root{--ink:#0F1218;--cyan:#00E5FF;--cyan-50:#E8FCFF;--white:#fff;--gray-500:#5B6573;--gray-100:#F2F4F7}
|
||||||
|
*{box-sizing:border-box;margin:0;padding:0}
|
||||||
|
body{font:17px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,sans-serif;color:var(--ink);background:var(--white)}
|
||||||
|
.container{max-width:1140px;margin:0 auto;padding:80px 24px}
|
||||||
|
.hero{background:var(--ink);color:var(--white)}
|
||||||
|
.hero h1{font-size:56px;font-weight:800;line-height:1.05;margin-bottom:24px}
|
||||||
|
.hero p{font-size:20px;color:#9aa3b2;max-width:600px;margin-bottom:32px}
|
||||||
|
.btn{display:inline-block;background:var(--cyan);color:var(--ink);padding:14px 28px;border-radius:8px;font-weight:700;text-decoration:none}
|
||||||
|
.btn:hover{background:#1be5ff}
|
||||||
|
.section h2{font-size:36px;font-weight:700;margin-bottom:24px}
|
||||||
|
.card{background:var(--gray-100);border-radius:16px;padding:32px;margin-bottom:16px}
|
||||||
|
@media (max-width:640px){.hero h1{font-size:36px}.section h2{font-size:28px}.container{padding:48px 20px}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section class="hero">
|
||||||
|
<div class="container">
|
||||||
|
<h1>Заголовок проекта</h1>
|
||||||
|
<p>Подзаголовок — пара предложений о чём это.</p>
|
||||||
|
<a class="btn" href="#section">Начать</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section id="section" class="section">
|
||||||
|
<div class="container">
|
||||||
|
<h2>Секция</h2>
|
||||||
|
<div class="card">Контент карточки.</div>
|
||||||
|
<div class="card">Контент карточки.</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Чем НЕ пользоваться
|
||||||
|
|
||||||
|
- Bootstrap, Material UI, Chakra, Ant Design — слишком тяжело и не нужно для лендинга
|
||||||
|
- Font Awesome — используй emoji (🚀 ⚡ ✨) или inline SVG
|
||||||
|
- jQuery — vanilla JS более чем достаточно
|
||||||
|
|
||||||
|
## Чем МОЖНО (если очень надо)
|
||||||
|
|
||||||
|
- **Tailwind через CDN**: `<script src="https://cdn.tailwindcss.com"></script>` — для прототипа OK
|
||||||
|
- **Lottie animations через CDN**
|
||||||
|
- **Placeholder картинки**: `https://picsum.photos/800/600`, `https://placehold.co/600x400`
|
||||||
|
- **Шрифты Google Fonts через `<link>`** в head
|
||||||
881
index.html
Normal file
881
index.html
Normal file
@ -0,0 +1,881 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>Метод Дейвиса — Интерактивные занятия</title>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--ink: #0F1218;
|
||||||
|
--cyan: #00E5FF;
|
||||||
|
--cyan-50: #E8FCFF;
|
||||||
|
--white: #FFFFFF;
|
||||||
|
--gray-500: #5B6573;
|
||||||
|
--gray-100: #F2F4F7;
|
||||||
|
--pink: #FF6B9D;
|
||||||
|
--green: #4CAF50;
|
||||||
|
--orange: #FF9800;
|
||||||
|
--purple: #9C27B0;
|
||||||
|
--yellow: #FFC107;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
|
||||||
|
color: var(--ink);
|
||||||
|
background: var(--white);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 1140px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 80px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hero Section */
|
||||||
|
.hero {
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
color: var(--white);
|
||||||
|
padding: 60px 24px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero h1 {
|
||||||
|
font-size: 48px;
|
||||||
|
font-weight: 800;
|
||||||
|
line-height: 1.1;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero p {
|
||||||
|
font-size: 20px;
|
||||||
|
color: rgba(255,255,255,0.9);
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 0 auto 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Navigation */
|
||||||
|
.nav {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn {
|
||||||
|
background: rgba(255,255,255,0.2);
|
||||||
|
color: var(--white);
|
||||||
|
border: 2px solid rgba(255,255,255,0.3);
|
||||||
|
padding: 12px 24px;
|
||||||
|
border-radius: 25px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn:hover, .nav-btn.active {
|
||||||
|
background: var(--white);
|
||||||
|
color: var(--ink);
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Section Styling */
|
||||||
|
.section {
|
||||||
|
padding: 60px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Letter Cards */
|
||||||
|
.letter-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
||||||
|
gap: 20px;
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter-card {
|
||||||
|
background: var(--gray-100);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
border: 3px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter-card:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
border-color: var(--cyan);
|
||||||
|
box-shadow: 0 10px 30px rgba(0,229,255,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter-card.selected {
|
||||||
|
background: var(--cyan-50);
|
||||||
|
border-color: var(--cyan);
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter-card .letter {
|
||||||
|
font-size: 48px;
|
||||||
|
font-weight: 800;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter-card .sound {
|
||||||
|
font-size: 16px;
|
||||||
|
color: var(--gray-500);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mirror Exercise */
|
||||||
|
.mirror-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 40px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mirror-letter {
|
||||||
|
font-size: 120px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: var(--pink);
|
||||||
|
transition: transform 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mirror-letter.flipped {
|
||||||
|
transform: scaleX(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mirror-controls {
|
||||||
|
display: flex;
|
||||||
|
gap: 20px;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 14px 28px;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-weight: 700;
|
||||||
|
text-decoration: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background: var(--cyan);
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background: #1be5ff;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--ink);
|
||||||
|
border: 2px solid var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary:hover {
|
||||||
|
background: var(--ink);
|
||||||
|
color: var(--white);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-pink {
|
||||||
|
background: var(--pink);
|
||||||
|
color: var(--white);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-green {
|
||||||
|
background: var(--green);
|
||||||
|
color: var(--white);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sound Game */
|
||||||
|
.sound-game {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-letter-display {
|
||||||
|
font-size: 80px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: var(--purple);
|
||||||
|
background: var(--gray-100);
|
||||||
|
padding: 40px;
|
||||||
|
border-radius: 20px;
|
||||||
|
min-width: 200px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-options {
|
||||||
|
display: flex;
|
||||||
|
gap: 15px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-option {
|
||||||
|
background: var(--white);
|
||||||
|
border: 3px solid var(--gray-100);
|
||||||
|
padding: 20px 30px;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-size: 24px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-option:hover {
|
||||||
|
border-color: var(--cyan);
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-option.correct {
|
||||||
|
background: #e8f5e9;
|
||||||
|
border-color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-option.wrong {
|
||||||
|
background: #ffebee;
|
||||||
|
border-color: var(--pink);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Memory Game */
|
||||||
|
.memory-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
||||||
|
gap: 15px;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.memory-card {
|
||||||
|
background: var(--gray-100);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.memory-card:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.memory-card.flipped {
|
||||||
|
background: var(--cyan-50);
|
||||||
|
border-color: var(--cyan);
|
||||||
|
}
|
||||||
|
|
||||||
|
.memory-card.matched {
|
||||||
|
background: #e8f5e9;
|
||||||
|
border-color: var(--green);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Progress */
|
||||||
|
.progress-container {
|
||||||
|
background: var(--gray-100);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar {
|
||||||
|
background: var(--gray-100);
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-fill {
|
||||||
|
background: linear-gradient(90deg, var(--cyan), var(--green));
|
||||||
|
height: 100%;
|
||||||
|
width: 0%;
|
||||||
|
transition: width 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-text {
|
||||||
|
font-size: 16px;
|
||||||
|
color: var(--gray-500);
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Feedback */
|
||||||
|
.feedback {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-top: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback.success {
|
||||||
|
background: #e8f5e9;
|
||||||
|
color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback.error {
|
||||||
|
background: #ffebee;
|
||||||
|
color: var(--pink);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Clay Modeling */
|
||||||
|
.clay-area {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 40px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clay-shape {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
background: var(--orange);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 48px;
|
||||||
|
color: var(--white);
|
||||||
|
font-weight: 800;
|
||||||
|
cursor: move;
|
||||||
|
transition: transform 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clay-shape:hover {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.clay-reference {
|
||||||
|
font-size: 100px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.hero h1 {
|
||||||
|
font-size: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero p {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter-card .letter {
|
||||||
|
font-size: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mirror-letter {
|
||||||
|
font-size: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-letter-display {
|
||||||
|
font-size: 60px;
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 60px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Animations */
|
||||||
|
@keyframes bounce {
|
||||||
|
0%, 100% { transform: translateY(0); }
|
||||||
|
50% { transform: translateY(-10px); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.bounce {
|
||||||
|
animation: bounce 0.6s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hidden sections */
|
||||||
|
.section-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-visible {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- Hero Section -->
|
||||||
|
<section class="hero">
|
||||||
|
<div class="container">
|
||||||
|
<h1>Интерактивные занятия по методу Дейвиса</h1>
|
||||||
|
<p>Помогаем детям с дислексией и СДВГ учиться через игру и творчество</p>
|
||||||
|
|
||||||
|
<div class="nav">
|
||||||
|
<button class="nav-btn active" onclick="showSection('letters')">Буквы</button>
|
||||||
|
<button class="nav-btn" onclick="showSection('mirror')">Зеркальные буквы</button>
|
||||||
|
<button class="nav-btn" onclick="showSection('sounds')">Звуки</button>
|
||||||
|
<button class="nav-btn" onclick="showSection('memory')">Память</button>
|
||||||
|
<button class="nav-btn" onclick="showSection('clay')">Глина</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Letters Section -->
|
||||||
|
<section id="letters" class="section section-visible">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="section-title">Узнаём буквы</h2>
|
||||||
|
|
||||||
|
<div class="progress-container">
|
||||||
|
<div class="progress-bar">
|
||||||
|
<div class="progress-fill" id="letters-progress"></div>
|
||||||
|
</div>
|
||||||
|
<div class="progress-text" id="letters-progress-text">0 из 10 букв изучено</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="letter-grid" id="letter-grid">
|
||||||
|
<!-- Letters will be added here -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="feedback" id="letters-feedback" style="display: none;"></div>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin-top: 30px;">
|
||||||
|
<button class="btn btn-primary" onclick="resetLetters()">Начать заново</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Mirror Section -->
|
||||||
|
<section id="mirror" class="section section-hidden">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="section-title">Зеркальные буквы</h2>
|
||||||
|
<p style="text-align: center; margin-bottom: 40px; color: var(--gray-500);">
|
||||||
|
Помоги букве встать правильно! Нажимай на кнопки, чтобы перевернуть букву.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="mirror-container">
|
||||||
|
<div class="mirror-letter" id="mirror-letter">Б</div>
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<p style="font-size: 18px; margin-bottom: 20px;">Как должна выглядеть буква?</p>
|
||||||
|
<button class="btn btn-primary" onclick="rotateLetter(-90)">← Влево</button>
|
||||||
|
<button class="btn btn-primary" onclick="rotateLetter(90)">Вправо →</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mirror-controls">
|
||||||
|
<button class="btn btn-secondary" onclick="prevMirrorLetter()">← Предыдущая</button>
|
||||||
|
<button class="btn btn-green" onclick="checkMirrorLetter()">Проверить</button>
|
||||||
|
<button class="btn btn-secondary" onclick="nextMirrorLetter()">Следующая →</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="feedback" id="mirror-feedback" style="display: none; margin-top: 30px;"></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Sounds Section -->
|
||||||
|
<section id="sounds" class="section section-hidden">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="section-title">Соединяем звуки и буквы</h2>
|
||||||
|
|
||||||
|
<div class="sound-game">
|
||||||
|
<div class="sound-letter-display" id="sound-letter">А</div>
|
||||||
|
|
||||||
|
<div class="sound-options" id="sound-options">
|
||||||
|
<!-- Sound options will be added here -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="feedback" id="sounds-feedback" style="display: none;"></div>
|
||||||
|
|
||||||
|
<button class="btn btn-primary" onclick="nextSoundLetter()">Следующая буква →</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Memory Section -->
|
||||||
|
<section id="memory" class="section section-hidden">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="section-title">Игра на память</h2>
|
||||||
|
<p style="text-align: center; margin-bottom: 40px; color: var(--gray-500);">
|
||||||
|
Найди одинаковые буквы! Нажимай на карточки, чтобы перевернуть их.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="memory-grid" id="memory-grid">
|
||||||
|
<!-- Memory cards will be added here -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin-top: 30px;">
|
||||||
|
<button class="btn btn-primary" onclick="initMemoryGame()">Начать игру заново</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Clay Section -->
|
||||||
|
<section id="clay" class="section section-hidden">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="section-title">Лепим из глины</h2>
|
||||||
|
<p style="text-align: center; margin-bottom: 40px; color: var(--gray-500);">
|
||||||
|
По методу Дейвиса дети лепят буквы из глины, чтобы лучше их запомнить.
|
||||||
|
Попробуй слепить букву, которая показана справа!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="clay-area">
|
||||||
|
<div class="clay-shape" id="clay-shape" draggable="true">?</div>
|
||||||
|
<div class="clay-reference" id="clay-reference">А</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin-top: 30px;">
|
||||||
|
<button class="btn btn-primary" onclick="nextClayLetter()">Следующая буква →</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Letter learning data
|
||||||
|
const letters = [
|
||||||
|
{ letter: 'А', sound: 'а', example: 'Арбуз' },
|
||||||
|
{ letter: 'Б', sound: 'бэ', example: 'Бабочка' },
|
||||||
|
{ letter: 'В', sound: 'вэ', example: 'Волк' },
|
||||||
|
{ letter: 'Г', sound: 'гэ', example: 'Гриб' },
|
||||||
|
{ letter: 'Д', sound: 'дэ', example: 'Дом' },
|
||||||
|
{ letter: 'Е', sound: 'е', example: 'Ёж' },
|
||||||
|
{ letter: 'Ж', sound: 'жэ', example: 'Жук' },
|
||||||
|
{ letter: 'З', sound: 'зэ', example: 'Звезда' },
|
||||||
|
{ letter: 'И', sound: 'и', example: 'Игрушка' },
|
||||||
|
{ letter: 'К', sound: 'ка', example: 'Кот' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// Mirror letters (pairs that are often confused)
|
||||||
|
const mirrorLetters = [
|
||||||
|
{ letter: 'Б', flipped: 'Ь', correct: 'Б' },
|
||||||
|
{ letter: 'В', flipped: 'В', correct: 'В' },
|
||||||
|
{ letter: 'Д', flipped: 'Д', correct: 'Д' },
|
||||||
|
{ letter: 'Р', flipped: 'Я', correct: 'Р' },
|
||||||
|
{ letter: 'С', flipped: 'С', correct: 'С' },
|
||||||
|
{ letter: 'Э', flipped: 'Э', correct: 'Э' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// State variables
|
||||||
|
let currentSection = 'letters';
|
||||||
|
let selectedLetter = null;
|
||||||
|
let lettersLearned = 0;
|
||||||
|
let currentMirrorIndex = 0;
|
||||||
|
let currentRotation = 0;
|
||||||
|
let currentSoundLetterIndex = 0;
|
||||||
|
let memoryCards = [];
|
||||||
|
let flippedCards = [];
|
||||||
|
let matchedPairs = 0;
|
||||||
|
|
||||||
|
// Initialize the app
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
initLetters();
|
||||||
|
initMirrorExercise();
|
||||||
|
initSoundGame();
|
||||||
|
initMemoryGame();
|
||||||
|
initClayExercise();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Navigation
|
||||||
|
function showSection(sectionId) {
|
||||||
|
// Hide all sections
|
||||||
|
document.querySelectorAll('.section').forEach(section => {
|
||||||
|
section.classList.remove('section-visible');
|
||||||
|
section.classList.add('section-hidden');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Show selected section
|
||||||
|
document.getElementById(sectionId).classList.remove('section-hidden');
|
||||||
|
document.getElementById(sectionId).classList.add('section-visible');
|
||||||
|
|
||||||
|
// Update navigation buttons
|
||||||
|
document.querySelectorAll('.nav-btn').forEach(btn => {
|
||||||
|
btn.classList.remove('active');
|
||||||
|
});
|
||||||
|
event.target.classList.add('active');
|
||||||
|
|
||||||
|
currentSection = sectionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Letters Section
|
||||||
|
function initLetters() {
|
||||||
|
const grid = document.getElementById('letter-grid');
|
||||||
|
grid.innerHTML = '';
|
||||||
|
|
||||||
|
letters.forEach((item, index) => {
|
||||||
|
const card = document.createElement('div');
|
||||||
|
card.className = 'letter-card';
|
||||||
|
card.innerHTML = `
|
||||||
|
<div class="letter">${item.letter}</div>
|
||||||
|
<div class="sound">${item.sound}</div>
|
||||||
|
`;
|
||||||
|
card.onclick = () => selectLetter(index, card);
|
||||||
|
grid.appendChild(card);
|
||||||
|
});
|
||||||
|
|
||||||
|
updateLettersProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectLetter(index, card) {
|
||||||
|
// Remove selection from all cards
|
||||||
|
document.querySelectorAll('.letter-card').forEach(c => c.classList.remove('selected'));
|
||||||
|
|
||||||
|
// Select this card
|
||||||
|
card.classList.add('selected');
|
||||||
|
selectedLetter = index;
|
||||||
|
|
||||||
|
// Show feedback
|
||||||
|
showFeedback('letters-feedback', `Буква "${letters[index].letter}" — ${letters[index].sound}. Пример: ${letters[index].example}`, 'success');
|
||||||
|
|
||||||
|
// Mark as learned
|
||||||
|
if (!card.classList.contains('learned')) {
|
||||||
|
card.classList.add('learned');
|
||||||
|
lettersLearned++;
|
||||||
|
updateLettersProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add bounce animation
|
||||||
|
card.classList.add('bounce');
|
||||||
|
setTimeout(() => card.classList.remove('bounce'), 600);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateLettersProgress() {
|
||||||
|
const progress = (lettersLearned / letters.length) * 100;
|
||||||
|
document.getElementById('letters-progress').style.width = `${progress}%`;
|
||||||
|
document.getElementById('letters-progress-text').textContent = `${lettersLearned} из ${letters.length} букв изучено`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetLetters() {
|
||||||
|
lettersLearned = 0;
|
||||||
|
document.querySelectorAll('.letter-card').forEach(card => {
|
||||||
|
card.classList.remove('selected', 'learned');
|
||||||
|
});
|
||||||
|
updateLettersProgress();
|
||||||
|
document.getElementById('letters-feedback').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mirror Exercise
|
||||||
|
function initMirrorExercise() {
|
||||||
|
currentMirrorIndex = 0;
|
||||||
|
currentRotation = 0;
|
||||||
|
updateMirrorDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateMirrorDisplay() {
|
||||||
|
const letter = mirrorLetters[currentMirrorIndex].letter;
|
||||||
|
document.getElementById('mirror-letter').textContent = letter;
|
||||||
|
document.getElementById('mirror-letter').style.transform = `rotate(${currentRotation}deg)`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function rotateLetter(degrees) {
|
||||||
|
currentRotation += degrees;
|
||||||
|
document.getElementById('mirror-letter').style.transform = `rotate(${currentRotation}deg)`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function prevMirrorLetter() {
|
||||||
|
currentMirrorIndex = (currentMirrorIndex - 1 + mirrorLetters.length) % mirrorLetters.length;
|
||||||
|
currentRotation = 0;
|
||||||
|
updateMirrorDisplay();
|
||||||
|
document.getElementById('mirror-feedback').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextMirrorLetter() {
|
||||||
|
currentMirrorIndex = (currentMirrorIndex + 1) % mirrorLetters.length;
|
||||||
|
currentRotation = 0;
|
||||||
|
updateMirrorDisplay();
|
||||||
|
document.getElementById('mirror-feedback').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkMirrorLetter() {
|
||||||
|
const isCorrect = currentRotation % 360 === 0;
|
||||||
|
const feedback = document.getElementById('mirror-feedback');
|
||||||
|
|
||||||
|
if (isCorrect) {
|
||||||
|
showFeedback('mirror-feedback', 'Молодец! Буква стоит правильно!', 'success');
|
||||||
|
} else {
|
||||||
|
showFeedback('mirror-feedback', 'Попробуй ещё раз! Буква должна стоять ровно.', 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sound Game
|
||||||
|
function initSoundGame() {
|
||||||
|
currentSoundLetterIndex = 0;
|
||||||
|
updateSoundGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSoundGame() {
|
||||||
|
const letter = letters[currentSoundLetterIndex];
|
||||||
|
document.getElementById('sound-letter').textContent = letter.letter;
|
||||||
|
|
||||||
|
const options = document.getElementById('sound-options');
|
||||||
|
options.innerHTML = '';
|
||||||
|
|
||||||
|
// Create correct answer
|
||||||
|
const correctOption = document.createElement('div');
|
||||||
|
correctOption.className = 'sound-option';
|
||||||
|
correctOption.textContent = letter.sound;
|
||||||
|
correctOption.onclick = () => checkSoundAnswer(correctOption, true);
|
||||||
|
options.appendChild(correctOption);
|
||||||
|
|
||||||
|
// Create wrong answers
|
||||||
|
const wrongAnswers = letters
|
||||||
|
.filter((_, index) => index !== currentSoundLetterIndex)
|
||||||
|
.sort(() => Math.random() - 0.5)
|
||||||
|
.slice(0, 3)
|
||||||
|
.map(item => item.sound);
|
||||||
|
|
||||||
|
wrongAnswers.forEach(sound => {
|
||||||
|
const wrongOption = document.createElement('div');
|
||||||
|
wrongOption.className = 'sound-option';
|
||||||
|
wrongOption.textContent = sound;
|
||||||
|
wrongOption.onclick = () => checkSoundAnswer(wrongOption, false);
|
||||||
|
options.appendChild(wrongOption);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Shuffle options
|
||||||
|
const optionsArray = Array.from(options.children);
|
||||||
|
optionsArray.sort(() => Math.random() - 0.5);
|
||||||
|
optionsArray.forEach(option => options.appendChild(option));
|
||||||
|
|
||||||
|
document.getElementById('sounds-feedback').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkSoundAnswer(option, isCorrect) {
|
||||||
|
const feedback = document.getElementById('sounds-feedback');
|
||||||
|
|
||||||
|
if (isCorrect) {
|
||||||
|
option.classList.add('correct');
|
||||||
|
showFeedback('sounds-feedback', 'Правильно! Молодец!', 'success');
|
||||||
|
} else {
|
||||||
|
option.classList.add('wrong');
|
||||||
|
showFeedback('sounds-feedback', 'Не совсем. Попробуй ещё раз!', 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextSoundLetter() {
|
||||||
|
currentSoundLetterIndex = (currentSoundLetterIndex + 1) % letters.length;
|
||||||
|
updateSoundGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Memory Game
|
||||||
|
function initMemoryGame() {
|
||||||
|
const grid = document.getElementById('memory-grid');
|
||||||
|
grid.innerHTML = '';
|
||||||
|
|
||||||
|
// Create pairs of letters
|
||||||
|
const selectedLetters = letters.slice(0, 6);
|
||||||
|
const pairs = [...selectedLetters, ...selectedLetters];
|
||||||
|
|
||||||
|
// Shuffle
|
||||||
|
memoryCards = pairs.sort(() => Math.random() - 0.5);
|
||||||
|
flippedCards = [];
|
||||||
|
matchedPairs = 0;
|
||||||
|
|
||||||
|
memoryCards.forEach((item, index) => {
|
||||||
|
const card = document.createElement('div');
|
||||||
|
card.className = 'memory-card';
|
||||||
|
card.dataset.index = index;
|
||||||
|
card.dataset.letter = item.letter;
|
||||||
|
card.textContent = '?';
|
||||||
|
card.onclick = () => flipCard(card, index);
|
||||||
|
grid.appendChild(card);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function flipCard(card, index) {
|
||||||
|
// Ignore if already flipped or matched
|
||||||
|
if (card.classList.contains('flipped') || card.classList.contains('matched')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flip the card
|
||||||
|
card.classList.add('flipped');
|
||||||
|
card.textContent = memoryCards[index].letter;
|
||||||
|
flippedCards.push({ card, index, letter: memoryCards[index].letter });
|
||||||
|
|
||||||
|
// Check if two cards are flipped
|
||||||
|
if (flippedCards.length === 2) {
|
||||||
|
const [first, second] = flippedCards;
|
||||||
|
|
||||||
|
if (first.letter === second.letter) {
|
||||||
|
// Match found
|
||||||
|
first.card.classList.add('matched');
|
||||||
|
second.card.classList.add('matched');
|
||||||
|
matchedPairs++;
|
||||||
|
|
||||||
|
// Check if game is complete
|
||||||
|
if (matchedPairs === memoryCards.length / 2) {
|
||||||
|
setTimeout(() => {
|
||||||
|
alert('Поздравляем! Ты нашёл все пары!');
|
||||||
|
initMemoryGame();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No match - flip back
|
||||||
|
setTimeout(() => {
|
||||||
|
first.card.classList.remove('flipped');
|
||||||
|
first.card.textContent = '?';
|
||||||
|
second.card.classList.remove('flipped');
|
||||||
|
second.card.textContent = '?';
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
flippedCards = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clay Exercise
|
||||||
|
function initClayExercise() {
|
||||||
|
nextClayLetter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextClayLetter() {
|
||||||
|
const randomIndex = Math.floor(Math.random() * letters.length);
|
||||||
|
document.getElementById('clay-reference').textContent = letters[randomIndex].letter;
|
||||||
|
document.getElementById('clay-shape').textContent = '?';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Feedback helper
|
||||||
|
function showFeedback(elementId, message, type) {
|
||||||
|
const feedback = document.getElementById(elementId);
|
||||||
|
feedback.textContent = message;
|
||||||
|
feedback.className = `feedback ${type}`;
|
||||||
|
feedback.style.display = 'block';
|
||||||
|
|
||||||
|
// Auto-hide after 3 seconds
|
||||||
|
setTimeout(() => {
|
||||||
|
feedback.style.display = 'none';
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user