-
{{ task.id }} {{ task.id_ }} {{ task.title }}
-
- {{ DateTime.fromMillis(task.dueDate).toFormat('dd/MM/yyyy') }}
+
+
+
+
+
+ {{ task.title }}
+
+
-
diff --git a/src/components/TodoList.vue b/src/components/TodoList.vue
new file mode 100644
index 0000000..7d05774
--- /dev/null
+++ b/src/components/TodoList.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ today
+
+ {{ task.title }}
+
+
+ next 7 days
+
+ {{ task.title }}
+
+
+
+
+
+
diff --git a/src/components/TodoListTouch.vue b/src/components/TodoListTouch.vue
new file mode 100644
index 0000000..8fd85c9
--- /dev/null
+++ b/src/components/TodoListTouch.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+ today
+
+ {{ task.title }}
+
+
+ next 7 days
+
+ {{ task.title }}
+
+
+
+
+
+
diff --git a/src/components/forms/CreateForm.vue b/src/components/forms/CreateForm.vue
new file mode 100644
index 0000000..96ec571
--- /dev/null
+++ b/src/components/forms/CreateForm.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
diff --git a/src/components/forms/EditForm.vue b/src/components/forms/EditForm.vue
new file mode 100644
index 0000000..96ec571
--- /dev/null
+++ b/src/components/forms/EditForm.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
diff --git a/src/components/forms/SettingsForm.vue b/src/components/forms/SettingsForm.vue
new file mode 100644
index 0000000..3789b72
--- /dev/null
+++ b/src/components/forms/SettingsForm.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/src/composables/useActions.ts b/src/composables/useActions.ts
index abdb7c5..eca1955 100644
--- a/src/composables/useActions.ts
+++ b/src/composables/useActions.ts
@@ -15,11 +15,13 @@ import {
tagRenameCommand,
} from '../utils/actions.ts'
import { parseCommand } from '../utils/parser.ts'
+import { useSettings } from './useSettings.ts'
import { useTasks } from './useTasks.ts'
export default function useActions() {
const { tasks: tasksOriginal, createTask, updateTask } = useTasks()
- const run = (value: string) => {
+ const { settings } = useSettings()
+ const run = async (value: string) => {
const cmd = parseCommand(value)
let tasksToUpdate: Task[] = []
let taskToCreate: Pick
| null = null
@@ -81,10 +83,9 @@ export default function useActions() {
case 'tagrename':
tasksToUpdate = tagRenameCommand(cmd, tasks)
break
- /* Visibility */
- // case 'hide':
- // updateCandidate = hideCommand(updateCandidate, cmd)
- // break
+ case 'today':
+ settings.value.todayShown = !settings.value.todayShown
+ break
// case 'show':
// updateCandidate = showCommand(updateCandidate, cmd)
// break
@@ -97,12 +98,11 @@ export default function useActions() {
// break
}
}
- // console.log(tasksToUpdate, taskToCreate)
if (tasksToUpdate) {
- updateTask(tasksToUpdate)
+ await updateTask(tasksToUpdate)
}
if (taskToCreate) {
- createTask(taskToCreate)
+ await createTask(taskToCreate)
}
}
return { run }
diff --git a/src/composables/useHistory.ts b/src/composables/useHistory.ts
index c05a179..75a21d4 100644
--- a/src/composables/useHistory.ts
+++ b/src/composables/useHistory.ts
@@ -1,14 +1,13 @@
import { computed, onMounted, ref } from 'vue'
import { useStore } from './useStore.ts'
+const store = ref([])
+const historyIndex = ref(0)
+
export default function useHistory() {
const { getValue, setValue } = useStore()
-
- const store = ref([])
const history = computed(() => store.value)
- const historyIndex = ref(0)
-
const resetHistoryIndex = () => {
historyIndex.value = store.value.length - 1
}
diff --git a/src/composables/useSettings.ts b/src/composables/useSettings.ts
index b66700d..d9898bc 100644
--- a/src/composables/useSettings.ts
+++ b/src/composables/useSettings.ts
@@ -1,63 +1,67 @@
-import { ref, watch } from 'vue';
-import { useStore } from './useStore.ts';
-import { useCrypto } from './useCrypto.ts';
+import { ref, watch } from 'vue'
+import { useCrypto } from './useCrypto.ts'
+import { useStore } from './useStore.ts'
-export type Settings = {
- username: string,
- password: string,
+export interface Settings {
+ username: string
+ password: string
+ todayShown: boolean
}
const settingsDefault: Settings = {
username: '',
password: '',
-};
+ todayShown: false,
+}
+const settings = ref({ ...settingsDefault })
export function useSettings() {
- const { setValue, getValue } = useStore();
- const { encrypt, decrypt } = useCrypto();
- const settings = ref({ ...settingsDefault });
+ const { setValue, getValue } = useStore()
+ const { encrypt, decrypt } = useCrypto()
const loadSettings = async () => {
- const readSettings = await getValue('settings');
+ const readSettings = await getValue('settings')
if (!readSettings) {
- settings.value = { ...settingsDefault };
- return;
+ settings.value = { ...settingsDefault }
+ return
}
- let password = readSettings.password ?? '';
+ let password = readSettings.password ?? ''
if (password) {
try {
- password = decrypt(password) as string;
- } catch (error) {
- console.warn('Failed to decrypt stored password:', error);
+ password = decrypt(password) as string
+ }
+ catch (error) {
+ console.warn('Failed to decrypt stored password:', error)
}
}
settings.value = {
- username: readSettings.username ?? '',
+ ...settingsDefault,
+ ...readSettings,
password,
- };
- };
+ }
+ }
const saveSettings = async () => {
const encryptedPassword = settings.value.password
? encrypt(settings.value.password) as string
- : '';
+ : ''
await setValue('settings', {
- username: settings.value.username,
+ ...settings.value,
password: encryptedPassword,
- });
- };
+ })
+ }
watch(settings, () => {
- void saveSettings();
- }, { deep: true });
+ void saveSettings()
+ }, { deep: true })
- void loadSettings();
+ void loadSettings()
return {
settings,
loadSettings,
- };
+ }
}
diff --git a/src/composables/useTasks.ts b/src/composables/useTasks.ts
index 9f715f4..124ad04 100644
--- a/src/composables/useTasks.ts
+++ b/src/composables/useTasks.ts
@@ -10,7 +10,6 @@ const error = ref(null)
export function useTasks() {
const api = useApi()
-
const fetchTasks = async (force = false) => {
if (tasks.value.length > 0 && !force)
return
diff --git a/src/main.ts b/src/main.ts
index e713407..226e47d 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,5 +1,5 @@
-import { createApp } from "vue";
-import App from "./App.vue";
-import { router } from './router.ts';
+import { createApp } from 'vue'
+import App from './App.vue'
+import { router } from './router.ts'
-createApp(App).use(router).mount("#app");
+createApp(App).use(router).mount('#app')
diff --git a/src/router.ts b/src/router.ts
index 26dcbd6..36de58c 100644
--- a/src/router.ts
+++ b/src/router.ts
@@ -1,10 +1,8 @@
import { createRouter, createWebHistory } from 'vue-router'
import ListScreen from './screens/ListScreen.vue'
-import SettingsScreen from './screens/SettingsScreen.vue'
const routes = [
{ path: '/', component: ListScreen },
- { path: '/settings', component: SettingsScreen },
]
export const router = createRouter({
diff --git a/src/screens/ListScreen.vue b/src/screens/ListScreen.vue
index b98abb8..5acef88 100644
--- a/src/screens/ListScreen.vue
+++ b/src/screens/ListScreen.vue
@@ -1,8 +1,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/styles/main.css b/src/styles/main.css
index 8af7fa7..0af0220 100644
--- a/src/styles/main.css
+++ b/src/styles/main.css
@@ -2,41 +2,80 @@
@plugin "daisyui";
+
@plugin "daisyui/theme" {
- name: "emerald";
+ name: "lofi";
default: true;
- prefersdark: true;
+ prefersdark: false;
color-scheme: "light";
--color-base-100: oklch(100% 0 0);
- --color-base-200: oklch(93% 0 0);
- --color-base-300: oklch(86% 0 0);
- --color-base-content: oklch(35.519% 0.032 262.988);
- --color-primary: oklch(76.662% 0.135 153.45);
- --color-primary-content: oklch(33.387% 0.04 162.24);
- --color-secondary: oklch(61.302% 0.202 261.294);
+ --color-base-200: oklch(97% 0 0);
+ --color-base-300: oklch(94% 0 0);
+ --color-base-content: oklch(0% 0 0);
+ --color-primary: oklch(15.906% 0 0);
+ --color-primary-content: oklch(100% 0 0);
+ --color-secondary: oklch(21.455% 0.001 17.278);
--color-secondary-content: oklch(100% 0 0);
- --color-accent: oklch(72.772% 0.149 33.2);
- --color-accent-content: oklch(0% 0 0);
- --color-neutral: oklch(35.519% 0.032 262.988);
- --color-neutral-content: oklch(98.462% 0.001 247.838);
- --color-info: oklch(72.06% 0.191 231.6);
- --color-info-content: oklch(0% 0 0);
- --color-success: oklch(64.8% 0.15 160);
- --color-success-content: oklch(0% 0 0);
- --color-warning: oklch(84.71% 0.199 83.87);
- --color-warning-content: oklch(0% 0 0);
- --color-error: oklch(71.76% 0.221 22.18);
- --color-error-content: oklch(0% 0 0);
- --radius-selector: 1rem;
- --radius-field: 0.5rem;
- --radius-box: 1rem;
+ --color-accent: oklch(26.861% 0 0);
+ --color-accent-content: oklch(100% 0 0);
+ --color-neutral: oklch(0% 0 0);
+ --color-neutral-content: oklch(100% 0 0);
+ --color-info: oklch(79.54% 0.103 205.9);
+ --color-info-content: oklch(15.908% 0.02 205.9);
+ --color-success: oklch(90.13% 0.153 164.14);
+ --color-success-content: oklch(18.026% 0.03 164.14);
+ --color-warning: oklch(88.37% 0.135 79.94);
+ --color-warning-content: oklch(17.674% 0.027 79.94);
+ --color-error: oklch(78.66% 0.15 28.47);
+ --color-error-content: oklch(15.732% 0.03 28.47);
+ --radius-selector: 0rem;
+ --radius-field: 0rem;
+ --radius-box: 0rem;
--size-selector: 0.25rem;
--size-field: 0.25rem;
- --border: 1px;
- --depth: 0;
- --noise: 0;
+ --border: 2px;
+ --depth: 1;
+ --noise: 1;
}
+
+@plugin "daisyui/theme" {
+ name: "black";
+ default: false;
+ prefersdark: true;
+ color-scheme: "dark";
+ --color-base-100: oklch(0% 0 0);
+ --color-base-200: oklch(19% 0 0);
+ --color-base-300: oklch(22% 0 0);
+ --color-base-content: oklch(87.609% 0 0);
+ --color-primary: oklch(35% 0 0);
+ --color-primary-content: oklch(100% 0 0);
+ --color-secondary: oklch(35% 0 0);
+ --color-secondary-content: oklch(100% 0 0);
+ --color-accent: oklch(35% 0 0);
+ --color-accent-content: oklch(100% 0 0);
+ --color-neutral: oklch(35% 0 0);
+ --color-neutral-content: oklch(100% 0 0);
+ --color-info: oklch(45.201% 0.313 264.052);
+ --color-info-content: oklch(89.04% 0.062 264.052);
+ --color-success: oklch(51.975% 0.176 142.495);
+ --color-success-content: oklch(90.395% 0.035 142.495);
+ --color-warning: oklch(96.798% 0.211 109.769);
+ --color-warning-content: oklch(19.359% 0.042 109.769);
+ --color-error: oklch(62.795% 0.257 29.233);
+ --color-error-content: oklch(12.559% 0.051 29.233);
+ --radius-selector: 0rem;
+ --radius-field: 0rem;
+ --radius-box: 0rem;
+ --size-selector: 0.25rem;
+ --size-field: 0.25rem;
+ --border: 2px;
+ --depth: 1;
+ --noise: 1;
+}
+
+
+
/* Transitions */
.fade-enter-active,
diff --git a/src/utils/actions.ts b/src/utils/actions.ts
index 136609c..6c0d1af 100644
--- a/src/utils/actions.ts
+++ b/src/utils/actions.ts
@@ -92,7 +92,6 @@ export function flagCommand(tasks: Task[], ids: Task['id_'][]) {
t.status
= t.status === TaskStatus.FLAG ? TaskStatus.WAIT : TaskStatus.FLAG
t = stopWorkLogging(t)
-
return t
})
}