diff options
Diffstat (limited to 'fe/src/lib/Layout.svelte')
-rw-r--r-- | fe/src/lib/Layout.svelte | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/fe/src/lib/Layout.svelte b/fe/src/lib/Layout.svelte index 2728dd3..26630d2 100644 --- a/fe/src/lib/Layout.svelte +++ b/fe/src/lib/Layout.svelte | |||
@@ -1,6 +1,6 @@ | |||
1 | <script> | 1 | <script> |
2 | import { authenticated, token, user, preferences } from "../stores/auth"; | 2 | import { authenticated, token, user, preferences } from "../stores/auth"; |
3 | import PreferencesForm from "./PreferencesForm.svelte"; | 3 | import { PreferencesForm, AddForm } from "./forms"; |
4 | import { addFormOpen } from "../stores/forms"; | 4 | import { addFormOpen } from "../stores/forms"; |
5 | 5 | ||
6 | const logout = () => { | 6 | const logout = () => { |
@@ -30,9 +30,18 @@ | |||
30 | <h1>Water</h1> | 30 | <h1>Water</h1> |
31 | </div> | 31 | </div> |
32 | <div> | 32 | <div> |
33 | <button on:click={showAddDialog}>Log Water</button> | 33 | <button on:click={showAddDialog}> |
34 | <button on:click={showPreferencesDialog}>Preference</button> | 34 | <span class="btn-icon">➕</span> |
35 | <button on:click={logout}>Logout</button> | 35 | <span class="btn-content">Log Water</span> |
36 | </button> | ||
37 | <button on:click={showPreferencesDialog}> | ||
38 | <span class="btn-icon">⚙</span> | ||
39 | <span class="btn-content">Preference</span> | ||
40 | </button> | ||
41 | <button on:click={logout}> | ||
42 | <span class="btn-icon">🔒</span> | ||
43 | <span class="btn-content">Logout</span> | ||
44 | </button> | ||
36 | </div> | 45 | </div> |
37 | </nav> | 46 | </nav> |
38 | <PreferencesForm open={preferenceFormOpen} on:close={closePreferenceDialog} /> | 47 | <PreferencesForm open={preferenceFormOpen} on:close={closePreferenceDialog} /> |
@@ -43,17 +52,30 @@ | |||
43 | </div> | 52 | </div> |
44 | 53 | ||
45 | <style> | 54 | <style> |
46 | .layout { | ||
47 | height: 100vh; | ||
48 | } | ||
49 | |||
50 | nav { | 55 | nav { |
51 | display: flex; | 56 | display: flex; |
52 | flex-direction: row; | 57 | flex-direction: row; |
53 | align-items: center; | 58 | align-items: center; |
54 | justify-content: space-between; | 59 | justify-content: space-between; |
55 | height: 64px; | 60 | height: 64px; |
56 | padding: 0 2em; | 61 | padding: 1em 0; |
62 | } | ||
63 | |||
64 | nav div button { | ||
65 | margin: 0 .5em; | ||
66 | } | ||
67 | |||
68 | nav div button:first-child { | ||
69 | margin-left: 0; | ||
70 | } | ||
71 | |||
72 | nav div button:last-child { | ||
73 | margin-right: 0; | ||
74 | } | ||
75 | |||
76 | |||
77 | nav .btn-content { | ||
78 | display: none; | ||
57 | } | 79 | } |
58 | 80 | ||
59 | nav div { | 81 | nav div { |
@@ -66,9 +88,16 @@ | |||
66 | 88 | ||
67 | #content { | 89 | #content { |
68 | display: flex; | 90 | display: flex; |
69 | flex-direction: row; | 91 | flex-direction: column; |
70 | justify-content: center; | 92 | justify-content: center; |
71 | gap: 2em; | 93 | gap: 2em; |
72 | margin-top: 4em; | 94 | margin-top: 1em; |
95 | } | ||
96 | |||
97 | @media (min-width: 916px) { | ||
98 | nav .btn-content { | ||
99 | display: inline; | ||
100 | margin-left: 1em; | ||
101 | } | ||
73 | } | 102 | } |
74 | </style> | 103 | </style> |