-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraderjoes_survey.html
154 lines (132 loc) · 4.7 KB
/
traderjoes_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>Trader Joe's Customer Survey</title>
<style>
body {
font-family: Arial, sans-serif;
background-image: url('https://example.com/traderjoes_background.jpg'); /* Replace with your Trader Joe's 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: #ff6f00; /* Trader Joe's orange */
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: #e65100;
}
.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 quality of products at Trader Joe's?",
"Question 2: How would you rate the customer service experience at Trader Joe's?",
"Question 3: How do you feel about the variety of products offered at Trader Joe's?",
"Question 4: How would you rate the pricing at Trader Joe's?",
"Question 5: Were you satisfied with the cleanliness of the store?",
"Question 6: How likely are you to recommend Trader Joe's to friends and family?",
"Question 7: What improvements would you suggest for Trader Joe's?"
];
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>