Skip to content

A self-hosted media server and file management system

fix: reduce animation on theme change

aminnausin39f88e7de091
diff --git a/resources/css/cedar-theme.css b/resources/css/cedar-theme.css
index 70dfed4b..461b40bb 100644
--- a/resources/css/cedar-theme.css
+++ b/resources/css/cedar-theme.css
@@ -34,7 +34,8 @@
--container-2xl: 1536px;
/* Input */
- --input-height: calc(var(--spacing) * 9); /* h-8 */
+ --input-height: calc(var(--spacing) * 9); /* h-9 forms */
+ --table-input-height: calc(var(--spacing) * 9); /* h-8 table */
--duration-input: 200ms;
/* Surfaces (0 is page) */
diff --git a/resources/css/theme.css b/resources/css/theme.css
index 4af3c3bf..ab1ded6a 100644
--- a/resources/css/theme.css
+++ b/resources/css/theme.css
@@ -20,6 +20,35 @@
.dark #root {
--color-scrollbar-track: rgb(38 38 38 / var(--tw-bg-opacity, 1));
}
+
+ .transition-input {
+ transition-property:
+ /* color, */
+ /* background-color, */
+ /* border-color, */
+ outline-color,
+ text-decoration-color,
+ fill,
+ stroke,
+ --tw-gradient-from,
+ --tw-gradient-via,
+ --tw-gradient-to,
+ opacity,
+ box-shadow,
+ transform,
+ translate,
+ scale,
+ rotate,
+ filter,
+ -webkit-backdrop-filter,
+ backdrop-filter,
+ display,
+ content-visibility,
+ overlay,
+ pointer-events;
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function) /* cubic-bezier(0.4, 0, 0.2, 1) */);
+ transition-duration: var(--tw-duration, var(--duration-input) /* 150ms */);
+ }
}
@layer utilities {
diff --git a/resources/js/components/cedar-ui/button/ButtonBase.vue b/resources/js/components/cedar-ui/button/ButtonBase.vue
index 9af3f1a1..5f85575c 100644
--- a/resources/js/components/cedar-ui/button/ButtonBase.vue
+++ b/resources/js/components/cedar-ui/button/ButtonBase.vue
@@ -50,7 +50,7 @@ defineExpose({
:is="wrapper"
:class="
cn(
- 'transition duration-(--duration-input) ease-in-out focus:outline-hidden', // Animation
+ 'transition-input ease-in-out focus:outline-hidden', // Animation
{ 'button-disabled-pointer': wrapper === 'button' && disabled }, // Disabled Button
{ 'button-disabled': disabled }, // Disabled
'flex items-center justify-center gap-2', // Layout
diff --git a/resources/js/components/cedar-ui/input/InputShell.vue b/resources/js/components/cedar-ui/input/InputShell.vue
index c11e8504..00ae464a 100644
--- a/resources/js/components/cedar-ui/input/InputShell.vue
+++ b/resources/js/components/cedar-ui/input/InputShell.vue
@@ -13,7 +13,7 @@ const props = withDefaults(defineProps<InputShellProps>(), { clampText: true });
cn(
'h-(--input-height)',
'scrollable-input scrollbar-thin',
- 'transition duration-(--duration-input) ease-in-out focus:outline-hidden',
+ 'transition-input ease-in-out focus:outline-hidden',
'bg-surface-2 placeholder:text-foreground-3 dark:placeholder:text-foreground-2 dark:bg-neutral-700',
'hocus:ring-2 hover:ring-primary-muted focus-visible:ring-primary',
{ 'line-clamp-1 text-ellipsis whitespace-nowrap': clampText },
diff --git a/resources/js/components/cedar-ui/select/InputSelect.vue b/resources/js/components/cedar-ui/select/InputSelect.vue
index b9d4bef9..37e01755 100644
--- a/resources/js/components/cedar-ui/select/InputSelect.vue
+++ b/resources/js/components/cedar-ui/select/InputSelect.vue
@@ -121,7 +121,7 @@ watch(
:disabled="disabled"
:class="
cn(
- 'transition duration-(--duration-input) ease-in-out focus:outline-hidden', // Animation
+ 'transition-input ease-in-out focus:outline-hidden', // Animation
'disabled:button-disabled disabled:button-disabled-pointer', // Disabled
'relative flex items-center justify-between gap-2', // Layout
'cursor-pointer rounded-md shadow-xs', // Style
diff --git a/resources/js/components/cedar-ui/table/TableBase.vue b/resources/js/components/cedar-ui/table/TableBase.vue
index 55f94a23..8fd768fd 100644
--- a/resources/js/components/cedar-ui/table/TableBase.vue
+++ b/resources/js/components/cedar-ui/table/TableBase.vue
@@ -52,13 +52,13 @@ onMounted(() => {
<template>
<section class="flex w-full flex-col gap-3">
- <section v-if="props.useToolbar" class="flex h-10 flex-col justify-center gap-2 sm:flex-row sm:justify-between">
+ <section v-if="props.useToolbar" class="flex flex-col justify-center gap-2 sm:flex-row sm:justify-between">
<TextInput
v-if="model !== undefined"
v-model="model"
:placeholder="`Search ${props.itemName ? `${props.itemName}...` : ''}`"
:id="'table-search'"
- class="ring-r-button hocus:ring-2 dark:bg-surface-2 w-full ring-1 sm:w-80"
+ class="ring-r-button hocus:ring-2 dark:bg-surface-2 h-(--table-input-height) w-full ring-1 sm:w-80"
title="Search with..."
/>
@@ -70,7 +70,7 @@ onMounted(() => {
:prefix="'By '"
:options="sortingOptions"
:defaultItem="0"
- class="w-full"
+ class="h-(--table-input-height) w-full"
title="Sort by..."
@selectItem="handleSortChange"
/>
@@ -82,7 +82,7 @@ onMounted(() => {
"
:title="`Reorder Results...`"
:aria-label="`Reorder Results`"
- class="inline-flex h-full"
+ class="inline-flex size-(--table-input-height) p-1"
>
<template #icon>
<!-- Arrow Pointing Down if ascending and then Up otherwise (arrow shows what to change to ?? idk descending points up actually)-->
diff --git a/resources/js/components/cedar-ui/table/TablePagination.vue b/resources/js/components/cedar-ui/table/TablePagination.vue
index 1af10762..11eb1c9b 100644
--- a/resources/js/components/cedar-ui/table/TablePagination.vue
+++ b/resources/js/components/cedar-ui/table/TablePagination.vue
@@ -50,7 +50,7 @@ const handleSetPage = async (page: number) => {
</script>
<template>
- <div :class="`flex scroll-mb-12 flex-col flex-wrap items-center gap-2 text-sm sm:flex-row sm:justify-between`" ref="$element">
+ <div class="flex scroll-mb-12 flex-col flex-wrap items-center gap-2 text-sm sm:flex-row sm:justify-between" ref="$element">
<p class="dark:text-foreground-7 line-clamp-1">
Showing
<span class="dark:text-foreground-0 font-medium">{{ props.listLength ? props.itemsPerPage * (currentPage - 1) + 1 : 0 }}</span>
@@ -60,9 +60,7 @@ const handleSetPage = async (page: number) => {
<span class="dark:text-foreground-0 font-medium">{{ listLength }}</span>
<!-- Results -->
</p>
- <ul
- class="bg-overlay-t divide-d text-foreground-7 border-overlay-border flex h-9 items-center divide-x rounded-md border leading-tight"
- >
+ <ul class="bg-overlay-t divide-d text-foreground-7 border-overlay-border flex h-(--table-input-height) items-center divide-x rounded-md border leading-tight">
<TablePaginationButton
:pageNumber="-1"
:text="'Previous'"
@@ -83,13 +81,7 @@ const handleSetPage = async (page: number) => {
<!-- Diff between start and current page is greater than 2 -->
<template v-if="pageCount > props.maxVisiblePages && props.currentPage > Math.max(props.maxVisiblePages - 2, 2)">
- <TablePaginationButton
- :pageNumber="1"
- :currentPage="props.currentPage"
- @click="handleSetPage(1)"
- :sticky="true"
- v-if="maxVisiblePages > 3"
- />
+ <TablePaginationButton :pageNumber="1" :currentPage="props.currentPage" @click="handleSetPage(1)" :sticky="true" v-if="maxVisiblePages > 3" />
<TablePaginationButton
:pageNumber="-1"
:text="'...'"
@@ -99,14 +91,7 @@ const handleSetPage = async (page: number) => {
/>
</template>
- <TablePaginationButton
- v-for="page in pageRange"
- :key="page"
- :pageNumber="page"
- :currentPage="props.currentPage"
- @click="handleSetPage(page)"
- :title="`Page ${page}`"
- />
+ <TablePaginationButton v-for="page in pageRange" :key="page" :pageNumber="page" :currentPage="props.currentPage" @click="handleSetPage(page)" :title="`Page ${page}`" />
<template v-if="pageCount > props.maxVisiblePages && pageCount - props.currentPage > Math.max(props.maxVisiblePages - 3, 1)">
<TablePaginationButton
@@ -116,13 +101,7 @@ const handleSetPage = async (page: number) => {
@click="handleSetPage(Math.floor((pageCount - currentPage) / 2 + currentPage))"
:underline="true"
/>
- <TablePaginationButton
- :pageNumber="pageCount"
- :currentPage="props.currentPage"
- @click="handleSetPage(pageCount)"
- :sticky="true"
- v-if="maxVisiblePages > 3"
- />
+ <TablePaginationButton :pageNumber="pageCount" :currentPage="props.currentPage" @click="handleSetPage(pageCount)" :sticky="true" v-if="maxVisiblePages > 3" />
</template>
<TablePaginationButton