Browse Source

Added Layouts support to dracula theme. Improved performance

sisyphus
JezerM 3 years ago
parent
commit
ea7be6c700
No known key found for this signature in database
GPG Key ID: 66BBC5D01388C6B5
  1. 23
      themes/dracula/css/style.css
  2. 20
      themes/dracula/index.html
  3. 4
      themes/dracula/js/backgrounds.js
  4. 6
      themes/dracula/js/index.js

23
themes/dracula/css/style.css vendored

@ -332,6 +332,10 @@ button {
background-color: var(--orange); background-color: var(--orange);
} }
.button-group .hide {
display: none;
}
/* Auth message */ /* Auth message */
#auth-message { #auth-message {
@ -566,8 +570,25 @@ button {
backdrop-filter: blur(20px); backdrop-filter: blur(20px);
border-radius: 2px; border-radius: 2px;
} }
#system-bar > *:hover { #system-bar > *:hover, #system-bar > *:focus {
background-color: #2828280e; background-color: #2828280e;
backdrop-filter: blur(50px);
}
#layouts-list {
padding: 0;
}
#layouts-button {
all: unset;
cursor: pointer;
padding: 8px;
}
#layouts-dropdown {
position: absolute;
margin: 2px;
bottom: 100%;
display: flex;
flex-direction: column-reverse;
} }
/* Animations */ /* Animations */

20
themes/dracula/index.html vendored

@ -15,7 +15,6 @@
<div id="background"> <div id="background">
<div id="bg-cover"></div> <div id="bg-cover"></div>
<img src="./assets/dracula.png" alt="">
</div> </div>
<button id="cover" class="hide"> <button id="cover" class="hide">
@ -102,15 +101,25 @@
</div> </div>
<button id="panel-button" class="button">
<span class="mdi mdi-menu mdi-24px"></span>
</button>
<div id="system-bar"> <div id="system-bar">
<div id="layouts-list">
<button id="layouts-button" class="">
LATAM
</button>
<ul id="layouts-dropdown" class="dropdown hide">
<li><button>Latam</button></li>
<li><button>English</button></li>
</ul>
</div>
<div id="brightness-label"></div> <div id="brightness-label"></div>
<div id="battery-label"></div> <div id="battery-label"></div>
</div> </div>
<button id="panel-button" class="button">
<span class="mdi mdi-menu mdi-24px"></span>
</button>
<div id="sidebar" class="panel hide"> <div id="sidebar" class="panel hide">
<h3>Background selector</h3> <h3>Background selector</h3>
<button id="close-panel-button" class="button"> <button id="close-panel-button" class="button">
@ -138,6 +147,7 @@
<script src="js/sidebar.js"></script> <script src="js/sidebar.js"></script>
<script src="js/backgrounds.js"></script> <script src="js/backgrounds.js"></script>
<script src="js/time-date.js"></script> <script src="js/time-date.js"></script>
<script src="js/layouts.js"></script>
<script src="js/power.js"></script> <script src="js/power.js"></script>
<script src="js/battery.js"></script> <script src="js/battery.js"></script>
<script src="js/brightness.js"></script> <script src="js/brightness.js"></script>

4
themes/dracula/js/backgrounds.js vendored

@ -35,6 +35,10 @@ class Backgrounds {
_updateBackgroundImages() { _updateBackgroundImages() {
let img = this._background.querySelector("img") let img = this._background.querySelector("img")
if (!img) {
img = document.createElement("img")
this._background.appendChild(img)
}
img.src = this._backgroundPath img.src = this._backgroundPath
this._localStorage.setItem("defaultBackgroundImage", String(this._backgroundPath)) this._localStorage.setItem("defaultBackgroundImage", String(this._backgroundPath))
} }

6
themes/dracula/js/index.js vendored

@ -20,7 +20,7 @@ async function wait(ms) {
async function initGreeter() { async function initGreeter() {
if (greeter_config.greeter.debug_mode) { if (greeter_config.greeter.debug_mode) {
debug = new Debug() //debug = new Debug()
} }
lightdm.authentication_complete?.connect(() => authentication_done()) lightdm.authentication_complete?.connect(() => authentication_done())
@ -39,8 +39,10 @@ async function initGreeter() {
time_date = new TimeDate() time_date = new TimeDate()
layouts = new Layouts()
backgrounds = new Backgrounds() backgrounds = new Backgrounds()
await backgrounds._init() backgrounds._init()
power = new Power() power = new Power()

Loading…
Cancel
Save