5
5
background-color : #fff ;
6
6
height : 100vh ;
7
7
font-family : ' Roboto+Condensed' , sans-serif ;
8
- background : url (' /images/bg4 .jpg' );
8
+ background : url (' /images/bg5 .jpg' );
9
9
background-size : cover ;
10
10
background-repeat : no-repeat ;
11
11
background-position : center center ;
22
22
bottom : 0 ;
23
23
height : 40vh ;
24
24
width : 100vw ;
25
- background-color : #DD0A00 ;
25
+ background-color : #EF4A4E ;
26
26
}
27
27
28
28
.kotak-soal-2 {
29
29
position : absolute ;
30
30
bottom : 0 ;
31
31
height : 34vh ;
32
32
width : 100vw ;
33
- background-color : #65171D ;
33
+ background-color : #C93E43 ;
34
34
margin-bottom : 3vh ;
35
35
}
36
36
39
39
bottom : 0 ;
40
40
height : 28vh ;
41
41
width : 94vw ;
42
- background-color : #FFFFFF ;
42
+ background-color : #EAE0D4 ;
43
43
margin-bottom : 3vh ;
44
44
left : 50% ;
45
45
margin-left : -47vw ;
52
52
}
53
53
54
54
.kotak-soal-3 .pilihan-jawaban {
55
- padding : 10px 300px ;
55
+ padding : 0px 300px ;
56
+ text-align : center ;
57
+ width : 100% ;
58
+ display : inline-table ;
59
+ }
60
+
61
+ .pilihan-jawaban .jawaban {
62
+ width : 50% ;
56
63
text-align : center ;
64
+ display : inline-block ;
65
+ height : 50px ;
66
+ line-height : 50px ;
67
+ margin-bottom : 15px ;
68
+ }
69
+
70
+ .jawaban p {
71
+ background-color : #EAE0D4 ;
72
+ border : 2px solid rgba (139 , 139 , 139 , .3 );
73
+ border-radius : 25px ;
74
+ margin : 3px 0px ;
75
+ -webkit-touch-callout : none ;
76
+ -webkit-user-select : none ;
77
+ -moz-user-select : none ;
78
+ -ms-user-select : none ;
79
+ user-select : none ;
80
+ -webkit-tap-highlight-color : transparent ;
81
+ transition : all .2s ;
82
+
83
+ transition : transform .3s ease-in-out ;
57
84
}
58
85
86
+ .jawaban.clicked p {
87
+ background-color : #FFF7A5 ;
88
+ }
59
89
90
+ #kotak-time-bar {
91
+ position : absolute ;
92
+ top : 0 ;
93
+ height : 5vh ;
94
+ width : 50vw ;
95
+ background-color : #EAE0D4 ;
96
+ left : 50% ;
97
+ margin-left : -25vw ;
98
+ border-radius : 5px ;
99
+ }
100
+
101
+ #kotak-time-bar div {
102
+ height : 100% ;
103
+ text-align : right ;
104
+ padding : 0 10px ;
105
+ line-height : 5vh ;
106
+ width : 0 ;
107
+ background-color : #EF4A4E ;
108
+ box-sizing : border-box ;
109
+ }
110
+
60
111
</style >
61
112
@endsection
62
113
63
114
@section (' body' )
64
115
<div class =" main" >
65
116
<div class =" container text-center" >
66
117
</div >
67
-
68
- <div class =" kotak-soal-1" >
118
+ <div id =" kotak-time-bar" >
119
+ <div ></div >
120
+ </div >
69
121
70
- <div class =" kotak-soal-2" >
71
- <div class =" kotak-soal-3" >
72
- <div class =" soal" >
73
- <h5 ><b >Siapakah nama saya?</b ></h5 >
74
- </div >
122
+ <div class =" kotak-soal-1" >
75
123
76
- <div class =" pilihan-jawaban" >
77
- <div class =" jawaban" >
78
- Dandy
79
- </div >
80
- <div class =" jawaban" >
81
- Randi
82
- </div >
83
- <div class =" jawaban" >
84
- Titut
124
+ <div class =" kotak-soal-2" >
125
+ <div class =" kotak-soal-3" >
126
+
127
+ <form method =" " action =" " id =" jawab-soal" >
128
+ @csrf
129
+
130
+ <div class =" soal" >
131
+ <h5 ><b >Siapakah nama saya?</b ></h5 >
85
132
</div >
86
- <div class =" jawaban" >
87
- Syavira
133
+
134
+ <div class =" pilihan-jawaban" >
135
+ <div class =" jawaban" >
136
+ <p >Dandy</p >
137
+ </div >
138
+ <div class =" jawaban" >
139
+ <p >Randi</p >
140
+ </div >
141
+ <div class =" jawaban" >
142
+ <p >Titut</p >
143
+ </div >
144
+ <div class =" jawaban" >
145
+ <p >Syavira</p >
146
+ </div >
88
147
</div >
148
+
149
+ </form >
150
+
89
151
</div >
90
152
</div >
91
153
</div >
92
- </div >
154
+
155
+
93
156
</div >
94
157
95
158
@endsection
96
159
97
160
@section (' js' )
161
+ <script >
162
+ $ (function (){
163
+ var flag = 0 ;
164
+
165
+ $ (' .jawaban' ).click (function (){
166
+ if (! flag){
167
+ $ (this ).addClass (' clicked' );
168
+
169
+ flag = 1 ;
170
+ }
171
+
172
+ })
173
+ });
174
+
175
+ function progress (timeleft , timetotal , $element ) {
176
+ var progressBarWidth = timeleft * $element .width () / timetotal;
177
+
178
+ $ (' #kotak-time-bar div' ).animate (
179
+ { width: progressBarWidth + ' px' },
180
+ timeleft == timetotal ? 0 : 1000 , ' linear' ).html (timeleft);
181
+ if (timeleft > 0 ) {
182
+
183
+ setTimeout (function () {
184
+ progress (timeleft - 1 , timetotal, $element);
185
+ }, 1000 );
186
+
187
+ }
188
+ };
189
+
190
+ progress (15 , 15 , $ (' #kotak-time-bar' ));
191
+
192
+ </script >
193
+
98
194
@endsection
0 commit comments