Skip to content

Commit b7eb5ec

Browse files
committed
feat(theme): add hypermind theme with notification support
Added a new (official) hypermind theme with color scheme to match new site and a notification display when switching themes
1 parent 5d5217e commit b7eb5ec

File tree

8 files changed

+112
-3
lines changed

8 files changed

+112
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ A completely decentralized chat system built directly on top of the swarm topolo
5050
### 3. Visualizations
5151
* **Particle Map:** Visualizes approximate peer locations (if enabled).
5252
* **Themes:** Built-in theme switcher (Nord, Solarized, Tokyo Night, etc).<br>
53-
<img src="assets/images/default-theme.png" width="100" alt="Default" /> <img src="assets/images/nord-dark-theme.png" width="100" alt="Nord" /> <img src="assets/images/solarized-light-theme.png" width="100" alt="Solarized" /> <img src="assets/images/tokyo-night-theme.png" width="100" alt="Tokyo Night" /> <img src="assets/images/volcano-theme.png" width="100" alt="Volcano" />
53+
<img src="assets/images/default-theme.png" width="100" alt="Default" /> <img src="assets/images/nord-dark-theme.png" width="100" alt="Nord" /> <img src="assets/images/solarized-light-theme.png" width="100" alt="Solarized" /> <img src="assets/images/tokyo-night-theme.png" width="100" alt="Tokyo Night" /> <img src="assets/images/volcano-theme.png" width="100" alt="Volcano" /> <img src="assets/images/hypermind-theme.png" width="100" alt="Hypermind" />
5454

5555
---
5656

THEMES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
![Volcano theme screenshot](assets/images/volcano-theme.png)
2222

23+
### Hypermind
24+
25+
![Hypermind theme screenshot](assets/images/hypermind-theme.png)
26+
2327
# Contributing custom themes
2428

2529
1. Fork `main` and clone locally to your device.
@@ -35,6 +39,7 @@
3539
'nord-dark.css',
3640
'solarized-light.css',
3741
'volcano.css',
42+
'hypermind.css',
3843
'new-theme.css' /* always add to the end of the list
3944
];
4045
```

assets/images/hypermind-theme.png

35.2 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hypermind",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "A decentralized P2P counter of active deployments",
55
"main": "server.js",
66
"scripts": {

public/app.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,39 @@ const themes = [
823823
"nord-dark.css",
824824
"solarized-light.css",
825825
"volcano.css",
826+
"hypermind.css",
826827
];
827828

828829
let currentThemeIndex = 0;
830+
let notificationTimeout;
831+
832+
function showThemeNotification(themeName) {
833+
const notification = document.getElementById("theme-notification");
834+
if (!notification) return;
835+
836+
const displayName = themeName
837+
.replace(".css", "")
838+
.split("-")
839+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
840+
.join(" ");
841+
842+
notification.innerText = `Theme: ${displayName}`;
843+
notification.classList.remove("hidden");
844+
845+
notification.offsetHeight;
846+
847+
notification.classList.add("show");
848+
849+
if (notificationTimeout) clearTimeout(notificationTimeout);
850+
851+
notificationTimeout = setTimeout(() => {
852+
notification.classList.remove("show");
853+
setTimeout(() => {
854+
notification.classList.add("hidden");
855+
}, 300);
856+
}, 2000);
857+
}
829858

830-
// Initialize currentThemeIndex based on the theme loaded by index.html
831859
const currentThemeLink = document.getElementById("theme-css");
832860
if (currentThemeLink) {
833861
const currentThemeName = currentThemeLink.href.split("/").pop();
@@ -856,6 +884,7 @@ function cycleTheme() {
856884
localStorage.setItem("hypermind-theme", newTheme);
857885
btn.disabled = false;
858886
btn.style.opacity = "";
887+
showThemeNotification(newTheme);
859888
};
860889

861890
newLink.onerror = () => {

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
<button id="theme-switcher" class="theme-btn {{THEMES_CLASS}}" title="Cycle Themes">
125125
<span class="material-symbols-outlined">palette</span>
126126
</button>
127+
<div id="theme-notification" class="theme-notification hidden"></div>
127128
<div id="terminal" class="terminal hidden">
128129
<div id="terminal-resizer" class="terminal-resizer"></div>
129130
<button id="terminal-toggle" class="terminal-toggle" title="Toggle Chat">

public/style.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,37 @@ a { color: var(--color-text-anchor-link); text-decoration: none; border-bottom:
182182
color: var(--color-theme-toggle-hover);
183183
}
184184

185+
.theme-notification {
186+
position: fixed;
187+
bottom: 1.5rem;
188+
left: 4.5rem;
189+
background: var(--color-terminal-bg);
190+
border: 1px solid var(--color-terminal-border);
191+
color: var(--color-terminal-text-default);
192+
padding: 6px 12px;
193+
border-radius: 6px;
194+
font-size: 0.8rem;
195+
z-index: 1000;
196+
pointer-events: none;
197+
opacity: 0;
198+
transition: opacity 0.3s ease, transform 0.3s ease;
199+
transform: translateX(-10px);
200+
white-space: nowrap;
201+
box-shadow: 0 2px 8px var(--color-terminal-shadow);
202+
display: flex;
203+
align-items: center;
204+
gap: 8px;
205+
}
206+
207+
.theme-notification.show {
208+
opacity: 1;
209+
transform: translateX(0);
210+
}
211+
212+
.theme-notification.hidden {
213+
display: none;
214+
}
215+
185216
.terminal {
186217
position: fixed;
187218
bottom: 0;

public/themes/hypermind.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
:root {
2+
--color-count: #718062;
3+
--color-particle: #718062;
4+
--color-particle-link: rgba(113, 128, 98, 0.15);
5+
--color-pulse: #daba8b;
6+
--color-theme-toggle: #718062;
7+
--color-theme-toggle-hover: #daba8b;
8+
--color-bg-main: #191716;
9+
--color-bg-overlay: rgba(25, 23, 22, 0.8);
10+
11+
--color-text-default: #daba8b;
12+
--color-text-main-label: #a17e3e;
13+
--color-text-footer: #65788f;
14+
--color-text-footer-hover: #a17e3e;
15+
--color-text-debug: #65788f;
16+
--color-text-debug-link: #65788f;
17+
--color-text-debug-link-hover: #a17e3e;
18+
--color-text-anchor-link: #65788f;
19+
20+
--color-modal-bg: #191716;
21+
--color-modal-border: #0f0e0d;
22+
--color-modal-title: #8c4f4a;
23+
--color-modal-close-btn: #0f0e0d;
24+
--color-modal-close-btn-hover: #8c4f4a;
25+
--color-modal-stat-div: #0f0e0d;
26+
--color-modal-stat-label: #65788f;
27+
--color-modal-stat-value: #a17e3e;
28+
--color-modal-footer: #0f0e0d;
29+
30+
--color-terminal-bg: rgba(25, 23, 22, 0.9);
31+
--color-terminal-border: #0f0e0d;
32+
--color-terminal-shadow: rgba(0, 0, 0, 0.3);
33+
--color-terminal-input-text: #daba8b;
34+
--color-terminal-input-divider: #0f0e0d;
35+
--color-terminal-output-message: #c8b491;
36+
--color-terminal-tab-arrow: #718062;
37+
--color-terminal-tab-arrow-hover: #daba8b;
38+
--color-terminal-tab-bg-hover: #0f0e0d;
39+
--color-terminal-status-message: #65788f;
40+
--color-terminal-scrollbar: #a17e3e;
41+
--color-terminal-scrollbar-hover: #8c4f4a;
42+
--color-terminal-text-default: #718062;
43+
}

0 commit comments

Comments
 (0)