full page redesign; improved light theme
This commit is contained in:
parent
b58290b4e5
commit
6ee4538dc3
9 changed files with 379 additions and 284 deletions
13
public/script/index.js
Normal file
13
public/script/index.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { hijackClickEvent } from './main.js';
|
||||
|
||||
document.addEventListener('readystatechange', () => {
|
||||
document.querySelectorAll("#project-list .project-item").forEach(projectItem => {
|
||||
const link = projectItem.querySelector('a');
|
||||
hijackClickEvent(projectItem, link);
|
||||
});
|
||||
|
||||
document.querySelectorAll("#crew-list .crew-item .crew-info").forEach(crewItem => {
|
||||
const link = crewItem.querySelector('a.handle');
|
||||
hijackClickEvent(crewItem, link);
|
||||
});
|
||||
});
|
16
public/script/main.js
Normal file
16
public/script/main.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
export function hijackClickEvent(container, link) {
|
||||
container.addEventListener('click', event => {
|
||||
if (event.target.tagName.toLowerCase() === 'a') return;
|
||||
event.preventDefault();
|
||||
link.dispatchEvent(new MouseEvent('click', {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
view: window,
|
||||
ctrlKey: event.ctrlKey,
|
||||
metaKey: event.metaKey,
|
||||
shiftKey: event.shiftKey,
|
||||
altKey: event.altKey,
|
||||
button: event.button,
|
||||
}));
|
||||
});
|
||||
}
|
1
public/script/vendor/htmx.min.js
vendored
1
public/script/vendor/htmx.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue