Autosave: 20260305-185725
@ -1,403 +1,189 @@
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f8fafc;
|
||||
--surface: #ffffff;
|
||||
--border: #e2e8f0;
|
||||
--text: #0f172a;
|
||||
--muted: #64748b;
|
||||
--accent: #1f2937;
|
||||
--accent-soft: #e5e7eb;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
|
||||
background-size: 400% 400%;
|
||||
animation: gradient 15s ease infinite;
|
||||
color: #212529;
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.main-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
.hero-card,
|
||||
.quiz-card,
|
||||
.info-card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 2rem;
|
||||
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 85vh;
|
||||
box-shadow: 0 20px 40px rgba(0,0,0,0.2);
|
||||
backdrop-filter: blur(15px);
|
||||
-webkit-backdrop-filter: blur(15px);
|
||||
overflow: hidden;
|
||||
.stat-stack {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #f9fafb;
|
||||
}
|
||||
|
||||
.chat-header {
|
||||
.score-badge {
|
||||
background: #f9fafb;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 0.75rem 1rem;
|
||||
min-width: 140px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.question-area {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.option-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
border: 1px solid var(--border);
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 0.85rem 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: 0.2s ease;
|
||||
}
|
||||
|
||||
.option-item:hover {
|
||||
border-color: #94a3b8;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.option-item-selected {
|
||||
border-color: #2563eb;
|
||||
background: #eff6ff;
|
||||
}
|
||||
|
||||
.option-item-correct {
|
||||
border-color: #16a34a;
|
||||
background: #f0fdf4;
|
||||
}
|
||||
|
||||
.option-item-wrong {
|
||||
border-color: #dc2626;
|
||||
background: #fef2f2;
|
||||
}
|
||||
|
||||
.option-index {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 8px;
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.answer-pill {
|
||||
background: #111827;
|
||||
color: #fff;
|
||||
border-radius: 999px;
|
||||
padding: 0.25rem 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
.answer-figure {
|
||||
width: 100%;
|
||||
max-width: 360px;
|
||||
}
|
||||
|
||||
.answer-image,
|
||||
.summary-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--border);
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.summary-image {
|
||||
margin-bottom: 0.75rem;
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
.summary-list {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 1rem;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.summary-item p {
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #111827;
|
||||
border-color: #111827;
|
||||
}
|
||||
|
||||
.btn-primary:hover,
|
||||
.btn-primary:focus {
|
||||
background: #0f172a;
|
||||
border-color: #0f172a;
|
||||
}
|
||||
|
||||
.btn-dark {
|
||||
background: #1f2937;
|
||||
border-color: #1f2937;
|
||||
}
|
||||
|
||||
.btn-dark:hover,
|
||||
.btn-dark:focus {
|
||||
background: #111827;
|
||||
border-color: #111827;
|
||||
}
|
||||
|
||||
code {
|
||||
background: #f1f5f9;
|
||||
padding: 0.1rem 0.35rem;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.hero-card,
|
||||
.quiz-card,
|
||||
.info-card {
|
||||
padding: 1.5rem;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-messages {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.message {
|
||||
max-width: 85%;
|
||||
padding: 0.85rem 1.1rem;
|
||||
border-radius: 16px;
|
||||
line-height: 1.5;
|
||||
font-size: 0.95rem;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
||||
animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(20px) scale(0.95); }
|
||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||
}
|
||||
|
||||
.message.visitor {
|
||||
align-self: flex-end;
|
||||
background: linear-gradient(135deg, #212529 0%, #343a40 100%);
|
||||
color: #fff;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.message.bot {
|
||||
align-self: flex-start;
|
||||
background: #ffffff;
|
||||
color: #212529;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.chat-input-area {
|
||||
padding: 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.chat-input-area form {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.chat-input-area input {
|
||||
flex: 1;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 12px;
|
||||
padding: 0.75rem 1rem;
|
||||
outline: none;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.chat-input-area input:focus {
|
||||
border-color: #23a6d5;
|
||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
|
||||
}
|
||||
|
||||
.chat-input-area button {
|
||||
background: #212529;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.chat-input-area button:hover {
|
||||
background: #000;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
/* Background Animations */
|
||||
.bg-animations {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.blob {
|
||||
position: absolute;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
filter: blur(80px);
|
||||
animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
|
||||
}
|
||||
|
||||
.blob-1 {
|
||||
top: -10%;
|
||||
left: -10%;
|
||||
background: rgba(238, 119, 82, 0.4);
|
||||
}
|
||||
|
||||
.blob-2 {
|
||||
bottom: -10%;
|
||||
right: -10%;
|
||||
background: rgba(35, 166, 213, 0.4);
|
||||
animation-delay: -7s;
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
.blob-3 {
|
||||
top: 40%;
|
||||
left: 30%;
|
||||
background: rgba(231, 60, 126, 0.3);
|
||||
animation-delay: -14s;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
@keyframes move {
|
||||
0% { transform: translate(0, 0) rotate(0deg) scale(1); }
|
||||
33% { transform: translate(150px, 100px) rotate(120deg) scale(1.1); }
|
||||
66% { transform: translate(-50px, 200px) rotate(240deg) scale(0.9); }
|
||||
100% { transform: translate(0, 0) rotate(360deg) scale(1); }
|
||||
}
|
||||
|
||||
.header-link {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.header-link:hover {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Admin Styles */
|
||||
.admin-container {
|
||||
max-width: 900px;
|
||||
margin: 3rem auto;
|
||||
padding: 2.5rem;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 20px 50px rgba(0,0,0,0.15);
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.admin-container h1 {
|
||||
margin-top: 0;
|
||||
color: #212529;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0 8px;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.table th {
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 1rem;
|
||||
color: #6c757d;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.75rem;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.table td {
|
||||
background: #fff;
|
||||
padding: 1rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table tr td:first-child { border-radius: 12px 0 0 12px; }
|
||||
.table tr td:last-child { border-radius: 0 12px 12px 0; }
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 12px;
|
||||
background: #fff;
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
outline: none;
|
||||
border-color: #23a6d5;
|
||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.1);
|
||||
}
|
||||
|
||||
.header-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header-links {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.admin-card {
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
padding: 2rem;
|
||||
border-radius: 20px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
margin-bottom: 2.5rem;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.admin-card h3 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.5rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-add {
|
||||
background: #212529;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.btn-save {
|
||||
background: #0088cc;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.8rem 1.5rem;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
width: 100%;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.webhook-url {
|
||||
font-size: 0.85em;
|
||||
color: #555;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.history-table-container {
|
||||
overflow-x: auto;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
padding: 1rem;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.history-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.history-table-time {
|
||||
width: 15%;
|
||||
white-space: nowrap;
|
||||
font-size: 0.85em;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.history-table-user {
|
||||
width: 35%;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.history-table-ai {
|
||||
width: 50%;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.no-messages {
|
||||
text-align: center;
|
||||
color: #777;
|
||||
}
|
||||
BIN
assets/images/quiz/q01-minsk.jpg
Normal file
|
After Width: | Height: | Size: 112 KiB |
BIN
assets/images/quiz/q02-flag.jpg
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
assets/images/quiz/q03-lake.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
assets/images/quiz/q04-bison.jpg
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
assets/images/quiz/q05-forest.jpg
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
assets/images/quiz/q06-vitebsk.jpg
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
assets/images/quiz/q07-cimbaly.jpg
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
assets/images/quiz/q08-castle.jpg
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
assets/images/quiz/q09-river.jpg
Normal file
|
After Width: | Height: | Size: 199 KiB |
BIN
assets/images/quiz/q10-ornament.jpg
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
assets/images/quiz/q11-polotsk.jpg
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
assets/images/quiz/q12-kozinaki.jpg
Normal file
|
After Width: | Height: | Size: 90 KiB |
@ -1,39 +1,254 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const chatForm = document.getElementById('chat-form');
|
||||
const chatInput = document.getElementById('chat-input');
|
||||
const chatMessages = document.getElementById('chat-messages');
|
||||
const quizData = [
|
||||
{
|
||||
question: "Столица Беларуси — это…",
|
||||
options: ["Гродно", "Минск", "Витебск", "Гомель"],
|
||||
answer: 1,
|
||||
fact: "Минск — самый большой город страны и её главный культурный центр.",
|
||||
imagePath: "assets/images/quiz/q01-minsk.jpg",
|
||||
imageAlt: "Панорама Минска"
|
||||
},
|
||||
{
|
||||
question: "Какие цвета есть на флаге Беларуси?",
|
||||
options: ["Синий и жёлтый", "Белый и красный", "Красный и зелёный", "Белый и зелёный"],
|
||||
answer: 2,
|
||||
fact: "Красный и зелёный — основные цвета флага, а сбоку есть орнамент.",
|
||||
imagePath: "assets/images/quiz/q02-flag.jpg",
|
||||
imageAlt: "Флаг Беларуси"
|
||||
},
|
||||
{
|
||||
question: "Самое большое озеро Беларуси называется…",
|
||||
options: ["Нарочь", "Свитязь", "Дривяты", "Кромань"],
|
||||
answer: 0,
|
||||
fact: "Озеро Нарочь — любимое место отдыха и часть Нарачанского парка.",
|
||||
imagePath: "assets/images/quiz/q03-lake.jpg",
|
||||
imageAlt: "Озеро в Беларуси"
|
||||
},
|
||||
{
|
||||
question: "Национальный символ животного Беларуси — это…",
|
||||
options: ["Зубр", "Лось", "Медведь", "Лиса"],
|
||||
answer: 0,
|
||||
fact: "Зубр — редкое и сильное животное, живёт в Беловежской пуще.",
|
||||
imagePath: "assets/images/quiz/q04-bison.jpg",
|
||||
imageAlt: "Зубр"
|
||||
},
|
||||
{
|
||||
question: "Как называется главный заповедник Беларуси?",
|
||||
options: ["Беловежская пуща", "Березинский парк", "Браславские озёра", "Припятский парк"],
|
||||
answer: 0,
|
||||
fact: "Беловежская пуща — старинный лес, который охраняется ЮНЕСКО.",
|
||||
imagePath: "assets/images/quiz/q05-forest.jpg",
|
||||
imageAlt: "Лес Беловежской пущи"
|
||||
},
|
||||
{
|
||||
question: "Какой город называют «северной столицей» Беларуси?",
|
||||
options: ["Витебск", "Гомель", "Брест", "Полоцк"],
|
||||
answer: 0,
|
||||
fact: "Витебск — родина художника Марка Шагала.",
|
||||
imagePath: "assets/images/quiz/q06-vitebsk.jpg",
|
||||
imageAlt: "Город Витебск"
|
||||
},
|
||||
{
|
||||
question: "Белорусский народный инструмент с кнопками — это…",
|
||||
options: ["Цимбалы", "Скрипка", "Дудка", "Сопилка"],
|
||||
answer: 0,
|
||||
fact: "Цимбалы — струнный инструмент, по ним ударяют молоточками.",
|
||||
imagePath: "assets/images/quiz/q07-cimbaly.jpg",
|
||||
imageAlt: "Традиционный музыкальный инструмент"
|
||||
},
|
||||
{
|
||||
question: "Какой замок стоит в городе Мир?",
|
||||
options: ["Мирский замок", "Несвижский замок", "Лидский замок", "Гродненский замок"],
|
||||
answer: 0,
|
||||
fact: "Мирский замок — объект Всемирного наследия ЮНЕСКО.",
|
||||
imagePath: "assets/images/quiz/q08-castle.jpg",
|
||||
imageAlt: "Мирский замок"
|
||||
},
|
||||
{
|
||||
question: "Главная река Беларуси — это…",
|
||||
options: ["Западная Двина", "Днепр", "Нёман", "Припять"],
|
||||
answer: 1,
|
||||
fact: "Днепр проходит через южные регионы страны и впадает в Чёрное море.",
|
||||
imagePath: "assets/images/quiz/q09-river.jpg",
|
||||
imageAlt: "Река Днепр"
|
||||
},
|
||||
{
|
||||
question: "Как называется традиционный белорусский узор на ткани?",
|
||||
options: ["Орнамент", "Гжель", "Петриковская роспись", "Хохлома"],
|
||||
answer: 0,
|
||||
fact: "Белорусский орнамент часто украшает флаг и народные костюмы.",
|
||||
imagePath: "assets/images/quiz/q10-ornament.jpg",
|
||||
imageAlt: "Белорусский орнамент"
|
||||
},
|
||||
{
|
||||
question: "Самый древний город Беларуси — это…",
|
||||
options: ["Полоцк", "Минск", "Брест", "Могилёв"],
|
||||
answer: 0,
|
||||
fact: "Полоцк впервые упоминается в летописях в 862 году.",
|
||||
imagePath: "assets/images/quiz/q11-polotsk.jpg",
|
||||
imageAlt: "Город Полоцк"
|
||||
},
|
||||
{
|
||||
question: "Как называется сладость из мёда и орехов, популярная в Беларуси?",
|
||||
options: ["Пастила", "Печенье", "Козинаки", "Зефир"],
|
||||
answer: 2,
|
||||
fact: "Козинаки часто готовят из мёда и орехов.",
|
||||
imagePath: "assets/images/quiz/q12-kozinaki.jpg",
|
||||
imageAlt: "Козинаки"
|
||||
}
|
||||
];
|
||||
|
||||
const appendMessage = (text, sender) => {
|
||||
const msgDiv = document.createElement('div');
|
||||
msgDiv.classList.add('message', sender);
|
||||
msgDiv.textContent = text;
|
||||
chatMessages.appendChild(msgDiv);
|
||||
chatMessages.scrollTop = chatMessages.scrollHeight;
|
||||
};
|
||||
const startBtn = document.getElementById("startQuizBtn");
|
||||
const quizSection = document.getElementById("quiz");
|
||||
const summarySection = document.getElementById("summary");
|
||||
const progressEl = document.getElementById("questionProgress");
|
||||
const questionText = document.getElementById("questionText");
|
||||
const optionList = document.getElementById("optionList");
|
||||
const totalQuestions = document.getElementById("totalQuestions");
|
||||
const classScore = document.getElementById("classScore");
|
||||
const revealBtn = document.getElementById("revealBtn");
|
||||
const nextBtn = document.getElementById("nextBtn");
|
||||
const answerArea = document.getElementById("answerArea");
|
||||
const answerImage = document.getElementById("answerImage");
|
||||
const correctAnswer = document.getElementById("correctAnswer");
|
||||
const factText = document.getElementById("factText");
|
||||
const answerResult = document.getElementById("answerResult");
|
||||
const finalScore = document.getElementById("finalScore");
|
||||
const summaryList = document.getElementById("summaryList");
|
||||
const restartBtn = document.getElementById("restartBtn");
|
||||
|
||||
chatForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const message = chatInput.value.trim();
|
||||
if (!message) return;
|
||||
const state = {
|
||||
index: 0,
|
||||
score: 0,
|
||||
revealed: false,
|
||||
selectedOption: null
|
||||
};
|
||||
|
||||
appendMessage(message, 'visitor');
|
||||
chatInput.value = '';
|
||||
totalQuestions.textContent = quizData.length.toString();
|
||||
|
||||
try {
|
||||
const response = await fetch('api/chat.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ message })
|
||||
});
|
||||
const data = await response.json();
|
||||
|
||||
// Artificial delay for realism
|
||||
setTimeout(() => {
|
||||
appendMessage(data.reply, 'bot');
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
appendMessage("Sorry, something went wrong. Please try again.", 'bot');
|
||||
}
|
||||
});
|
||||
function renderQuestion() {
|
||||
const current = quizData[state.index];
|
||||
progressEl.textContent = `Вопрос ${state.index + 1} из ${quizData.length}`;
|
||||
questionText.textContent = current.question;
|
||||
optionList.innerHTML = "";
|
||||
|
||||
current.options.forEach((option, idx) => {
|
||||
const li = document.createElement("li");
|
||||
li.className = "option-item";
|
||||
li.setAttribute("role", "button");
|
||||
li.setAttribute("tabindex", "0");
|
||||
li.dataset.index = String(idx);
|
||||
|
||||
if (idx === state.selectedOption) {
|
||||
li.classList.add("option-item-selected");
|
||||
}
|
||||
|
||||
if (state.revealed) {
|
||||
if (idx === current.answer) {
|
||||
li.classList.add("option-item-correct");
|
||||
} else if (idx === state.selectedOption) {
|
||||
li.classList.add("option-item-wrong");
|
||||
}
|
||||
}
|
||||
|
||||
li.innerHTML = `<span class="option-index">${String.fromCharCode(65 + idx)}</span><span>${option}</span>`;
|
||||
optionList.appendChild(li);
|
||||
});
|
||||
|
||||
classScore.textContent = state.score.toString();
|
||||
answerArea.classList.toggle("d-none", !state.revealed);
|
||||
revealBtn.classList.toggle("d-none", state.revealed);
|
||||
nextBtn.classList.toggle("d-none", !state.revealed);
|
||||
revealBtn.disabled = state.selectedOption === null;
|
||||
|
||||
if (state.revealed) {
|
||||
answerImage.src = current.imagePath;
|
||||
answerImage.alt = current.imageAlt;
|
||||
correctAnswer.textContent = current.options[current.answer];
|
||||
factText.textContent = current.fact;
|
||||
answerResult.textContent = state.selectedOption === current.answer
|
||||
? "Верно! +1 балл."
|
||||
: "Немного не так. В следующий раз получится!";
|
||||
answerResult.className = `mt-3 mb-0 fw-semibold ${state.selectedOption === current.answer ? "text-success" : "text-danger"}`;
|
||||
}
|
||||
}
|
||||
|
||||
function showSummary() {
|
||||
quizSection.classList.add("d-none");
|
||||
summarySection.classList.remove("d-none");
|
||||
finalScore.textContent = `${state.score} из ${quizData.length}`;
|
||||
summaryList.innerHTML = "";
|
||||
|
||||
quizData.forEach((item, idx) => {
|
||||
const div = document.createElement("div");
|
||||
div.className = "summary-item";
|
||||
div.innerHTML = `
|
||||
<img src="${item.imagePath}" alt="${item.imageAlt}" class="summary-image" loading="lazy" width="420" height="220">
|
||||
<p class="fw-semibold mb-1">Вопрос ${idx + 1}: ${item.question}</p>
|
||||
<p class="text-muted mb-1">Правильный ответ: ${item.options[item.answer]}</p>
|
||||
<p class="text-muted mb-0">${item.fact}</p>
|
||||
`;
|
||||
summaryList.appendChild(div);
|
||||
});
|
||||
}
|
||||
|
||||
startBtn.addEventListener("click", () => {
|
||||
quizSection.classList.remove("d-none");
|
||||
summarySection.classList.add("d-none");
|
||||
state.index = 0;
|
||||
state.score = 0;
|
||||
state.revealed = false;
|
||||
state.selectedOption = null;
|
||||
renderQuestion();
|
||||
quizSection.scrollIntoView({ behavior: "smooth" });
|
||||
});
|
||||
|
||||
revealBtn.addEventListener("click", () => {
|
||||
if (state.selectedOption === null) return;
|
||||
const current = quizData[state.index];
|
||||
if (state.selectedOption === current.answer) {
|
||||
state.score += 1;
|
||||
}
|
||||
state.revealed = true;
|
||||
renderQuestion();
|
||||
});
|
||||
|
||||
nextBtn.addEventListener("click", () => {
|
||||
if (state.index < quizData.length - 1) {
|
||||
state.index += 1;
|
||||
state.revealed = false;
|
||||
state.selectedOption = null;
|
||||
renderQuestion();
|
||||
} else {
|
||||
showSummary();
|
||||
summarySection.scrollIntoView({ behavior: "smooth" });
|
||||
}
|
||||
});
|
||||
|
||||
restartBtn.addEventListener("click", () => {
|
||||
state.index = 0;
|
||||
state.score = 0;
|
||||
state.revealed = false;
|
||||
state.selectedOption = null;
|
||||
summarySection.classList.add("d-none");
|
||||
quizSection.classList.remove("d-none");
|
||||
renderQuestion();
|
||||
quizSection.scrollIntoView({ behavior: "smooth" });
|
||||
});
|
||||
|
||||
optionList.addEventListener("click", (event) => {
|
||||
if (state.revealed) return;
|
||||
const option = event.target.closest(".option-item");
|
||||
if (!option) return;
|
||||
state.selectedOption = Number(option.dataset.index);
|
||||
renderQuestion();
|
||||
});
|
||||
|
||||
optionList.addEventListener("keydown", (event) => {
|
||||
if (state.revealed) return;
|
||||
if (event.key !== "Enter" && event.key !== " ") return;
|
||||
const option = event.target.closest(".option-item");
|
||||
if (!option) return;
|
||||
event.preventDefault();
|
||||
state.selectedOption = Number(option.dataset.index);
|
||||
renderQuestion();
|
||||
});
|
||||
|
||||
264
index.php
@ -4,147 +4,165 @@ declare(strict_types=1);
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Викторина «Что я знаю о Беларуси»</title>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="assets/css/custom.css?v=<?= time(); ?>" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
<header class="border-bottom bg-white sticky-top">
|
||||
<nav class="navbar navbar-expand-lg navbar-light container py-3">
|
||||
<a class="navbar-brand fw-semibold" href="/">Викторина «Беларусь»</a>
|
||||
<div class="ms-auto d-flex gap-3 small text-muted">
|
||||
<span class="d-none d-md-inline">Режим: ведущий</span>
|
||||
<span>Обновлено: <?= htmlspecialchars($now) ?> (UTC)</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="container my-4 my-lg-5">
|
||||
<section class="hero-card mb-4 mb-lg-5">
|
||||
<div class="row g-4 align-items-center">
|
||||
<div class="col-lg-7">
|
||||
<p class="text-uppercase small text-muted mb-2">Интерактив для 5‑го класса</p>
|
||||
<h1 class="display-6 fw-bold mb-3">Что я знаю о Беларуси</h1>
|
||||
<p class="text-muted mb-4">
|
||||
Быстрый сценарий для учителя: вопросы на экране, варианты ответов,
|
||||
затем правильный ответ и короткий факт. Никаких аккаунтов и подготовки.
|
||||
</p>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<button id="startQuizBtn" class="btn btn-primary btn-lg">Начать викторину</button>
|
||||
<a href="#guide" class="btn btn-outline-secondary btn-lg">Как проводить</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<div class="stat-stack p-4">
|
||||
<div class="d-flex justify-content-between align-items-center border-bottom pb-3 mb-3">
|
||||
<span class="text-muted">Вопросов</span>
|
||||
<span class="fw-semibold" id="totalQuestions">12</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center border-bottom pb-3 mb-3">
|
||||
<span class="text-muted">Темы</span>
|
||||
<span class="fw-semibold">символы • география • культура</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted">Длительность</span>
|
||||
<span class="fw-semibold">15–25 минут</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="quiz" class="quiz-card mb-4 mb-lg-5 d-none">
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3 mb-3">
|
||||
<div>
|
||||
<p class="text-muted small mb-1">Прогресс</p>
|
||||
<h2 class="h5 mb-0" id="questionProgress">Вопрос 1 из 12</h2>
|
||||
</div>
|
||||
<div class="score-badge">
|
||||
<span class="text-muted small">Счёт класса</span>
|
||||
<span class="fs-4 fw-semibold" id="classScore">0</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="question-area">
|
||||
<div class="question-label text-uppercase small text-muted mb-2">Вопрос</div>
|
||||
<h3 class="h4 mb-3" id="questionText">Готовы?</h3>
|
||||
<ul class="list-unstyled option-list" id="optionList"></ul>
|
||||
</div>
|
||||
|
||||
<div class="answer-area mt-4 d-none" id="answerArea">
|
||||
<div class="alert alert-light border" role="status">
|
||||
<div class="d-flex flex-column flex-lg-row gap-3 align-items-start">
|
||||
<figure class="answer-figure mb-0">
|
||||
<img id="answerImage" src="" alt="" class="answer-image" loading="lazy" width="560" height="320">
|
||||
</figure>
|
||||
<div class="w-100">
|
||||
<div class="answer-pill mb-2">Правильный ответ</div>
|
||||
<p class="mb-1 fw-semibold" id="correctAnswer"></p>
|
||||
<p class="mb-0 text-muted" id="factText"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-3 mb-0 fw-semibold" id="answerResult"></p>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-wrap gap-2 mt-4">
|
||||
<button class="btn btn-dark" id="revealBtn">Показать ответ</button>
|
||||
<button class="btn btn-outline-dark d-none" id="nextBtn">Следующий вопрос</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="summary" class="quiz-card d-none">
|
||||
<div class="d-flex flex-column flex-lg-row justify-content-between align-items-start gap-3 mb-3">
|
||||
<div>
|
||||
<p class="text-muted small mb-1">Итоги викторины</p>
|
||||
<h2 class="h4 mb-0">Класс набрал <span id="finalScore">0</span> баллов</h2>
|
||||
</div>
|
||||
<button class="btn btn-outline-primary" id="restartBtn">Пройти ещё раз</button>
|
||||
</div>
|
||||
<div class="alert alert-light border" role="status">
|
||||
<p class="mb-2 fw-semibold">Правильные ответы и факты</p>
|
||||
<div id="summaryList" class="summary-list"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="guide" class="mb-5">
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<article class="info-card">
|
||||
<h2 class="h5 fw-semibold mb-3">Сценарий для учителя</h2>
|
||||
<ol class="text-muted">
|
||||
<li>Нажмите «Начать викторину» и выводите вопросы на экран.</li>
|
||||
<li>Дайте детям 20–30 секунд на обсуждение.</li>
|
||||
<li>Выберите вариант ответа, затем нажмите «Показать ответ».</li>
|
||||
<li>В конце покажите итоги и обсудите факты.</li>
|
||||
</ol>
|
||||
</article>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<article class="info-card">
|
||||
<h2 class="h5 fw-semibold mb-3">Подсказки</h2>
|
||||
<ul class="text-muted mb-0">
|
||||
<li>Можно вести счёт по рядам или командам, используя «Счёт класса».</li>
|
||||
<li>Если нужно, остановите викторину и обсудите факт дня.</li>
|
||||
<li>Вопросы можно заменить прямо в <code>assets/js/main.js</code>.</li>
|
||||
</ul>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
|
||||
<footer class="border-top bg-white">
|
||||
<div class="container py-4 small text-muted d-flex flex-wrap justify-content-between gap-2">
|
||||
<span>Викторина для показа на экране.</span>
|
||||
<span>Сделано для урока в 5‑м классе.</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" defer></script>
|
||||
<script src="assets/js/main.js?v=<?= time(); ?>" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||