Skip to content

Commit

Permalink
webui: change toggle position
Browse files Browse the repository at this point in the history
as the previous position is quite ugly in ksu/apatch
  • Loading branch information
KOWX712 committed Dec 14, 2024
1 parent 89ae7a5 commit 8bc58a8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 36 deletions.
13 changes: 7 additions & 6 deletions module/webroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
<i class="fa fa-play"></i>
</button>
</div>
<div class="controlPanel" id="control-panel">
<div class="box" id="status-box">
<h2 id="status-header">Status</h2>
<p id="status-text">Initializing...</p>
</div>
<div class="box" id="control-panel">
<h2>Control Panel</h2>
<div class="toggle-container">
<i id="update-icon" class="fa fa-download"></i>
<span id="update-text">Update</span>
Expand All @@ -33,18 +38,14 @@
</label>
</div>
<div class="action-redirect-container">
<i id="action-icon" class="fa fa-play"></i>
<i id="action-icon" class="fa fa-play"></i>
<span id="action-redirect-text">Action Redirect</span>
<label class="toggle-switch">
<input type="checkbox" id="action-redirect" disabled>
<span class="slider round"></span>
</label>
</div>
</div>
<div class="box" id="status-box">
<h2 id="status-header">Status</h2>
<p id="status-text">Initializing...</p>
</div>
<div class="box">
<h2>
Custom Rules
Expand Down
44 changes: 14 additions & 30 deletions module/webroot/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,66 +108,46 @@ body.input-focused {
font-size: 14px;
}

.controlPanel {
position: relative;
width: calc(85vw + 30px);
max-width: 830px;
background-color: transparent;
padding: 0;
margin: 0;
padding-top: 5px;
border: none;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}

.action-redirect-container {
display: none;
align-items: center;
margin-top: 5px;
margin-right: auto;
margin-bottom: 5px;
background-color: #fff;
padding: 2px 10px;
border-radius: 10px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
border: 1px solid #ccc;
height: 38px;
white-space: nowrap;
text-align: left;
flex-shrink: 0;
}

.toggle-container {
display: flex;
align-items: center;
margin-top: 5px;
margin-right: 7px;
margin-bottom: 5px;
background-color: #fff;
padding: 2px 10px;
border-radius: 10px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
border: 1px solid #ccc;
height: 38px;
white-space: nowrap;
text-align: left;
flex-shrink: 0;
}

#action-redirect-text {
font-size: 16px;
font-weight: bold;
padding-right: 7px;
padding-left: 6px;
padding-left: 13px;
}

#action-icon {
font-size: 17px;
font-size: 20px;
}

#update-text {
font-size: 16px;
font-weight: bold;
padding-right: 7px;
padding-left: 5px;
padding-left: 10px;
}

#update-icon {
Expand All @@ -178,6 +158,7 @@ body.input-focused {
.toggle-switch {
position: relative;
display: inline-block;
margin-left: auto;
width: 40px;
height: 25px;
}
Expand Down Expand Up @@ -423,7 +404,6 @@ label {
color: white;
font-size: 15px;
padding: 5px 15px;
z-index: 1000;
transform: translateY(100%);
transition: transform 0.5s ease, background-color 0.2s ease;
white-space: nowrap;
Expand Down Expand Up @@ -507,8 +487,6 @@ label {
color: #eee
}

.action-redirect-container,
.toggle-container,
.box {
background-color: #343434;
}
Expand All @@ -524,6 +502,12 @@ label {
border: 1px solid #6E6E6E;
}

.action-redirect-container,
.toggle-container {
background-color: #343434;
border: 1px solid #6E6E6E;
}

.controlPanel {
background-color: none;
}
Expand Down

0 comments on commit 8bc58a8

Please sign in to comment.