Skip to content

Commit 46e7bbf

Browse files
committed
fix: improve ux
1 parent eee901e commit 46e7bbf

2 files changed

Lines changed: 108 additions & 23 deletions

File tree

core/src/server/static/index.html

Lines changed: 69 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@
4444
<style>
4545
/** ectocore **/
4646
:root {
47-
--background-color: #e6eeff;
48-
--header-footer-background: #5282d9;
49-
--banks-background: #94acda;
50-
--highlight-color: #94acda;
51-
--highlight-color-darker: #7799d6;
52-
--highlight-color-darkerer: #5577c6;
53-
--hover-color: #93a6c9;
54-
--hover-color-light: #c3d1f0;
55-
--other-color: #3478ff;
47+
--background-color: #f0f0f0;
48+
--header-footer-background: #1a1a1a;
49+
--banks-background: #b0b0b0;
50+
--highlight-color: #b0b0b0;
51+
--highlight-color-darker: #808080;
52+
--highlight-color-darkerer: #505050;
53+
--hover-color: #909090;
54+
--hover-color-light: #d0d0d0;
55+
--other-color: #000000;
56+
--shadow-color: #00000015;
5657
}
5758
</style>
5859
[[ end ]]
@@ -497,8 +498,9 @@ <h2>Settings</h2>
497498
</dialog>
498499

499500
<header>
500-
<a href=" /"><img src="/static/[[ if .IsEctocore]]ecto/[[ end]]apple-icon.png"
501-
style="filter:brightness(100); max-height: 32px; margin-left: -0.25em;float:right; position:relative;padding-right:1em;"></a>
501+
<a href=" /" id="headerIcon"
502+
style="max-height: 32px; margin-left: -0.25em;float:right; position:relative;padding-right:1em;">
503+
</a>
502504
<h1 style="margin:0; padding:0; font-size:1.5em;"><a
503505
:href="window.location.protocol+'//'+window.location.host + title + '/'">[[ if .IsZeptocore
504506
]]zeptocore.com[[else]]ectocore.rocks[[end]]{{title}}</a>
@@ -968,7 +970,7 @@ <h2>Changes to the Cookie Policy</h2>
968970
<input id="wsfzoom" type="range" min="10" max="5000" value="10">
969971
</p>
970972

971-
<p>
973+
<p style="display:none;">
972974
<input type="checkbox" id="variablesplices" @click="updateSpliceVariable"
973975
v-model="banks[selectedBank].files[selectedFile].SpliceVariable">
974976
<label for="variablesplices">Variable: <span
@@ -1086,6 +1088,46 @@ <h2>Changes to the Cookie Policy</h2>
10861088
<script>
10871089
// global constants
10881090
const isZeptocore = [[ if .IsZeptocore ]]true[[ else]]false[[end]];
1091+
1092+
// Simple hash function for strings
1093+
function hashCode(str) {
1094+
let hash = 0;
1095+
for (let i = 0; i < str.length; i++) {
1096+
const char = str.charCodeAt(i);
1097+
hash = ((hash << 5) - hash) + char;
1098+
hash = hash & hash; // Convert to 32bit integer
1099+
}
1100+
return Math.abs(hash);
1101+
}
1102+
1103+
// Set header icon based on URL hash
1104+
function setHeaderIcon() {
1105+
const url = window.location.pathname;
1106+
const grimoireIndex = hashCode(url) % 7; // 7 grimoires (0-6)
1107+
1108+
// Get the grimoire element
1109+
const grimoireElement = document.getElementById('grimoire' + grimoireIndex);
1110+
if (grimoireElement) {
1111+
const svgClone = grimoireElement.querySelector('svg').cloneNode(true);
1112+
svgClone.setAttribute('width', '32');
1113+
svgClone.setAttribute('height', '32');
1114+
// Change stroke color to white - set on SVG element so inherit works
1115+
svgClone.style.stroke = 'white';
1116+
1117+
const headerIcon = document.getElementById('headerIcon');
1118+
if (headerIcon) {
1119+
headerIcon.innerHTML = '';
1120+
headerIcon.appendChild(svgClone);
1121+
}
1122+
}
1123+
}
1124+
1125+
// Set icon when DOM is ready
1126+
if (document.readyState === 'loading') {
1127+
document.addEventListener('DOMContentLoaded', setHeaderIcon);
1128+
} else {
1129+
setHeaderIcon();
1130+
}
10891131
</script>
10901132
<script src="/static/app.js"></script>
10911133
<script>
@@ -1138,19 +1180,24 @@ <h2>Changes to the Cookie Policy</h2>
11381180

11391181
window.onload = function () {
11401182

1141-
// Display the browser banner if not using Chrome
1142-
if (!isChrome()) {
1143-
document.getElementById('browserBanner').style.display = 'block';
1144-
}
11451183
let consent = localStorage.getItem('cookieConsent');
11461184
if (!consent) {
1147-
document.getElementById('cookieConsentContainer').style.display = 'block';
1185+
const cookieConsentContainer = document.getElementById('cookieConsentContainer');
1186+
if (cookieConsentContainer) {
1187+
cookieConsentContainer.style.display = 'block';
1188+
}
11481189
}
11491190

1150-
document.getElementById('cookieConsentButton').onclick = function () {
1151-
localStorage.setItem('cookieConsent', 'true');
1152-
document.getElementById('cookieConsentContainer').style.display = 'none';
1153-
};
1191+
const cookieConsentButton = document.getElementById('cookieConsentButton');
1192+
if (cookieConsentButton) {
1193+
cookieConsentButton.onclick = function () {
1194+
localStorage.setItem('cookieConsent', 'true');
1195+
const cookieConsentContainer = document.getElementById('cookieConsentContainer');
1196+
if (cookieConsentContainer) {
1197+
cookieConsentContainer.style.display = 'none';
1198+
}
1199+
};
1200+
}
11541201
document.getElementById("show-dialog").addEventListener("click", () => {
11551202
document.getElementById("dialog").showModal();
11561203
});
@@ -1199,4 +1246,4 @@ <h2>Changes to the Cookie Policy</h2>
11991246

12001247
</body>
12011248

1202-
</html>
1249+
</html>

core/src/server/static/style.css

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ a {
507507
}
508508

509509
.file-details {
510-
box-shadow: 3px 3px 2px 1px #bdafedaa;
510+
box-shadow: 3px 3px 2px 1px var(--shadow-color);
511511
}
512512

513513
.cookie-consent-container {
@@ -846,4 +846,42 @@ footer select {
846846

847847
#dialog-settings>p>select {
848848
padding: 0.25em;
849+
}
850+
851+
/* Override jQuery UI blue colors with theme colors */
852+
.ui-visual-focus {
853+
box-shadow: 0 0 3px 1px var(--header-footer-background) !important;
854+
}
855+
856+
.ui-state-active,
857+
.ui-widget-content .ui-state-active,
858+
.ui-widget-header .ui-state-active,
859+
a.ui-button:active,
860+
.ui-button:active,
861+
.ui-button.ui-state-active:hover {
862+
border: 1px solid var(--header-footer-background) !important;
863+
background: var(--header-footer-background) !important;
864+
color: #ffffff !important;
865+
}
866+
867+
.ui-icon-background,
868+
.ui-state-active .ui-icon-background {
869+
border: var(--header-footer-background) !important;
870+
background-color: #ffffff !important;
871+
}
872+
873+
.ui-state-checked {
874+
border: 1px solid var(--header-footer-background) !important;
875+
background: var(--header-footer-background) !important;
876+
}
877+
878+
/* Style checkboxes and radio buttons */
879+
input[type="checkbox"]:checked,
880+
input[type="radio"]:checked {
881+
accent-color: var(--header-footer-background);
882+
}
883+
884+
/* Style range sliders */
885+
input[type="range"] {
886+
accent-color: var(--header-footer-background);
849887
}

0 commit comments

Comments
 (0)