Joung Jiwon

css 수정

This diff could not be displayed because it is too large.
...@@ -17,7 +17,8 @@ body { ...@@ -17,7 +17,8 @@ body {
17 margin: 0; 17 margin: 0;
18 padding: 0; 18 padding: 0;
19 overflow-x: hidden; 19 overflow-x: hidden;
20 - font-family:'NanumBarunGothic' 20 + font-family:'NanumBarunGothic';
21 + min-width: 1200px;
21 } 22 }
22 a { 23 a {
23 transition: all 0.3s ease; 24 transition: all 0.3s ease;
...@@ -230,6 +231,78 @@ a:focus { ...@@ -230,6 +231,78 @@ a:focus {
230 background: white; 231 background: white;
231 } 232 }
232 233
234 +/* Dropdown list*/
235 +select{
236 + -webkit-appearance: none; /* 네이티브 외형 감추기 */
237 + -moz-appearance: none;
238 + appearance: none;
239 + display:none;
240 +}
241 +
242 +select::-ms-expand {
243 + display: none;
244 +}
245 +
246 +.custom-select {
247 + position: relative;
248 + font-family: Arial;
249 +}
250 +
251 +.custom-select select {
252 + display: none; /*hide original SELECT element:*/
253 +}
254 +
255 +.select-selected {
256 + background-color: white;
257 +}
258 +
259 +/*style the arrow inside the select element:*/
260 +.select-selected:after {
261 + position: absolute;
262 + content: "";
263 + top: 14px;
264 + right: 10px;
265 + width: 0;
266 + height: 0;
267 + border: 6px solid transparent;
268 + border-color: #fff transparent transparent transparent;
269 +}
270 +
271 +/*point the arrow upwards when the select box is open (active):*/
272 +.select-selected.select-arrow-active:after {
273 + border-color: transparent transparent #fff transparent;
274 + top: 7px;
275 +}
276 +
277 +/*style the items (options), including the selected item:*/
278 +.select-items div,.select-selected {
279 + color: #333; font-size:15px;
280 + text-align: center;
281 + border: 1px solid transparent;
282 + border-color: transparent transparent rgba(0, 0, 0, 0.1) transparent;
283 + cursor: pointer;
284 + user-select: none;
285 +}
286 +
287 +/*style items (options):*/
288 +.select-items {
289 + position: absolute;
290 + background-color:white;
291 + top: 100%;
292 + left: 0;
293 + right: 0;
294 + z-index: 99;
295 +}
296 +
297 +/*hide the items when the select box is closed:*/
298 +.select-hide {
299 + display: none;
300 +}
301 +
302 +.select-items div:hover, .same-as-selected {
303 + background-color: rgba(0, 0, 0, 0.1);
304 +}
305 +
233 /* Introduction */ 306 /* Introduction */
234 307
235 .tm-section-title { 308 .tm-section-title {
...@@ -298,7 +371,7 @@ a:focus { ...@@ -298,7 +371,7 @@ a:focus {
298 select::-ms-expand { 371 select::-ms-expand {
299 display: none; 372 display: none;
300 } 373 }
301 -출처: https://doolyit.tistory.com/126 [동해둘리의 IT Study] 374 +
302 input{ 375 input{
303 border-radius:5px; 376 border-radius:5px;
304 } 377 }
...@@ -309,6 +382,7 @@ input{ ...@@ -309,6 +382,7 @@ input{
309 margin-top:40px; 382 margin-top:40px;
310 border:none; 383 border:none;
311 border-radius:5px; 384 border-radius:5px;
385 + color : -internal-light-dark(black, white);
312 } 386 }
313 387
314 #map-answer{ 388 #map-answer{
......
...@@ -94,8 +94,9 @@ ...@@ -94,8 +94,9 @@
94 </div> 94 </div>
95 <div class="container question-field"> 95 <div class="container question-field">
96 <div class="question-text">몇 학년인가요?</div> 96 <div class="question-text">몇 학년인가요?</div>
97 - <div class="question-input"> 97 + <div class="custom-select" style="width:208px; margin-right:42px">
98 - <select name="semester" id="semester"> 98 + <select>
99 + <option value="0">1학년 1학기</option>
99 <option value="sem-1-1">1학년 1학기</option> 100 <option value="sem-1-1">1학년 1학기</option>
100 <option value="sem-1-2">1학년 2학기</option> 101 <option value="sem-1-2">1학년 2학기</option>
101 <option value="sem-2-1">2학년 1학기</option> 102 <option value="sem-2-1">2학년 1학기</option>
...@@ -115,12 +116,136 @@ ...@@ -115,12 +116,136 @@
115 <br> 116 <br>
116 117
117 <div id="map" style="width:700px;height:700px;"></div> 118 <div id="map" style="width:700px;height:700px;"></div>
118 -<script> 119 + <div class="answer-field">
119 -var btn = document.querySelector('button'); 120 + 한번 갈 때마다 ...<br>
121 + <span class="answer-highlight">n</span> 시간 <span class="answer-highlight">n</span><br>
122 + <span class="answer-highlight">n</span><br>
123 + </div>
124 + </div>
125 + <div class="row">
126 + <div id="list-answer">
127 + <div class="answer-field" id="answer-how-many-hours">
128 + 지금까지 <span class="answer-highlight" id="since">?</span>시간을 길에서 보내셨군요<br>
129 + 졸업까지 앞으로 <span class="answer-highlight" id="until">?</span>시간은 더 길에서 보내시면 됩니다.<br>
130 + </div>
131 + </div>
132 + </div>
133 + <div class="row">
134 + <div class="answer-detail-question">
135 + 이 시간에 알바를 했다면? <br>
136 + 교통비로 국밥 <br>
137 + 이 거리라면 에베레스트 등반을 <br>
138 + 지구를
139 + </div>
140 + <div class="answer-detail-answer">
141 + <span id = "salary">?</span><br>
142 + <span id = "dish">?</span>그릇<br>
143 + <span id = "everest">?</span>번이나...<br>
144 + <span id = "earth">?</span>바퀴나 돌아요<br><br><br>
145 + </div>
146 + </div>
147 + </div>
148 + <footer class="text-center small tm-footer">
149 + <p class="mb-0">
150 + Copyright &copy; 2020 TongGilMut
151 +
152 + - Design: <a rel="nofollow" href="https://github.com/wjdwl001" class="tm-footer-link">Joung Jiwon</a>
153 + </p>
154 + </footer>
155 + </section>
156 +
157 +
158 + <script src="js/jquery-1.9.1.min.js"></script>
159 + <script src="slick/slick.min.js"></script>
160 + <script src="magnific-popup/jquery.magnific-popup.min.js"></script>
161 + <script src="js/jquery.singlePageNav.min.js"></script>
162 + <script src="js/bootstrap.min.js"></script>
163 + <script> //dropdown list
164 + var x, i, j, l, ll, selElmnt, a, b, c;
165 + /*look for any elements with the class "custom-select":*/
166 + x = document.getElementsByClassName("custom-select");
167 + l = x.length;
168 + for (i = 0; i < l; i++) {
169 + selElmnt = x[i].getElementsByTagName("select")[0];
170 + ll = selElmnt.length;
171 + /*for each element, create a new DIV that will act as the selected item:*/
172 + a = document.createElement("DIV");
173 + a.setAttribute("class", "select-selected");
174 + a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;
175 + x[i].appendChild(a);
176 + /*for each element, create a new DIV that will contain the option list:*/
177 + b = document.createElement("DIV");
178 + b.setAttribute("class", "select-items select-hide");
179 + for (j = 1; j < ll; j++) {
180 + /*for each option in the original select element,
181 + create a new DIV that will act as an option item:*/
182 + c = document.createElement("DIV");
183 + c.innerHTML = selElmnt.options[j].innerHTML;
184 + c.addEventListener("click", function(e) {
185 + /*when an item is clicked, update the original select box,
186 + and the selected item:*/
187 + var y, i, k, s, h, sl, yl;
188 + s = this.parentNode.parentNode.getElementsByTagName("select")[0];
189 + sl = s.length;
190 + h = this.parentNode.previousSibling;
191 + for (i = 0; i < sl; i++) {
192 + if (s.options[i].innerHTML == this.innerHTML) {
193 + s.selectedIndex = i;
194 + h.innerHTML = this.innerHTML;
195 + y = this.parentNode.getElementsByClassName("same-as-selected");
196 + yl = y.length;
197 + for (k = 0; k < yl; k++) {
198 + y[k].removeAttribute("class");
199 + }
200 + this.setAttribute("class", "same-as-selected");
201 + break;
202 + }
203 + }
204 + h.click();
205 + });
206 + b.appendChild(c);
207 + }
208 + x[i].appendChild(b);
209 + a.addEventListener("click", function(e) {
210 + /*when the select box is clicked, close any other select boxes,
211 + and open/close the current select box:*/
212 + e.stopPropagation();
213 + closeAllSelect(this);
214 + this.nextSibling.classList.toggle("select-hide");
215 + this.classList.toggle("select-arrow-active");
216 + });
217 + }
218 + function closeAllSelect(elmnt) {
219 + /*a function that will close all select boxes in the document,
220 + except the current select box:*/
221 + var x, y, i, xl, yl, arrNo = [];
222 + x = document.getElementsByClassName("select-items");
223 + y = document.getElementsByClassName("select-selected");
224 + xl = x.length;
225 + yl = y.length;
226 + for (i = 0; i < yl; i++) {
227 + if (elmnt == y[i]) {
228 + arrNo.push(i)
229 + } else {
230 + y[i].classList.remove("select-arrow-active");
231 + }
232 + }
233 + for (i = 0; i < xl; i++) {
234 + if (arrNo.indexOf(i)) {
235 + x[i].classList.add("select-hide");
236 + }
237 + }
238 + }
239 + /*if the user clicks anywhere outside the select box,
240 + then close all select boxes:*/
241 + document.addEventListener("click", closeAllSelect);
242 + </script>
243 + <script> //API
244 + var btn = document.querySelector('button');
120 245
121 -btn.addEventListener('click', updateBtn); 246 + btn.addEventListener('click', updateBtn);
122 247
123 -function updateBtn() { 248 + function updateBtn() {
124 var start = document.getElementById('start').value; 249 var start = document.getElementById('start').value;
125 var end = document.getElementById('end').value; 250 var end = document.getElementById('end').value;
126 naver.maps.Service.geocode({ 251 naver.maps.Service.geocode({
...@@ -253,53 +378,9 @@ function updateBtn() { ...@@ -253,53 +378,9 @@ function updateBtn() {
253 } 378 }
254 }); 379 });
255 }); 380 });
256 -} 381 + }
257 -</script> 382 + </script>
258 - 383 + <script> //값 계산
259 -
260 - <div class="answer-field">
261 - 한번 갈 때마다 ...<br>
262 - <span class="answer-highlight">n</span> 시간 <span class="answer-highlight">n</span><br>
263 - <span class="answer-highlight">n</span><br>
264 - </div>
265 - </div>
266 - <div class="row">
267 - <div id="list-answer">
268 - <div class="answer-field" id="answer-how-many-hours">
269 - 지금까지 <span class="answer-highlight" id="since">?</span>시간을 길에서 보내셨군요<br>
270 - 졸업까지 앞으로 <span class="answer-highlight" id="until">?</span>시간은 더 길에서 보내시면 됩니다.<br>
271 - </div>
272 - </div>
273 - </div>
274 - <div class="row">
275 - <div class="answer-detail-question">
276 - 이 시간에 알바를 했다면? <br>
277 - 교통비로 국밥 <br>
278 - 이 거리라면 에베레스트 등반을 <br>
279 - 지구를
280 - </div>
281 - <div class="answer-detail-answer">
282 - <span id = "salary">?</span><br>
283 - <span id = "dish">?</span>그릇<br>
284 - <span id = "everest">?</span>번이나...<br>
285 - <span id = "earth">?</span>바퀴나 돌아요<br><br><br>
286 - </div>
287 - </div>
288 - </div>
289 - <footer class="text-center small tm-footer">
290 - <p class="mb-0">
291 - Copyright &copy; 2020 TongGilMut
292 -
293 - - Design: <a rel="nofollow" href="https://github.com/wjdwl001" class="tm-footer-link">Joung Jiwon</a>
294 - </p>
295 - </footer>
296 - </section>
297 - <script src="js/jquery-1.9.1.min.js"></script>
298 - <script src="slick/slick.min.js"></script>
299 - <script src="magnific-popup/jquery.magnific-popup.min.js"></script>
300 - <script src="js/jquery.singlePageNav.min.js"></script>
301 - <script src="js/bootstrap.min.js"></script>
302 - <script>
303 $('button-calculate').click(function () { 384 $('button-calculate').click(function () {
304 385
305 }) 386 })
...@@ -499,11 +580,11 @@ function updateBtn() { ...@@ -499,11 +580,11 @@ function updateBtn() {
499 slidesToShow: 1, 580 slidesToShow: 1,
500 slidesToScroll: 1 581 slidesToScroll: 1
501 } 582 }
502 - } 583 + }]
503 - ]
504 }); 584 });
505 }); 585 });
506 </script> 586 </script>
587 +
507 </body> 588 </body>
508 589
509 </html> 590 </html>
......