Skip to content

Open source personal finance application

refactor: enhance scrollbar styles and component layouts

Ilya Komichev24b3db1a7389
diff --git a/app/assets/css/tailwind.css b/app/assets/css/tailwind.css
index 044cf306..30932a83 100644
--- a/app/assets/css/tailwind.css
+++ b/app/assets/css/tailwind.css
@@ -15,11 +15,6 @@
@apply absolute top-1/2 left-1/2;
transform: translate(-50%, -50%);
}
-
- .overflow-scroll-y {
- @apply overflow-hidden overflow-y-auto;
- -webkit-overflow-scrolling: touch;
- }
}
@layer base {
@@ -57,27 +52,22 @@
}
/* Scrollbar styles */
- .scroll,
.scrollbar {
@apply h-full overflow-hidden overflow-y-auto;
}
- .scroll::-webkit-scrollbar,
.scrollbar::-webkit-scrollbar {
@apply w-1.5 h-1.5;
}
- .scroll::-webkit-scrollbar-track,
.scrollbar::-webkit-scrollbar-track {
@apply bg-transparent rounded-[10px];
}
- .scroll::-webkit-scrollbar-thumb,
.scrollbar::-webkit-scrollbar-thumb {
@apply bg-gray-500 rounded-[10px];
}
- .scroll::-webkit-scrollbar-thumb:hover,
.scrollbar::-webkit-scrollbar-thumb:hover {
@apply bg-gray-600;
}
diff --git a/app/components/filter/FilterSelected.vue b/app/components/filter/FilterSelected.vue
index 14b32e5f..77adb816 100644
--- a/app/components/filter/FilterSelected.vue
+++ b/app/components/filter/FilterSelected.vue
@@ -17,7 +17,7 @@ const itemClasses = getStyles('item', ['alt', 'rounded'])
</script>
<template>
- <div class="flex gap-2">
+ <div class="scrollbar flex gap-2 overflow-hidden overflow-x-auto">
<!-- Wallets -->
<template v-if="props.isShowWallets">
<WalletsItem
diff --git a/app/components/stat/Header.vue b/app/components/stat/Header.vue
index 57dcb0bb..878ec580 100644
--- a/app/components/stat/Header.vue
+++ b/app/components/stat/Header.vue
@@ -88,14 +88,11 @@ function onClickWallet(walletId: WalletId) {
class="grid gap-2 px-2 pb-0 lg:px-4 2xl:px-8"
>
<template v-if="filter.isShow?.value || statConfig.config.value.wallets.isShow">
- <div
+ <FilterSelected
v-if="props.filter && filter.isShow?.value && filter.categoriesIds.value.length > 0 || (filter.walletsIds.value.length > 0 && !statConfig.config.value.wallets.isShow)"
- >
- <FilterSelected
- :isShowCategories="props.filter?.isShowCategories"
- :isShowWallets="props.filter?.isShowWallets && !statConfig.config.value.wallets.isShow"
- />
- </div>
+ :isShowCategories="props.filter?.isShowCategories"
+ :isShowWallets="props.filter?.isShowWallets && !statConfig.config.value.wallets.isShow"
+ />
<div
v-if="statConfig.config.value.wallets.isShow"
diff --git a/app/components/stat/Item.vue b/app/components/stat/Item.vue
index b492e7b2..fe803f88 100644
--- a/app/components/stat/Item.vue
+++ b/app/components/stat/Item.vue
@@ -221,7 +221,7 @@ function getIntervalsData(trnsIds: TrnId[], intervalsInRange: Range[]) {
:xAxisLabels="chart.xAxisLabels.value"
/>
- <div class="grid gap-1 pb-5 md:max-w-lg">
+ <div class="grid pb-5 md:max-w-lg">
<StatDateNavigation :maxRange="statDate.maxRange.value" />
<StatDateQuick
v-if="statConfig.config.value.date.isShowQuick"
diff --git a/app/components/stat/chart/Intervals.vue b/app/components/stat/chart/Intervals.vue
index 2f379f82..94cc599a 100644
--- a/app/components/stat/chart/Intervals.vue
+++ b/app/components/stat/chart/Intervals.vue
@@ -40,7 +40,7 @@ const items = computed(() => {
</script>
<template>
- <div class="flex gap-0">
+ <div class="flex gap-0 min-h-8">
<StatChartButton
v-for="item in items"
:key="item.value"
diff --git a/app/components/stat/chart/Wrap.vue b/app/components/stat/chart/Wrap.vue
index 5532084b..db85a398 100644
--- a/app/components/stat/chart/Wrap.vue
+++ b/app/components/stat/chart/Wrap.vue
@@ -40,7 +40,7 @@ function onClickChart(idx: number) {
}
const isShowChart = computed(() => {
- return statConfig.config.value?.chartShow && (statDate.params.value.rangeDuration !== 1 || statDate.params.value.rangeBy !== 'day') && statDate.intervalsInRange.value.length > 1
+ return statConfig.config.value?.chartShow
})
function onChangePeriod(period: Period) {
diff --git a/app/components/stat/date/Quick.vue b/app/components/stat/date/Quick.vue
index b2d33a92..2b2d3edf 100644
--- a/app/components/stat/date/Quick.vue
+++ b/app/components/stat/date/Quick.vue
@@ -33,8 +33,7 @@ onMounted(() => {
observeParents: true,
observer: true,
shortSwipes: false,
- slidesPerView: 'auto',
- spaceBetween: 16,
+ slidesPerView: '1',
touchStartPreventDefault: false,
})
})
@@ -57,11 +56,14 @@ function setMaxRange(isSkipEmpty = false) {
</script>
<template>
- <div class="relative ml-1 overflow-hidden rounded-lg bg-foreground-2">
+ <div class="relative ml-1 overflow-hidden">
<div ref="sliderRef" class="swiper-container">
<div class="swiper-wrapper">
<!-- Recent -->
- <div class="swiper-slide !w-auto">
+ <div class="swiper-slide">
+ <slot />
+ </div>
+ <div class="swiper-slide">
<div class="flex flex-wrap">
<DateRanges @onClose="emit('onClose')" />
@@ -79,13 +81,13 @@ function setMaxRange(isSkipEmpty = false) {
</div>
</div>
- <div class="swiper-slide !w-auto">
+ <div class="swiper-slide">
<div class="flex flex-wrap">
<DateRanges2 @onClose="emit('onClose')" />
</div>
</div>
- <div class="swiper-slide !w-auto">
+ <div class="swiper-slide">
<div class="flex flex-wrap">
<DateLinkItem
:isActive="statDate.params.value.isShowMaxRange && !statDate.params.value.isSkipEmpty"
diff --git a/app/components/trnForm/Categories.vue b/app/components/trnForm/Categories.vue
index ff662fef..5cba1daf 100644
--- a/app/components/trnForm/Categories.vue
+++ b/app/components/trnForm/Categories.vue
@@ -46,7 +46,7 @@ onMounted(() => {
<!-- Recent -->
<div class="swiper-slide h-full">
<div
- class="scrollBlock overflow-scroll-y scrollerBlock rounded-t-2xl bg-foreground-1 px-3 py-4 text-center font-primary text-xl font-semibold"
+ class="scrollbar scrollerBlock bg-foreground-1 font-primary rounded-t-2xl px-3 py-4 text-center text-xl font-semibold"
>
{{ $t("categories.lastUsedTitle") }}
</div>
@@ -63,7 +63,7 @@ onMounted(() => {
<!-- Main -->
<div class="swiper-slide h-full">
<div
- class="scrollBlock overflow-scroll-y scrollerBlock rounded-t-2xl bg-foreground-1 px-3 py-4 text-center font-primary text-xl font-semibold"
+ class="scrollbar scrollerBlock bg-foreground-1 font-primary rounded-t-2xl px-3 py-4 text-center text-xl font-semibold"
>
{{ $t("categories.title") }}
</div>
@@ -80,7 +80,7 @@ onMounted(() => {
<!-- Favorite -->
<div class="swiper-slide h-full">
<div
- class="scrollBlock overflow-scroll-y scrollerBlock rounded-t-2xl bg-foreground-1 px-3 py-4 text-center font-primary text-xl font-semibold"
+ class="scrollbar scrollerBlock bg-foreground-1 font-primary rounded-t-2xl px-3 py-4 text-center text-xl font-semibold"
>
{{ $t("categories.favoriteTitle") }}
</div>