fix: update sub-products in footer
This commit is contained in:
+51
-3
@@ -1263,7 +1263,7 @@ a.citation-count-badge:hover {
|
||||
|
||||
.article-citation-item {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-secondary);
|
||||
@@ -1284,16 +1284,64 @@ a.citation-count-badge:hover {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.citation-link {
|
||||
.citation-actions {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.citation-link,
|
||||
.citation-copy {
|
||||
color: var(--accent-blue-light);
|
||||
opacity: 0.75;
|
||||
transition: opacity 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.citation-link:hover {
|
||||
.citation-copy {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.citation-link:hover,
|
||||
.citation-copy:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.citation-copy-feedback {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: calc(100% + 0.2rem);
|
||||
transform: translateX(-50%);
|
||||
font-size: 0.62rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
color: var(--accent-blue-light);
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.citation-copy-icon-done {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.citation-copy.is-copied .citation-copy-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.citation-copy.is-copied .citation-copy-icon-done {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.citation-copy.is-copied {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ const SELECTORS = {
|
||||
faqQuestion: '.faq-question',
|
||||
faqAnswer: '.faq-answer',
|
||||
fadeInElements: '.fade-in',
|
||||
citationCopy: '.citation-copy',
|
||||
};
|
||||
|
||||
function initNavbarScroll() {
|
||||
@@ -190,6 +191,47 @@ function initReadMore() {
|
||||
});
|
||||
}
|
||||
|
||||
function initCitationCopy() {
|
||||
const copyButtons = document.querySelectorAll(SELECTORS.citationCopy);
|
||||
if (!copyButtons.length) return;
|
||||
|
||||
copyButtons.forEach((btn) => {
|
||||
const url = btn.getAttribute('data-citation-url');
|
||||
const feedback = btn.querySelector('.citation-copy-feedback');
|
||||
if (!url || !feedback) return;
|
||||
|
||||
let resetTimer = null;
|
||||
|
||||
btn.addEventListener('click', async () => {
|
||||
clearTimeout(resetTimer);
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(url);
|
||||
} catch {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = url;
|
||||
textarea.setAttribute('readonly', '');
|
||||
textarea.style.position = 'fixed';
|
||||
textarea.style.left = '-9999px';
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
|
||||
feedback.hidden = false;
|
||||
btn.classList.add('is-copied');
|
||||
btn.setAttribute('aria-label', 'Link copied');
|
||||
|
||||
resetTimer = setTimeout(() => {
|
||||
feedback.hidden = true;
|
||||
btn.classList.remove('is-copied');
|
||||
btn.setAttribute('aria-label', 'Copy citation link');
|
||||
}, 2000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
initNavbarScroll();
|
||||
initMobileMenu();
|
||||
@@ -197,6 +239,7 @@ function init() {
|
||||
initFAQAccordion();
|
||||
initIntersectionObserver();
|
||||
initReadMore();
|
||||
initCitationCopy();
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
|
||||
Reference in New Issue
Block a user