File tree Expand file tree Collapse file tree 6 files changed +214
-0
lines changed
client/src/components/QuizNavbar Expand file tree Collapse file tree 6 files changed +214
-0
lines changed Original file line number Diff line number Diff line change 1+ <script >
2+ import {Meta , Template , Story } from ' @storybook/addon-svelte-csf' ;
3+ import QuizNavbar from ' ./QuizNavbar.svelte' ;
4+ </script >
5+
6+ <Meta
7+ title =" Example/QuizNavbar"
8+ component ={QuizNavbar }
9+ argTypes ={{
10+ questions : {control : ' array' }
11+ }}
12+ />
13+
14+ <Template let:args >
15+ <QuizNavbar {...args } />
16+ </Template >
17+
18+ <Story
19+ name =" Example Quiz Navbar"
20+ args ={{
21+ questions : [
22+ {
23+ number: 1 ,
24+ state: ' unanswered'
25+ },
26+ {
27+ number: 2 ,
28+ state: ' answered'
29+ },
30+ {
31+ number: 3 ,
32+ state: ' unanswered'
33+ },
34+ {
35+ number: 4 ,
36+ state: ' answered'
37+ },
38+ {
39+ number: 5 ,
40+ state: ' answered'
41+ },
42+ {
43+ number: 6 ,
44+ state: ' answered'
45+ },
46+ {
47+ number: 7 ,
48+ state: ' answered'
49+ },
50+ {
51+ number: 8 ,
52+ state: ' answered'
53+ },
54+ {
55+ number: 9 ,
56+ state: ' answered'
57+ },
58+ {
59+ number: 10 ,
60+ state: ' answered'
61+ },
62+ {
63+ number: 11 ,
64+ state: ' unanswered'
65+ },
66+ {
67+ number: 12 ,
68+ state: ' answered'
69+ },
70+ {
71+ number: 13 ,
72+ state: ' unanswered'
73+ }
74+ ]
75+ }}
76+ />
Original file line number Diff line number Diff line change 1+ <script >
2+ import {QuizNavbarQuestion } from ' ./QuizNavbarQuestion' ;
3+ export let questions;
4+ export let model;
5+ </script >
6+
7+ <div class =" main" >
8+ <div class =" title" >QUIZ</div >
9+ {#each questions as question }
10+ <QuizNavbarQuestion
11+ number ={question .number }
12+ state ={question .state }
13+ {model }
14+ />
15+ {/each }
16+ </div >
17+
18+ <style type =" text/scss" >
19+ .main {
20+ height : auto ;
21+ width : 16% ;
22+ align-items : center ;
23+ border-style : solid ;
24+ /* border-radius: 0.6rem;*/
25+ border-width : 0.1rem ;
26+ border-color : white ;
27+ margin : 0.5rem ;
28+ padding : 1rem ;
29+ display : grid ;
30+ grid-template-columns : auto auto auto auto auto ;
31+ align-items : center ;
32+ justify-content : center ;
33+ background-color : #ffab40 ;
34+ }
35+
36+ .title {
37+ text-align : center ;
38+ font-family : ' Assistant' , sans-serif ;
39+ color : white ;
40+ font-weight : bold ;
41+ width : 1rem ;
42+ padding : 1rem ;
43+ }
44+ @media only screen and (max-width : 1900px ) {
45+ .main {
46+ grid-template-columns : auto auto auto auto ;
47+ }
48+ }
49+ @media only screen and (max-width : 1600px ) {
50+ .main {
51+ grid-template-columns : auto auto auto ;
52+ }
53+ }
54+ @media only screen and (max-width : 1300px ) {
55+ .main {
56+ grid-template-columns : auto auto ;
57+ }
58+ }
59+ @media only screen and (max-width : 920px ) {
60+ .main {
61+ grid-template-columns : auto ;
62+ }
63+ }
64+ </style >
Original file line number Diff line number Diff line change 1+ <script >
2+ import {Meta , Template , Story } from ' @storybook/addon-svelte-csf' ;
3+ import QuizNavbarQuestion from ' ./QuizNavbarQuestion.svelte' ;
4+ </script >
5+
6+ <Meta
7+ title =" Example/QuizNavbarQuestion"
8+ component ={QuizNavbarQuestion }
9+ argTypes ={{
10+ number : {control : ' number' },
11+ state : {
12+ options : [' unanswered' , ' answered' ]
13+ }
14+ }}
15+ />
16+
17+ <Template let:args >
18+ <QuizNavbarQuestion {...args } />
19+ </Template >
20+
21+ <Story
22+ name =" Question 14"
23+ args ={{
24+ number : 14 ,
25+ state : ' unanswered'
26+ }}
27+ />
28+
29+ <Story
30+ name =" Question 7"
31+ args ={{
32+ number : 7 ,
33+ state : ' answered'
34+ }}
35+ />
Original file line number Diff line number Diff line change 1+ <script >
2+ export let number;
3+ export let state;
4+ export let model;
5+ </script >
6+
7+ <meta name =" viewport" content =" width=device-width, initial-scale=1" />
8+ <div class ="main {state }" >
9+ {number }
10+ </div >
11+
12+ <style >
13+ .main {
14+ height : 1rem ;
15+ align-items : center ;
16+ border-style : solid ;
17+ border-radius : 0.5rem ;
18+ border-width : 0.1rem ;
19+ /* border-color: #c0c0c0; */
20+
21+ margin : 0.5rem ;
22+ width : 1rem ;
23+ padding : 1rem ;
24+ font-family : ' Assistant' , sans-serif ;
25+ }
26+
27+ .answered {
28+ background-color : #99ccff ;
29+ border-color : #99ccff ;
30+ color : white ;
31+ }
32+
33+ .unanswered {
34+ background-color : white ;
35+ border-color : white ;
36+ }
37+ </style >
Original file line number Diff line number Diff line change 1+ export { default as QuizNavbarQuestion } from './QuizNavbarQuestion.svelte' ;
Original file line number Diff line number Diff line change 1+ export { default as QuizNavbar } from './QuizNavbar.svelte' ;
You can’t perform that action at this time.
0 commit comments