From e4c8539b2ad01226b78446751bd0497d97ad11e0 Mon Sep 17 00:00:00 2001 From: adyjs Date: Sat, 21 Nov 2020 23:07:32 +0800 Subject: [PATCH 1/4] Changes to be committed: modified: index.html 1. add new algorithm , odd-even sorting algorithm 2. add odd-even-sort.js file in bottom of index.html new file: js/odd_even_sort.js 1. add new odd-even sorting algorithm content modified: js/test.js 1. add try catch syntax in algoChosen() function 2. add OddEvenSort value 3. add , if algoChosen() error, then window alert pops up, notices user to press F5 to refresh page. --- index.html | 4 ++- js/odd_even_sort.js | 85 +++++++++++++++++++++++++++++++++++++++++++++ js/test.js | 68 +++++++++++++++++++++--------------- 3 files changed, 128 insertions(+), 29 deletions(-) create mode 100644 js/odd_even_sort.js diff --git a/index.html b/index.html index 7a3742b..cc76f82 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@ + @@ -74,7 +75,7 @@ - + @@ -82,6 +83,7 @@ + \ No newline at end of file diff --git a/js/odd_even_sort.js b/js/odd_even_sort.js new file mode 100644 index 0000000..8eaf897 --- /dev/null +++ b/js/odd_even_sort.js @@ -0,0 +1,85 @@ +'strict' + +class OddEvenSort extends SortingBase{ + constructor(){ + super(); + } + + splitTime = 1000; + + setSplitTime(mspf){ + if(mspf <3){ + this.splitTime = 1; + return; + } + this.splitTime = mspf /3; + } + + static async run(one, sleep, endingPose){ + let temp; + let isAllSorted; + one.setSplitTime(one.milliSecPerFrame) + + isAllSorted = 0; + + while(1){ + for(let i=0 ; i one.blockBox[i+1].value){ + temp = one.blockBox[i]; + one.blockBox[i] = one.blockBox[i+1]; + one.blockBox[i+1] = temp; + isAllSorted++; + } + + one.checkCompareColoring(one.blockBox[i] , one.blockBox[i+1]); + one.fillStageWithBlocks(); + await sleep(one.splitTime); + + one.doneCompareColoring(one.blockBox[i] , one.blockBox[i+1]); + one.fillStageWithBlocks(); + await sleep(one.splitTime); + + } + }; + if(!isAllSorted){break;} + isAllSorted = 0; + for(let i=1 ; i one.blockBox[i+1].value){ + temp = one.blockBox[i]; + one.blockBox[i] = one.blockBox[i+1]; + one.blockBox[i+1] = temp; + isAllSorted++; + } + + one.checkCompareColoring(one.blockBox[i] , one.blockBox[i+1]); + one.fillStageWithBlocks(); + await sleep(one.splitTime); + + one.doneCompareColoring(one.blockBox[i] , one.blockBox[i+1]); + one.fillStageWithBlocks(); + await sleep(one.splitTime); + } + }; + if(!isAllSorted){break;} + isAllSorted = 0; + } + + endingPose(one, sleep) + + console.log('done') + } + +} \ No newline at end of file diff --git a/js/test.js b/js/test.js index d3f1ac0..4414727 100644 --- a/js/test.js +++ b/js/test.js @@ -30,36 +30,48 @@ window.onload = function(){ function algoChosen(){ - algo = algoSelector.value; - if(algo === null || algo === 'none'){ - clearInputDashBoard(); - allDisable([algoSelector]); - } - else{ - if(algo === 'BubbleSort'){ - one = new BubbleSort(); - classOne = BubbleSort; - } - else if(algo === 'SelectionSort'){ - one = new SelectionSort(); - classOne = SelectionSort; - } - else if(algo === 'ExchangeSort'){ - one = new ExchangeSort(); - classOne = ExchangeSort; - } - else if(algo === 'InsertionSort'){ - one = new InsertionSort(); - classOne = InsertionSort; + try{ + + algo = algoSelector.value; + if(algo === null || algo === 'none'){ + clearInputDashBoard(); + allDisable([algoSelector]); } - else if(algo === 'ShakerSort'){ - one = new ShakerSort(); - classOne = ShakerSort; + else{ + if(algo === 'BubbleSort'){ + one = new BubbleSort(); + classOne = BubbleSort; + } + else if(algo === 'SelectionSort'){ + one = new SelectionSort(); + classOne = SelectionSort; + } + else if(algo === 'ExchangeSort'){ + one = new ExchangeSort(); + classOne = ExchangeSort; + } + else if(algo === 'InsertionSort'){ + one = new InsertionSort(); + classOne = InsertionSort; + } + else if(algo === 'ShakerSort'){ + one = new ShakerSort(); + classOne = ShakerSort; + } + else if(algo === 'OddEvenSort'){ + one = new OddEvenSort(); + classOne = OddEvenSort; + } + else{ + window.alert('演算法系統錯誤,\n請按 F5 重新整理系統,再次使用。'); + // refresh(); + } + + allEnable([goBtn]) } - - allEnable([goBtn]) } - + catch(e){ + } } function clearInputDashBoard(){ @@ -121,7 +133,7 @@ function inputInvalid(entryNum , mspfNum){ } return false; } - + function prepareForRun(){ one.entryNum = isCountInputValid( parseInt(countInput.value, 10) ); one.milliSecPerFrame = isMspfInputValid( parseInt(mspfInput.value, 10)); From 8da5adc31749bea296d8d23b427f491b629ca3ff Mon Sep 17 00:00:00 2001 From: adyjs Date: Sun, 22 Nov 2020 07:40:41 +0800 Subject: [PATCH 2/4] Revert "layout modified" This reverts commit 9dc1250be2af6c7082bdaf42c5426c8a5d9fd551. I made wrong commit on rwd-layout branch, so now revert it. --- css/RWD_index.css | 399 ++++++++++++++++++++++ css/index.css | 816 ++++++++++----------------------------------- index.html | 14 +- less/index.less | 825 +++++++++------------------------------------- 4 files changed, 739 insertions(+), 1315 deletions(-) create mode 100644 css/RWD_index.css diff --git a/css/RWD_index.css b/css/RWD_index.css new file mode 100644 index 0000000..656ffb2 --- /dev/null +++ b/css/RWD_index.css @@ -0,0 +1,399 @@ + +@media screen and (min-width: 320px) and (max-width: 479px){ + + header h1{ + font-size: 20px; + } + section article#stage{ + height:65%; + } + section article#dashboard{ + position: relative; + height:35%; + } + + section article#dashboard label, + section article#dashboard select, + section article#dashboard input, + section article#dashboard button{ + margin:0; + height:20%; + width:40%; + font-size:16px; + } + + + section article#dashboard label#algo_label{ + display:none; + position: absolute; + top:0; + left:5%; + } + + section article#dashboard select#algo{ + position: absolute; + top:5%; + left:5%; + } + + section article#dashboard label#count_label{ + display:none; + position: absolute; + bottom:10%; + left:5%; + } + + section article#dashboard input#count{ + position: absolute; + top:30%; + left:5%; + font-size: 16px; + } + + section article#dashboard label#mspf_label{ + display:none; + position: absolute; + + } + + section article#dashboard input#mspf{ + position: absolute; + top:55%; + font-size: 16px; + } + + section article#dashboard button#prepare{ + position: absolute; + top:30%; + right:5%; + } + section article#dashboard button#go{ + position: absolute; + top:5%; + right:5%; + } + section article#dashboard button#reset{ + position: absolute; + top:55%; + right:5%; + width:20%; + } + + section article#dashboard label#err{ + display:block; + position: absolute; + height:20%; + width:40%; + top:80%; + left:5%; + color:red; + font-size: 16px; + } + + footer h6{ + text-align:center; + line-height:20px; + font-size:14px; + font-weight:100; + } + + +} + + +@media screen and (min-width: 480px) and (max-width: 639px){ + header h1{ + font-size: 20px; + } + section article#stage{ + height:65%; + } + section article#dashboard{ + position: relative; + height:35%; + } + + section article#dashboard label, + section article#dashboard select, + section article#dashboard input, + section article#dashboard button{ + margin:0; + height:20%; + width:40%; + font-size:16px; + } + + + section article#dashboard label#algo_label{ + display:none; + position: absolute; + top:0; + left:5%; + } + + section article#dashboard select#algo{ + position: absolute; + top:5%; + left:5%; + } + + section article#dashboard label#count_label{ + display:none; + position: absolute; + bottom:10%; + left:5%; + } + + section article#dashboard input#count{ + position: absolute; + top:30%; + left:5%; + font-size: 16px; + } + + section article#dashboard label#mspf_label{ + display:none; + position: absolute; + + } + + section article#dashboard input#mspf{ + position: absolute; + top:55%; + font-size: 16px; + } + + section article#dashboard button#prepare{ + position: absolute; + top:30%; + right:5%; + } + section article#dashboard button#go{ + position: absolute; + top:5%; + right:5%; + } + section article#dashboard button#reset{ + position: absolute; + top:55%; + right:5%; + width:20%; + } + + section article#dashboard label#err{ + display:block; + position: absolute; + height:20%; + width:40%; + top:80%; + left:5%; + color:red; + font-size: 16px; + } + + footer h6{ + text-align:center; + line-height:20px; + font-size:14px; + font-weight:100; + } +} + + +@media screen and (min-width: 640px) and (max-width: 767px){ + header h1{ + font-size: 26px; + } + section article#stage{ + height:65%; + } + section article#dashboard{ + position: relative; + height:35%; + } + + section article#dashboard label, + section article#dashboard select, + section article#dashboard input, + section article#dashboard button{ + margin:0; + height:20%; + width:40%; + font-size:22px; + } + + + section article#dashboard label#algo_label{ + display:none; + position: absolute; + top:0; + left:5%; + } + + section article#dashboard select#algo{ + position: absolute; + top:5%; + left:5%; + } + + section article#dashboard label#count_label{ + display:none; + position: absolute; + bottom:10%; + left:5%; + } + + section article#dashboard input#count{ + position: absolute; + top:30%; + left:5%; + font-size: 22px; + } + + section article#dashboard label#mspf_label{ + display:none; + position: absolute; + + } + + section article#dashboard input#mspf{ + position: absolute; + top:55%; + font-size: 22px; + } + + section article#dashboard button#prepare{ + position: absolute; + top:30%; + right:5%; + } + section article#dashboard button#go{ + position: absolute; + top:5%; + right:5%; + } + section article#dashboard button#reset{ + position: absolute; + top:55%; + right:5%; + width:20%; + } + + section article#dashboard label#err{ + display:block; + position: absolute; + height:20%; + width:40%; + top:80%; + left:5%; + color:red; + font-size: 22px; + } + + footer h6{ + text-align:center; + line-height:26px; + font-size:20px; + font-weight:100; + } +} + + + +@media screen and (min-width: 768px) and (max-width: 1023px){ + header h1{ + font-size: 34px; + } + section article#stage{ + height:65%; + } + section article#dashboard{ + position: relative; + height:35%; + } + + section article#dashboard label, + section article#dashboard select, + section article#dashboard input, + section article#dashboard button{ + margin:0; + height:20%; + width:40%; + font-size:30px; + } + + + section article#dashboard label#algo_label{ + display:none; + position: absolute; + top:0; + left:5%; + } + + section article#dashboard select#algo{ + position: absolute; + top:5%; + left:5%; + } + + section article#dashboard label#count_label{ + display:none; + position: absolute; + bottom:10%; + left:5%; + } + + section article#dashboard input#count{ + position: absolute; + top:30%; + left:5%; + font-size: 30px; + } + + section article#dashboard label#mspf_label{ + display:none; + position: absolute; + + } + + section article#dashboard input#mspf{ + position: absolute; + top:55%; + font-size: 30px; + } + + section article#dashboard button#prepare{ + position: absolute; + top:30%; + right:5%; + } + section article#dashboard button#go{ + position: absolute; + top:5%; + right:5%; + } + section article#dashboard button#reset{ + position: absolute; + top:55%; + right:5%; + width:20%; + } + + section article#dashboard label#err{ + display:block; + position: absolute; + height:20%; + width:40%; + top:80%; + left:5%; + color:red; + font-size: 30px; + } + + footer h6{ + text-align:center; + line-height:30px; + font-size:24px; + font-weight:100; + } +} diff --git a/css/index.css b/css/index.css index 7918130..f886167 100644 --- a/css/index.css +++ b/css/index.css @@ -1,7 +1,7 @@ * { margin: 0; padding: 0; - font-size: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + font-size: sans-serif; box-sizing: border-box; -o-box-sizing: border-box; -moz-box-sizing: border-box; @@ -24,13 +24,13 @@ body .main-container { body .main-container #stage { border: #888 solid 2px; background-color: #4a4a4a; - width: 85%; + width: 90%; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: flex-end; - padding: 80px 50px; + padding: 3% 5%; } body .main-container #stage .img-container { width: 80px; @@ -54,7 +54,7 @@ body .main-container #stage li { } body .main-container #dashboard { font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - width: 15%; + width: 10%; background-color: #4a4a4a; display: flex; flex-direction: column; @@ -164,638 +164,176 @@ body .main-container #dashboard .footer-container .footer-copyright { padding: 10px; text-align: center; } -@media screen and (max-width: 1200px) { - body .main-container { - width: 100%; - height: 100%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - } - body .main-container #stage { - border: #888 solid 2px; - background-color: #4a4a4a; - width: 85%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding: 80px 50px; - } - body .main-container #stage .img-container { - width: 80px; - height: 100%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - } - body .main-container #stage .img-container .initial-img { - width: 80px; - height: 80px; - transform: rotate(-90deg); - } - body .main-container #stage li { - background-color: #00ffff; - width: 100%; - list-style-type: none; - border: #000 dotted 0.1px; - } - body .main-container #dashboard { - font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - width: 15%; - background-color: #4a4a4a; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - } - body .main-container #dashboard .algo-selector-container { - width: 100%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .algo-selector-container .algo-label { - font-size: 14px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .algo-selector-container .selector-container { - width: 100%; - background-color: #333; - padding: 10px 0; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector { - border: none; - width: 100%; - color: white; - background-color: #333; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { - outline: none; - } - body .main-container #dashboard .algo-selector-container .selector-container .options { - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container { - width: 100%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .count-input-container .count-label { - font-size: 14px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .count-input-container .count-input { - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container .count-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .mspf-input-container { - width: 100%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .mspf-input-container .mspf-label { - font-size: 14px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .mspf-input-container .mspf-input { - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .mspf-input-container .mspf-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag { - width: 80%; - margin: 0 auto; - border-radius: 10px; - padding: 6px 4px; - font-size: 16px; - color: white; - background-color: #333; - margin-top: 10px; - } - body .main-container #dashboard .btn-tag:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag:disabled:hover { - cursor: not-allowed; - } - body .main-container #dashboard .btn-tag:hover { - cursor: pointer; - } - body .main-container #dashboard .footer-container { - width: 100%; - margin-top: auto; - } - body .main-container #dashboard .footer-container .footer-copyright { - color: white; - font-size: 16px; - padding: 10px; - text-align: center; - } -} -@media screen and (max-width: 900px) { - body .main-container { - width: 100%; - height: 100%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - } - body .main-container #stage { - border: #888 solid 2px; - background-color: #4a4a4a; - width: 85%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding: 80px 50px; - } - body .main-container #stage .img-container { - width: 70px; - height: 100%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - } - body .main-container #stage .img-container .initial-img { - width: 70px; - height: 70px; - transform: rotate(-90deg); - } - body .main-container #stage li { - background-color: #00ffff; - width: 100%; - list-style-type: none; - border: #000 dotted 0.1px; - } - body .main-container #dashboard { - font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - width: 15%; - background-color: #4a4a4a; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - } - body .main-container #dashboard .algo-selector-container { - width: 100%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .algo-selector-container .algo-label { - font-size: 13px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .algo-selector-container .selector-container { - width: 100%; - background-color: #333; - padding: 10px 0; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector { - font-size: 13px; - border: none; - width: 100%; - color: white; - background-color: #333; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { - outline: none; - } - body .main-container #dashboard .algo-selector-container .selector-container .options { - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container { - width: 100%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .count-input-container .count-label { - font-size: 13px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .count-input-container .count-input { - font-size: 13px; - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container .count-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .mspf-input-container { - width: 100%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .mspf-input-container .mspf-label { - font-size: 13px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .mspf-input-container .mspf-input { - font-size: 13px; - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .mspf-input-container .mspf-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag { - width: 80%; - margin: 0 auto; - border-radius: 10px; - padding: 6px 4px; - font-size: 13px; - color: white; - background-color: #333; - margin-top: 10px; - } - body .main-container #dashboard .btn-tag:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag:disabled:hover { - cursor: not-allowed; - } - body .main-container #dashboard .btn-tag:hover { - cursor: pointer; - } - body .main-container #dashboard .footer-container { - width: 100%; - margin-top: auto; - } - body .main-container #dashboard .footer-container .footer-copyright { - color: white; - font-size: 13px; - padding: 10px; - text-align: center; - } -} -@media screen and (max-width: 700px) { - body { - background-color: #4a4a4a; - } - body .main-container { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - } - body .main-container #stage { - border: none; - background-color: #4a4a4a; - width: 100%; - height: 420px; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding: 50px 20px; - } - body .main-container #stage .img-container { - width: 70px; - height: 100%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - } - body .main-container #stage .img-container .initial-img { - width: 70px; - height: 70px; - transform: rotate(-90deg); - } - body .main-container #stage li { - background-color: #00ffff; - width: 100%; - list-style-type: none; - border: #000 dotted 0.1px; - } - body .main-container #dashboard { - font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - width: 100%; - background-color: #4a4a4a; - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - body .main-container #dashboard .algo-selector-container { - width: 33.33%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .algo-selector-container .algo-label { - font-size: 10px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .algo-selector-container .selector-container { - width: 100%; - background-color: #333; - padding: 10px 0; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector { - font-size: 13px; - border: none; - width: 100%; - color: white; - background-color: #333; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { - outline: none; - } - body .main-container #dashboard .algo-selector-container .selector-container .options { - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container { - width: 33.33%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .count-input-container .count-label { - font-size: 10px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .count-input-container .count-input { - font-size: 13px; - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container .count-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .mspf-input-container { - width: 33.33%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .mspf-input-container .mspf-label { - font-size: 10px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .mspf-input-container .mspf-input { - font-size: 13px; - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .mspf-input-container .mspf-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag { - width: 33.333%; - margin: 0 auto; - border-radius: 0; - padding: 6px 4px; - font-size: 17px; - color: white; - background-color: #333; - margin: 0; - } - body .main-container #dashboard .btn-tag:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag:disabled:hover { - cursor: not-allowed; - } - body .main-container #dashboard .btn-tag:hover { - cursor: pointer; - } - body .main-container #dashboard .footer-container { - display: none; - width: 100%; - margin-top: auto; - } - body .main-container #dashboard .footer-container .footer-copyright { - color: white; - font-size: 13px; - padding: 10px; - text-align: center; - } -} -@media screen and (max-width: 500px) { - body { - background-color: #4a4a4a; - } - body .main-container { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - } - body .main-container #stage { - border: none; - background-color: #4a4a4a; - width: 100%; - height: 420px; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding: 50px 20px; - } - body .main-container #stage .img-container { - width: 70px; - height: 100%; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - } - body .main-container #stage .img-container .initial-img { - width: 70px; - height: 70px; - transform: rotate(-90deg); - } - body .main-container #stage li { - background-color: #00ffff; - width: 100%; - list-style-type: none; - border: #000 dotted 0.1px; - } - body .main-container #dashboard { - font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - width: 100%; - background-color: #4a4a4a; - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - body .main-container #dashboard .algo-selector-container { - width: 33.33%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .algo-selector-container .algo-label { - font-size: 10px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .algo-selector-container .selector-container { - width: 100%; - background-color: #333; - padding: 10px 0; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector { - font-size: 13px; - border: none; - width: 100%; - color: white; - background-color: #333; - } - body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { - outline: none; - } - body .main-container #dashboard .algo-selector-container .selector-container .options { - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container { - width: 33.33%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .count-input-container .count-label { - font-size: 10px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .count-input-container .count-input { - font-size: 13px; - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .count-input-container .count-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .mspf-input-container { - width: 33.33%; - margin-bottom: 1px; - border: #ccc solid 2px; - } - body .main-container #dashboard .mspf-input-container .mspf-label { - font-size: 10px; - display: block; - color: white; - background-color: #6a6a6a; - padding: 6px 0; - text-align: center; - } - body .main-container #dashboard .mspf-input-container .mspf-input { - font-size: 13px; - width: 100%; - padding: 10px 0 10px 10px; - color: white; - background-color: #333; - } - body .main-container #dashboard .mspf-input-container .mspf-input:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag { - width: 33.333%; - margin: 0 auto; - border-radius: 0; - padding: 6px 4px; - font-size: 15px; - color: white; - background-color: #333; - margin: 0; - } - body .main-container #dashboard .btn-tag:disabled { - background-color: #ccc; - } - body .main-container #dashboard .btn-tag:disabled:hover { - cursor: not-allowed; - } - body .main-container #dashboard .btn-tag:hover { - cursor: pointer; - } - body .main-container #dashboard .footer-container { - display: none; - width: 100%; - margin-top: auto; - } - body .main-container #dashboard .footer-container .footer-copyright { - color: white; - font-size: 13px; - padding: 10px; - text-align: center; - } -} +/* + +* { + + +} +html,body{ + width:100%; + height:100%; +} +header{ + background: linear-gradient(to top, #000 , #333 , #555 , #777); + display:flex; + align-items:center; +} + +header h1{ + font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + font-weight:100; + letter-spacing: 3px; + font-size:26px; + margin: 0 auto; + padding:10px 0; + color:white; + +} + +section{ + border:#333 solid 1px; + height:90%; + width:100%; + background-color:#3e3e3e; +} + +section article#stage{ + display:flex; + align-items:center; + height:90%; + overflow: hidden; + padding:1% 5%; + align-items:flex-end; + + +} +section article div.img-container{ + width:100%; + height:100%; + display:flex; + align-items: center; +} + +section article#stage img{ + transform:rotate(-90deg); + margin:0 auto; + width:90px; +} +section article#stage li{ + list-style-type:none; + width:100%; + float:left; + background-color:#ffe4e1; + outline:thin #000 dotted; +} + +section article#stage li.sorted{ + background-color: #86f67c; +} + +section article#dashboard{ + + width:100%; + height:5%; + padding:0 5%; +} +section article#dashboard select, +section article#dashboard input, +section article#dashboard button{ + margin-right:1%; +} + + +section article#dashboard select{ + width:13%; + height:100%; + padding:0 0 0 0.5%; + + -o-transition:all 0.5s; + -moz-transition:all 0.5s; + -webkit-transition:all 0.5s; + transition:all 0.5s; +} +section article#dashboard input{ + font-size:11px; + width:10%; + height:100%; + padding:0 0 0 0.5%; + + + -o-transition:all 0.5s; + -moz-transition:all 0.5s; + -webkit-transition:all 0.5s; + transition:all 0.5s; +} + +section article#dashboard button{ + border:none; + background-color: lightgrey; + border-radius: 5px; + cursor:pointer; + width:10%; + height:100%; + + -o-transition:all 0.5s; + -moz-transition:all 0.5s; + -webkit-transition:all 0.5s; + transition:all 0.5s; +} + +section article#dashboard button#prepare{ +} +section article#dashboard button#go{ +} +section article#dashboard button#reset{ + background-color:#ffe901; + color:#000; + float:right; + margin:0; + + -o-transition-duration:0.3s; + -moz-transition-duration:0.3s; + -o-webkittransition-duration:0.3s; + transition-duration:0.3s; +} +section article#dashboard button#reset:hover{ + background-color: #ffff00; + box-shadow:1px 1px 10px 2px #b2a300; + color:#000; + font-weight: 600; + float:right; + margin:0; +} + +section article#dashboard label#err{ + position: absolute; + color:red; + font-size: 12px; + bottom:10%; + left:28.8%; +} + +section article#dashboard .unset_value{ + border:red solid 1px; +} +section article#dashboard .done_value{ + border:#86f67c solid 1px; +} + +section article#dashboard .done_button{ + background-color:#86f67c; + color:#fff; +} + + +footer{ + height:2%; + padding:0 5%; +} + +footer h6{ + text-align:right; +} + +*/ diff --git a/index.html b/index.html index cc76f82..4aa4812 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,16 @@ + + + +
@@ -38,9 +46,9 @@ id="count" type="number" disabled="true" - placeholder="5 ~ 300" + placeholder="5 ~ 500" min="5" - max="300"> + max="500"> @@ -57,11 +65,11 @@ + -
diff --git a/less/index.less b/less/index.less index cd7c459..b346e9e 100644 --- a/less/index.less +++ b/less/index.less @@ -4,7 +4,7 @@ *{ margin:0; padding:0; - font-size: @font; + font-size: sans-serif; box-sizing: border-box; -o-box-sizing: border-box; -moz-box-sizing: border-box; @@ -30,14 +30,13 @@ body{ #stage{ border:#888 solid 2px; background-color:#4a4a4a; - width:85%; + width:90%; display:flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: flex-end; - padding:80px 50px; - + padding:3% 5%; .img-container{ width:80px; height:100%; @@ -61,7 +60,7 @@ body{ } #dashboard{ font-family:@font; - width:15%; + width:10%; background-color:#4a4a4a; display:flex; flex-direction: column; @@ -111,6 +110,7 @@ body{ text-align:center; } .count-input{ + width:100%; padding:10px 0 10px 10px; color:white; @@ -144,6 +144,7 @@ body{ } } + .btn-tag{ width:80%; margin:0 auto; @@ -179,698 +180,176 @@ body{ } } +/* -@media screen and (max-width:1200px){ - body{ - .main-container{ - width:100%; - height:100%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - - #stage{ - border:#888 solid 2px; - background-color:#4a4a4a; - width:85%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding:80px 50px; - - .img-container{ - width:80px; - height:100%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - .initial-img{ - width:80px; - height:80px; - transform: rotate(-90deg); - } - } - li{ - background-color:#00ffff; - width:100%; - list-style-type: none; - border:#000 dotted 0.1px; - } - } - #dashboard{ - font-family:@font; - width:15%; - background-color:#4a4a4a; - display:flex; - flex-direction: column; - flex-wrap: nowrap; - .algo-selector-container{ - width:100%; - margin-bottom:1px; - border:#ccc solid 2px; - .algo-label{ - font-size:14px; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .selector-container{ - width:100%; - background-color:#333; - padding:10px 0; - - .selector{ - border:none; - width:100%; - color:white; - background-color:#333; - &:focus{ - outline:none; - } - } - .options{ - color:white; - background-color:#333; - } - } - } - .count-input-container{ - width:100%; - margin-bottom:1px; - border:#ccc solid 2px; - .count-label{ - font-size:14px; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .count-input{ - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } - .mspf-input-container{ - width:100%; - margin-bottom:1px; - border:#ccc solid 2px; - .mspf-label{ - font-size:14px; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .mspf-input{ - - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } - - - .btn-tag{ - width:80%; - margin:0 auto; - border-radius:10px; - padding:6px 4px; - font-size:16px; - color:white; - background-color:#333; - margin-top:10px; - &:disabled{ - background-color:#ccc; - &:hover{ - cursor:not-allowed; - } - } - &:hover{ - cursor:pointer; - } - } - - .footer-container{ - width:100%; - margin-top:auto; - .footer-copyright{ - color:white; - font-size:16px; - padding:10px; - text-align:center; - } - } - } - - } - } +* { + + +} +html,body{ + width:100%; + height:100%; +} +header{ + background: linear-gradient(to top, #000 , #333 , #555 , #777); + display:flex; + align-items:center; } +header h1{ + font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + font-weight:100; + letter-spacing: 3px; + font-size:26px; + margin: 0 auto; + padding:10px 0; + color:white; + +} -@media screen and (max-width:900px){ - body{ - .main-container{ - width:100%; - height:100%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - - #stage{ - border:#888 solid 2px; - background-color:#4a4a4a; - width:85%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding:80px 50px; - .img-container{ - width:70px; - height:100%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - .initial-img{ - width:70px; - height:70px; - transform: rotate(-90deg); - } - } - li{ - background-color:#00ffff; - width:100%; - list-style-type: none; - border:#000 dotted 0.1px; - } - } - - @dashBoard-label-font-size:13px; - @dashBoard-selector-font-size:13px; - @dashBoard-input-font-size:13px; - @dashBoard-btn-font-size:13px; - @dashBoard-footer-font-size:13px; - #dashboard{ - font-family:@font; - width:15%; - background-color:#4a4a4a; - display:flex; - flex-direction: column; - flex-wrap: nowrap; - .algo-selector-container{ - width:100%; - margin-bottom:1px; - border:#ccc solid 2px; - .algo-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .selector-container{ - width:100%; - background-color:#333; - padding:10px 0; - - .selector{ - font-size:@dashBoard-selector-font-size; - border:none; - width:100%; - color:white; - background-color:#333; - &:focus{ - outline:none; - } - } - .options{ - color:white; - background-color:#333; - } - } - } - .count-input-container{ - width:100%; - margin-bottom:1px; - border:#ccc solid 2px; - .count-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .count-input{ - font-size:@dashBoard-input-font-size; - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } - .mspf-input-container{ - width:100%; - margin-bottom:1px; - border:#ccc solid 2px; - .mspf-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .mspf-input{ - font-size:@dashBoard-input-font-size; - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } - - - .btn-tag{ - width:80%; - margin:0 auto; - border-radius:10px; - padding:6px 4px; - font-size:@dashBoard-btn-font-size; - color:white; - background-color:#333; - margin-top:10px; - &:disabled{ - background-color:#ccc; - &:hover{ - cursor:not-allowed; - } - } - &:hover{ - cursor:pointer; - } - } - - .footer-container{ - width:100%; - margin-top:auto; - .footer-copyright{ - color:white; - font-size:@dashBoard-footer-font-size; - padding:10px; - text-align:center; - } - } - } - - } - } +section{ + border:#333 solid 1px; + height:90%; + width:100%; + background-color:#3e3e3e; } +section article#stage{ + display:flex; + align-items:center; + height:90%; + overflow: hidden; + padding:1% 5%; + align-items:flex-end; -@media screen and (max-width:700px){ - body{ - background-color:#4a4a4a; - .main-container{ - width:100%; - height:100%; - display:flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; +} +section article div.img-container{ + width:100%; + height:100%; + display:flex; + align-items: center; +} - #stage{ - border:none; - background-color:#4a4a4a; - width:100%; - height:420px; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding:50px 20px; - .img-container{ - width:70px; - height:100%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - .initial-img{ - width:70px; - height:70px; - transform: rotate(-90deg); - } - } - li{ - background-color:#00ffff; - width:100%; - list-style-type: none; - border:#000 dotted 0.1px; - } - } +section article#stage img{ + transform:rotate(-90deg); + margin:0 auto; + width:90px; +} +section article#stage li{ + list-style-type:none; + width:100%; + float:left; + background-color:#ffe4e1; + outline:thin #000 dotted; +} - @dashBoard-label-font-size:10px; - @dashBoard-selector-font-size:13px; - @dashBoard-input-font-size:13px; - @dashBoard-btn-font-size:17px; - @dashBoard-footer-font-size:13px; +section article#stage li.sorted{ + background-color: #86f67c; +} +section article#dashboard{ - #dashboard{ - font-family:@font; - width:100%; - background-color:#4a4a4a; - display:flex; - flex-direction: row; - flex-wrap: wrap; - .algo-selector-container{ - width:33.33%; - margin-bottom:1px; - border:#ccc solid 2px; - .algo-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .selector-container{ - width:100%; - background-color:#333; - padding:10px 0; - - .selector{ - font-size:@dashBoard-selector-font-size; - border:none; - width:100%; - color:white; - background-color:#333; - &:focus{ - outline:none; - } - } - .options{ - color:white; - background-color:#333; - } - } - } - .count-input-container{ - width:33.33%; - margin-bottom:1px; - border:#ccc solid 2px; - .count-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .count-input{ - font-size:@dashBoard-input-font-size; - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } - .mspf-input-container{ - width:33.33%; - margin-bottom:1px; - border:#ccc solid 2px; - .mspf-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .mspf-input{ - font-size:@dashBoard-input-font-size; - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } + width:100%; + height:5%; + padding:0 5%; +} +section article#dashboard select, +section article#dashboard input, +section article#dashboard button{ + margin-right:1%; +} - .btn-tag{ - width:33.333%; - margin:0 auto; - border-radius:0; - padding:6px 4px; - font-size:@dashBoard-btn-font-size; - color:white; - background-color:#333; - margin:0; - &:disabled{ - background-color:#ccc; - &:hover{ - cursor:not-allowed; - } - } - &:hover{ - cursor:pointer; - } - } +section article#dashboard select{ + width:13%; + height:100%; + padding:0 0 0 0.5%; - .footer-container{ - display:none; - width:100%; - margin-top:auto; - .footer-copyright{ - color:white; - font-size:@dashBoard-footer-font-size; - padding:10px; - text-align:center; - } - } - } + -o-transition:all 0.5s; + -moz-transition:all 0.5s; + -webkit-transition:all 0.5s; + transition:all 0.5s; +} +section article#dashboard input{ + font-size:11px; + width:10%; + height:100%; + padding:0 0 0 0.5%; + - } - } + -o-transition:all 0.5s; + -moz-transition:all 0.5s; + -webkit-transition:all 0.5s; + transition:all 0.5s; } +section article#dashboard button{ + border:none; + background-color: lightgrey; + border-radius: 5px; + cursor:pointer; + width:10%; + height:100%; -@media screen and (max-width:500px){ - body{ - background-color:#4a4a4a; - .main-container{ - width:100%; - height:100%; - display:flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; + -o-transition:all 0.5s; + -moz-transition:all 0.5s; + -webkit-transition:all 0.5s; + transition:all 0.5s; +} - #stage{ - border:none; - background-color:#4a4a4a; - width:100%; - height:420px; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: flex-end; - padding:50px 20px; - .img-container{ - width:70px; - height:100%; - display:flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - .initial-img{ - width:70px; - height:70px; - transform: rotate(-90deg); - } - } - li{ - background-color:#00ffff; - width:100%; - list-style-type: none; - border:#000 dotted 0.1px; - } - } +section article#dashboard button#prepare{ +} +section article#dashboard button#go{ +} +section article#dashboard button#reset{ + background-color:#ffe901; + color:#000; + float:right; + margin:0; + + -o-transition-duration:0.3s; + -moz-transition-duration:0.3s; + -o-webkittransition-duration:0.3s; + transition-duration:0.3s; +} +section article#dashboard button#reset:hover{ + background-color: #ffff00; + box-shadow:1px 1px 10px 2px #b2a300; + color:#000; + font-weight: 600; + float:right; + margin:0; +} - @dashBoard-label-font-size:10px; - @dashBoard-selector-font-size:13px; - @dashBoard-input-font-size:13px; - @dashBoard-btn-font-size:15px; - @dashBoard-footer-font-size:13px; +section article#dashboard label#err{ + position: absolute; + color:red; + font-size: 12px; + bottom:10%; + left:28.8%; +} +section article#dashboard .unset_value{ + border:red solid 1px; +} +section article#dashboard .done_value{ + border:#86f67c solid 1px; +} - #dashboard{ - font-family:@font; - width:100%; - background-color:#4a4a4a; - display:flex; - flex-direction: row; - flex-wrap: wrap; - .algo-selector-container{ - width:33.33%; - margin-bottom:1px; - border:#ccc solid 2px; - .algo-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .selector-container{ - width:100%; - background-color:#333; - padding:10px 0; - - .selector{ - font-size:@dashBoard-selector-font-size; - border:none; - width:100%; - color:white; - background-color:#333; - &:focus{ - outline:none; - } - } - .options{ - color:white; - background-color:#333; - } - } - } - .count-input-container{ - width:33.33%; - margin-bottom:1px; - border:#ccc solid 2px; - .count-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .count-input{ - font-size:@dashBoard-input-font-size; - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } - .mspf-input-container{ - width:33.33%; - margin-bottom:1px; - border:#ccc solid 2px; - .mspf-label{ - font-size:@dashBoard-label-font-size; - display:block; - color:white; - background-color:#6a6a6a; - padding:6px 0; - text-align:center; - } - .mspf-input{ - font-size:@dashBoard-input-font-size; - width:100%; - padding:10px 0 10px 10px; - color:white; - background-color:#333; - &:disabled{ - background-color:#ccc; - } - } - } +section article#dashboard .done_button{ + background-color:#86f67c; + color:#fff; +} - .btn-tag{ - width:33.333%; - margin:0 auto; - border-radius:0; - padding:6px 4px; - font-size:@dashBoard-btn-font-size; - color:white; - background-color:#333; - margin:0; - &:disabled{ - background-color:#ccc; - &:hover{ - cursor:not-allowed; - } - } - &:hover{ - cursor:pointer; - } - } +footer{ + height:2%; + padding:0 5%; +} - .footer-container{ - display:none; - width:100%; - margin-top:auto; - .footer-copyright{ - color:white; - font-size:@dashBoard-footer-font-size; - padding:10px; - text-align:center; - } - } - } +footer h6{ + text-align:right; +} - } - } -} \ No newline at end of file +*/ \ No newline at end of file From 3536c71d1e0ef3ed26f42fd0983f4052c4c17614 Mon Sep 17 00:00:00 2001 From: adyjs Date: Sun, 22 Nov 2020 07:55:48 +0800 Subject: [PATCH 3/4] Revert "Revert "layout modified"" This reverts commit 8da5adc31749bea296d8d23b427f491b629ca3ff. --- css/RWD_index.css | 399 ---------------------- css/index.css | 816 +++++++++++++++++++++++++++++++++++---------- index.html | 14 +- less/index.less | 825 +++++++++++++++++++++++++++++++++++++--------- 4 files changed, 1315 insertions(+), 739 deletions(-) delete mode 100644 css/RWD_index.css diff --git a/css/RWD_index.css b/css/RWD_index.css deleted file mode 100644 index 656ffb2..0000000 --- a/css/RWD_index.css +++ /dev/null @@ -1,399 +0,0 @@ - -@media screen and (min-width: 320px) and (max-width: 479px){ - - header h1{ - font-size: 20px; - } - section article#stage{ - height:65%; - } - section article#dashboard{ - position: relative; - height:35%; - } - - section article#dashboard label, - section article#dashboard select, - section article#dashboard input, - section article#dashboard button{ - margin:0; - height:20%; - width:40%; - font-size:16px; - } - - - section article#dashboard label#algo_label{ - display:none; - position: absolute; - top:0; - left:5%; - } - - section article#dashboard select#algo{ - position: absolute; - top:5%; - left:5%; - } - - section article#dashboard label#count_label{ - display:none; - position: absolute; - bottom:10%; - left:5%; - } - - section article#dashboard input#count{ - position: absolute; - top:30%; - left:5%; - font-size: 16px; - } - - section article#dashboard label#mspf_label{ - display:none; - position: absolute; - - } - - section article#dashboard input#mspf{ - position: absolute; - top:55%; - font-size: 16px; - } - - section article#dashboard button#prepare{ - position: absolute; - top:30%; - right:5%; - } - section article#dashboard button#go{ - position: absolute; - top:5%; - right:5%; - } - section article#dashboard button#reset{ - position: absolute; - top:55%; - right:5%; - width:20%; - } - - section article#dashboard label#err{ - display:block; - position: absolute; - height:20%; - width:40%; - top:80%; - left:5%; - color:red; - font-size: 16px; - } - - footer h6{ - text-align:center; - line-height:20px; - font-size:14px; - font-weight:100; - } - - -} - - -@media screen and (min-width: 480px) and (max-width: 639px){ - header h1{ - font-size: 20px; - } - section article#stage{ - height:65%; - } - section article#dashboard{ - position: relative; - height:35%; - } - - section article#dashboard label, - section article#dashboard select, - section article#dashboard input, - section article#dashboard button{ - margin:0; - height:20%; - width:40%; - font-size:16px; - } - - - section article#dashboard label#algo_label{ - display:none; - position: absolute; - top:0; - left:5%; - } - - section article#dashboard select#algo{ - position: absolute; - top:5%; - left:5%; - } - - section article#dashboard label#count_label{ - display:none; - position: absolute; - bottom:10%; - left:5%; - } - - section article#dashboard input#count{ - position: absolute; - top:30%; - left:5%; - font-size: 16px; - } - - section article#dashboard label#mspf_label{ - display:none; - position: absolute; - - } - - section article#dashboard input#mspf{ - position: absolute; - top:55%; - font-size: 16px; - } - - section article#dashboard button#prepare{ - position: absolute; - top:30%; - right:5%; - } - section article#dashboard button#go{ - position: absolute; - top:5%; - right:5%; - } - section article#dashboard button#reset{ - position: absolute; - top:55%; - right:5%; - width:20%; - } - - section article#dashboard label#err{ - display:block; - position: absolute; - height:20%; - width:40%; - top:80%; - left:5%; - color:red; - font-size: 16px; - } - - footer h6{ - text-align:center; - line-height:20px; - font-size:14px; - font-weight:100; - } -} - - -@media screen and (min-width: 640px) and (max-width: 767px){ - header h1{ - font-size: 26px; - } - section article#stage{ - height:65%; - } - section article#dashboard{ - position: relative; - height:35%; - } - - section article#dashboard label, - section article#dashboard select, - section article#dashboard input, - section article#dashboard button{ - margin:0; - height:20%; - width:40%; - font-size:22px; - } - - - section article#dashboard label#algo_label{ - display:none; - position: absolute; - top:0; - left:5%; - } - - section article#dashboard select#algo{ - position: absolute; - top:5%; - left:5%; - } - - section article#dashboard label#count_label{ - display:none; - position: absolute; - bottom:10%; - left:5%; - } - - section article#dashboard input#count{ - position: absolute; - top:30%; - left:5%; - font-size: 22px; - } - - section article#dashboard label#mspf_label{ - display:none; - position: absolute; - - } - - section article#dashboard input#mspf{ - position: absolute; - top:55%; - font-size: 22px; - } - - section article#dashboard button#prepare{ - position: absolute; - top:30%; - right:5%; - } - section article#dashboard button#go{ - position: absolute; - top:5%; - right:5%; - } - section article#dashboard button#reset{ - position: absolute; - top:55%; - right:5%; - width:20%; - } - - section article#dashboard label#err{ - display:block; - position: absolute; - height:20%; - width:40%; - top:80%; - left:5%; - color:red; - font-size: 22px; - } - - footer h6{ - text-align:center; - line-height:26px; - font-size:20px; - font-weight:100; - } -} - - - -@media screen and (min-width: 768px) and (max-width: 1023px){ - header h1{ - font-size: 34px; - } - section article#stage{ - height:65%; - } - section article#dashboard{ - position: relative; - height:35%; - } - - section article#dashboard label, - section article#dashboard select, - section article#dashboard input, - section article#dashboard button{ - margin:0; - height:20%; - width:40%; - font-size:30px; - } - - - section article#dashboard label#algo_label{ - display:none; - position: absolute; - top:0; - left:5%; - } - - section article#dashboard select#algo{ - position: absolute; - top:5%; - left:5%; - } - - section article#dashboard label#count_label{ - display:none; - position: absolute; - bottom:10%; - left:5%; - } - - section article#dashboard input#count{ - position: absolute; - top:30%; - left:5%; - font-size: 30px; - } - - section article#dashboard label#mspf_label{ - display:none; - position: absolute; - - } - - section article#dashboard input#mspf{ - position: absolute; - top:55%; - font-size: 30px; - } - - section article#dashboard button#prepare{ - position: absolute; - top:30%; - right:5%; - } - section article#dashboard button#go{ - position: absolute; - top:5%; - right:5%; - } - section article#dashboard button#reset{ - position: absolute; - top:55%; - right:5%; - width:20%; - } - - section article#dashboard label#err{ - display:block; - position: absolute; - height:20%; - width:40%; - top:80%; - left:5%; - color:red; - font-size: 30px; - } - - footer h6{ - text-align:center; - line-height:30px; - font-size:24px; - font-weight:100; - } -} diff --git a/css/index.css b/css/index.css index f886167..7918130 100644 --- a/css/index.css +++ b/css/index.css @@ -1,7 +1,7 @@ * { margin: 0; padding: 0; - font-size: sans-serif; + font-size: 'Noto Sans TC', 'Noto Sans JP', sans-serif; box-sizing: border-box; -o-box-sizing: border-box; -moz-box-sizing: border-box; @@ -24,13 +24,13 @@ body .main-container { body .main-container #stage { border: #888 solid 2px; background-color: #4a4a4a; - width: 90%; + width: 85%; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: flex-end; - padding: 3% 5%; + padding: 80px 50px; } body .main-container #stage .img-container { width: 80px; @@ -54,7 +54,7 @@ body .main-container #stage li { } body .main-container #dashboard { font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - width: 10%; + width: 15%; background-color: #4a4a4a; display: flex; flex-direction: column; @@ -164,176 +164,638 @@ body .main-container #dashboard .footer-container .footer-copyright { padding: 10px; text-align: center; } -/* - -* { - - -} -html,body{ - width:100%; - height:100%; -} -header{ - background: linear-gradient(to top, #000 , #333 , #555 , #777); - display:flex; - align-items:center; -} - -header h1{ - font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - font-weight:100; - letter-spacing: 3px; - font-size:26px; - margin: 0 auto; - padding:10px 0; - color:white; - -} - -section{ - border:#333 solid 1px; - height:90%; - width:100%; - background-color:#3e3e3e; -} - -section article#stage{ - display:flex; - align-items:center; - height:90%; - overflow: hidden; - padding:1% 5%; - align-items:flex-end; - - -} -section article div.img-container{ - width:100%; - height:100%; - display:flex; - align-items: center; -} - -section article#stage img{ - transform:rotate(-90deg); - margin:0 auto; - width:90px; -} -section article#stage li{ - list-style-type:none; - width:100%; - float:left; - background-color:#ffe4e1; - outline:thin #000 dotted; -} - -section article#stage li.sorted{ - background-color: #86f67c; -} - -section article#dashboard{ - - width:100%; - height:5%; - padding:0 5%; -} -section article#dashboard select, -section article#dashboard input, -section article#dashboard button{ - margin-right:1%; -} - - -section article#dashboard select{ - width:13%; - height:100%; - padding:0 0 0 0.5%; - - -o-transition:all 0.5s; - -moz-transition:all 0.5s; - -webkit-transition:all 0.5s; - transition:all 0.5s; -} -section article#dashboard input{ - font-size:11px; - width:10%; - height:100%; - padding:0 0 0 0.5%; - - - -o-transition:all 0.5s; - -moz-transition:all 0.5s; - -webkit-transition:all 0.5s; - transition:all 0.5s; -} - -section article#dashboard button{ - border:none; - background-color: lightgrey; - border-radius: 5px; - cursor:pointer; - width:10%; - height:100%; - - -o-transition:all 0.5s; - -moz-transition:all 0.5s; - -webkit-transition:all 0.5s; - transition:all 0.5s; -} - -section article#dashboard button#prepare{ -} -section article#dashboard button#go{ -} -section article#dashboard button#reset{ - background-color:#ffe901; - color:#000; - float:right; - margin:0; - - -o-transition-duration:0.3s; - -moz-transition-duration:0.3s; - -o-webkittransition-duration:0.3s; - transition-duration:0.3s; -} -section article#dashboard button#reset:hover{ - background-color: #ffff00; - box-shadow:1px 1px 10px 2px #b2a300; - color:#000; - font-weight: 600; - float:right; - margin:0; -} - -section article#dashboard label#err{ - position: absolute; - color:red; - font-size: 12px; - bottom:10%; - left:28.8%; -} - -section article#dashboard .unset_value{ - border:red solid 1px; -} -section article#dashboard .done_value{ - border:#86f67c solid 1px; -} - -section article#dashboard .done_button{ - background-color:#86f67c; - color:#fff; -} - - -footer{ - height:2%; - padding:0 5%; -} - -footer h6{ - text-align:right; -} - -*/ +@media screen and (max-width: 1200px) { + body .main-container { + width: 100%; + height: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + } + body .main-container #stage { + border: #888 solid 2px; + background-color: #4a4a4a; + width: 85%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding: 80px 50px; + } + body .main-container #stage .img-container { + width: 80px; + height: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + } + body .main-container #stage .img-container .initial-img { + width: 80px; + height: 80px; + transform: rotate(-90deg); + } + body .main-container #stage li { + background-color: #00ffff; + width: 100%; + list-style-type: none; + border: #000 dotted 0.1px; + } + body .main-container #dashboard { + font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + width: 15%; + background-color: #4a4a4a; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + } + body .main-container #dashboard .algo-selector-container { + width: 100%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .algo-selector-container .algo-label { + font-size: 14px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .algo-selector-container .selector-container { + width: 100%; + background-color: #333; + padding: 10px 0; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector { + border: none; + width: 100%; + color: white; + background-color: #333; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { + outline: none; + } + body .main-container #dashboard .algo-selector-container .selector-container .options { + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container { + width: 100%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .count-input-container .count-label { + font-size: 14px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .count-input-container .count-input { + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container .count-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .mspf-input-container { + width: 100%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .mspf-input-container .mspf-label { + font-size: 14px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .mspf-input-container .mspf-input { + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .mspf-input-container .mspf-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag { + width: 80%; + margin: 0 auto; + border-radius: 10px; + padding: 6px 4px; + font-size: 16px; + color: white; + background-color: #333; + margin-top: 10px; + } + body .main-container #dashboard .btn-tag:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag:disabled:hover { + cursor: not-allowed; + } + body .main-container #dashboard .btn-tag:hover { + cursor: pointer; + } + body .main-container #dashboard .footer-container { + width: 100%; + margin-top: auto; + } + body .main-container #dashboard .footer-container .footer-copyright { + color: white; + font-size: 16px; + padding: 10px; + text-align: center; + } +} +@media screen and (max-width: 900px) { + body .main-container { + width: 100%; + height: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + } + body .main-container #stage { + border: #888 solid 2px; + background-color: #4a4a4a; + width: 85%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding: 80px 50px; + } + body .main-container #stage .img-container { + width: 70px; + height: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + } + body .main-container #stage .img-container .initial-img { + width: 70px; + height: 70px; + transform: rotate(-90deg); + } + body .main-container #stage li { + background-color: #00ffff; + width: 100%; + list-style-type: none; + border: #000 dotted 0.1px; + } + body .main-container #dashboard { + font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + width: 15%; + background-color: #4a4a4a; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + } + body .main-container #dashboard .algo-selector-container { + width: 100%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .algo-selector-container .algo-label { + font-size: 13px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .algo-selector-container .selector-container { + width: 100%; + background-color: #333; + padding: 10px 0; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector { + font-size: 13px; + border: none; + width: 100%; + color: white; + background-color: #333; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { + outline: none; + } + body .main-container #dashboard .algo-selector-container .selector-container .options { + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container { + width: 100%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .count-input-container .count-label { + font-size: 13px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .count-input-container .count-input { + font-size: 13px; + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container .count-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .mspf-input-container { + width: 100%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .mspf-input-container .mspf-label { + font-size: 13px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .mspf-input-container .mspf-input { + font-size: 13px; + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .mspf-input-container .mspf-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag { + width: 80%; + margin: 0 auto; + border-radius: 10px; + padding: 6px 4px; + font-size: 13px; + color: white; + background-color: #333; + margin-top: 10px; + } + body .main-container #dashboard .btn-tag:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag:disabled:hover { + cursor: not-allowed; + } + body .main-container #dashboard .btn-tag:hover { + cursor: pointer; + } + body .main-container #dashboard .footer-container { + width: 100%; + margin-top: auto; + } + body .main-container #dashboard .footer-container .footer-copyright { + color: white; + font-size: 13px; + padding: 10px; + text-align: center; + } +} +@media screen and (max-width: 700px) { + body { + background-color: #4a4a4a; + } + body .main-container { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + } + body .main-container #stage { + border: none; + background-color: #4a4a4a; + width: 100%; + height: 420px; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding: 50px 20px; + } + body .main-container #stage .img-container { + width: 70px; + height: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + } + body .main-container #stage .img-container .initial-img { + width: 70px; + height: 70px; + transform: rotate(-90deg); + } + body .main-container #stage li { + background-color: #00ffff; + width: 100%; + list-style-type: none; + border: #000 dotted 0.1px; + } + body .main-container #dashboard { + font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + width: 100%; + background-color: #4a4a4a; + display: flex; + flex-direction: row; + flex-wrap: wrap; + } + body .main-container #dashboard .algo-selector-container { + width: 33.33%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .algo-selector-container .algo-label { + font-size: 10px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .algo-selector-container .selector-container { + width: 100%; + background-color: #333; + padding: 10px 0; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector { + font-size: 13px; + border: none; + width: 100%; + color: white; + background-color: #333; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { + outline: none; + } + body .main-container #dashboard .algo-selector-container .selector-container .options { + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container { + width: 33.33%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .count-input-container .count-label { + font-size: 10px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .count-input-container .count-input { + font-size: 13px; + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container .count-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .mspf-input-container { + width: 33.33%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .mspf-input-container .mspf-label { + font-size: 10px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .mspf-input-container .mspf-input { + font-size: 13px; + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .mspf-input-container .mspf-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag { + width: 33.333%; + margin: 0 auto; + border-radius: 0; + padding: 6px 4px; + font-size: 17px; + color: white; + background-color: #333; + margin: 0; + } + body .main-container #dashboard .btn-tag:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag:disabled:hover { + cursor: not-allowed; + } + body .main-container #dashboard .btn-tag:hover { + cursor: pointer; + } + body .main-container #dashboard .footer-container { + display: none; + width: 100%; + margin-top: auto; + } + body .main-container #dashboard .footer-container .footer-copyright { + color: white; + font-size: 13px; + padding: 10px; + text-align: center; + } +} +@media screen and (max-width: 500px) { + body { + background-color: #4a4a4a; + } + body .main-container { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + } + body .main-container #stage { + border: none; + background-color: #4a4a4a; + width: 100%; + height: 420px; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding: 50px 20px; + } + body .main-container #stage .img-container { + width: 70px; + height: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + } + body .main-container #stage .img-container .initial-img { + width: 70px; + height: 70px; + transform: rotate(-90deg); + } + body .main-container #stage li { + background-color: #00ffff; + width: 100%; + list-style-type: none; + border: #000 dotted 0.1px; + } + body .main-container #dashboard { + font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; + width: 100%; + background-color: #4a4a4a; + display: flex; + flex-direction: row; + flex-wrap: wrap; + } + body .main-container #dashboard .algo-selector-container { + width: 33.33%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .algo-selector-container .algo-label { + font-size: 10px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .algo-selector-container .selector-container { + width: 100%; + background-color: #333; + padding: 10px 0; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector { + font-size: 13px; + border: none; + width: 100%; + color: white; + background-color: #333; + } + body .main-container #dashboard .algo-selector-container .selector-container .selector:focus { + outline: none; + } + body .main-container #dashboard .algo-selector-container .selector-container .options { + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container { + width: 33.33%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .count-input-container .count-label { + font-size: 10px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .count-input-container .count-input { + font-size: 13px; + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .count-input-container .count-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .mspf-input-container { + width: 33.33%; + margin-bottom: 1px; + border: #ccc solid 2px; + } + body .main-container #dashboard .mspf-input-container .mspf-label { + font-size: 10px; + display: block; + color: white; + background-color: #6a6a6a; + padding: 6px 0; + text-align: center; + } + body .main-container #dashboard .mspf-input-container .mspf-input { + font-size: 13px; + width: 100%; + padding: 10px 0 10px 10px; + color: white; + background-color: #333; + } + body .main-container #dashboard .mspf-input-container .mspf-input:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag { + width: 33.333%; + margin: 0 auto; + border-radius: 0; + padding: 6px 4px; + font-size: 15px; + color: white; + background-color: #333; + margin: 0; + } + body .main-container #dashboard .btn-tag:disabled { + background-color: #ccc; + } + body .main-container #dashboard .btn-tag:disabled:hover { + cursor: not-allowed; + } + body .main-container #dashboard .btn-tag:hover { + cursor: pointer; + } + body .main-container #dashboard .footer-container { + display: none; + width: 100%; + margin-top: auto; + } + body .main-container #dashboard .footer-container .footer-copyright { + color: white; + font-size: 13px; + padding: 10px; + text-align: center; + } +} diff --git a/index.html b/index.html index 4aa4812..cc76f82 100644 --- a/index.html +++ b/index.html @@ -10,16 +10,8 @@ - - - -
@@ -46,9 +38,9 @@

排序演算法視覺化

id="count" type="number" disabled="true" - placeholder="5 ~ 500" + placeholder="5 ~ 300" min="5" - max="500"> + max="300"> @@ -65,11 +57,11 @@

排序演算法視覺化

- +
diff --git a/less/index.less b/less/index.less index b346e9e..cd7c459 100644 --- a/less/index.less +++ b/less/index.less @@ -4,7 +4,7 @@ *{ margin:0; padding:0; - font-size: sans-serif; + font-size: @font; box-sizing: border-box; -o-box-sizing: border-box; -moz-box-sizing: border-box; @@ -30,13 +30,14 @@ body{ #stage{ border:#888 solid 2px; background-color:#4a4a4a; - width:90%; + width:85%; display:flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: flex-end; - padding:3% 5%; + padding:80px 50px; + .img-container{ width:80px; height:100%; @@ -60,7 +61,7 @@ body{ } #dashboard{ font-family:@font; - width:10%; + width:15%; background-color:#4a4a4a; display:flex; flex-direction: column; @@ -110,7 +111,6 @@ body{ text-align:center; } .count-input{ - width:100%; padding:10px 0 10px 10px; color:white; @@ -144,7 +144,6 @@ body{ } } - .btn-tag{ width:80%; margin:0 auto; @@ -180,176 +179,698 @@ body{ } } -/* -* { - - -} -html,body{ - width:100%; - height:100%; -} -header{ - background: linear-gradient(to top, #000 , #333 , #555 , #777); - display:flex; - align-items:center; -} +@media screen and (max-width:1200px){ + body{ + .main-container{ + width:100%; + height:100%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; -header h1{ - font-family: 'Noto Sans TC', 'Noto Sans JP', sans-serif; - font-weight:100; - letter-spacing: 3px; - font-size:26px; - margin: 0 auto; - padding:10px 0; - color:white; - -} + #stage{ + border:#888 solid 2px; + background-color:#4a4a4a; + width:85%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding:80px 50px; -section{ - border:#333 solid 1px; - height:90%; - width:100%; - background-color:#3e3e3e; -} + .img-container{ + width:80px; + height:100%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + .initial-img{ + width:80px; + height:80px; + transform: rotate(-90deg); + } + } + li{ + background-color:#00ffff; + width:100%; + list-style-type: none; + border:#000 dotted 0.1px; + } + } + #dashboard{ + font-family:@font; + width:15%; + background-color:#4a4a4a; + display:flex; + flex-direction: column; + flex-wrap: nowrap; + .algo-selector-container{ + width:100%; + margin-bottom:1px; + border:#ccc solid 2px; + .algo-label{ + font-size:14px; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .selector-container{ + width:100%; + background-color:#333; + padding:10px 0; + + .selector{ + border:none; + width:100%; + color:white; + background-color:#333; + &:focus{ + outline:none; + } + } + .options{ + color:white; + background-color:#333; + } + } + } + .count-input-container{ + width:100%; + margin-bottom:1px; + border:#ccc solid 2px; + .count-label{ + font-size:14px; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .count-input{ + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } + .mspf-input-container{ + width:100%; + margin-bottom:1px; + border:#ccc solid 2px; + .mspf-label{ + font-size:14px; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .mspf-input{ -section article#stage{ - display:flex; - align-items:center; - height:90%; - overflow: hidden; - padding:1% 5%; - align-items:flex-end; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } -} -section article div.img-container{ - width:100%; - height:100%; - display:flex; - align-items: center; -} + .btn-tag{ + width:80%; + margin:0 auto; + border-radius:10px; + padding:6px 4px; + font-size:16px; + color:white; + background-color:#333; + margin-top:10px; + &:disabled{ + background-color:#ccc; + &:hover{ + cursor:not-allowed; + } + } + &:hover{ + cursor:pointer; + } + } -section article#stage img{ - transform:rotate(-90deg); - margin:0 auto; - width:90px; -} -section article#stage li{ - list-style-type:none; - width:100%; - float:left; - background-color:#ffe4e1; - outline:thin #000 dotted; -} + .footer-container{ + width:100%; + margin-top:auto; + .footer-copyright{ + color:white; + font-size:16px; + padding:10px; + text-align:center; + } + } + } -section article#stage li.sorted{ - background-color: #86f67c; + } + } } -section article#dashboard{ - width:100%; - height:5%; - padding:0 5%; -} -section article#dashboard select, -section article#dashboard input, -section article#dashboard button{ - margin-right:1%; -} +@media screen and (max-width:900px){ + body{ + .main-container{ + width:100%; + height:100%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + #stage{ + border:#888 solid 2px; + background-color:#4a4a4a; + width:85%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding:80px 50px; + .img-container{ + width:70px; + height:100%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + .initial-img{ + width:70px; + height:70px; + transform: rotate(-90deg); + } + } + li{ + background-color:#00ffff; + width:100%; + list-style-type: none; + border:#000 dotted 0.1px; + } + } -section article#dashboard select{ - width:13%; - height:100%; - padding:0 0 0 0.5%; + @dashBoard-label-font-size:13px; + @dashBoard-selector-font-size:13px; + @dashBoard-input-font-size:13px; + @dashBoard-btn-font-size:13px; + @dashBoard-footer-font-size:13px; + #dashboard{ + font-family:@font; + width:15%; + background-color:#4a4a4a; + display:flex; + flex-direction: column; + flex-wrap: nowrap; + .algo-selector-container{ + width:100%; + margin-bottom:1px; + border:#ccc solid 2px; + .algo-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .selector-container{ + width:100%; + background-color:#333; + padding:10px 0; + + .selector{ + font-size:@dashBoard-selector-font-size; + border:none; + width:100%; + color:white; + background-color:#333; + &:focus{ + outline:none; + } + } + .options{ + color:white; + background-color:#333; + } + } + } + .count-input-container{ + width:100%; + margin-bottom:1px; + border:#ccc solid 2px; + .count-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .count-input{ + font-size:@dashBoard-input-font-size; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } + .mspf-input-container{ + width:100%; + margin-bottom:1px; + border:#ccc solid 2px; + .mspf-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .mspf-input{ + font-size:@dashBoard-input-font-size; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } - -o-transition:all 0.5s; - -moz-transition:all 0.5s; - -webkit-transition:all 0.5s; - transition:all 0.5s; -} -section article#dashboard input{ - font-size:11px; - width:10%; - height:100%; - padding:0 0 0 0.5%; - - -o-transition:all 0.5s; - -moz-transition:all 0.5s; - -webkit-transition:all 0.5s; - transition:all 0.5s; -} + .btn-tag{ + width:80%; + margin:0 auto; + border-radius:10px; + padding:6px 4px; + font-size:@dashBoard-btn-font-size; + color:white; + background-color:#333; + margin-top:10px; + &:disabled{ + background-color:#ccc; + &:hover{ + cursor:not-allowed; + } + } + &:hover{ + cursor:pointer; + } + } -section article#dashboard button{ - border:none; - background-color: lightgrey; - border-radius: 5px; - cursor:pointer; - width:10%; - height:100%; + .footer-container{ + width:100%; + margin-top:auto; + .footer-copyright{ + color:white; + font-size:@dashBoard-footer-font-size; + padding:10px; + text-align:center; + } + } + } - -o-transition:all 0.5s; - -moz-transition:all 0.5s; - -webkit-transition:all 0.5s; - transition:all 0.5s; + } + } } -section article#dashboard button#prepare{ -} -section article#dashboard button#go{ -} -section article#dashboard button#reset{ - background-color:#ffe901; - color:#000; - float:right; - margin:0; - - -o-transition-duration:0.3s; - -moz-transition-duration:0.3s; - -o-webkittransition-duration:0.3s; - transition-duration:0.3s; -} -section article#dashboard button#reset:hover{ - background-color: #ffff00; - box-shadow:1px 1px 10px 2px #b2a300; - color:#000; - font-weight: 600; - float:right; - margin:0; -} -section article#dashboard label#err{ - position: absolute; - color:red; - font-size: 12px; - bottom:10%; - left:28.8%; -} -section article#dashboard .unset_value{ - border:red solid 1px; -} -section article#dashboard .done_value{ - border:#86f67c solid 1px; -} +@media screen and (max-width:700px){ + body{ + background-color:#4a4a4a; + .main-container{ + width:100%; + height:100%; + display:flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; -section article#dashboard .done_button{ - background-color:#86f67c; - color:#fff; -} + #stage{ + border:none; + background-color:#4a4a4a; + width:100%; + height:420px; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding:50px 20px; + .img-container{ + width:70px; + height:100%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + .initial-img{ + width:70px; + height:70px; + transform: rotate(-90deg); + } + } + li{ + background-color:#00ffff; + width:100%; + list-style-type: none; + border:#000 dotted 0.1px; + } + } + @dashBoard-label-font-size:10px; + @dashBoard-selector-font-size:13px; + @dashBoard-input-font-size:13px; + @dashBoard-btn-font-size:17px; + @dashBoard-footer-font-size:13px; -footer{ - height:2%; - padding:0 5%; -} -footer h6{ - text-align:right; + #dashboard{ + font-family:@font; + width:100%; + background-color:#4a4a4a; + display:flex; + flex-direction: row; + flex-wrap: wrap; + .algo-selector-container{ + width:33.33%; + margin-bottom:1px; + border:#ccc solid 2px; + .algo-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .selector-container{ + width:100%; + background-color:#333; + padding:10px 0; + + .selector{ + font-size:@dashBoard-selector-font-size; + border:none; + width:100%; + color:white; + background-color:#333; + &:focus{ + outline:none; + } + } + .options{ + color:white; + background-color:#333; + } + } + } + .count-input-container{ + width:33.33%; + margin-bottom:1px; + border:#ccc solid 2px; + .count-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .count-input{ + font-size:@dashBoard-input-font-size; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } + .mspf-input-container{ + width:33.33%; + margin-bottom:1px; + border:#ccc solid 2px; + .mspf-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .mspf-input{ + font-size:@dashBoard-input-font-size; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } + + + .btn-tag{ + width:33.333%; + margin:0 auto; + border-radius:0; + padding:6px 4px; + font-size:@dashBoard-btn-font-size; + color:white; + background-color:#333; + margin:0; + &:disabled{ + background-color:#ccc; + &:hover{ + cursor:not-allowed; + } + } + &:hover{ + cursor:pointer; + } + } + + .footer-container{ + display:none; + width:100%; + margin-top:auto; + .footer-copyright{ + color:white; + font-size:@dashBoard-footer-font-size; + padding:10px; + text-align:center; + } + } + } + + } + } } -*/ \ No newline at end of file + +@media screen and (max-width:500px){ + body{ + background-color:#4a4a4a; + .main-container{ + width:100%; + height:100%; + display:flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + + #stage{ + border:none; + background-color:#4a4a4a; + width:100%; + height:420px; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-end; + padding:50px 20px; + .img-container{ + width:70px; + height:100%; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + .initial-img{ + width:70px; + height:70px; + transform: rotate(-90deg); + } + } + li{ + background-color:#00ffff; + width:100%; + list-style-type: none; + border:#000 dotted 0.1px; + } + } + + @dashBoard-label-font-size:10px; + @dashBoard-selector-font-size:13px; + @dashBoard-input-font-size:13px; + @dashBoard-btn-font-size:15px; + @dashBoard-footer-font-size:13px; + + + #dashboard{ + font-family:@font; + width:100%; + background-color:#4a4a4a; + display:flex; + flex-direction: row; + flex-wrap: wrap; + .algo-selector-container{ + width:33.33%; + margin-bottom:1px; + border:#ccc solid 2px; + .algo-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .selector-container{ + width:100%; + background-color:#333; + padding:10px 0; + + .selector{ + font-size:@dashBoard-selector-font-size; + border:none; + width:100%; + color:white; + background-color:#333; + &:focus{ + outline:none; + } + } + .options{ + color:white; + background-color:#333; + } + } + } + .count-input-container{ + width:33.33%; + margin-bottom:1px; + border:#ccc solid 2px; + .count-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .count-input{ + font-size:@dashBoard-input-font-size; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } + .mspf-input-container{ + width:33.33%; + margin-bottom:1px; + border:#ccc solid 2px; + .mspf-label{ + font-size:@dashBoard-label-font-size; + display:block; + color:white; + background-color:#6a6a6a; + padding:6px 0; + text-align:center; + } + .mspf-input{ + font-size:@dashBoard-input-font-size; + width:100%; + padding:10px 0 10px 10px; + color:white; + background-color:#333; + &:disabled{ + background-color:#ccc; + } + } + } + + + .btn-tag{ + width:33.333%; + margin:0 auto; + border-radius:0; + padding:6px 4px; + font-size:@dashBoard-btn-font-size; + color:white; + background-color:#333; + margin:0; + &:disabled{ + background-color:#ccc; + &:hover{ + cursor:not-allowed; + } + } + &:hover{ + cursor:pointer; + } + } + + .footer-container{ + display:none; + width:100%; + margin-top:auto; + .footer-copyright{ + color:white; + font-size:@dashBoard-footer-font-size; + padding:10px; + text-align:center; + } + } + } + + } + } +} \ No newline at end of file From 9784e5ed484d072c2c7a38843e18197f5e746b88 Mon Sep 17 00:00:00 2001 From: adyjs Date: Sun, 22 Nov 2020 07:56:59 +0800 Subject: [PATCH 4/4] Revert "Changes to be committed:" This reverts commit e4c8539b2ad01226b78446751bd0497d97ad11e0. --- index.html | 4 +-- js/odd_even_sort.js | 85 --------------------------------------------- js/test.js | 68 +++++++++++++++--------------------- 3 files changed, 29 insertions(+), 128 deletions(-) delete mode 100644 js/odd_even_sort.js diff --git a/index.html b/index.html index cc76f82..7a3742b 100644 --- a/index.html +++ b/index.html @@ -26,7 +26,6 @@ - @@ -75,7 +74,7 @@
- + @@ -83,7 +82,6 @@ - \ No newline at end of file diff --git a/js/odd_even_sort.js b/js/odd_even_sort.js deleted file mode 100644 index 8eaf897..0000000 --- a/js/odd_even_sort.js +++ /dev/null @@ -1,85 +0,0 @@ -'strict' - -class OddEvenSort extends SortingBase{ - constructor(){ - super(); - } - - splitTime = 1000; - - setSplitTime(mspf){ - if(mspf <3){ - this.splitTime = 1; - return; - } - this.splitTime = mspf /3; - } - - static async run(one, sleep, endingPose){ - let temp; - let isAllSorted; - one.setSplitTime(one.milliSecPerFrame) - - isAllSorted = 0; - - while(1){ - for(let i=0 ; i one.blockBox[i+1].value){ - temp = one.blockBox[i]; - one.blockBox[i] = one.blockBox[i+1]; - one.blockBox[i+1] = temp; - isAllSorted++; - } - - one.checkCompareColoring(one.blockBox[i] , one.blockBox[i+1]); - one.fillStageWithBlocks(); - await sleep(one.splitTime); - - one.doneCompareColoring(one.blockBox[i] , one.blockBox[i+1]); - one.fillStageWithBlocks(); - await sleep(one.splitTime); - - } - }; - if(!isAllSorted){break;} - isAllSorted = 0; - for(let i=1 ; i one.blockBox[i+1].value){ - temp = one.blockBox[i]; - one.blockBox[i] = one.blockBox[i+1]; - one.blockBox[i+1] = temp; - isAllSorted++; - } - - one.checkCompareColoring(one.blockBox[i] , one.blockBox[i+1]); - one.fillStageWithBlocks(); - await sleep(one.splitTime); - - one.doneCompareColoring(one.blockBox[i] , one.blockBox[i+1]); - one.fillStageWithBlocks(); - await sleep(one.splitTime); - } - }; - if(!isAllSorted){break;} - isAllSorted = 0; - } - - endingPose(one, sleep) - - console.log('done') - } - -} \ No newline at end of file diff --git a/js/test.js b/js/test.js index 4414727..d3f1ac0 100644 --- a/js/test.js +++ b/js/test.js @@ -30,48 +30,36 @@ window.onload = function(){ function algoChosen(){ - try{ - - algo = algoSelector.value; - if(algo === null || algo === 'none'){ - clearInputDashBoard(); - allDisable([algoSelector]); + algo = algoSelector.value; + if(algo === null || algo === 'none'){ + clearInputDashBoard(); + allDisable([algoSelector]); + } + else{ + if(algo === 'BubbleSort'){ + one = new BubbleSort(); + classOne = BubbleSort; } - else{ - if(algo === 'BubbleSort'){ - one = new BubbleSort(); - classOne = BubbleSort; - } - else if(algo === 'SelectionSort'){ - one = new SelectionSort(); - classOne = SelectionSort; - } - else if(algo === 'ExchangeSort'){ - one = new ExchangeSort(); - classOne = ExchangeSort; - } - else if(algo === 'InsertionSort'){ - one = new InsertionSort(); - classOne = InsertionSort; - } - else if(algo === 'ShakerSort'){ - one = new ShakerSort(); - classOne = ShakerSort; - } - else if(algo === 'OddEvenSort'){ - one = new OddEvenSort(); - classOne = OddEvenSort; - } - else{ - window.alert('演算法系統錯誤,\n請按 F5 重新整理系統,再次使用。'); - // refresh(); - } - - allEnable([goBtn]) + else if(algo === 'SelectionSort'){ + one = new SelectionSort(); + classOne = SelectionSort; } + else if(algo === 'ExchangeSort'){ + one = new ExchangeSort(); + classOne = ExchangeSort; + } + else if(algo === 'InsertionSort'){ + one = new InsertionSort(); + classOne = InsertionSort; + } + else if(algo === 'ShakerSort'){ + one = new ShakerSort(); + classOne = ShakerSort; + } + + allEnable([goBtn]) } - catch(e){ - } + } function clearInputDashBoard(){ @@ -133,7 +121,7 @@ function inputInvalid(entryNum , mspfNum){ } return false; } - + function prepareForRun(){ one.entryNum = isCountInputValid( parseInt(countInput.value, 10) ); one.milliSecPerFrame = isMspfInputValid( parseInt(mspfInput.value, 10));