Light/dark theme switch

This commit is contained in:
color.diff=auto
2021-03-31 08:52:20 -06:00
parent 02527a0d65
commit 65b3980c44
14 changed files with 192 additions and 43 deletions

View File

@@ -61,7 +61,8 @@ if (!empty($_POST)) {
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
modname VARCHAR(255),
path VARCHAR(255),
lastused INT
lastused INT,
theme INT
)";
PDO_Execute($sql);
@@ -90,7 +91,8 @@ ERROR: INVALID PATH</h1></center>';
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
modname VARCHAR(255),
path VARCHAR(255),
lastused INT
lastused INT,
theme INT
)";
PDO_Execute($sql);

View File

@@ -1,11 +1,24 @@
<div class="container">
<div class=" row" style="background: none;">
<div class="offset-9 col-3" style="background: none;">
<div class=" row" style="background: none;">
<div class="offset-9 col-3" style="background: none;">
<a style="font-weight: bold;" class="btn btn-info" href="/src/D2Config.php">Setup New Mod</a>
<a style="font-weight: bold;" class="btn btn-warning" href="/switchMods.php">Switch Mods</a>
<br><hr>
<div class="custom-control custom-radio custom-control-inline">
<input name="theme" id="theme_0" type="radio" class="custom-control-input" value="0">
<label for="theme_0" class="custom-control-label">Light</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="theme" id="theme_1" type="radio" class="custom-control-input" value="1">
<label for="theme_1" class="custom-control-label">Dark</label>
</div>
<input type="hidden" name="modname" value="<?php echo $_SESSION['modname'] ?>">
</div>
<span id="themeHelpBlock" class="form-text text-muted">Theme</span>
</div>
</div>
</div>
<footer>
<h1 id="credits-">Credits:</h1>
<p><a target="_blank" href="https://d2mods.info">Thanks Phrozen Keep! My favorite mod community since 2002!</a></p>

View File

@@ -53,11 +53,11 @@
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/res/style.css">
<link rel="stylesheet" href="/res/<?php echo $css ?>">
<style>
</style>
<script
src="/res/jquery-3.6.0.min.js"></script>
<script src="/res/jquery-3.6.0.min.js"></script>
<script src="/res/bootstrap.bundle.min.js"></script>
<script src="/res/app.js"></script>

View File

@@ -7,7 +7,7 @@
</div>
</div>
<div class="row" style="">
<div class="col-4">
<div class="col-5">
<select name="uniqueitems" class="custom-select uniqueitems-select">
<option value=""></option>
<?php foreach ($uniqueitems as $u) { ?>
@@ -15,8 +15,8 @@
<?php } ?>
</select>
</div>
<div class="col-8">
<span style="font-family:Exocet;">Sort By: </span>
<div class="col-7 sortby">
<p style="font-family:Exocet;">Sort By: </p>
<div class="custom-control custom-radio custom-control-inline">
<input name="sort" id="sort_0" type="radio" class="custom-control-input" value="lvl">
<label for="sort_0" class="custom-control-label">Level</label>
@@ -33,10 +33,8 @@
<input name="sort" id="sort_3" type="radio" class="custom-control-input" value="code">
<label for="sort_3" class="custom-control-label">Item Code</label>
</div>
</div>
<div class="offset-4 col-8">
<span style="font-family:Exocet;">View Only: </span>
<hr>
<p style="font-family:Exocet;">View Only: </p>
<div class="custom-control custom-radio custom-control-inline">
<input name="view" id="view_0" type="radio" class="custom-control-input" value="rin">
<label for="view_0" class="custom-control-label">Rings</label>
@@ -79,15 +77,15 @@
<div class="col-2" style="background: #eed;">
<p>Version:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="0">
<input name="version" id="version_0" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="0">
<label for="version_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="1">
<input name="version" id="version_1" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="1">
<label for="version_1" class="custom-control-label">1</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="100" checked>
<input name="version" id="version_2" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="100" checked>
<label for="version_2" class="custom-control-label">100</label>
</div><br><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
@@ -98,11 +96,11 @@
<div class="col-2" style="background: #def;">
<p>Enabled:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="enabled" type="radio" class="custom-control-input" value="0" aria-describedby="enabledHelpBlock" required="required">
<input name="enabled" id="enabled_0" type="radio" class="custom-control-input" value="0" aria-describedby="enabledHelpBlock" required="required">
<label for="enabled_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="enabled" type="radio" class="custom-control-input" value="1" aria-describedby="enabledHelpBlock" required="required" checked>
<input name="enabled" id="enabled_1" type="radio" class="custom-control-input" value="1" aria-describedby="enabledHelpBlock" required="required" checked>
<label for="enabled_1" class="custom-control-label">1</label>
</div><br><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
@@ -114,11 +112,11 @@
<p>Ladder:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="ladder" type="radio" class="custom-control-input" value="0" aria-describedby="ladderHelpBlock" required="required" checked>
<input name="ladder" id="ladder_0" type="radio" class="custom-control-input" value="0" aria-describedby="ladderHelpBlock" required="required" checked>
<label for="ladder_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="ladder" type="radio" class="custom-control-input" value="1" aria-describedby="ladderHelpBlock" required="required">
<input name="ladder" id="ladder_1" type="radio" class="custom-control-input" value="1" aria-describedby="ladderHelpBlock" required="required">
<label for="ladder_1" class="custom-control-label">1</label>
</div><br><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
@@ -228,7 +226,7 @@
</div>
<div class="col-3" style="background: #def;">
<div class="col-2" style="background: #def;">
<p>CostAdd</p>
<input value="" name="costadd" type="text" aria-describedby="costaddHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
@@ -236,14 +234,13 @@
</div>
<div class="col-3" style="background: #fde;">
<div class="col-2" style="background: #fde;">
<p>CharTransform</p>
<input name="chrtransform" type="text" aria-describedby="chrtransformHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">ChrTransform: palette shift to apply to the the DCC component-file and the DC6 flippy-file (whenever or not the color shift will apply is determined by Weapons.txt, Armor.txt or Misc.txt). This is an ID pointer from Colors.txt.</span>
</div>
</div>
<div class="form-group row">
<div class="col-2">
<p>InvTransform</p>
@@ -290,7 +287,7 @@
</span><span class="form-text">UseSound: overrides the usesound (the sound played when the item is consumed by the player) specified in Weapons.txt, Armor.txt or Misc.txt for the base item. This field contains an ID pointer from Sounds.txt.</span>
</div>
</div>
<div class="form-group row">
<div class="form-group row props">
<?php
$html = '';

View File

@@ -2,6 +2,5 @@
<div class="offset-10 col-2" style="background: none;">
<button style="" name="submit" type="submit" class="btn btn-success">SAVE</button>
<button name="submit" type="reset" class="btn btn-danger">CLEAR</button>
</div>
</div>
</div>