A simple to-do app focused on tasks that can be completed within a specific time span. taskline.tobinio.dev/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mobile styling improvements implemented #2

open opened by benni043.tngl.sh targeting main from benni043.tngl.sh/task-line: mobile-styling

this pr changes the style for pwa and adds the possibility for a different nav bar

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:4d7tshmkdmu3kss6q2v5tzka/sh.tangled.repo.pull/3ml3wgftdhp22
+92 -28
Diff #0
+39 -21
app/components/Nav/HorizontalNav.vue
··· 4 4 const isSettingsSheetOpen = defineModel<boolean>("isSettingsSheetOpen"); 5 5 const isFilterSheetOpen = defineModel<boolean>("isFilterSheetOpen"); 6 6 const isNewSheetOpen = defineModel<boolean>("isNewSheetOpen"); 7 + 8 + const { standalone } = useIsPwa(); 9 + const { settings } = useSettings(); 7 10 </script> 8 11 9 12 <template> 10 - <div class="bg-surface fixed bottom-0 flex h-12 w-dvw justify-between"> 11 - <div class="relativ -z-10 flex"> 12 - <button 13 - type="button" 14 - data-testid="settings-button" 15 - class="bg-secondary hover:bg-secondary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors" 16 - @click="() => isSettingsSheetOpen = true" 17 - > 18 - <Icon name="material-symbols:settings-outline-rounded" size="24" /> 19 - </button> 13 + <div class="flex justify-center"> 14 + <div 15 + class="bg-surface fixed bottom-0 flex h-12 w-dvw justify-between" 16 + :class="{ 17 + 'bottom-6 max-w-[90vw] h-18 px-2 flex items-center rounded-4xl border border-white/10 shadow-2xl': settings.design === 'modern', 18 + 'bottom-12 bg-transparent': standalone && !(settings.design === 'modern') 19 + }" 20 + > 21 + <div class="relativ -z-10 flex"> 22 + <button 23 + type="button" 24 + data-testid="settings-button" 25 + class="bg-secondary hover:bg-secondary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors" 26 + :class="{'rounded-3xl': settings.design === 'modern', 'h-12': settings.design === 'modern'}" 27 + @click="() => isSettingsSheetOpen = true" 28 + > 29 + <Icon name="material-symbols:settings-outline-rounded" size="24" /> 30 + </button> 31 + <button 32 + type="button" 33 + class="bg-secondary hover:bg-secondary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors" 34 + :class="{'rounded-3xl': settings.design === 'modern', 'h-12': settings.design === 'modern'}" 35 + @click="() => isFilterSheetOpen = true" 36 + > 37 + <Icon 38 + v-if="isFiltering" 39 + name="material-symbols:filter-alt" 40 + size="24" 41 + /> 42 + <Icon v-else name="material-symbols:filter-alt-outline" size="24" /> 43 + </button> 44 + </div> 20 45 <button 21 46 type="button" 22 - class="bg-secondary hover:bg-secondary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors" 23 - @click="() => isFilterSheetOpen = true" 47 + class="bg-primary hover:bg-primary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors" 48 + :class="{'rounded-3xl': settings.design === 'modern', 'h-12': settings.design === 'modern'}" 49 + @click="() => isNewSheetOpen = true" 24 50 > 25 - <Icon v-if="isFiltering" name="material-symbols:filter-alt" size="24" /> 26 - <Icon v-else name="material-symbols:filter-alt-outline" size="24" /> 51 + <Icon name="material-symbols:add-2-rounded" size="24" /> 27 52 </button> 28 53 </div> 29 - <button 30 - type="button" 31 - class="bg-primary hover:bg-primary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors" 32 - @click="() => isNewSheetOpen = true" 33 - > 34 - <Icon name="material-symbols:add-2-rounded" size="24" /> 35 - </button> 36 54 </div> 37 55 </template>
+17 -3
app/components/Settings/SettingsSheet.vue
··· 52 52 53 53 <template> 54 54 <Sheet :is-open="isOpen" title="Settings Sheet" @close="close"> 55 - <div data-testid="settings-sheet" class="flex flex-col gap-1"> 55 + <div data-testid="settings-sheet" class="flex flex-col gap-4"> 56 56 <div class="flex gap-1"> 57 57 <div> 58 58 <h2 class="text-muted-text text-lg">{{ t("login") }}</h2> ··· 66 66 class="bg-surface border-secondary h-8 cursor-pointer rounded border px-2 text-white" 67 67 :value="locale" 68 68 @change=" 69 - onLanguageChange(($event.target as HTMLSelectElement).value) 70 - " 69 + onLanguageChange(($event.target as HTMLSelectElement).value) 70 + " 71 71 > 72 72 <option v-for="lang in locales" :key="lang.code" :value="lang.code"> 73 73 {{ t(`languageNames.${lang.code}`) }} 74 74 </option> 75 75 </select> 76 76 </div> 77 + </div> 77 78 79 + <div class="flex gap-1"> 78 80 <div> 79 81 <h2 class="text-muted-text text-lg">{{ t("push") }}</h2> 80 82 <button ··· 87 89 </button> 88 90 </div> 89 91 92 + <div> 93 + <h2 class="text-muted-text text-lg">{{ t("design") }}</h2> 94 + <select 95 + v-model="settings.design" 96 + class="bg-surface border-secondary h-8 cursor-pointer rounded border px-2 text-white" 97 + > 98 + <option value="classic">{{ t(`classic`) }}</option> 99 + <option value="modern">{{ t(`modern`) }}</option> 100 + </select> 101 + </div> 102 + 90 103 <div> 91 104 <h2 class="text-muted-text text-lg">{{ t("insertionPoint") }}</h2> 92 105 <select ··· 98 111 </select> 99 112 </div> 100 113 </div> 114 + 101 115 <Categories /> 102 116 <Tags /> 103 117 <ApiKeys />
+9 -2
app/components/Utils/Sheet.vue
··· 22 22 const emit = defineEmits<{ close: [] }>(); 23 23 24 24 const useModal = useMediaQuery("(min-width: 40rem)"); 25 + 26 + const { standalone } = useIsPwa(); 25 27 </script> 26 28 27 29 <template> ··· 33 35 @click="emit('close')" 34 36 /> 35 37 <DrawerContent 36 - class="bg-surface fixed bottom-0 z-30 flex h-96 w-dvw flex-col gap-2 rounded-t-lg drop-shadow-lg" 38 + class="bg-surface fixed bottom-0 z-30 flex h-106 w-dvw flex-col gap-2 rounded-t-lg drop-shadow-lg" 37 39 > 38 40 <div class="h-full"> 39 41 <VisuallyHidden> ··· 41 43 <DrawerDescription>{{ title }}</DrawerDescription> 42 44 </VisuallyHidden> 43 45 <DrawerHandle class="my-2" /> 44 - <div class="h-full overflow-auto px-2 pb-7"><slot /></div> 46 + <div 47 + class="h-full overflow-auto px-2 pb-7" 48 + :class="{'pb-17': standalone}" 49 + > 50 + <slot /> 51 + </div> 45 52 </div> 46 53 </DrawerContent> 47 54 </DrawerPortal>
+17
app/composables/useIsPwa.ts
··· 1 + import { onMounted, ref } from "vue"; 2 + 3 + interface NavigatorStandalone extends Navigator { 4 + standalone?: boolean; 5 + } 6 + 7 + export function useIsPwa() { 8 + const standalone = ref(false); 9 + 10 + onMounted(() => { 11 + standalone.value = 12 + window.matchMedia("(display-mode: standalone)").matches || 13 + (window.navigator as NavigatorStandalone).standalone!; 14 + }); 15 + 16 + return { standalone }; 17 + }
+2
app/composables/useSettings.ts
··· 1 1 type Settings = { 2 2 insertionPoint: "top" | "bottom"; 3 + design: "classic" | "modern"; 3 4 }; 4 5 5 6 export function useSettings() { 6 7 const settings = useLocalStorage<Settings>("settings", { 7 8 insertionPoint: "bottom", 9 + design: "classic", 8 10 }); 9 11 return { settings }; 10 12 }
+4 -1
i18n/locales/de.json
··· 34 34 "tagSelect": { 35 35 "notUsedYet": "Nicht verwendet" 36 36 }, 37 - "push": "Webpush" 37 + "push": "Webpush", 38 + "design": "Design", 39 + "classic": "Klassisch", 40 + "modern": "Modern" 38 41 }
+4 -1
i18n/locales/en.json
··· 34 34 "push": "Webpush", 35 35 "tagSelect": { 36 36 "notUsedYet": "Not used yet" 37 - } 37 + }, 38 + "design": "Design", 39 + "classic": "Klassisch", 40 + "modern": "Modern" 38 41 }

History

2 rounds 0 comments
sign up or login to add to the discussion
2 commits
expand
mobile styling improvements implemented
fixed
merge conflicts detected
expand
  • app/components/Nav/HorizontalNav.vue:4
  • app/components/Settings/SettingsSheet.vue:52
  • app/components/Utils/Sheet.vue:33
  • app/composables/useSettings.ts:1
  • i18n/locales/de.json:34
  • i18n/locales/en.json:34
expand 0 comments
benni043.tngl.sh submitted #0
1 commit
expand
mobile styling improvements implemented
expand 0 comments