mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 11:12:54 +02:00
style: optimize gsap animations, add preload for stix-Italic
This commit is contained in:
parent
1f141963a1
commit
653596fc3d
2 changed files with 14 additions and 13 deletions
|
@ -16,8 +16,8 @@ function setupPostPageAnimation() {
|
|||
// First 15 elements
|
||||
gsap.from(allElements.slice(0, 15), {
|
||||
opacity: 0,
|
||||
y: '3rem',
|
||||
duration: 0.5,
|
||||
y: '2rem',
|
||||
duration: 0.4,
|
||||
delay: 0.1,
|
||||
ease: 'power2.out',
|
||||
stagger: 0.05,
|
||||
|
@ -26,9 +26,9 @@ function setupPostPageAnimation() {
|
|||
if (allElements.length > 15) {
|
||||
gsap.from(allElements.slice(15), {
|
||||
opacity: 0,
|
||||
y: '3rem',
|
||||
duration: 0.5,
|
||||
delay: 0.05 * 15 + 0.1,
|
||||
y: '2rem',
|
||||
duration: 0.4,
|
||||
delay: 0.1 + 0.05 * 15,
|
||||
ease: 'power2.out',
|
||||
})
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ function setupPostPageAnimation() {
|
|||
if (dateElement) {
|
||||
gsap.from(dateElement, {
|
||||
opacity: 0,
|
||||
y: '1.5rem',
|
||||
duration: 0.5,
|
||||
y: '1rem',
|
||||
duration: 0.4,
|
||||
delay: 0.1,
|
||||
ease: 'power2.out',
|
||||
})
|
||||
|
@ -51,7 +51,7 @@ function setupPostPageAnimation() {
|
|||
gsap.from(tocIcon, {
|
||||
opacity: 0,
|
||||
y: '0.5rem',
|
||||
duration: 0.5,
|
||||
duration: 0.4,
|
||||
delay: 0.125,
|
||||
ease: 'power2.out',
|
||||
})
|
||||
|
@ -61,8 +61,8 @@ function setupPostPageAnimation() {
|
|||
if (tocListChildren.length > 0) {
|
||||
gsap.from(tocListChildren, {
|
||||
opacity: 0,
|
||||
y: '1.5rem',
|
||||
duration: 0.5,
|
||||
y: '1rem',
|
||||
duration: 0.4,
|
||||
delay: 0.15,
|
||||
ease: 'power2.out',
|
||||
stagger: 0.025,
|
||||
|
@ -74,7 +74,7 @@ function setupPostPageAnimation() {
|
|||
gsap.from(backButton, {
|
||||
opacity: 0,
|
||||
x: '0.5rem',
|
||||
duration: 0.5,
|
||||
duration: 0.4,
|
||||
delay: 0.15,
|
||||
ease: 'power2.out',
|
||||
})
|
||||
|
@ -85,8 +85,8 @@ function setupPostPageAnimation() {
|
|||
if (isSmallScreen && tocContainer) {
|
||||
gsap.from(tocContainer, {
|
||||
opacity: 0,
|
||||
y: '3rem',
|
||||
duration: 0.5,
|
||||
y: '2rem',
|
||||
duration: 0.4,
|
||||
delay: 0.1,
|
||||
ease: 'power2.out',
|
||||
})
|
||||
|
|
|
@ -55,6 +55,7 @@ const pageImage = postSlug
|
|||
<link rel="preload" href="/fonts/EarlySummer-Subset.woff2" as="font" type="font/woff2" crossorigin />
|
||||
<link rel="preload" href="/fonts/Snell-Black.woff2" as="font" type="font/woff2" crossorigin />
|
||||
<link rel="preload" href="/fonts/Snell-Bold.woff2" as="font" type="font/woff2" crossorigin />
|
||||
<link rel="preload" href="/fonts/STIX-Italic.woff2" as="font" type="font/woff2" crossorigin />
|
||||
{commentEnabled && walineServerURL && <link rel="stylesheet" href="/assets/waline/waline.css" />}
|
||||
{katexEnabled && <link rel="stylesheet" href={katexCSS} />}
|
||||
<link rel="alternate" href="/rss.xml" type="application/rss+xml" title="RSS Feed" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue