Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

Commit c8810cb

Browse files
committed
fixed some bugs of menu
1 parent e5da3e8 commit c8810cb

File tree

2 files changed

+42
-32
lines changed

2 files changed

+42
-32
lines changed

code.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ Code.loadDemoArea = function () {
454454

455455
if (localStorage.demoArea == 'open') {
456456
area.className = area.className + "show";
457-
btn.style.opacity = 1;
457+
btn.className = "notext toolMenu opened";
458458
}
459459

460460
if (!localStorage.demoAreaSelect) {
@@ -496,19 +496,19 @@ Code.loadDemoArea = function () {
496496
if (localStorage.demoArea == 'open') {
497497
area.className = area.className.replace("show", "");
498498
localStorage.demoArea = 'close';
499-
btn.style.opacity = 0.8;
499+
btn.className = "notext toolMenu";
500500
} else {
501501
area.className += " show";
502502
localStorage.demoArea = 'open';
503-
btn.style.opacity = 1;
503+
btn.className = "notext toolMenu opened";
504504
}
505505
Code.reloadSandbox();
506506
};
507507

508508
close.onclick = function () {
509509
area.className = area.className.replace("show", "");
510510
localStorage.demoArea = 'close';
511-
btn.style.opacity = 0.8;
511+
btn.className = "notext toolMenu";
512512
};
513513

514514
select.onchange = function () {
@@ -539,13 +539,13 @@ Code.loadSample = function () {
539539
if(!sampleMenuOpen){
540540
sampleMenuOpen = true;
541541
sampleMenu.style.display = 'block';
542-
sampleBtn.style.opacity = 1;
542+
sampleBtn.className = "notext toolMenu opened";
543543
sampleMenu.focus();
544544
}else{
545545
sampleMenuOpen = false;
546546
sampleMenu.style.display = 'none';
547547
sampleBtn.style.color = '#000';
548-
sampleBtn.style.opacity = 0.8;
548+
sampleBtn.className = "notext toolMenu";
549549
}
550550
};
551551

@@ -554,7 +554,7 @@ Code.loadSample = function () {
554554
sampleMenuOpen = false;
555555
sampleMenu.style.display = 'none';
556556
sampleBtn.style.color = '#000';
557-
sampleBtn.style.opacity = 0.8;
557+
sampleBtn.className = "notext toolMenu";
558558
}
559559
};
560560

@@ -986,7 +986,7 @@ Code.toggleRunning = function () {
986986
document.querySelector('#runButton div').innerHTML = "停止執行";
987987
select.disabled = true;
988988
demoBtn.disabled = true;
989-
demoBtn.style.opacity = 0.5;
989+
demoBtn.className = "notext toolMenu running";
990990
demoBtn.style.pointerEvents = 'none';
991991
demoStopBtn.style.pointerEvents = 'none';
992992
demoStopBtn.style.opacity = 0.2;
@@ -998,9 +998,9 @@ Code.toggleRunning = function () {
998998
select.disabled = false;
999999
demoBtn.disabled = false;
10001000
if (localStorage.demoArea == 'open') {
1001-
demoBtn.style.opacity = 1;
1001+
demoBtn.className = "notext toolMenu opened";
10021002
}else{
1003-
demoBtn.style.opacity = 0.8;
1003+
demoBtn.className = "notext toolMenu";
10041004
}
10051005
demoBtn.style.pointerEvents = 'auto';
10061006
demoStopBtn.style.pointerEvents = 'auto';

css/style.css

+32-22
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ html[dir="RTL"] .farSide {
2222
/* Buttons */
2323

2424
button {
25-
margin: 5px;
25+
margin: 5px 3px;
2626
padding: 10px;
2727
border-radius: 4px;
28-
border: 1px solid #ddd;
28+
border: none;
2929
font-size: large;
3030
background-color: #fff;
3131
color: #000;
@@ -50,10 +50,6 @@ button:hover>img {
5050
opacity: 1;
5151
}
5252

53-
button:active {
54-
border: 1px solid #888 !important;
55-
}
56-
5753
button:hover {
5854
box-shadow: 2px 2px 5px #888;
5955
}
@@ -104,9 +100,7 @@ td.tabmin {
104100
}
105101

106102
td.tabmax {
107-
border-top-style: none !important;
108-
border-left-style: none !important;
109-
border-right-style: none !important;
103+
border:none!important;
110104
width: 99%;
111105
padding-left: 10px;
112106
padding-right: 10px;
@@ -163,8 +157,7 @@ pre.content {
163157

164158
#check-device-online {
165159
display: inline-block;
166-
background: #fff;
167-
opacity: .8;
160+
background: #ddd;
168161
box-sizing: border-box;
169162
padding: 0 0 0 5px;
170163
margin: -7px 0 4px;
@@ -206,7 +199,7 @@ pre.content {
206199
}
207200

208201
#check-device-online:hover {
209-
opacity: 1;
202+
background:#fff;
210203
}
211204

212205

@@ -424,6 +417,9 @@ table.nav {
424417
table.nav td {
425418
background: #fff;
426419
}
420+
table.nav>tr:first-child>td {
421+
background: none;
422+
}
427423

428424
table.nav td.tabmax,
429425
table td.tabmin {
@@ -434,13 +430,20 @@ table.nav td.tabmax {
434430
padding-right: 0;
435431
}
436432

433+
table.nav td.tabmax a,
434+
table.nav td.tabmax div,
435+
table.nav td.tabmax button{
436+
display:inline-block;
437+
height:28px;
438+
}
439+
437440
table.nav td.tabmax button {
438441
margin: -3px 0 4px;
439442
/*padding: 3px 12px;*/
440443
outline: none;
441444
cursor: pointer;
442445
transition: .2s;
443-
opacity: .8;
446+
background:#ddd;
444447
vertical-align: bottom;
445448
}
446449

@@ -450,12 +453,7 @@ table.nav td.tabmax button img {
450453

451454
table.nav td.tabmax button:hover {
452455
box-shadow: none;
453-
opacity: 1;
454-
}
455-
456-
table.nav td.tabmax button:active {
457-
opacity: .7;
458-
border: 1px solid rgba(0, 0, 0, 0)!important;
456+
background:#fff;
459457
}
460458

461459
table.nav table {
@@ -467,6 +465,19 @@ table.nav td.tabon {
467465
background: #ddd;
468466
}
469467

468+
button#runButton{
469+
background:#dd4b39;
470+
border-color:#dd4b39;
471+
}
472+
473+
table.nav td.tabmax button.opened{
474+
background:#fff;
475+
}
476+
477+
table.nav td.tabmax button.running{
478+
background:#999;
479+
}
480+
470481

471482
td#copyCode {
472483
background-image: linear-gradient(top, #ddd 0%, #fff 100%);
@@ -573,8 +584,7 @@ td#copyCode div {
573584
display: inline-block;
574585
font-size: 16px;
575586
color: #000;
576-
background: #fff;
577-
opacity:.8;
587+
background: #ddd;
578588
transition: .3s;
579589
border-radius: 5px;
580590
margin: -7px 0 4px;
@@ -595,7 +605,7 @@ td#copyCode div {
595605
}
596606

597607
.linkButton:hover {
598-
opacity:1;
608+
background: #fff;
599609
}
600610

601611
.linkButton:active {

0 commit comments

Comments
 (0)