Skip to content

Commit b4aa6d8

Browse files
author
15363205631
committed
normal optimize
1 parent 6f14724 commit b4aa6d8

File tree

17 files changed

+87
-520
lines changed

17 files changed

+87
-520
lines changed

src/lib/Z-transitions.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
import * as ease from "svelte/easing";
22

3-
export function slideWithPadding(node, { delay = 0, duration = 400, axis }) {
4-
const width = window.getComputedStyle(node).width;
5-
const padding = window.getComputedStyle(node).padding.split(' ').map(Number);
6-
return {
7-
delay,
8-
duration,
9-
axis,
10-
easing: ease.quadOut,
11-
css(t, u) {
12-
return `
13-
position: sticky;
14-
overflow: hidden;
15-
min-width: 0;
16-
padding: ${padding[0] * t} ${padding[1] * t} ${padding[2] * t} ${padding[3] * t};
17-
width:${parseInt(width.replace('px', '')) * t}px;
18-
`;
19-
}
20-
};
21-
}
22-
233
export function scaleX(node, { delay = 0, duration = 200, direction = 'left' }) {
244
return {
255
delay,

src/lib/ZBlurBtn/ZBlurBtn.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<style>
1818
button :global {
1919
font-family: unset;
20+
font-size: unset;
2021
box-sizing: border-box;
2122
margin: 0;
2223
padding: 0;
@@ -26,7 +27,7 @@
2627
border-radius: 0.7rem;
2728
outline: none;
2829
background-color: var(--header-btn-bg-color);
29-
backdrop-filter: blur(10px);
30+
backdrop-filter: blur(5px);
3031
display: flex;
3132
justify-content: center;
3233
align-items: center;

src/lib/ZIcon/ZIcon.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@
99
*/
1010
1111
/** @type {Props} */
12-
let { option , height = '1.25rem', width = '1.25rem', stroke, fill, ...others } = $props();
12+
let {
13+
option,
14+
height = '1.25rem',
15+
width = '1.25rem',
16+
stroke = 'var(--all-svg-color)',
17+
fill = 'var(--all-svg-color)',
18+
...others
19+
} = $props();
1320
// .replace(/\d+/g, (match) => parseInt(match, 10) * 2.4)
1421
let viewBox = $derived(viewBoxs[option]);
1522
let path = $derived(paths[option]);
1623
</script>
1724

1825
<!-- svelte-ignore a11y_no_static_element_interactions -->
19-
<svg style="--strokeColor:{stroke};--fillColor:{fill}" {...others} {viewBox} {height} {width}
26+
<svg {...others} style="--strokeColor:{stroke};--fillColor:{fill}" {viewBox} {height} {width}
2027
>{@html path}</svg
2128
>
2229

src/lib/ZIcon/Zicon.js

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/ZNav/ZNav.svelte

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { afterNavigate } from '$app/navigation';
33
import { page } from '$app/stores';
44
import ZBlurBtn from '$lib/ZBlurBtn/ZBlurBtn.svelte';
5+
import ZIcon from '$lib/ZIcon/ZIcon.svelte';
56
import { onMount } from 'svelte';
67
78
let urls = $state();
@@ -15,14 +16,11 @@
1516
const url = new URL($page.url);
1617
urls = url.pathname.split('/').filter(Boolean);
1718
});
18-
19-
$inspect(urls);
2019
</script>
2120

2221
<div class="znav">
23-
<div>></div>
2422
{#each urls as url, i}
25-
{#if i !== 0}
23+
{#if i !== 0 && urls.length !== 0}
2624
<span>/</span>
2725
{/if}
2826
<a href={'/' + urls.slice(0, i + 1).join('/')}>{url}</a>
@@ -32,30 +30,31 @@
3230
<style>
3331
.znav :global {
3432
display: flex;
35-
padding: 0 1rem;
33+
padding: 0 0.5rem;
3634
height: 3rem;
3735
min-width: 3rem;
3836
align-items: center;
3937
justify-content: center;
4038
flex-wrap: nowrap;
4139
flex-direction: row;
42-
backdrop-filter: blur(10px);
43-
background-color: var(--header-btn-bg-color);
4440
border-radius: 0.7rem;
41+
backdrop-filter: blur(5px);
42+
background-color: var(--header-btn-bg-color);
4543
* {
4644
color: var(--header-text-color);
4745
}
4846
a {
49-
font-size: large;
50-
font-weight: bolder;
47+
font-size: 0.9rem;
5148
text-decoration: none;
49+
color: var(--header-text-light-color);
5250
&:hover {
5351
text-decoration: solid underline;
5452
color: var(--header-text-hover-color);
5553
}
5654
}
57-
span{
58-
padding: 0 1rem;
55+
span {
56+
color: var(--header-text-light-color);
57+
padding: 0 0.5rem;
5958
}
6059
}
6160
</style>

src/lib/ZSibar/ZSidebar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
}
164164
a.sidebar {
165165
text-decoration: none;
166-
color: var(----main-text-color);
166+
color: var(--sidebar-text-color);
167167
transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 300ms 70ms;
168168
&:hover {
169169
text-decoration: underline;

src/lib/ZThemeBtn/ZThemeBtn.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
width: 5rem;
9696
height: var(--header-block-height);
9797
justify-content: center;
98+
font-size: 0.9rem;
9899
& .theme-btnContainer {
99100
display: flex;
100101
flex-direction: column;

src/routes/+layout.server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export async function load() {
1010
.filter((d) => d.isDirectory())
1111
.map((d) => path.join(d.parentPath, d.name).replaceAll('\\', '/').replaceAll(baseDir, ''));
1212

13-
const docDir = 'docs/';
13+
const docDir = 'Docs/';
1414
const docItems = await readdir(docDir, { recursive: true, withFileTypes: true });
15-
const docDirectory = docItems.map((d) => path.join(d.parentPath, d.name).replaceAll('\\', '/').replaceAll(docDir, '/docs/').replace('.md', ''));
15+
const docDirectory = docItems.map((d) => path.join(d.parentPath, d.name).replaceAll('\\', '/').replaceAll(docDir, '/Docs/').replace('.md', ''));
1616

1717
directory = [...directory, ...docDirectory].filter((i) => !i.match(/\[.*\]/g));
1818

0 commit comments

Comments
 (0)