Skip to content

Commit 41f4004

Browse files
committed
survey form is working fine
1 parent 2934887 commit 41f4004

File tree

3 files changed

+151
-183
lines changed

3 files changed

+151
-183
lines changed
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
[
2-
{
3-
"q1": "Yes",
4-
"q2": "Not yet, but I plan to",
5-
"q3": "1-3 months ago",
6-
"q9": ""
7-
},
8-
{
9-
"q5": "Yes",
10-
"q7": "Handwriting practice sheets",
11-
"q9": "ajfvrnarkjvnrnvanvjav;jaewv;jawbvrjawb"
12-
},
13-
{
14-
"id": null,
15-
"timestamp": "2025-01-31T12:38:34.816Z",
16-
"q1": "No",
17-
"q2": "Not yet, but I plan to",
18-
"q4": "15-30 minutes",
19-
"q5": "Not sure",
20-
"q7": "Interactive apps or websites",
21-
"q9": "cccccccccccccccccccc"
22-
}
23-
]

src/assets/styles/survey.css

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
.survey-container {
2+
max-width: 1200px;
3+
margin: 0 auto;
4+
padding: 1.5rem;
5+
background: #0f172a;
6+
border-radius: 8px;
7+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
8+
}
9+
10+
.survey-header {
11+
text-align: center;
12+
margin-bottom: 2rem;
13+
display: flex;
14+
flex-direction: column;
15+
}
16+
17+
.survey-header h1 {
18+
font-size: 2rem;
19+
color: #d8d9d9;
20+
margin-bottom: 1rem;
21+
}
22+
23+
.survey-header p {
24+
font-size: 1rem;
25+
color: #fafafa;
26+
margin-bottom: 2rem;
27+
}
28+
29+
.questions-container {
30+
max-height: 70vh;
31+
overflow-y: auto;
32+
padding: 1rem;
33+
background: #fdfdfd;
34+
border-radius: 8px;
35+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
36+
}
37+
38+
.question-card {
39+
background: #e3e2e2;
40+
border: 1px solid #e2e8f0;
41+
border-radius: 8px;
42+
padding: 1rem;
43+
margin-bottom: 1rem;
44+
}
45+
46+
.question-card h3 {
47+
font-size: 1.5rem;
48+
color: #2d3748;
49+
margin-bottom: 0.75rem;
50+
}
51+
52+
.options-group {
53+
display: grid;
54+
gap: 0.75rem;
55+
}
56+
57+
.option-label {
58+
display: flex;
59+
align-items: center;
60+
gap: 0.5rem;
61+
padding: 0.5rem;
62+
border-radius: 4px;
63+
background: #f8fafc;
64+
cursor: pointer;
65+
color: rgb(24, 22, 22);
66+
}
67+
68+
.radio-input,
69+
.checkbox-input {
70+
width: 1rem;
71+
height: 1rem;
72+
accent-color: #3b82f6;
73+
}
74+
75+
.textarea-input {
76+
width: 100%;
77+
padding: 0.5rem;
78+
background-color: #ffffff;
79+
border-radius: 4px;
80+
resize: vertical;
81+
color: #2d3748;
82+
}
83+
84+
.survey-controls {
85+
display: flex;
86+
gap: 1rem;
87+
justify-content: center;
88+
margin-top: 1.5rem;
89+
padding: 1rem;
90+
}
91+
92+
.submit-btn,
93+
.download-btn {
94+
padding: 0.75rem 1.5rem;
95+
border-radius: 4px;
96+
border: none;
97+
cursor: pointer;
98+
font-size: 1rem;
99+
transition: background-color 0.3s ease;
100+
}
101+
102+
.submit-btn {
103+
background: #3b82f6;
104+
color: white;
105+
}
106+
107+
.submit-btn:hover {
108+
background: #2563eb;
109+
}
110+
111+
.download-btn {
112+
background: white;
113+
color: #3b82f6;
114+
border: 1px solid #3b82f6;
115+
}
116+
117+
.download-btn:hover {
118+
background: #f8fafc;
119+
}
120+
121+
/* Responsive Design */
122+
@media (max-width: 768px) {
123+
.survey-container {
124+
padding: 1rem;
125+
}
126+
127+
.survey-header h1 {
128+
font-size: 1.5rem;
129+
}
130+
131+
.survey-header p {
132+
font-size: 0.9rem;
133+
}
134+
135+
.question-card h3 {
136+
font-size: 0.9rem;
137+
}
138+
139+
.submit-btn,
140+
.download-btn {
141+
padding: 0.5rem 1rem;
142+
font-size: 0.9rem;
143+
}
144+
145+
.survey-controls {
146+
flex-direction: column;
147+
gap: 0.5rem;
148+
}
149+
}

src/components/surveyForm.astro

Lines changed: 2 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const { data } = Astro.props;
1010

1111
<div class="survey-wrapper">
1212
<div class="survey-container">
13-
<header class="survey-header">
13+
<div class="survey-header">
1414
<h1>{data.surveyTitle}</h1>
1515
<p>{data.description}</p>
16-
</header>
16+
<div/>
1717

1818
<div class="questions-container">
1919
<form id="surveyForm" class="survey-form">
@@ -140,161 +140,3 @@ const { data } = Astro.props;
140140
downloadBtn?.addEventListener('click', downloadResults);
141141
</script>
142142

143-
<style>
144-
.survey-wrapper {
145-
width: 100%;
146-
min-height: 100vh;
147-
font-family: Arial, sans-serif;
148-
color: #333;
149-
padding: 1rem;
150-
background-color: #f8fafc;
151-
}
152-
153-
.survey-container {
154-
max-width: 1200px;
155-
margin: 0 auto;
156-
padding: 1.5rem;
157-
background: #fff;
158-
border-radius: 8px;
159-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
160-
}
161-
162-
.survey-header {
163-
text-align: center;
164-
margin-bottom: 2rem;
165-
display: flex;
166-
flex-direction: column;
167-
}
168-
169-
.survey-header h1 {
170-
font-size: 2rem;
171-
color: #1a365d;
172-
margin-bottom: 0.5rem;
173-
}
174-
175-
.survey-header p {
176-
font-size: 1rem;
177-
color: #4a5568;
178-
}
179-
180-
.questions-container {
181-
max-height: 60vh;
182-
overflow-y: auto;
183-
padding: 1rem;
184-
background: #ffffff;
185-
border-radius: 8px;
186-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
187-
}
188-
189-
.question-card {
190-
background: #ffffff;
191-
border: 1px solid #e2e8f0;
192-
border-radius: 8px;
193-
padding: 1rem;
194-
margin-bottom: 1rem;
195-
}
196-
197-
.question-card h3 {
198-
font-size: 1rem;
199-
color: #2d3748;
200-
margin-bottom: 0.75rem;
201-
}
202-
203-
.options-group {
204-
display: grid;
205-
gap: 0.75rem;
206-
}
207-
208-
.option-label {
209-
display: flex;
210-
align-items: center;
211-
gap: 0.5rem;
212-
padding: 0.5rem;
213-
border-radius: 4px;
214-
background: #f8fafc;
215-
cursor: pointer;
216-
}
217-
218-
.radio-input,
219-
.checkbox-input {
220-
width: 1rem;
221-
height: 1rem;
222-
accent-color: #3b82f6;
223-
}
224-
225-
.textarea-input {
226-
width: 100%;
227-
padding: 0.5rem;
228-
background-color: #e2e8f0;
229-
border: 1px solid #e2e8f0;
230-
border-radius: 4px;
231-
resize: vertical;
232-
}
233-
234-
.survey-controls {
235-
display: flex;
236-
gap: 1rem;
237-
justify-content: center;
238-
margin-top: 1.5rem;
239-
padding: 1rem;
240-
}
241-
242-
.submit-btn,
243-
.download-btn {
244-
padding: 0.75rem 1.5rem;
245-
border-radius: 4px;
246-
border: none;
247-
cursor: pointer;
248-
font-size: 1rem;
249-
transition: background-color 0.3s ease;
250-
}
251-
252-
.submit-btn {
253-
background: #3b82f6;
254-
color: white;
255-
}
256-
257-
.submit-btn:hover {
258-
background: #2563eb;
259-
}
260-
261-
.download-btn {
262-
background: white;
263-
color: #3b82f6;
264-
border: 1px solid #3b82f6;
265-
}
266-
267-
.download-btn:hover {
268-
background: #f8fafc;
269-
}
270-
271-
/* Responsive Design */
272-
@media (max-width: 768px) {
273-
.survey-container {
274-
padding: 1rem;
275-
}
276-
277-
.survey-header h1 {
278-
font-size: 1.5rem;
279-
}
280-
281-
.survey-header p {
282-
font-size: 0.9rem;
283-
}
284-
285-
.question-card h3 {
286-
font-size: 0.9rem;
287-
}
288-
289-
.submit-btn,
290-
.download-btn {
291-
padding: 0.5rem 1rem;
292-
font-size: 0.9rem;
293-
}
294-
295-
.survey-controls {
296-
flex-direction: column;
297-
gap: 0.5rem;
298-
}
299-
}
300-
</style>

0 commit comments

Comments
 (0)