From 03facb5db85788e1937b94175f52861bcd0d3666 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 12 May 2026 21:29:45 +0300 Subject: [PATCH] feat: add second questionnaire with clarifying questions --- questionnaire2.html | 270 ++++++++++++++++++++++++++++++++++++++++++++ script2.js | 108 ++++++++++++++++++ 2 files changed, 378 insertions(+) create mode 100644 questionnaire2.html create mode 100644 script2.js diff --git a/questionnaire2.html b/questionnaire2.html new file mode 100644 index 0000000..15a320b --- /dev/null +++ b/questionnaire2.html @@ -0,0 +1,270 @@ + + + + + + + Sunset Pass — Уточняющий опросник + + + + + +
+ +
+
Kot Kanagrilli Oy
+ kotkanagrilli@gmail.com +
+
+ + +
+
+ Saarijärven koirapuisto — Уточняющий опросник + +
+
+ +
+
+ + +
+ + +
+ +
+
+
+
+
+

Заполнено: 0 из 16

+
+ +
+ + + + + + + +
+
+

О воротах

+
+

Вы указали: оборудования нет, нужно закупить с нуля.

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+

Об оплате

+
+

Вы указали: онлайн.

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+

О бронировании

+
+

Вы указали: минимум 1 час, максимум 1 день.

+ +
+ + +
+ +
+ + +
+
+ + +
+
+

О PIN-коде и уведомлениях

+
+

Вы указали: система генерирует PIN автоматически после оплаты.

+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+

Об управлении бронированиями

+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+

Юридическое

+
+

В Финляндии по закону ЕС (GDPR) сайт обязан иметь политику конфиденциальности.

+ +
+ + +
+
+ + +
+
+

О дизайне

+
+

Вы указали: название Saarijärven koirapuisto, логотипа пока нет.

+ +
+ + +
+ +
+ + +
+
+ + +
+
+

О формате продукта

+
+

Мы можем реализовать проект в нескольких вариантах:

+ +
+ Вариант 1 — Простой сайт (быстро, дёшево)
+ Сайт на финском: календарь слотов, онлайн-оплата, PIN по email. Работает на любом телефоне через браузер. +
+ +
+ Вариант 2 — Продвинутый сайт (рекомендуем)
+ То же + SMS-уведомления, напоминания перед концом слота, панель управления для вас (блокировка дат, просмотр бронирований, статистика). +
+ +
+ Вариант 3 — Сайт + мобильное приложение (максимум)
+ То же + приложение для iOS и Android. PIN приходит в приложение, уведомления через приложение. Самый удобный вариант для клиентов. +
+ +
+ + +
+
+ + +
+
+

Ваши контактные данные

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +

После отправки мы свяжемся с вами в течение 1-2 рабочих дней.

+ +
+
+ + +
+
+
Предпросмотр
+
+

Начните заполнять форму — здесь появится предпросмотр

+
+
+
+ +
+ + + + diff --git a/script2.js b/script2.js new file mode 100644 index 0000000..2d9507b --- /dev/null +++ b/script2.js @@ -0,0 +1,108 @@ +// ─── Поля прогресса ─────────────────────────────────────────────────────────── +const TRACKED_FIELDS = [ + 'gate_type','gate_electricity','gate_internet','gate_camera', + 'payment_provider','price_per_hour','price_tiers','invoice', + 'closing_time','advance_booking', + 'pin_delivery','time_warning','park_signal', + 'admin_view','block_dates','support_phone', + 'product_choice' +]; + +// ─── Инициализация ──────────────────────────────────────────────────────────── +document.addEventListener('DOMContentLoaded', function () { + updateProgress(); + updatePreview(); + + document.getElementById('client_email').addEventListener('input', function () { + document.getElementById('_replyto').value = this.value; + }); + document.getElementById('_replyto').value = document.getElementById('client_email').value; + + document.getElementById('questionnaireForm').addEventListener('input', function () { + updateProgress(); + updatePreview(); + }); + + document.getElementById('questionnaireForm').addEventListener('submit', function () { + const now = new Date(); + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + const offsetMin = -now.getTimezoneOffset(); + const offsetSign = offsetMin >= 0 ? '+' : '-'; + const offsetHours = String(Math.floor(Math.abs(offsetMin) / 60)).padStart(2, '0'); + const offsetMins = String(Math.abs(offsetMin) % 60).padStart(2, '0'); + document.getElementById('sender_time').value = + now.toLocaleString('ru-RU', { hour12: false }) + + ` (UTC${offsetSign}${offsetHours}:${offsetMins}, ${tz})`; + document.getElementById('sender_timezone').value = tz; + document.getElementById('anton_time').value = + now.toLocaleString('ru-RU', { + timeZone: 'Europe/Helsinki', hour12: false, + year: 'numeric', month: '2-digit', day: '2-digit', + hour: '2-digit', minute: '2-digit', second: '2-digit' + }) + ' (UTC+3, Финляндия)'; + }, true); + + document.getElementById('btnSave').addEventListener('click', function () { + showFlash('Сохранено!'); + }); +}); + +// ─── Прогресс ───────────────────────────────────────────────────────────────── +function updateProgress() { + let filled = 0; + TRACKED_FIELDS.forEach(name => { + const el = document.getElementById(name); + if (el && el.value.trim()) filled++; + }); + const total = TRACKED_FIELDS.length; + const pct = Math.round((filled / total) * 100); + document.getElementById('progressFill').style.width = pct + '%'; + document.getElementById('progressText').textContent = `Заполнено: ${filled} из ${total}`; +} + +// ─── Предпросмотр ───────────────────────────────────────────────────────────── +function updatePreview() { + const container = document.getElementById('previewContent'); + const sections = document.querySelectorAll('.section'); + let html = ''; + + sections.forEach(section => { + const title = section.querySelector('h2'); + const questions = section.querySelectorAll('.question'); + let sectionHtml = ''; + + questions.forEach(q => { + const input = q.querySelector('textarea, input[type="text"], input[type="email"], input[type="tel"]'); + const label = q.querySelector('label'); + if (!input || !label) return; + const val = input.value.trim(); + if (val) { + sectionHtml += `
+
${label.textContent.trim()}
+
${escapeHtml(val)}
+
`; + } + }); + + if (sectionHtml && title) { + html += `
+
${title.textContent.trim()}
+ ${sectionHtml} +
`; + } + }); + + container.innerHTML = html || '

Начните заполнять форму — здесь появится предпросмотр

'; +} + +// ─── Flash ──────────────────────────────────────────────────────────────────── +function showFlash(msg) { + const el = document.getElementById('flash'); + el.textContent = msg; + el.classList.add('show'); + setTimeout(() => el.classList.remove('show'), 2500); +} + +function escapeHtml(str) { + return str.replace(/&/g,'&').replace(//g,'>'); +}