Skip to content

Commit 97be60f

Browse files
committed
changed default separator to comma, modified navbar for mobile
1 parent 70c9bfc commit 97be60f

File tree

6 files changed

+242
-35
lines changed

6 files changed

+242
-35
lines changed

.air.toml

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,49 @@ testdata_dir = "testdata"
33
tmp_dir = "tmp"
44

55
[build]
6-
args_bin = []
7-
bin = "tmp\\main.exe"
8-
cmd = "go build -o ./tmp/main.exe ./main.go"
9-
delay = 1000
10-
exclude_dir = ["internal\\assets", "tmp", "internal\\database", "testdata", "internal\\node_modules"]
11-
exclude_file = []
12-
exclude_regex = ["_templ.go"]
13-
exclude_unchanged = false
14-
follow_symlink = false
15-
include_dir = []
16-
include_ext = ["go", "templ", "html"]
17-
include_file = []
18-
kill_delay = "0s"
19-
log = "build-errors.log"
20-
poll = false
21-
poll_interval = 0
22-
post_cmd = []
23-
pre_cmd = ["task assets"]
24-
rerun = false
25-
rerun_delay = 500
26-
send_interrupt = true
27-
stop_on_error = true
6+
args_bin = []
7+
bin = "tmp\\main.exe"
8+
cmd = "go build -o ./tmp/main.exe ./main_windows.go"
9+
delay = 1000
10+
exclude_dir = [
11+
"internal\\assets",
12+
"tmp",
13+
"internal\\database",
14+
"testdata",
15+
"internal\\node_modules",
16+
]
17+
exclude_file = []
18+
exclude_regex = ["_templ.go"]
19+
exclude_unchanged = false
20+
follow_symlink = false
21+
include_dir = []
22+
include_ext = ["go", "templ", "html"]
23+
include_file = []
24+
kill_delay = "0s"
25+
log = "build-errors.log"
26+
poll = false
27+
poll_interval = 0
28+
post_cmd = []
29+
pre_cmd = ["task assets"]
30+
rerun = false
31+
rerun_delay = 500
32+
send_interrupt = true
33+
stop_on_error = true
2834

2935
[color]
30-
app = ""
31-
build = "yellow"
32-
main = "magenta"
33-
runner = "green"
34-
watcher = "cyan"
36+
app = ""
37+
build = "yellow"
38+
main = "magenta"
39+
runner = "green"
40+
watcher = "cyan"
3541

3642
[log]
37-
main_only = false
38-
time = false
43+
main_only = false
44+
time = false
3945

4046
[misc]
41-
clean_on_exit = false
47+
clean_on_exit = false
4248

4349
[screen]
44-
clear_on_rebuild = false
45-
keep_scroll = true
50+
clear_on_rebuild = false
51+
keep_scroll = true

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Deleted projects are only hidden from projects page through is_deleted flag
88

9+
### Bugfix
10+
11+
- Default decimal separator change to ',' to write a proper default config
12+
913
## v0.5.6
1014

1115
### Bugfix

internal/assets/css/input.css

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,15 @@ html {
862862
color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
863863
}
864864

865+
.menu li > *:not(ul, .menu-title, details, .btn):active,
866+
.menu li > *:not(ul, .menu-title, details, .btn).active,
867+
.menu li > details > summary:active {
868+
--tw-bg-opacity: 1;
869+
background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
870+
--tw-text-opacity: 1;
871+
color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
872+
}
873+
865874
.table tr.hover:hover,
866875
.table tr.hover:nth-child(even):hover {
867876
--tw-bg-opacity: 1;
@@ -1182,6 +1191,18 @@ html {
11821191
border-color: color-mix(in oklab, var(--fallback-p,oklch(var(--p)/1)) 90%, black);
11831192
}
11841193
}
1194+
1195+
:where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(.active, .btn):hover, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(.active, .btn):hover {
1196+
cursor: pointer;
1197+
outline: 2px solid transparent;
1198+
outline-offset: 2px;
1199+
}
1200+
1201+
@supports (color: oklch(0% 0 0)) {
1202+
:where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(.active, .btn):hover, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(.active, .btn):hover {
1203+
background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
1204+
}
1205+
}
11851206
}
11861207

11871208
.form-control {
@@ -1254,6 +1275,59 @@ html {
12541275
text-decoration-line: underline;
12551276
}
12561277

1278+
.menu {
1279+
display: flex;
1280+
flex-direction: column;
1281+
flex-wrap: wrap;
1282+
font-size: 0.875rem;
1283+
line-height: 1.25rem;
1284+
padding: 0.5rem;
1285+
}
1286+
1287+
.menu :where(li ul) {
1288+
position: relative;
1289+
white-space: nowrap;
1290+
margin-inline-start: 1rem;
1291+
padding-inline-start: 0.5rem;
1292+
}
1293+
1294+
.menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)), .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
1295+
display: grid;
1296+
grid-auto-flow: column;
1297+
align-content: flex-start;
1298+
align-items: center;
1299+
gap: 0.5rem;
1300+
grid-auto-columns: minmax(auto, max-content) auto max-content;
1301+
-webkit-user-select: none;
1302+
-moz-user-select: none;
1303+
user-select: none;
1304+
}
1305+
1306+
.menu li.disabled {
1307+
cursor: not-allowed;
1308+
-webkit-user-select: none;
1309+
-moz-user-select: none;
1310+
user-select: none;
1311+
color: var(--fallback-bc,oklch(var(--bc)/0.3));
1312+
}
1313+
1314+
.menu :where(li > .menu-dropdown:not(.menu-dropdown-show)) {
1315+
display: none;
1316+
}
1317+
1318+
:where(.menu li) {
1319+
position: relative;
1320+
display: flex;
1321+
flex-shrink: 0;
1322+
flex-direction: column;
1323+
flex-wrap: wrap;
1324+
align-items: stretch;
1325+
}
1326+
1327+
:where(.menu li) .badge {
1328+
justify-self: end;
1329+
}
1330+
12571331
.navbar {
12581332
display: flex;
12591333
align-items: center;
@@ -1832,6 +1906,88 @@ html {
18321906
outline-offset: 2px;
18331907
}
18341908

1909+
:where(.menu li:empty) {
1910+
--tw-bg-opacity: 1;
1911+
background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
1912+
opacity: 0.1;
1913+
margin: 0.5rem 1rem;
1914+
height: 1px;
1915+
}
1916+
1917+
.menu :where(li ul):before {
1918+
position: absolute;
1919+
bottom: 0.75rem;
1920+
inset-inline-start: 0px;
1921+
top: 0.75rem;
1922+
width: 1px;
1923+
--tw-bg-opacity: 1;
1924+
background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
1925+
opacity: 0.1;
1926+
content: "";
1927+
}
1928+
1929+
.menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)),
1930+
.menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
1931+
border-radius: var(--rounded-btn, 0.5rem);
1932+
padding-left: 1rem;
1933+
padding-right: 1rem;
1934+
padding-top: 0.5rem;
1935+
padding-bottom: 0.5rem;
1936+
text-align: start;
1937+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
1938+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
1939+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
1940+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1941+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
1942+
transition-duration: 200ms;
1943+
text-wrap: balance;
1944+
}
1945+
1946+
:where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(summary, .active, .btn).focus, :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(summary, .active, .btn):focus, :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):is(summary):not(.active, .btn):focus-visible, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(summary, .active, .btn).focus, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(summary, .active, .btn):focus, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):is(summary):not(.active, .btn):focus-visible {
1947+
cursor: pointer;
1948+
background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
1949+
--tw-text-opacity: 1;
1950+
color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
1951+
outline: 2px solid transparent;
1952+
outline-offset: 2px;
1953+
}
1954+
1955+
.menu li > *:not(ul, .menu-title, details, .btn):active,
1956+
.menu li > *:not(ul, .menu-title, details, .btn).active,
1957+
.menu li > details > summary:active {
1958+
--tw-bg-opacity: 1;
1959+
background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
1960+
--tw-text-opacity: 1;
1961+
color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
1962+
}
1963+
1964+
.menu :where(li > details > summary)::-webkit-details-marker {
1965+
display: none;
1966+
}
1967+
1968+
.menu :where(li > details > summary):after,
1969+
.menu :where(li > .menu-dropdown-toggle):after {
1970+
justify-self: end;
1971+
display: block;
1972+
margin-top: -0.5rem;
1973+
height: 0.5rem;
1974+
width: 0.5rem;
1975+
transform: rotate(45deg);
1976+
transition-property: transform, margin-top;
1977+
transition-duration: 0.3s;
1978+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1979+
content: "";
1980+
transform-origin: 75% 75%;
1981+
box-shadow: 2px 2px;
1982+
pointer-events: none;
1983+
}
1984+
1985+
.menu :where(li > details[open] > summary):after,
1986+
.menu :where(li > .menu-dropdown-toggle.menu-dropdown-show):after {
1987+
transform: rotate(225deg);
1988+
margin-top: 0;
1989+
}
1990+
18351991
.mockup-browser .mockup-browser-toolbar .input {
18361992
position: relative;
18371993
margin-left: auto;
@@ -2341,6 +2497,10 @@ html {
23412497
margin-right: auto;
23422498
}
23432499

2500+
.block {
2501+
display: block;
2502+
}
2503+
23442504
.flex {
23452505
display: flex;
23462506
}
@@ -2365,6 +2525,10 @@ html {
23652525
height: 2.5rem;
23662526
}
23672527

2528+
.h-14 {
2529+
height: 3.5rem;
2530+
}
2531+
23682532
.h-20 {
23692533
height: 5rem;
23702534
}
@@ -2410,6 +2574,10 @@ html {
24102574
max-width: 20rem;
24112575
}
24122576

2577+
.flex-1 {
2578+
flex: 1 1 0%;
2579+
}
2580+
24132581
.grow {
24142582
flex-grow: 1;
24152583
}
@@ -2541,4 +2709,14 @@ html {
25412709

25422710
input {
25432711
color-scheme: dark;
2712+
}
2713+
2714+
@media (min-width: 640px) {
2715+
.sm\:block {
2716+
display: block;
2717+
}
2718+
2719+
.sm\:hidden {
2720+
display: none;
2721+
}
25442722
}

internal/components/components.templ

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ templ PageHeader(contents templ.Component) {
124124
</head>
125125
<body>
126126
<div class="flex flex-col">
127-
<div class="navbar border-b shadow">
127+
//default navbar
128+
<div class="navbar hidden border-b shadow sm:block">
128129
<div class="container mx-auto max-w-[1000px] grow">
129130
<div class="hero-content h-20">
130131
<a class="primary-content text-5xl font-bold" href="/">TimeTracker</a>
@@ -138,6 +139,23 @@ templ PageHeader(contents templ.Component) {
138139
<button class="btn btn-ghost text-xl" hx-get="/year" hx-target="#content-section" hx-swap="innerHTML settle:0ms">Year</button>
139140
</div>
140141
</div>
142+
// mobile navbar
143+
<div class="navbar block border-b shadow sm:hidden">
144+
<div class="flex w-full flex-col">
145+
<div class="hero-content h-14">
146+
<a class="primary-content text-5xl font-bold" href="/">TimeTracker</a>
147+
<br>
148+
<p class="primary-content self-end">{ version }</p>
149+
</div>
150+
<div class="flex w-full flex-row">
151+
<button class="btn btn-ghost flex-1 text-xl" hx-get="/timeframes" hx-target="#content-section" hx-swap="innerHTML settle:0ms">Rec</button>
152+
<button class="btn btn-ghost flex-1 text-xl" hx-get="/projects" hx-target="#content-section" hx-swap="innerHTML settle:0ms">Proj</button>
153+
<div class="divider divider-horizontal"></div>
154+
<button class="btn btn-ghost flex-1 text-xl" hx-get="/month" hx-target="#content-section" hx-swap="innerHTML settle:0ms">Month</button>
155+
<button class="btn btn-ghost flex-1 text-xl" hx-get="/year" hx-target="#content-section" hx-swap="innerHTML settle:0ms">Year</button>
156+
</div>
157+
</div>
158+
</div>
141159
<div class="container mx-auto max-w-[1000px] grow">
142160
<section id="content-section">
143161
@contents
@@ -291,6 +309,7 @@ templ RecordList(tfList []database.Timeframe, projectList []database.Project, lo
291309
hx-trigger="change delay:400ms"
292310
>
293311
for _, project := range projectList {
312+
//TODO: Change color of deleted projects in drop down menu and throughtout other UI elements
294313
if timeframe.ProjectID == project.ID {
295314
<option value={ strconv.Itoa(project.ID) } selected>{ project.Name }</option>
296315
} else {

main_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func viperInit() {
6767
viper.SetDefault("worktime_per_week", "39h0m0s")
6868
viper.SetDefault("offset_overtime", "0h0m0s")
6969
viper.SetDefault("logfile", false)
70-
viper.SetDefault("decimal_separator", ".")
70+
viper.SetDefault("decimal_separator", ",")
7171

7272
viper.SetConfigName("timetrackerconf")
7373
viper.SetConfigType("yaml")

main_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func viperInit() {
8080
viper.SetDefault("worktime_per_week", "39h0m0s")
8181
viper.SetDefault("offset_overtime", "0h0m0s")
8282
viper.SetDefault("logfile", false)
83-
viper.SetDefault("decimal_separator", ".")
83+
viper.SetDefault("decimal_separator", ",")
8484

8585
viper.SetConfigName("timetracker")
8686
viper.SetConfigType("yaml")

0 commit comments

Comments
 (0)