Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobuxstation committed Mar 10, 2024
1 parent bc6362e commit 810bdc7
Show file tree
Hide file tree
Showing 12 changed files with 508 additions and 390 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
-u "${CIRCLE_PROJECT_USERNAME}" \
-r "${CIRCLE_PROJECT_REPONAME}" \
-c "${CIRCLE_SHA1}" \
v1.2.5 /tmp/filesystem
v1.2.6 /tmp/filesystem
workflows:
build_and_publish:
Expand Down
284 changes: 284 additions & 0 deletions apps/settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
<html>

<head>
<script src="fontawesome.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../scroll.css" id="style">
<style>
* {
margin: 0;
padding: 0;
font-family: Inter;
user-select: none;
}

input[type='file'] {
font-size: 0;
padding: 0px;
}

.div {
text-align: left;
background: none;
padding: 0;
height: 23px;
}

#applist {
width: 87.5%;
padding: 15px;
}

::file-selector-button {
color: white;
font-size: initial;
font-family: Inter;
background: none;
border: none;
float: left;
margin: 0;
padding: 0;
}

.content {
width: 80vw;
height: 100vh;
float: right;
background: lightgray;
padding: 15px;
box-sizing: border-box;
overflow: auto;
}

.applistsidebar {
width: 20vw;
height: 100vh;
position: fixed !important;
z-index: 2;
float: left;
overflow: auto;
background-color: #1d1d1ddd;
backdrop-filter: blur(10px);
color: white;
overflow-x: hidden;
padding: 10px;
box-sizing: border-box;
}

input {
background: none;
border: none;
border-radius: 2.5px;
padding: 2px;
transition: all 0.1s ease;
color: white;
}

summary {
font-weight: bold;
}

button,
input {
background: lightgray;
border: #767676 solid 1px;
border-radius: 2.5px;
padding: 5px;
transition: all 0.1s ease;
}

.content button:hover,
input:hover {
background: rgb(192, 192, 192);
border: #767676 solid 1px;
border-radius: 2.5px;
transition: all 0.1s ease;
}

.content button:active,
input:active {
background: gray;
border: #1d1d1d solid 1px;
border-radius: 2.5px;
transition: all 0.1s ease;
}

.card img {
width: 10vw;
margin-bottom: 10px;
aspect-ratio: 1/1;
}

.card {
margin-right: 10px;
margin-bottom: 10px;
}

fieldset {
padding: 10px;
border-radius: 5px;
}

input {
color: black;
}
</style>
</head>

<body id="body">
<section>
<div class="div">
<div class="content">
<fieldset>
<legend>Background</legend>
<button onclick="bg('bg.jpg')">Normal</button><br><br>
<button onclick="bg('background/citywater.png')">City With Water</button><br><br>
<button onclick="bg('background/Flowers.png')">Flowers</button><br><br>
<button onclick="bg('background/Boardwalk.png')">Boardwalk</button><br><br>
<button onclick="bg('https://source.unsplash.com/1600x900/?landscape')">Random</button><br><br>
<button onclick="document.getElementById('file-input').click()">Custom</button>
<input type="file" accept="image/*" id="file-input" onchange="custom_bg(event)" hidden>
</fieldset>

<fieldset>
<legend>Display</legend>
<button onclick="zoom(-0.25)">-</button>
<button id="zoomMeter">1</button>
<button onclick="zoom(0.25)">+</button>
</fieldset>

<fieldset>
<legend>Themes</legend>
<button onclick="theme1()">Default</button><br><br>
<input id="cssimport" placeholder="Import Theme"></input> <button
onclick="cssimport()">Import</button>
</fieldset>

<fieldset>
<legend>Footer</legend>
<input id="changelogo" placeholder="Customize menu launch icon"></input> <button
onclick="changelogo()">Change</button><br><br>
<button onclick="iconstyle('left')">Left align icons</button>
<button onclick="iconstyle('center')">Center icons</button>
</fieldset>

<fieldset>
<legend>Experimental</legend>
<input id="notifybeta" placeholder="Write a notification"></input> <button
onclick="notifybeta()">Notify</button>
</fieldset>
</div>

<div class="applistsidebar">
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-paint-roller"></i> Background</H4>
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-display"></i> Display</H4>
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-palette"></i> Themes</H4>
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-rectangle-list"></i> Footer</H4>
<h4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-flask"></i> Experimental</h4>
</div>
</div>
</section>
</body>

<script>
const remote = require('@electron/remote');
const app = remote.app;
const configDir = app.getPath('userData');
const desktopConfig = require(configDir + '/desktopconfig.json');
const fs = require("fs")

document.getElementById("zoomMeter").innerText = desktopConfig.zoomVal + 1

function isEmptyOrSpaces(str) {
return str === null || str.match(/^ *$/) !== null;
}

function notifybeta() {
notificationvar = document.getElementById('notifybeta').value;
kasiusAPI.notify(notificationvar, "", false)
}

function zoom(val) {
document.getElementById("zoomMeter").innerText = desktopConfig.zoomVal + val + 1

var obj = (desktopConfig);
obj.zoomVal += val;
jsonStr = JSON.stringify(obj, null, "\t");
console.log(jsonStr)

fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}

//background
function bg(background) {
var obj = (desktopConfig);
obj.backgroundImage = background;
jsonStr = JSON.stringify(obj, null, "\t");
console.log(jsonStr)

fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}

//custom bg
function custom_bg(event) {
var reader = new FileReader();
reader.onload = function () {
var obj = (desktopConfig);
obj.backgroundImage = reader.result;
jsonStr = JSON.stringify(obj, null, "\t");
console.log(jsonStr)

fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}
reader.readAsDataURL(event.target.files[0]);
}

//Color scheme
async function cssimport() {
b = document.getElementById("cssimport").value;
if (isEmptyOrSpaces(b)) {
document.getElementById("cssimport").value = ''
return
};

let fetching = await fetch(b)

var obj = (desktopConfig);
obj.theme = b;
jsonStr = JSON.stringify(obj, null, "\t");
fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}

//themes
function theme1() {
var obj = (desktopConfig);
obj.theme = "style.css";
jsonStr = JSON.stringify(obj, null, "\t");
fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}

//footer
async function changelogo() {
c = document.getElementById("changelogo").value;
if (isEmptyOrSpaces(b)) {
document.getElementById("cssimport").value = ''
return
};

let fetching = await fetch(c)

var obj = (desktopConfig);
obj.footerIcon = c;
jsonStr = JSON.stringify(obj, null, "\t");
fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}

function iconstyle(style) {
var obj = (desktopConfig);
obj.iconStyle = style;
jsonStr = JSON.stringify(obj, null, "\t");
fs.writeFileSync(configDir + '/desktopconfig.json', jsonStr);
}
</script>

</html>
71 changes: 1 addition & 70 deletions kasiusdesktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<script type="text/javascript" src="scripts/jsonloader.js"></script>
<script type="text/javascript" src="scripts/jquery-ui.min.js"></script>
<script type="text/javascript" src="scripts/jqueryui2.js"></script>
<script type="text/javascript" src="scripts/close.js"></script>
<script type="text/javascript" src="scripts/fontawesome.js"></script>
<script type="text/javascript" src="scripts/time.js" defer></script>
Expand Down Expand Up @@ -63,71 +62,6 @@ <h4 id="errormessagetext">messagehere</h4>
<!--Window-->

<section style="height: 100vh; " id="section">
<div id="shortcuts">

</div>
<div style="display: none;" class="window" id="window6" onclick="focusWindow(this)">
<div class="header" id="header">
<button class="headertext">Settings</button>
<button onclick="Closetestwindow6()" class="closebutton"><i class="fa-solid fa-xmark"></i></button>
<button
onclick="hide('window6'); document.getElementById('minimizedsettings').className = 'menubuttonminimized'"
class="minimize"><i class="fa-solid fa-window-minimize"></i></button>
</div>
<div class="content" style="width: 800px;">
<div class="settingssidebar"
style="width: 162px;float: left;height: 450px;backdrop-filter: blur(10px);box-sizing: border-box;padding: 10px;">
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-paint-roller"></i> Background
</H4>
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-display"></i> Display</H4>
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-palette"></i> Themes</H4>
<H4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-rectangle-list"></i> Footer</H4>
<h4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-flask"></i> Experimental</h4>
</div>
<div class="Settings"
style="background-color: lightgray;float: right;width: 638px;height: 450px;padding: 10px;overflow: auto;box-sizing: border-box;">

<fieldset>
<legend>Background</legend>
<button onclick="bg('bg.jpg')">Normal</button><br><br>
<button onclick="bg('background/citywater.png')">City With Water</button><br><br>
<button onclick="bg('background/Flowers.png')">Flowers</button><br><br>
<button onclick="bg('background/Boardwalk.png')">Boardwalk</button><br><br>
<button onclick="bg('https://source.unsplash.com/1600x900/?landscape')">Random</button><br><br>
<input type="file" accept="image/*" onchange="custom_bg(event)">
</fieldset>

<fieldset>
<legend>Display</legend>
<button onclick="zoom(-0.25)">-</button>
<button id="zoomMeter">1</button>
<button onclick="zoom(0.25)">+</button>
</fieldset>

<fieldset>
<legend>Themes</legend>
<button onclick="theme1()">Default</button><br><br>
<input id="cssimport" placeholder="Import Theme"></input> <button
onclick="cssimport()">Import</button>
</fieldset>

<fieldset>
<legend>Footer</legend>
<input id="changelogo" placeholder="Customize menu launch icon"></input> <button
onclick="changelogo()">Change</button><br><br>
<button onclick="iconstyle('left')">Left align icons</button>
<button onclick="iconstyle('center')">Center icons</button>
</fieldset>

<fieldset>
<legend>Experimental</legend>
<input id="notifybeta" placeholder="Write a notification"></input> <button
onclick="notifybeta()">Notify</button><br><br>
<button onclick="remote.getCurrentWindow().webContents.openDevTools()">Open Developer
Console</button>
<button onclick="appDebugMode = true">Enable app developer mode</button>
</fieldset>
</div>
</section>

<!--Footer-->
Expand All @@ -138,10 +72,7 @@ <h4 style="padding:5px; margin-bottom: 5px;"><i class="fa-solid fa-flask"></i> E
style="height: 24px; margin-top: 3px; width: 22.5px;"></img></button>
<nav>
<ul id="footer1">
<li><button style="display: none;"
onclick="show('window6'); this.className = 'menubuttonminimized menubuttonminimizing'; focusWindow(document.getElementById('window6'))"
class="menubuttonminimized" id="minimizedsettings"><i
style="padding-top: 2px;padding-left: 1px;" class="fa-solid fa-gear"></i></button></li>

</ul>
</nav>
<button style="float: right;" onclick="NotificationMenu(); refreshWifiPicker(); getBatteryInfo()" class="menubutton"
Expand Down
Loading

0 comments on commit 810bdc7

Please sign in to comment.