Файловый менеджер - Редактировать - /home/gqdcvggs/go.imators.com/feedback.imators.com.tar
Назад
index.html 0000664 00000041222 15114726670 0006555 0 ustar 00 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Share Your Experience</title> <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=Mulish:ital,wght@0,200..1000;1,200..1000&display=swap" rel="stylesheet"> <style> :root { --matcha-green: #D4E9C7; --dark-text: #333333; --accent-color: #95B878; --light-text: #666666; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Mulish', sans-serif; } body { background-color: var(--matcha-green); color: var(--dark-text); min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem; } .container { max-width: 800px; margin: 0 auto; width: 100%; } .intro { text-align: center; margin-bottom: 3rem; opacity: 0; transform: translateY(30px); animation: fadeInUp 0.8s ease forwards; } .intro h1 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--dark-text); } .intro p { color: var(--light-text); font-size: 1.1rem; line-height: 1.6; } .progress-bar { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: rgba(255, 255, 255, 0.3); } .progress-fill { height: 100%; background: var(--accent-color); width: 0%; transition: width 0.3s ease; } .step { background: rgba(255, 255, 255, 0.95); padding: 2.5rem; border-radius: 1.5rem; margin-bottom: 1rem; transform: translateY(50px); opacity: 0; transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .step.active { transform: translateY(0); opacity: 1; } .step-number { font-size: 0.9rem; color: var(--accent-color); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0; animation: fadeIn 0.5s ease forwards 0.3s; } .question { font-size: 1.4rem; margin-bottom: 1.5rem; line-height: 1.4; opacity: 0; animation: fadeIn 0.5s ease forwards 0.5s; } .description { color: var(--light-text); margin-bottom: 2rem; font-size: 1rem; line-height: 1.6; opacity: 0; animation: fadeIn 0.5s ease forwards 0.7s; } textarea, input[type="text"] { width: 100%; padding: 1rem; margin-bottom: 1.5rem; border: 2px solid #eee; border-radius: 0.8rem; font-size: 1rem; transition: all 0.3s ease; opacity: 0; animation: fadeIn 0.5s ease forwards 0.9s; } textarea:focus, input[type="text"]:focus { border-color: var(--accent-color); outline: none; box-shadow: 0 0 0 3px rgba(149, 184, 120, 0.2); } textarea { min-height: 120px; resize: vertical; } .buttons { display: flex; justify-content: space-between; margin-top: 2rem; opacity: 0; animation: fadeIn 0.5s ease forwards 1.1s; } button { padding: 1rem 2rem; border: none; border-radius: 0.8rem; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; font-weight: 600; } .btn-primary { background: var(--dark-text); color: white; } .btn-secondary { background: transparent; color: var(--dark-text); border: 2px solid var(--dark-text); } button:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } .summary { margin-top: 2rem; } .summary-item { display: flex; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid #eee; opacity: 0; animation: fadeIn 0.5s ease forwards; } .summary-item:last-child { border-bottom: none; } .summary-question { color: var(--light-text); flex: 1; padding-right: 2rem; } .summary-answer { flex: 2; } .edit-btn { background: transparent; color: var(--accent-color); border: 1px solid var(--accent-color); padding: 0.4rem 1rem; font-size: 0.9rem; margin-left: 1rem; border-radius: 0.5rem; } @keyframes fadeInUp { from {opacity: 0; transform: translateY(30px);} to {opacity: 1; transform: translateY(0);} } @keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} } .rating-container { display: flex; gap: 1rem; margin: 2rem 0; opacity: 0; animation: fadeIn 0.5s ease forwards 0.9s; } .rating-option { flex: 1; text-align: center; padding: 1rem; border: 2px solid #eee; border-radius: 0.8rem; cursor: pointer; transition: all 0.3s ease; } .rating-option:hover, .rating-option.selected { border-color: var(--accent-color); background: rgba(149, 184, 120, 0.1); } .rating-option .number { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; } .rating-option .label { font-size: 0.9rem; color: var(--light-text); } .success-message { text-align: center; padding: 3rem; opacity: 0; transform: scale(0.9); transition: all 0.5s ease; } .success-message.active { opacity: 1; transform: scale(1); } .success-icon { font-size: 4rem; color: var(--accent-color); margin-bottom: 2rem; } </style> </head> <body> <div class="progress-bar"> <div class="progress-fill"></div> </div> <div class="container"> <div class="intro"> <h1>Share Your Experience</h1> <p>Your feedback helps us improve and create better experiences for everyone.</p> </div> </div> <script> const questions = [ { id: 1, stepNumber: "Step 1", text: "How would you rate your overall experience?", description: "Consider all aspects of your interaction with us.", type: "rating" }, { id: 2, stepNumber: "Step 2", text: "What aspects did you enjoy the most?", description: "Tell us about the highlights of your experience.", type: "textarea" }, { id: 3, stepNumber: "Step 3", text: "What could be improved?", description: "Your suggestions help us enhance our service.", type: "textarea" }, { id: 4, stepNumber: "Step 4", text: "Would you recommend us to others?", description: "Share your thoughts on why you would or wouldn't recommend us.", type: "textarea" } ]; let currentStep = 0; let answers = {}; function updateProgressBar() { const progress = ((currentStep + 1) / (questions.length + 1)) * 100; document.querySelector('.progress-fill').style.width = `${progress}%`; } function createRatingOptions() { const container = document.createElement('div'); container.className = 'rating-container'; for (let i = 1; i <= 5; i++) { const option = document.createElement('div'); option.className = 'rating-option'; if (answers[1] === i) option.classList.add('selected'); const number = document.createElement('div'); number.className = 'number'; number.textContent = i; const label = document.createElement('div'); label.className = 'label'; label.textContent = i === 1 ? 'Poor' : i === 5 ? 'Excellent' : ''; option.appendChild(number); option.appendChild(label); option.onclick = () => { document.querySelectorAll('.rating-option').forEach(opt => opt.classList.remove('selected')); option.classList.add('selected'); answers[1] = i; }; container.appendChild(option); } return container; } function createStep(question, isActive = false) { const step = document.createElement('div'); step.className = `step ${isActive ? 'active' : ''}`; const stepNumber = document.createElement('div'); stepNumber.className = 'step-number'; stepNumber.textContent = question.stepNumber; const questionElement = document.createElement('div'); questionElement.className = 'question'; questionElement.textContent = question.text; const description = document.createElement('div'); description.className = 'description'; description.textContent = question.description; step.appendChild(stepNumber); step.appendChild(questionElement); step.appendChild(description); if (question.type === 'rating') { step.appendChild(createRatingOptions()); } else { const input = question.type === 'textarea' ? document.createElement('textarea') : document.createElement('input'); input.type = question.type; input.id = `question-${question.id}`; input.value = answers[question.id] || ''; input.placeholder = 'Type your answer here...'; step.appendChild(input); } const buttons = document.createElement('div'); buttons.className = 'buttons'; if (currentStep > 0) { const prevButton = document.createElement('button'); prevButton.className = 'btn-secondary'; prevButton.textContent = 'Previous'; prevButton.onclick = previousStep; buttons.appendChild(prevButton); } const nextButton = document.createElement('button'); nextButton.className = 'btn-primary'; nextButton.textContent = currentStep === questions.length - 1 ? 'Review' : 'Next'; nextButton.onclick = () => { if (question.type !== 'rating') { answers[question.id] = document.getElementById(`question-${question.id}`).value; } nextStep(); }; buttons.appendChild(nextButton); step.appendChild(buttons); return step; } function createSummary() { const step = document.createElement('div'); step.className = 'step active'; const stepNumber = document.createElement('div'); stepNumber.className = 'step-number'; stepNumber.textContent = 'Review'; const title = document.createElement('div'); title.className = 'question'; title.textContent = 'Review Your Feedback'; const description = document.createElement('div'); description.className = 'description'; description.textContent = 'Please review your responses before submitting.'; const summary = document.createElement('div'); summary.className = 'summary'; questions.forEach((question, index) => { const item = document.createElement('div'); item.className = 'summary-item'; item.style.animationDelay = `${index * 0.1}s`; const questionText = document.createElement('div'); questionText.className = 'summary-question'; questionText.textContent = question.text; const answerContainer = document.createElement('div'); answerContainer.className = 'summary-answer'; const answer = document.createElement('span'); answer.textContent = question.type === 'rating' ? `${answers[question.id]} out of 5` : answers[question.id]; const editButton = document.createElement('button'); editButton.className = 'edit-btn'; editButton.textContent = 'Edit'; editButton.onclick = () => goToStep(questions.indexOf(question)); answerContainer.appendChild(answer); answerContainer.appendChild(editButton); item.appendChild(questionText); item.appendChild(answerContainer); summary.appendChild(item); }); const buttons = document.createElement('div'); buttons.className = 'buttons'; const prevButton = document.createElement('button'); prevButton.className = 'btn-secondary'; prevButton.textContent = 'Previous'; prevButton.onclick = previousStep; const submitButton = document.createElement('button'); submitButton.className = 'btn-primary'; submitButton.textContent = 'Submit Feedback'; submitButton.onclick = submitFeedback; buttons.appendChild(prevButton); buttons.appendChild(submitButton); step.appendChild(stepNumber); step.appendChild(title); step.appendChild(description); step.appendChild(summary); step.appendChild(buttons); return step; } function createSuccessMessage() { const step = document.createElement('div'); step.className = 'step success-message'; const icon = document.createElement('div'); icon.className = 'success-icon'; icon.textContent = '✓'; const title = document.createElement('div'); title.className = 'question'; title.textContent = 'Thank You for Your Feedback!'; const description = document.createElement('div'); description.className = 'description'; description.textContent = 'Your insights help us improve.'; const button = document.createElement('button'); button.className = 'btn-primary'; button.textContent = 'Start New Feedback'; button.onclick = resetForm; step.appendChild(icon); step.appendChild(title); step.appendChild(description); step.appendChild(button); setTimeout(() => step.classList.add('active'), 100); return step; } function nextStep() { if (currentStep < questions.length) { currentStep++; renderStep(); } updateProgressBar(); } function previousStep() { if (currentStep > 0) { currentStep--; renderStep(); } updateProgressBar(); } function goToStep(step) { currentStep = step; renderStep(); updateProgressBar(); } function renderStep() { const container = document.querySelector('.container'); const intro = container.querySelector('.intro'); Array.from(container.children).forEach(child => { if (!child.classList.contains('intro')) { child.remove(); } }); if (currentStep < questions.length) { container.appendChild(createStep(questions[currentStep], true)); } else { container.appendChild(createSummary()); } } function resetForm() { answers = {}; currentStep = 0; renderStep(); updateProgressBar(); } async function submitFeedback() { try { const response = await fetch('save_feedback.php', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(answers) }); if (response.ok) { const container = document.querySelector('.container'); Array.from(container.children).forEach(child => { if (!child.classList.contains('intro')) { child.remove(); } }); container.appendChild(createSuccessMessage()); } else { throw new Error('Failed to submit feedback'); } } catch (error) { alert('Error submitting feedback. Please try again.'); console.error('Error:', error); } } renderStep(); updateProgressBar(); </script> </body> </html>