提交 e855c18c 编写于 作者: L LeoKu

Improve animation

上级 bdd29116
...@@ -211,7 +211,9 @@ onUnmounted(() => { ...@@ -211,7 +211,9 @@ onUnmounted(() => {
.fade-enter-active, .fade-enter-active,
.fade-leave-active { .fade-leave-active {
transition: opacity 0.25s ease, transform 0.25s; @media (prefers-reduced-motion: no-preference) {
transition: opacity 0.25s ease, transform 0.25s;
}
} }
.fade-enter-from, .fade-enter-from,
......
...@@ -58,7 +58,6 @@ onUnmounted(() => { ...@@ -58,7 +58,6 @@ onUnmounted(() => {
.container { .container {
height: 100%; height: 100%;
padding-right: var.$layout-sider-width; padding-right: var.$layout-sider-width;
transition: padding-right 0.2s;
&.full { &.full {
padding-right: 0; padding-right: 0;
...@@ -67,5 +66,9 @@ onUnmounted(() => { ...@@ -67,5 +66,9 @@ onUnmounted(() => {
@media screen and (max-width: var.$screen-lg) { @media screen and (max-width: var.$screen-lg) {
padding-right: 0; padding-right: 0;
} }
@media (prefers-reduced-motion: no-preference) {
transition: padding-right 0.2s;
}
} }
</style> </style>
...@@ -56,27 +56,65 @@ import { recordEvent } from '@/utils/ga' ...@@ -56,27 +56,65 @@ import { recordEvent } from '@/utils/ga'
margin-left: auto; margin-left: auto;
.github-button { .github-button {
position: relative;
z-index: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 8rem; width: 9rem;
height: 2.5rem; height: 2.6rem;
overflow: hidden;
color: var.$color-text; color: var.$color-text;
font-weight: bold; font-weight: bold;
font-size: 1.05rem; font-size: 1.05rem;
background-color: var.$color-dark; background-color: var.$color-dark;
border-radius: 0.6rem; border-radius: 0.6rem;
cursor: pointer; cursor: pointer;
transition: box-shadow 0.2s, background-color 0.2s;
user-select: none; user-select: none;
&:hover { @media (prefers-reduced-motion: no-preference) {
background-color: lighten(var.$color-dark, 2); transition: background-color 0.2s;
box-shadow: 0 0.2rem 1.5rem 0.2rem lighten(var.$color-dark, 5);
&::before,
&::after {
position: absolute;
right: 0;
bottom: 0;
z-index: -1;
width: 5rem;
height: 5rem;
background: var.$color-text;
border-radius: 50%;
transform: translate(100%, -25%) translate3d(0, 0, 0);
opacity: 0;
transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1),
opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1);
content: '';
}
&:hover {
background-color: darken(var.$color-dark, 3);
&::before,
&::after {
opacity: 0.15;
transition: transform 0.2s cubic-bezier(0.02, 0.01, 0.47, 1),
opacity 0.2s cubic-bezier(0.02, 0.01, 0.47, 1);
}
&::before {
transform: translate3d(50%, 0, 0) scale(0.9);
}
&::after {
transform: translate(50%, 0) scale(1.1);
}
}
} }
.text { .text {
margin-left: 0.5rem; margin-left: 0.5rem;
letter-spacing: 0.03rem;
} }
} }
} }
......
...@@ -24,7 +24,13 @@ const { isCollapsed, openSider, closeSider } = useSider() ...@@ -24,7 +24,13 @@ const { isCollapsed, openSider, closeSider } = useSider()
right: 0; right: 0;
z-index: 200; z-index: 200;
height: 100%; height: 100%;
transition: transform 0.2s;
@media (prefers-reduced-motion: no-preference) {
& {
transition: transform 0.2s;
will-change: transform;
}
}
.icon-right { .icon-right {
transition: transform 0.2s; transition: transform 0.2s;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册