Compare commits

...

7 Commits

Author SHA1 Message Date
Flatlogic Bot
aae6b26656 Autosave: 20260305-195720 2026-03-05 19:57:20 +00:00
Flatlogic Bot
4227c05243 Autosave: 20260305-193319 2026-03-05 19:33:19 +00:00
Flatlogic Bot
8b1bd058d8 3 2026-03-05 19:31:21 +00:00
Flatlogic Bot
797ea360c3 2 2026-03-05 19:15:42 +00:00
Flatlogic Bot
0db6750fb8 Autosave: 20260305-191457 2026-03-05 19:14:57 +00:00
Flatlogic Bot
4e06b037ca 1 2026-03-05 19:01:52 +00:00
Flatlogic Bot
84b78e4872 Autosave: 20260305-185725 2026-03-05 18:57:25 +00:00
30 changed files with 946 additions and 509 deletions

View File

@ -1,403 +1,408 @@
:root {
color-scheme: light;
--bg: #fff8f2;
--surface: #fffdf9;
--border: #eadfce;
--text: #2e2118;
--muted: #7a6151;
--accent: #a54f2a;
--accent-soft: #f6e7d8;
}
* {
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: radial-gradient(circle at top right, #ffe8d3 0, var(--bg) 45%);
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(102, 58, 28, 0.08);
}
.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: #fff4e8;
}
.chat-header {
.score-badge {
background: #fff4e8;
border: 1px solid var(--border);
border-radius: 10px;
padding: 0.75rem 1rem;
min-width: 140px;
text-align: center;
}
.quiz-progress-wrap {
border: 1px solid var(--border);
border-radius: 12px;
background: #fff7ef;
padding: 0.8rem 0.95rem;
}
.quiz-progress-bar {
width: 100%;
height: 13px;
border-radius: 999px;
background: #f3dfcc;
overflow: hidden;
}
.quiz-progress-fill {
height: 100%;
width: 0;
border-radius: inherit;
background: linear-gradient(90deg, #f59e0b, #22c55e);
transition: width 0.35s ease;
}
.question-area {
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.5rem;
background: #fff8f0;
}
.option-list {
margin: 0;
padding: 0;
display: grid;
gap: 0.75rem;
}
#quiz #questionText {
font-size: clamp(1.5rem, 2.3vw, 2.25rem);
line-height: 1.25;
font-weight: 700;
}
.option-item {
border: 1px solid var(--border);
background: #fffdfa;
border-radius: 10px;
padding: 1rem 1.15rem;
display: flex;
align-items: center;
gap: 0.75rem;
font-weight: 600;
font-size: 1.12rem;
min-height: 74px;
cursor: pointer;
transition: 0.2s ease;
}
.option-item:hover {
border-color: #d39a72;
transform: translateY(-1px);
}
.option-item-selected {
border-color: #c06a3a;
background: #fff1e7;
}
.option-item-correct {
border-color: #16a34a;
background: #f0fdf4;
}
.option-item-correct-pop {
animation: correctPop 0.9s cubic-bezier(0.2, 0.9, 0.28, 1.2);
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
}
.option-item-wrong {
border-color: #dc2626;
background: #fef2f2;
}
.option-index {
width: 42px;
height: 42px;
border-radius: 10px;
background: var(--accent-soft);
color: var(--accent);
display: grid;
place-items: center;
font-weight: 700;
flex: 0 0 42px;
}
.answer-pill {
background: #7a3f1f;
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-trigger {
border: none;
background: transparent;
padding: 0;
width: 100%;
text-align: left;
cursor: zoom-in;
}
.answer-image,
.summary-image {
width: 100%;
height: auto;
border-radius: 10px;
border: 1px solid var(--border);
object-fit: cover;
}
.zoom-hint {
display: inline-block;
margin-top: 0.5rem;
font-size: 0.85rem;
color: var(--muted);
}
.fact-list {
margin: 0;
padding-left: 1.1rem;
color: var(--muted);
}
.fact-list li + li {
margin-top: 0.3rem;
}
.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: #fffdfa;
}
.summary-item p {
margin-bottom: 0.35rem;
}
.btn-primary {
background: #a54f2a;
border-color: #a54f2a;
}
.btn-primary:hover,
.btn-primary:focus {
background: #8f4321;
border-color: #8f4321;
}
.btn-dark {
background: #7a3f1f;
border-color: #7a3f1f;
}
.btn-dark:hover,
.btn-dark:focus {
background: #663419;
border-color: #663419;
}
code {
background: #fbe9da;
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;
body.quiz-live .tv-extra {
display: none !important;
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 6px;
body.quiz-live main.container {
max-width: 100%;
margin-top: 0 !important;
margin-bottom: 0 !important;
padding-top: 1rem;
padding-bottom: 1rem;
}
::-webkit-scrollbar-track {
background: transparent;
body.quiz-live #quiz {
border: none;
box-shadow: none;
background: transparent;
padding: 0;
}
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 10px;
body.quiz-live #quiz .quiz-meta,
body.quiz-live #quiz #revealBtn {
display: none !important;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
body.quiz-live #quiz .quiz-progress-wrap {
margin-bottom: 1rem !important;
padding: 0.95rem 1.1rem;
}
.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);
body.quiz-live #quiz .quiz-progress-bar {
height: 18px;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px) scale(0.95); }
to { opacity: 1; transform: translateY(0) scale(1); }
body.quiz-live #quiz .quiz-actions {
display: flex;
justify-content: center;
}
.message.visitor {
align-self: flex-end;
background: linear-gradient(135deg, #212529 0%, #343a40 100%);
color: #fff;
border-bottom-right-radius: 4px;
body.quiz-live #quiz .question-area {
min-height: 52vh;
padding: 2rem;
display: flex;
flex-direction: column;
justify-content: center;
}
.message.bot {
align-self: flex-start;
background: #ffffff;
color: #212529;
border-bottom-left-radius: 4px;
body.quiz-live #quiz #questionText {
font-size: clamp(2rem, 3.8vw, 3.1rem);
margin-bottom: 1.25rem !important;
}
.chat-input-area {
padding: 1.25rem;
background: rgba(255, 255, 255, 0.5);
border-top: 1px solid rgba(0, 0, 0, 0.05);
body.quiz-live #quiz .option-list {
gap: 1rem;
}
.chat-input-area form {
display: flex;
gap: 0.75rem;
body.quiz-live #quiz .option-item {
font-size: clamp(1.3rem, 2.2vw, 1.9rem);
padding: 1.2rem 1.4rem;
min-height: 92px;
border-radius: 14px;
}
.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;
body.quiz-live #quiz .option-index {
width: 56px;
height: 56px;
flex-basis: 56px;
border-radius: 12px;
font-size: 1.25rem;
}
.chat-input-area input:focus {
border-color: #23a6d5;
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
body.quiz-live #quiz #answerArea {
margin-top: 1rem !important;
}
.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;
body.lightbox-open {
overflow: hidden;
}
.chat-input-area button:hover {
background: #000;
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
.image-lightbox {
position: fixed;
inset: 0;
background: rgba(41, 22, 11, 0.92);
z-index: 1060;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
}
/* Background Animations */
.bg-animations {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
overflow: hidden;
pointer-events: none;
.image-lightbox-img {
max-width: min(96vw, 1700px);
max-height: 90vh;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.18);
box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
object-fit: contain;
}
.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);
.image-lightbox-close {
position: absolute;
top: 0.8rem;
right: 1rem;
border: none;
background: rgba(255, 255, 255, 0.14);
color: #fff;
font-size: 2rem;
line-height: 1;
width: 2.4rem;
height: 2.4rem;
border-radius: 999px;
}
.blob-1 {
top: -10%;
left: -10%;
background: rgba(238, 119, 82, 0.4);
.correct-spark {
position: fixed;
width: var(--size, 14px);
height: var(--size, 14px);
border-radius: 5px;
pointer-events: none;
z-index: 1100;
box-shadow: 0 0 14px rgba(255, 180, 75, 0.75);
transform: translate(-50%, -50%) scale(0.55);
animation: sparkBurst 1.15s ease-out forwards;
}
.blob-2 {
bottom: -10%;
right: -10%;
background: rgba(35, 166, 213, 0.4);
animation-delay: -7s;
width: 600px;
height: 600px;
@keyframes correctPop {
0% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.42);
}
35% {
transform: scale(1.1);
box-shadow: 0 0 0 28px rgba(34, 197, 94, 0);
}
65% {
transform: scale(1.04);
}
100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
}
}
.blob-3 {
top: 40%;
left: 30%;
background: rgba(231, 60, 126, 0.3);
animation-delay: -14s;
width: 450px;
height: 450px;
@keyframes sparkBurst {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.45) rotate(0deg);
}
18% {
opacity: 1;
}
100% {
opacity: 0;
transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.25) rotate(var(--rot));
}
}
@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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -1,39 +1,435 @@
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: "Минск — самый большой город страны и её главный культурный центр.",
facts: [
"Минск впервые упоминается в летописях в 1067 году.",
"В городе находится Национальная библиотека с необычной формой ромбокубооктаэдра.",
"В Минске более 2 миллионов жителей — это крупнейший город Беларуси."
],
imagePath: "assets/pasted-20260305-185724-631e7f99.webp",
imageAlt: "Панорама Минска"
},
{
question: "Какие цвета есть на флаге Беларуси?",
options: ["Синий и жёлтый", "Белый и красный", "Красный и зелёный", "Белый и зелёный"],
answer: 2,
fact: "Красный и зелёный — основные цвета флага, а сбоку есть орнамент.",
facts: [
"Красный цвет на флаге символизирует мужество и историческую память.",
"Зелёный цвет связан с природой, лесами и полями страны.",
"Белорусский орнамент на флаге основан на традиционном народном узоре."
],
imagePath: "assets/images/quiz/q02-flag.jpg",
imageAlt: "Флаг Беларуси"
},
{
question: "Самое большое озеро Беларуси называется…",
options: ["Нарочь", "Свитязь", "Дривяты", "Кромань"],
answer: 0,
fact: "Озеро Нарочь — любимое место отдыха и часть Нарачанского парка.",
facts: [
"Площадь озера Нарочь — около 80 км², это крупнейшее озеро Беларуси.",
"Озеро входит в территорию Национального парка «Нарочанский».",
"Нарочь известна чистой водой и популярна для летнего отдыха."
],
imagePath: "assets/pasted-20260305-185926-dd9a5c42.webp",
imageAlt: "Озеро в Беларуси"
},
{
question: "Национальный символ животного Беларуси — это…",
options: ["Зубр", "Лось", "Медведь", "Лиса"],
answer: 0,
fact: "Зубр — редкое и сильное животное, живёт в Беловежской пуще.",
facts: [
"Зубр — самое тяжёлое наземное животное Европы.",
"После почти полного исчезновения популяцию зубров удалось восстановить.",
"В Беловежской пуще находится одна из самых известных популяций зубра."
],
imagePath: "assets/pasted-20260305-193021-7ef32b53.jpg",
imageAlt: "Зубр"
},
{
question: "Как называется главный заповедник Беларуси?",
options: ["Беловежская пуща", "Березинский парк", "Браславские озёра", "Припятский парк"],
answer: 0,
fact: "Беловежская пуща — старинный лес, который охраняется ЮНЕСКО.",
facts: [
"Беловежская пуща — один из самых древних лесов Европы.",
"Часть территории заповедника внесена в список Всемирного наследия ЮНЕСКО.",
"В пуще можно увидеть зубров, оленей и редкие виды птиц."
],
imagePath: "assets/pasted-20260305-190111-63cd8baa.jpg",
imageAlt: "Лес Беловежской пущи"
},
{
question: "Какой город называют «северной столицей» Беларуси?",
options: ["Витебск", "Гомель", "Брест", "Полоцк"],
answer: 0,
fact: "Витебск — родина художника Марка Шагала.",
facts: [
"В Витебске ежегодно проходит международный фестиваль «Славянский базар».",
"Город связан с именем художника Марка Шагала.",
"Витебск стоит на реке Западная Двина и имеет богатую историю."
],
imagePath: "assets/images/quiz/q06-vitebsk.jpg",
imageAlt: "Город Витебск"
},
{
question: "Как называется белорусский струнный ударный музыкальный инструмент?",
options: ["Цимбалы", "Скрипка", "Дудка", "Сопилка"],
answer: 0,
fact: "Цимбалы — это инструмент со струнами, по которым играют маленькими молоточками.",
facts: [
"Цимбалы похожи на большую деревянную трапецию со струнами.",
"По струнам ударяют двумя маленькими молоточками, и получается звонкий звук.",
"Цимбалы часто звучат в белорусской народной музыке."
],
imagePath: "assets/pasted-20260305-190344-ec46e879.jpg",
imageAlt: "Традиционный музыкальный инструмент"
},
{
question: "Какой замок стоит в городе Мир?",
options: ["Мирский замок", "Несвижский замок", "Лидский замок", "Гродненский замок"],
answer: 0,
fact: "Мирский замок — объект Всемирного наследия ЮНЕСКО.",
facts: [
"Мирский замок начали строить в начале XVI века.",
"Замок сочетает элементы готики, ренессанса и барокко.",
"Комплекс Мирского замка входит в список Всемирного наследия ЮНЕСКО."
],
imagePath: "assets/pasted-20260305-193451-5d1a5abc.jpg",
imageAlt: "Мирский замок"
},
{
question: "Главная река Беларуси — это…",
options: ["Западная Двина", "Днепр", "Нёман", "Припять"],
answer: 1,
fact: "Днепр проходит через южные регионы страны и впадает в Чёрное море.",
facts: [
"Днепр — одна из крупнейших рек Европы.",
"Река протекает через Беларусь, Россию и Украину.",
"В Беларуси Днепр важен для судоходства и водоснабжения."
],
imagePath: "assets/pasted-20260305-190627-76b2a1c1.jpg",
imageAlt: "Река Днепр"
},
{
question: "Как называется традиционный белорусский узор на ткани?",
options: ["Орнамент", "Гжель", "Петриковская роспись", "Хохлома"],
answer: 0,
fact: "Белорусский орнамент часто украшает флаг и народные костюмы.",
facts: [
"Орнамент передавался из поколения в поколение в народной вышивке.",
"В узорах часто встречаются ромбы, кресты и растительные элементы.",
"Белорусский орнамент используется в национальной символике и сувенирах."
],
imagePath: "assets/pasted-20260305-190855-a269e4b8.png",
imageAlt: "Белорусский орнамент"
},
{
question: "Самый древний город Беларуси — это…",
options: ["Полоцк", "Минск", "Брест", "Могилёв"],
answer: 0,
fact: "Полоцк впервые упоминается в летописях в 862 году.",
facts: [
"Полоцк — один из старейших городов восточных славян, известен с 862 года.",
"В городе находится Софийский собор — важный исторический памятник.",
"Полоцк был крупным культурным и торговым центром в Средние века."
],
imagePath: "assets/pasted-20260305-193618-2a0dd0c5.jpg",
imageAlt: "Город Полоцк"
},
{
question: "Как называется сладость из мёда и орехов, популярная в Беларуси?",
options: ["Пастила", "Печенье", "Козинаки", "Зефир"],
answer: 2,
fact: "Козинаки часто готовят из мёда и орехов.",
facts: [
"Козинаки делают из орехов или семечек, скреплённых мёдом или сиропом.",
"Эта сладость получается хрустящей и очень питательной.",
"Козинаки часто подают к чаю как традиционное лакомство."
],
imagePath: "assets/pasted-20260305-191522-fbd0d85f.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 progressLabel = document.getElementById("progressLabel");
const progressFill = document.getElementById("progressFill");
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 answerImageTrigger = document.getElementById("answerImageTrigger");
const answerImage = document.getElementById("answerImage");
const correctAnswer = document.getElementById("correctAnswer");
const factList = document.getElementById("factList");
const answerResult = document.getElementById("answerResult");
const finalScore = document.getElementById("finalScore");
const summaryList = document.getElementById("summaryList");
const restartBtn = document.getElementById("restartBtn");
const imageLightbox = document.getElementById("imageLightbox");
const lightboxImage = document.getElementById("lightboxImage");
const closeImageLightbox = document.getElementById("closeImageLightbox");
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,
locked: false,
lastAnswerCorrect: false,
optionOrders: []
};
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 updateProgressBar() {
const completed = state.index + (state.revealed ? 1 : 0);
const percent = Math.max(0, Math.min(100, Math.round((completed / quizData.length) * 100)));
progressLabel.textContent = `${completed} из ${quizData.length}`;
progressFill.style.width = `${percent}%`;
progressFill.parentElement?.setAttribute("aria-valuenow", String(percent));
}
function shuffleArray(items) {
const arr = items.slice();
for (let i = arr.length - 1; i > 0; i -= 1) {
const j = Math.floor(Math.random() * (i + 1));
[arr[i], arr[j]] = [arr[j], arr[i]];
}
return arr;
}
function buildOptionOrders() {
return quizData.map((item) => shuffleArray(item.options.map((_, idx) => idx)));
}
function renderQuestion() {
const current = quizData[state.index];
const currentOrder = state.optionOrders[state.index] || current.options.map((_, idx) => idx);
progressEl.textContent = `Вопрос ${state.index + 1} из ${quizData.length}`;
updateProgressBar();
questionText.textContent = current.question;
optionList.innerHTML = "";
optionList.classList.toggle("d-none", state.revealed);
optionList.setAttribute("aria-hidden", state.revealed ? "true" : "false");
currentOrder.forEach((originalIdx, displayIdx) => {
const option = current.options[originalIdx];
const li = document.createElement("li");
li.className = "option-item";
li.setAttribute("role", "button");
li.setAttribute("tabindex", "0");
li.dataset.index = String(originalIdx);
if (originalIdx === state.selectedOption) {
li.classList.add("option-item-selected");
}
if (state.revealed) {
if (originalIdx === current.answer) {
li.classList.add("option-item-correct");
} else if (originalIdx === state.selectedOption) {
li.classList.add("option-item-wrong");
}
}
li.innerHTML = `<span class="option-index">${String.fromCharCode(65 + displayIdx)}</span><span>${option}</span>`;
optionList.appendChild(li);
});
classScore.textContent = state.score.toString();
answerArea.classList.add("d-none");
answerResult.classList.remove("text-success", "text-danger");
nextBtn.classList.add("d-none");
}
function renderAnswer() {
const current = quizData[state.index];
answerImage.src = current.imagePath;
answerImage.alt = current.imageAlt;
correctAnswer.textContent = current.options[current.answer];
factList.innerHTML = "";
const facts = Array.isArray(current.facts) && current.facts.length ? current.facts.slice(0, 4) : [current.fact];
facts.forEach((fact) => {
const li = document.createElement("li");
li.textContent = fact;
factList.appendChild(li);
});
const isCorrect = state.selectedOption === current.answer;
answerResult.textContent = isCorrect ? "Верно!" : "Неверно. Правильный ответ показан выше.";
answerResult.classList.toggle("text-success", isCorrect);
answerResult.classList.toggle("text-danger", !isCorrect);
answerArea.classList.remove("d-none");
}
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", () => {
document.body.classList.add("quiz-live");
quizSection.classList.remove("d-none");
summarySection.classList.add("d-none");
state.index = 0;
state.score = 0;
state.revealed = false;
state.selectedOption = null;
state.locked = false;
state.lastAnswerCorrect = false;
state.optionOrders = buildOptionOrders();
renderQuestion();
quizSection.scrollIntoView({ behavior: "smooth" });
});
function goToNextQuestion() {
if (state.index < quizData.length - 1) {
state.index += 1;
state.revealed = false;
state.selectedOption = null;
state.locked = false;
state.lastAnswerCorrect = false;
renderQuestion();
} else {
showSummary();
summarySection.scrollIntoView({ behavior: "smooth" });
}
}
restartBtn.addEventListener("click", () => {
state.index = 0;
state.score = 0;
state.revealed = false;
state.selectedOption = null;
state.locked = false;
state.lastAnswerCorrect = false;
state.optionOrders = buildOptionOrders();
summarySection.classList.add("d-none");
quizSection.classList.remove("d-none");
renderQuestion();
quizSection.scrollIntoView({ behavior: "smooth" });
});
function playCorrectClickEffect() {
const selectedEl = optionList.querySelector(`.option-item[data-index="${state.selectedOption}"]`);
if (!selectedEl) return;
selectedEl.classList.remove("option-item-correct-pop");
void selectedEl.offsetWidth;
selectedEl.classList.add("option-item-correct-pop");
const rect = selectedEl.getBoundingClientRect();
const burstCount = 28;
const colors = ["#f59e0b", "#f97316", "#fb7185", "#22c55e", "#facc15"];
for (let i = 0; i < burstCount; i += 1) {
const spark = document.createElement("span");
spark.className = "correct-spark";
spark.style.left = `${rect.left + rect.width / 2}px`;
spark.style.top = `${rect.top + rect.height / 2}px`;
spark.style.background = colors[i % colors.length];
const angle = ((Math.PI * 2) / burstCount) * i + (Math.random() * 0.3 - 0.15);
const distance = 88 + Math.random() * 148;
const size = 12 + Math.random() * 18;
spark.style.setProperty("--dx", `${Math.cos(angle) * distance}px`);
spark.style.setProperty("--dy", `${Math.sin(angle) * distance}px`);
spark.style.setProperty("--rot", `${Math.random() * 280 - 140}deg`);
spark.style.setProperty("--size", `${size}px`);
document.body.appendChild(spark);
setTimeout(() => spark.remove(), 1250);
}
}
function closeLightbox() {
imageLightbox.classList.add("d-none");
document.body.classList.remove("lightbox-open");
}
answerImageTrigger.addEventListener("click", () => {
if (!answerImage.src) return;
lightboxImage.src = answerImage.src;
lightboxImage.alt = answerImage.alt;
imageLightbox.classList.remove("d-none");
document.body.classList.add("lightbox-open");
});
closeImageLightbox.addEventListener("click", closeLightbox);
imageLightbox.addEventListener("click", (event) => {
if (event.target === imageLightbox) {
closeLightbox();
}
});
document.addEventListener("keydown", (event) => {
if (event.key === "Escape" && !imageLightbox.classList.contains("d-none")) {
closeLightbox();
}
});
function selectOption(index) {
if (state.revealed || state.locked) return;
const current = quizData[state.index];
state.selectedOption = index;
state.lastAnswerCorrect = state.selectedOption === current.answer;
if (state.lastAnswerCorrect) {
playCorrectClickEffect();
state.score += 1;
}
state.revealed = true;
state.locked = true;
renderQuestion();
renderAnswer();
nextBtn.classList.remove("d-none");
}
optionList.addEventListener("click", (event) => {
const option = event.target.closest(".option-item");
if (!option) return;
selectOption(Number(option.dataset.index));
});
optionList.addEventListener("keydown", (event) => {
if (event.key !== "Enter" && event.key !== " ") return;
const option = event.target.closest(".option-item");
if (!option) return;
event.preventDefault();
selectOption(Number(option.dataset.index));
});
nextBtn.addEventListener("click", () => {
if (!state.revealed) return;
goToNextQuestion();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

282
index.php
View File

@ -4,147 +4,183 @@ 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 tv-extra">
<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 tv-extra">
<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">1525 минут</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 quiz-meta">
<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="quiz-progress-wrap mb-3" aria-live="polite">
<div class="d-flex justify-content-between align-items-center gap-2 mb-2">
<span class="small text-muted">Пройдено</span>
<span class="small fw-semibold" id="progressLabel">0 из 12</span>
</div>
<div class="quiz-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-label="Прогресс по вопросам">
<div class="quiz-progress-fill" id="progressFill"></div>
</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">
<button type="button" class="answer-image-trigger" id="answerImageTrigger" aria-label="Открыть изображение на весь экран">
<img id="answerImage" src="" alt="" class="answer-image" loading="lazy" width="560" height="320">
<span class="zoom-hint">Нажмите на картинку, чтобы открыть на весь экран</span>
</button>
</figure>
<div class="w-100">
<div class="answer-pill mb-2">Правильный ответ</div>
<p class="mb-1 fw-semibold" id="correctAnswer"></p>
<p class="mb-2 text-muted">Интересные факты:</p>
<ul class="fact-list mb-0" id="factList"></ul>
</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 quiz-actions">
<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 tv-extra">
<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>Дайте детям 2030 секунд на обсуждение.</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 tv-extra">
<div class="container py-4 small text-muted d-flex flex-wrap justify-content-between gap-2">
<span>Викторина для показа на экране.</span>
<span>Сделано для урока в 5‑м классе.</span>
</div>
</footer>
<div class="image-lightbox d-none" id="imageLightbox" role="dialog" aria-modal="true" aria-label="Увеличенное изображение">
<button class="image-lightbox-close" id="closeImageLightbox" type="button" aria-label="Закрыть увеличенное изображение">&times;</button>
<img id="lightboxImage" src="" alt="" class="image-lightbox-img" loading="lazy" width="1400" height="900">
</div>
<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>