Update story description and enhance sidebar styles
- Revised the story section description to reflect the server's narrative. - Removed placeholder text and added a prompt for content creation. - Improved sidebar link styles for better visibility and interaction. - Added hover effects and styles for sections with sub-items in the table of contents. - Introduced new styles for alcohol and contact link cards for consistent design. - Enhanced map call-to-action button with new styles and hover effects.
This commit is contained in:
@@ -93,6 +93,34 @@ const topLinks = [
|
||||
</button>
|
||||
|
||||
<script>
|
||||
const enhanceSidebarGroupLinks = () => {
|
||||
const targets = [{ label: 'Алкоголь', href: '/alcohol/' }];
|
||||
const labelNodes = document.querySelectorAll('.sidebar-content details > summary .group-label .large');
|
||||
|
||||
labelNodes.forEach((labelNode) => {
|
||||
if (!(labelNode instanceof HTMLElement)) return;
|
||||
|
||||
const text = labelNode.textContent?.trim();
|
||||
const target = targets.find((item) => item.label === text);
|
||||
if (!target) return;
|
||||
|
||||
if (labelNode.querySelector('a[data-sidebar-group-link]')) return;
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.href = target.href;
|
||||
link.className = 'sidebar-group-link';
|
||||
link.dataset.sidebarGroupLink = 'true';
|
||||
link.textContent = target.label;
|
||||
link.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
window.location.href = target.href;
|
||||
});
|
||||
|
||||
labelNode.replaceChildren(link);
|
||||
});
|
||||
};
|
||||
|
||||
const setReadProgress = () => {
|
||||
const progressEl = document.querySelector('[data-read-progress]');
|
||||
const backToTopBtn = document.querySelector('[data-back-to-top]');
|
||||
@@ -135,6 +163,7 @@ const topLinks = [
|
||||
});
|
||||
});
|
||||
|
||||
enhanceSidebarGroupLinks();
|
||||
setReadProgress();
|
||||
window.addEventListener('scroll', setReadProgress, { passive: true });
|
||||
window.addEventListener('resize', setReadProgress);
|
||||
@@ -146,7 +175,10 @@ const topLinks = [
|
||||
bindReadProgress();
|
||||
}
|
||||
|
||||
document.addEventListener('astro:page-load', setReadProgress);
|
||||
document.addEventListener('astro:page-load', () => {
|
||||
enhanceSidebarGroupLinks();
|
||||
setReadProgress();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user