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
+124 -30
Diff #1
+65 -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 isPwa = 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 14 + class="flex justify-center" 15 + :data-design="settings.design" 16 + :data-pwa="isPwa" 17 + > 18 + <div 19 + class=" 20 + bg-surface fixed bottom-0 flex h-12 w-dvw justify-between 21 + 22 + floating:bottom-6 23 + floating:max-w-[90vw] 24 + floating:h-18 25 + floating:items-center 26 + floating:rounded-4xl 27 + floating:border 28 + floating:border-white/10 29 + floating:px-2 30 + floating:shadow-2xl 31 + 32 + pwa:bottom-12 33 + pwa:bg-transparent 34 + 35 + floating:pwa:bottom-6 36 + " 37 + > 38 + <div class="relativ -z-10 flex"> 39 + <button 40 + type="button" 41 + data-testid="settings-button" 42 + class=" 43 + bg-secondary hover:bg-secondary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors 44 + floating:rounded-3xl 45 + floating:h-12 46 + " 47 + @click="() => isSettingsSheetOpen = true" 48 + > 49 + <Icon name="material-symbols:settings-outline-rounded" size="24" /> 50 + </button> 51 + <button 52 + type="button" 53 + class=" 54 + bg-secondary hover:bg-secondary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors 55 + floating:rounded-3xl 56 + floating:h-12 57 + " 58 + @click="() => isFilterSheetOpen = true" 59 + > 60 + <Icon 61 + v-if="isFiltering" 62 + name="material-symbols:filter-alt" 63 + size="24" 64 + /> 65 + <Icon v-else name="material-symbols:filter-alt-outline" size="24" /> 66 + </button> 67 + </div> 20 68 <button 21 69 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" 70 + class=" 71 + bg-primary hover:bg-primary-hover relative m-1 flex aspect-square h-10 cursor-pointer items-center justify-center rounded transition-colors 72 + floating:rounded-3xl 73 + floating:h-12 74 + " 75 + @click="() => isNewSheetOpen = true" 24 76 > 25 - <Icon v-if="isFiltering" name="material-symbols:filter-alt" size="24" /> 26 - <Icon v-else name="material-symbols:filter-alt-outline" size="24" /> 77 + <Icon name="material-symbols:add-2-rounded" size="24" /> 27 78 </button> 28 79 </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 80 </div> 37 81 </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 ··· 88 90 </div> 89 91 90 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="floating">{{ t(`floating`) }}</option> 100 + </select> 101 + </div> 102 + 103 + <div> 91 104 <h2 class="text-muted-text text-lg">{{ t("insertionPoint") }}</h2> 92 105 <select 93 106 ··· 98 111 </select> 99 112 </div> 100 113 </div> 114 + 101 115 <Categories /> 102 116 <Tags /> 103 117 <ApiKeys />
+12 -4
app/components/Utils/Sheet.vue
··· 22 22 const emit = defineEmits<{ close: [] }>(); 23 23 24 24 const useModal = useMediaQuery("(min-width: 40rem)"); 25 + 26 + const isPwa = 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 - <div class="h-full"> 40 + <div class="h-full" :data-pwa="isPwa"> 39 41 <VisuallyHidden> 40 - 42 + <DrawerTitle>{{ title }}</DrawerTitle> 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=" 48 + h-full overflow-auto px-2 pb-7 49 + pwa:pb-17" 50 + > 51 + <slot /> 52 + </div> 45 53 </div> 46 54 </DrawerContent> 47 55 </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 isPwa = ref(false); 9 + 10 + onMounted(() => { 11 + isPwa.value = 12 + window.matchMedia("(display-mode: standalone)").matches || 13 + (window.navigator as NavigatorStandalone).standalone === true; 14 + }); 15 + 16 + return isPwa; 17 + }
+2
app/composables/useSettings.ts
··· 1 1 type Settings = { 2 2 insertionPoint: "top" | "bottom"; 3 + design: "classic" | "floating"; 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 + "floating": "Schwebend" 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": "Classic", 40 + "floating": "Floating" 38 41 }
+3
app/assets/css/main.css
··· 102 102 ::-webkit-scrollbar-thumb:hover { 103 103 background: #555; 104 104 } 105 + 106 + @custom-variant floating (&:where([data-design="floating"] *)); 107 + @custom-variant pwa (&:where([data-pwa="true"] *));

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
1 commit
expand
mobile styling improvements implemented
expand 0 comments