-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsephora_survey.html
154 lines (132 loc) · 4.67 KB
/
sephora_survey.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sephora Customer Survey</title>
<style>
body {
font-family: Arial, sans-serif;
background-image: url('https://example.com/sephora_background.jpg'); /* Replace with your Sephora theme image */
background-size: cover;
background-position: center;
margin: 0;
padding: 20px;
color: #fff;
}
.container {
width: 90%;
max-width: 800px;
margin: 50px auto;
padding: 20px;
background: rgba(255, 255, 255, 0.8);
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.question {
margin-bottom: 20px;
}
.question h2 {
font-size: 24px;
color: #333;
}
.question label {
display: block;
margin-bottom: 10px;
}
.question input[type="radio"],
.question input[type="checkbox"] {
margin-right: 10px;
}
.button-container {
text-align: center;
}
.button-container button {
background-color: #e91e63; /* Sephora's pink */
color: white;
border: none;
padding: 10px 20px;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
margin: 10px;
transition: background-color 0.3s;
}
.button-container button:hover {
background-color: #c2185b;
}
.button-container .back-button {
background-color: #007bff;
}
.button-container .back-button:hover {
background-color: #0056b3;
}
.message {
text-align: center;
font-size: 18px;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<div id="questionContainer" class="question">
<!-- Survey questions will be dynamically inserted here -->
</div>
<div class="button-container">
<button id="backButton" class="back-button" style="display:none;">Back</button>
<button id="nextButton">Next</button>
</div>
<div id="message" class="message"></div>
</div>
<script>
const questions = [
"Question 1: How satisfied are you with the range of beauty products available at Sephora?",
"Question 2: How would you rate the quality of customer service at Sephora?",
"Question 3: How easy was it to find what you were looking for at Sephora?",
"Question 4: How do you rate the pricing of products at Sephora?",
"Question 5: Were you satisfied with the cleanliness of the Sephora store?",
"Question 6: How likely are you to recommend Sephora to others?",
"Question 7: What improvements would you suggest for Sephora?"
];
let currentQuestion = 0;
let timer;
function startTimer() {
let timeLeft = 10;
document.getElementById('timer').innerText = timeLeft;
document.getElementById('nextButton').disabled = true;
timer = setInterval(() => {
timeLeft--;
document.getElementById('timer').innerText = timeLeft;
if (timeLeft <= 0) {
clearInterval(timer);
document.getElementById('nextButton').disabled = false;
}
}, 1000);
}
function displayQuestion() {
if (currentQuestion >= questions.length) {
document.getElementById('questionContainer').innerHTML = "<p>Thank you for completing the survey!</p>";
document.getElementById('nextButton').style.display = 'none';
document.getElementById('backButton').style.display = 'none';
return;
}
document.getElementById('questionContainer').innerHTML = `<h2>${questions[currentQuestion]}</h2>`;
startTimer();
}
function nextQuestion() {
currentQuestion++;
displayQuestion();
}
function goBack() {
if (currentQuestion > 0) {
currentQuestion--;
displayQuestion();
}
}
document.getElementById('nextButton').addEventListener('click', nextQuestion);
document.getElementById('backButton').addEventListener('click', goBack);
displayQuestion();
</script>
</body>
</html>