mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
Light/dark theme switch
This commit is contained in:
15
res/app.js
15
res/app.js
@@ -169,7 +169,20 @@ $(document).ready(function () {
|
||||
searchbox.addEventListener('input', search);
|
||||
|
||||
|
||||
|
||||
$('input[name="theme"]').change(function(){
|
||||
modname = $('input[name="modname"]').val();
|
||||
$.get("/res/css.php?theme="+this.value+"&modname="+modname, function(data){
|
||||
location.reload();
|
||||
});
|
||||
|
||||
|
||||
// $('body').toggleClass("body-dark");
|
||||
// $('.container-top').toggleClass("container-top-dark");
|
||||
// $('input').toggleClass("input-dark");
|
||||
// $('select').toggleClass("select-dark");
|
||||
// $('option').toggleClass("option-dark");
|
||||
// $('.col-2,.col-3,.col-4').attr({"style":""});
|
||||
});
|
||||
|
||||
|
||||
});
|
56
res/css.php
Normal file
56
res/css.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
|
||||
This file is part of D2Modder
|
||||
|
||||
Redistribution and use in source and binary forms, with
|
||||
or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY!
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// 0 = light
|
||||
// 1 = dark
|
||||
|
||||
include "../_pdo.php";
|
||||
|
||||
$theme = $_GET['theme'];
|
||||
$modname = $_GET['modname'];
|
||||
|
||||
PDO_Connect("sqlite:../D2Modder.db");
|
||||
$sql = "UPDATE D2Modder SET `theme`=$theme WHERE `modname`='$modname'";
|
||||
PDO_Execute($sql);
|
58
res/dark.css
Normal file
58
res/dark.css
Normal file
@@ -0,0 +1,58 @@
|
||||
body {
|
||||
background-color: #222 !important;
|
||||
color: #eee;
|
||||
}
|
||||
.container-top {
|
||||
background: #222;
|
||||
color: #eee;
|
||||
border: none;
|
||||
}
|
||||
input, select{
|
||||
background: url(/img/button.png) !important;
|
||||
background-size: contain;
|
||||
color: #eee;
|
||||
}
|
||||
option {
|
||||
background: #333;
|
||||
color: #eee;
|
||||
}
|
||||
.row {
|
||||
background: none;
|
||||
color: #eee;
|
||||
}
|
||||
.col-2,.col-3,.col-4 {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.sortby {
|
||||
background: #434;
|
||||
padding: 20px;
|
||||
}
|
||||
.viewonly {
|
||||
background: #656;
|
||||
}
|
||||
#search{
|
||||
background: url(/img/button_long.png) !important;
|
||||
background-size: cover;
|
||||
color: #eee;
|
||||
height: 36px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.props input {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.props {
|
||||
background: #222;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
.uniqueitems-select {
|
||||
background: url(/img/button_long.png) !important;
|
||||
background-size: cover;
|
||||
color: #eee;
|
||||
height: 36px;
|
||||
width: 420px;
|
||||
text-align: center;
|
||||
}
|
@@ -38,7 +38,7 @@
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
*/
|
||||
@font-face {
|
||||
font-family: 'Exocet';
|
||||
src: url('/fonts/ExocetHeavy.eot');
|
||||
@@ -105,9 +105,9 @@ option {
|
||||
}
|
||||
|
||||
body {
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
font-family:lato;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
font-family:lato;
|
||||
}
|
||||
|
||||
h1,h2,h3,h4,h5,h6, div > p {
|
||||
@@ -135,13 +135,9 @@ h1,h2,h3,h4,h5,h6, div > p {
|
||||
}
|
||||
|
||||
select {
|
||||
font-size: 18px;
|
||||
border: 1px solid #CCC;
|
||||
height: 34px;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
background: url(https://stackoverflow.com/favicon.ico) 96% / 15% no-repeat #EEE;
|
||||
font-size: 18px;
|
||||
border: 1px solid #CCC;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +157,10 @@ select::-ms-expand {
|
||||
}
|
||||
|
||||
option {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
.props input {
|
||||
margin: 15px 0;
|
||||
}
|
Reference in New Issue
Block a user