Skip to content

Commit 7c7894b

Browse files
committed
no-hover mode
1 parent b131b44 commit 7c7894b

File tree

4 files changed

+85
-4
lines changed

4 files changed

+85
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emulsion",
3-
"version": "0.9.98",
3+
"version": "0.9.99",
44
"summary": "Better gaming throught chemistry",
55
"description": "Display your games collection into responsive galleries, manage game metadata, cover art and emulator configuration. Launch your games in style.",
66
"homepage": "https://yphil.gitlab.io/emulsion",

src/css/init.css

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,61 @@ h3 {
151151
color:var(--color-text-1);
152152
}
153153

154-
/* .no-hover * { */
155-
/* pointer-events: none !important; */
156-
/* } */
154+
.no-hover *,
155+
.no-hover *::before,
156+
.no-hover *::after {
157+
pointer-events: none !important;
158+
}
159+
160+
.no-hover .hover:hover {
161+
color: inherit !important;
162+
}
163+
164+
.no-hover svg.icon:hover {
165+
fill: inherit !important;
166+
}
167+
168+
.no-hover .page-content.list .game-container:hover {
169+
background-color: inherit !important;
170+
}
171+
172+
.no-hover .page-content:not(.list) .game-container img:hover,
173+
.no-hover .page-content:not(.list) .game-container-image:hover {
174+
/* Override hover effects for grid view images */
175+
}
176+
177+
.no-hover .menu-game-container:hover {
178+
border-color: inherit !important;
179+
}
180+
181+
.no-hover .btn:hover {
182+
transform: none !important;
183+
}
184+
185+
.no-hover .preferences-error-dialog .reset:hover {
186+
background: inherit !important;
187+
}
188+
189+
.no-hover .preferences-error-dialog .quit:hover {
190+
background: inherit !important;
191+
}
192+
193+
.no-hover .controls i:hover {
194+
color: inherit !important;
195+
}
196+
197+
.no-hover .button:hover,
198+
.no-hover .button:focus {
199+
/* Override button hover effects */
200+
}
201+
202+
.no-hover input[type="range"]::-webkit-slider-thumb:hover {
203+
background-color: inherit !important;
204+
}
205+
206+
.no-hover *::-webkit-scrollbar-thumb:hover {
207+
background-color: inherit !important;
208+
}
157209

158210
a:link {
159211
color: red;

src/js/app.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ window.LB = LB;
3030
let mouseBlankerTimer = null;
3131
let lastInputWasMouse = false;
3232
const MOUSE_TIMEOUT = 3000;
33+
let storedTitles = new Map(); // Store title attributes for restoration
3334

3435
function handleMouseInput() {
3536
lastInputWasMouse = true;
@@ -48,16 +49,40 @@ function resetMouseTimer() {
4849
mouseBlankerTimer = setTimeout(hideCursor, MOUSE_TIMEOUT);
4950
}
5051

52+
function removeTitles() {
53+
// Store and remove all title attributes
54+
const elementsWithTitles = document.querySelectorAll('[title]');
55+
elementsWithTitles.forEach(element => {
56+
storedTitles.set(element, element.title);
57+
element.removeAttribute('title');
58+
});
59+
}
60+
61+
function restoreTitles() {
62+
// Restore all stored title attributes
63+
storedTitles.forEach((title, element) => {
64+
if (element && element.isConnected) { // Check if element still exists in DOM
65+
element.title = title;
66+
}
67+
});
68+
storedTitles.clear();
69+
}
70+
5171
function showCursor() {
5272
document.body.style.cursor = 'default';
5373
document.body.classList.remove('no-hover');
74+
restoreTitles();
5475
}
5576

5677
function hideCursor() {
5778
document.body.style.cursor = 'none';
5879
document.body.classList.add('no-hover');
80+
removeTitles();
5981
}
6082

83+
// Make hideCursor globally available for gamepad input detection
84+
window.hideCursor = hideCursor;
85+
6186
async function initializeApp() {
6287
try {
6388
// Load all app data and preferences in one call

src/js/slideshow.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@ export function initGamepad() {
929929
}
930930

931931
function handleGameControllerButtonPress(buttonIndex) {
932+
// Trigger no-hover mode when any gamepad input is detected
933+
if (window.hideCursor) {
934+
window.hideCursor();
935+
}
932936

933937
switch (buttonIndex) {
934938
case 0:

0 commit comments

Comments
 (0)