astro-pure 1.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/advanced/QRCode.astro +2 -2
- package/components/basic/Header.astro +6 -6
- package/components/pages/BackToTop.astro +2 -3
- package/components/pages/TOC.astro +1 -1
- package/components/pages/TOCHeading.astro +2 -2
- package/components/user/Collapse.astro +3 -3
- package/package.json +1 -1
- package/bunfig.toml +0 -2
|
@@ -10,12 +10,12 @@ const { content, class: className, ...props } = Astro.props
|
|
|
10
10
|
<script is:inline define:vars={{ content }}>
|
|
11
11
|
const renderContent = content ?? window.location.href
|
|
12
12
|
// Load qrcode
|
|
13
|
-
function
|
|
13
|
+
function loadQRcode(qrcodeContainer) {
|
|
14
14
|
if (!qrcodeContainer) throw new Error('qrcode container not found')
|
|
15
15
|
if (qrcodeContainer.innerHTML !== '') return
|
|
16
16
|
new QRCode(qrcodeContainer, renderContent)
|
|
17
17
|
}
|
|
18
18
|
const qrcodeContainer = document.getElementById('qrcode-container')
|
|
19
19
|
if (!qrcodeContainer) throw new Error('qrcode container not found')
|
|
20
|
-
|
|
20
|
+
loadQRcode(qrcodeContainer)
|
|
21
21
|
</script>
|
|
@@ -17,7 +17,7 @@ import { Icon } from '../user'
|
|
|
17
17
|
<div class='flex items-center gap-x-2'>
|
|
18
18
|
{/* Menu links */}
|
|
19
19
|
<div
|
|
20
|
-
id='
|
|
20
|
+
id='headerExpandContent'
|
|
21
21
|
class='end-0 start-0 top-12 grid border border-transparent group-[.not-top]:rounded-xl group-[.expanded]:opacity-100 dark:group-[.expanded.not-top]:bg-muted max-sm:absolute max-sm:opacity-0 max-sm:group-[.not-top]:border-border max-sm:group-[.expanded.not-top]:bg-background max-sm:group-[.not-top]:px-4 max-sm:group-[.not-top]:py-2 sm:grid-rows-1'
|
|
22
22
|
>
|
|
23
23
|
<div class='flex flex-col items-center justify-center overflow-hidden sm:flex-row'>
|
|
@@ -148,7 +148,7 @@ import { Icon } from '../user'
|
|
|
148
148
|
|
|
149
149
|
/* header menu */
|
|
150
150
|
@media (max-width: 640px) {
|
|
151
|
-
#
|
|
151
|
+
#headerExpandContent {
|
|
152
152
|
grid-template-rows: 0fr;
|
|
153
153
|
transition:
|
|
154
154
|
opacity 0.3s,
|
|
@@ -156,10 +156,10 @@ import { Icon } from '../user'
|
|
|
156
156
|
border-color 0.15s,
|
|
157
157
|
grid-template-rows 0.3s;
|
|
158
158
|
}
|
|
159
|
-
.expanded #
|
|
159
|
+
.expanded #headerExpandContent {
|
|
160
160
|
grid-template-rows: 1fr;
|
|
161
161
|
}
|
|
162
|
-
.expanded.not-top #
|
|
162
|
+
.expanded.not-top #headerExpandContent {
|
|
163
163
|
box-shadow:
|
|
164
164
|
rgb(255, 255, 255) 0px 0px 0px 0px,
|
|
165
165
|
rgba(24, 24, 27, 0.08) 0px 0px 0px 1px,
|
|
@@ -168,7 +168,7 @@ import { Icon } from '../user'
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/* header component after */
|
|
171
|
-
header-component #
|
|
171
|
+
header-component #headerExpandContent::after {
|
|
172
172
|
box-sizing: content-box;
|
|
173
173
|
content: '';
|
|
174
174
|
position: absolute;
|
|
@@ -181,7 +181,7 @@ import { Icon } from '../user'
|
|
|
181
181
|
opacity: 0;
|
|
182
182
|
border-bottom: 1px solid transparent;
|
|
183
183
|
}
|
|
184
|
-
header-component:not(.not-top) #
|
|
184
|
+
header-component:not(.not-top) #headerExpandContent::after {
|
|
185
185
|
visibility: visible;
|
|
186
186
|
bottom: -1rem;
|
|
187
187
|
opacity: 1;
|
|
@@ -5,13 +5,13 @@ const { header: headerName, content: contentName, needPercent = true } = Astro.p
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<div
|
|
8
|
-
class='z-
|
|
8
|
+
class='z-10 group fixed bottom-8 end-4 transition-all flex flex-col gap-y-4 sm:end-8'
|
|
9
9
|
id='action-buttons'
|
|
10
10
|
>
|
|
11
11
|
<slot name='other-icons' />
|
|
12
12
|
<button
|
|
13
13
|
aria-label='Back to Top'
|
|
14
|
-
class='relative
|
|
14
|
+
class='relative size-10 flex items-center justify-center rounded-full border-2 border-transparent bg-muted text-muted-foreground duration-300 hover:border-border/75 sm:size-12 opacity-0'
|
|
15
15
|
id='to-top-btn'
|
|
16
16
|
>
|
|
17
17
|
<div
|
|
@@ -47,7 +47,6 @@ const { header: headerName, content: contentName, needPercent = true } = Astro.p
|
|
|
47
47
|
} else {
|
|
48
48
|
console.error(`Element with ID ${headerName} not found.`)
|
|
49
49
|
}
|
|
50
|
-
|
|
51
50
|
if (needPercent) {
|
|
52
51
|
// scroll percentage
|
|
53
52
|
const scrollHeight = articleElement.scrollHeight // total height
|
|
@@ -90,7 +90,7 @@ const toc = generateToc(headings)
|
|
|
90
90
|
(i == this.tocLinks.length - 1 ||
|
|
91
91
|
!this.headingProgress[this.tocLinks[i + 1]?.slug].inView)
|
|
92
92
|
)
|
|
93
|
-
bar.classList.toggle('
|
|
93
|
+
bar.classList.toggle('is-read', !inView && progress == 1)
|
|
94
94
|
bar.classList.toggle('highlight-bg', inView)
|
|
95
95
|
bar.style.setProperty('height', `${progress * 90}%`)
|
|
96
96
|
}
|
|
@@ -16,12 +16,12 @@ const text = rawText.endsWith('#') ? rawText.slice(0, -1) : rawText
|
|
|
16
16
|
<li>
|
|
17
17
|
<div class='relative'>
|
|
18
18
|
<span
|
|
19
|
-
class='absolute top-[5%] w-[2px] rounded transition-colors duration-300 [&.highlight-bg]:bg-primary [&.
|
|
19
|
+
class='absolute top-[5%] w-[2px] rounded transition-colors duration-300 [&.highlight-bg]:bg-primary [&.is-read]:bg-input'
|
|
20
20
|
></span>
|
|
21
21
|
<a
|
|
22
22
|
aria-label={`Scroll to section: ${text}`}
|
|
23
23
|
class={cn(
|
|
24
|
-
'toc-item line-clamp-2 px-3 py-1 ms-2 text-foreground/75 transition-all hover:text-foreground [&.highlight]:font-medium [&.highlight]:text-primary [&.
|
|
24
|
+
'toc-item line-clamp-2 px-3 py-1 ms-2 text-foreground/75 transition-all hover:text-foreground [&.highlight]:font-medium [&.highlight]:text-primary [&.is-read]:text-input [&.highlight-bg-translucent]:bg-muted',
|
|
25
25
|
depth > 2 && 'ps-7'
|
|
26
26
|
)}
|
|
27
27
|
href={`#${slug}`}>{text}</a
|
|
@@ -45,7 +45,7 @@ const { class: className, title, ...props } = Astro.props
|
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
47
|
<div
|
|
48
|
-
class='expand-
|
|
48
|
+
class='expand-content grid opacity-0 transition-all duration-300 ease-in-out group-[.expanded]/expand:mb-3 group-[.expanded]/expand:opacity-100 sm:group-[.expanded]/expand:mb-4'
|
|
49
49
|
>
|
|
50
50
|
<div class='overflow-hidden'>
|
|
51
51
|
<slot />
|
|
@@ -72,10 +72,10 @@ const { class: className, title, ...props } = Astro.props
|
|
|
72
72
|
</script>
|
|
73
73
|
|
|
74
74
|
<style>
|
|
75
|
-
.expand-
|
|
75
|
+
.expand-content {
|
|
76
76
|
grid-template-rows: 0fr;
|
|
77
77
|
}
|
|
78
|
-
.expanded .expand-
|
|
78
|
+
.expanded .expand-content {
|
|
79
79
|
grid-template-rows: 1fr;
|
|
80
80
|
}
|
|
81
81
|
</style>
|
package/package.json
CHANGED
package/bunfig.toml
DELETED