🎨 🐛 Fixed the friends link code block & others imports.

This commit is contained in:
elkan1788
2025-01-25 17:43:52 +08:00
parent f215616230
commit 6d65d92943
14 changed files with 53 additions and 88 deletions

View File

@@ -6,7 +6,6 @@
@import 'gitter';
@import 'livere';
@import 'waline';
@import 'mermaid';
.use-motion .animated {
// Fix issue #48 #55

View File

@@ -1,3 +0,0 @@
.post-block .post-body .mermaid {
background: var(--highlight-foreground);
}

View File

@@ -2,7 +2,6 @@
@import 'group-pictures';
@import 'label';
@import 'link-grid';
@import 'mermaid';
@import 'note';
@import 'pdf';
@import 'tabs';

View File

@@ -1,6 +0,0 @@
@if $mermaid_enable {
.mermaid {
margin-bottom: 20px;
text-align: center;
}
}

View File

@@ -7,7 +7,6 @@ $darkmode : {{ $P.darkmode }};
$body_scrollbar_overlay : {{ $P.bodyScrollbar.overlay }};
$body_scrollbar_stable : {{ $P.bodyScrollbar.stable }};
$mermaid_enable : {{ $P.mermaid.enable }};
$mobile_layout_economy : {{ $P.mobileLayoutEconomy }};
$theme_color_dark : {{ $P.themeColor.dark }};
$theme_color_light : {{ $P.themeColor.light }};

View File

@@ -1,41 +1,41 @@
/* clipboard plugin */
NexT.plugins.others.clipboard = function () {
if (!NexT.CONFIG.copybtn) return;
let chromaDiv = document.querySelectorAll('div.highlight div.chroma');
if (chromaDiv.length === 0) return;
chromaDiv.forEach(element => {
// Add copy button DOM.
let codeblock = element.querySelector('code[class]:not([class=""]');
let lang = codeblock.className;
let copyBtn = document.createElement('div');
copyBtn.classList.add('copy-btn');
codeblock.parentNode.appendChild(copyBtn);
element.addEventListener('mouseleave', () => {
setTimeout(() => {
copyBtn.classList.remove('copied','uncopied');
}, 300);
});
// Add code header show
var ch = document.createElement('div');
ch.classList.add('code-header');
ch.classList.add(lang);
ch.insertAdjacentHTML('afterbegin',
'<span class="code-lang"></span><span class="collapse-btn"></span>');
ch.addEventListener('click', function () {
element.classList.toggle('hidden-code');
ch.querySelector('.collapse-btn').classList.toggle('collapse');
}, false);
element.parentNode.insertBefore(ch, element);
});
if (!NexT.CONFIG.copybtn || !NexT.CONFIG.page.clipboard) return;
const clipboard_js = NexT.utils.getCDNResource(NexT.CONFIG.page.clipboard.js);
NexT.utils.getScript(clipboard_js, function () {
let chromaDiv = document.querySelectorAll('div.highlight div.chroma');
if (chromaDiv.length === 0) return;
chromaDiv.forEach(element => {
// Add copy button DOM.
let codeblock = element.querySelector('code[class]:not([class=""]');
let lang = codeblock.className;
let copyBtn = document.createElement('div');
copyBtn.classList.add('copy-btn');
codeblock.parentNode.appendChild(copyBtn);
element.addEventListener('mouseleave', () => {
setTimeout(() => {
copyBtn.classList.remove('copied','uncopied');
}, 300);
});
// Add code header show
var ch = document.createElement('div');
ch.classList.add('code-header');
ch.classList.add(lang);
ch.insertAdjacentHTML('afterbegin',
'<span class="code-lang"></span><span class="collapse-btn"></span>');
ch.addEventListener('click', function () {
element.classList.toggle('hidden-code');
ch.querySelector('.collapse-btn').classList.toggle('collapse');
}, false);
element.parentNode.insertBefore(ch, element);
});
NexT.utils.getScript(clipboard_js, function () {
// Register the clipboard event.
var clipboard = new ClipboardJS('.copy-btn', {
text: function (trigger) {