Skip to content

Commit

Permalink
refactor files folders
Browse files Browse the repository at this point in the history
  • Loading branch information
martypdx committed Mar 30, 2024
1 parent 686e68d commit 9964bf1
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FocusPlay from './focus/FocusPlay.jsx';
import Theme from './Theme.jsx';
import Theme from './theme/Theme.jsx';

export default function Header() {
return <header>
Expand Down
38 changes: 0 additions & 38 deletions src/Theme.old.jsx

This file was deleted.

7 changes: 5 additions & 2 deletions src/focus/useFocus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { branch } from 'azoth/chronos/channels';
import { useLocalStorageJSON } from '../local-storage.js';
import './focus.css';

const newFocus = () => ({ priority: '', exit: '' });
const newFocus = level => ({
priority: level ? `level ${level}` : '',
exit: ''
});

export function useFocus() {
const [foci, setLocal] = useLocalStorageJSON('FOP.FOCI', [newFocus()]);
Expand All @@ -21,7 +24,7 @@ export function useFocus() {
};

const add = () => {
foci.push(newFocus());
foci.push(newFocus(foci.length));
save();
changeFocus();
};
Expand Down
43 changes: 0 additions & 43 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,6 @@
--background: var(--light-background);
}

html,
body {
&.light {
--color: var(--light-color);
--background: var(--light-background);
}

&.dark {
--color: var(--dark-color);
--background: var(--dark-background);
}
}

@media (prefers-color-scheme: light) {
html:not(.dark) {
--color: var(--light-color);
--background: var(--light-background);
}
}

@media (prefers-color-scheme: dark) {
html:not(.light) {
--color: var(--dark-color);
--background: var(--dark-background);
}
}

body {
margin: 0;
padding: 2vw 4vw;
Expand All @@ -64,22 +37,6 @@ header {
margin-bottom: 4vw
}

select.theme {
border: 0;
outline: 0;
appearance: none;

font-family: 'Arial';
font-size: 2em;
opacity: .75;
color: var(--color);
background: transparent;
cursor: pointer;
}

html.light select.theme {
opacity: 0.75;
}

#sessions {
padding: 0;
Expand Down
69 changes: 69 additions & 0 deletions src/theme/Theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
html,
body {
&.light {
--color: var(--light-color);
--background: var(--light-background);
}

&.dark {
--color: var(--dark-color);
--background: var(--dark-background);
}
}

@media (prefers-color-scheme: light) {
html:not(.dark) {
--color: var(--light-color);
--background: var(--light-background);
}
}

@media (prefers-color-scheme: dark) {
html:not(.light) {
--color: var(--dark-color);
--background: var(--dark-background);
}
}

select.theme {
border: 0;
outline: 0;
appearance: none;

font-family: 'Arial';
font-size: 2em;
opacity: .75;
color: var(--color);
background: transparent;
cursor: pointer;
}

html.light select.theme {
opacity: 0.75;
}

footer {
position: absolute;
left: 1vw;
bottom: 1vw;
opacity: 0.7;

a,
a:visited,
a:active {
color: var(--color);
}

a {
text-decoration: none;

&:before {
content: 'ⓘ ';
}

span {
text-decoration: underline;
}
}

}
3 changes: 2 additions & 1 deletion src/Theme.jsx → src/theme/Theme.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { unicast } from 'azoth/chronos/generators';
import { consume } from 'azoth/chronos/channels';
import { useLocalStorage } from './local-storage.js';
import { useLocalStorage } from '../local-storage.js';
import './Theme.css';

const html = document.querySelector('html');

Expand Down

0 comments on commit 9964bf1

Please sign in to comment.