Skip to content

Commit 576d040

Browse files
committed
1 parent 1d4e143 commit 576d040

File tree

37 files changed

+2797
-31
lines changed

37 files changed

+2797
-31
lines changed

404.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,86 @@ <h3 class="search-result--title section-title"></h3>
315315
document.head.appendChild(customFont);
316316
}());
317317
</script>
318+
<style>
319+
.highlight {
320+
321+
max-height: 400px;
322+
overflow: hidden;
323+
}
324+
325+
.code-show {
326+
max-height: none !important;
327+
}
328+
329+
.code-more-box {
330+
width: 100%;
331+
padding-top: 78px;
332+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#fff));
333+
position: absolute;
334+
left: 0;
335+
right: 0;
336+
bottom: 0;
337+
z-index: 1;
338+
}
339+
340+
.code-more-btn {
341+
display: block;
342+
margin: auto;
343+
width: 44px;
344+
height: 22px;
345+
background: #f0f0f5;
346+
border-top-left-radius: 8px;
347+
border-top-right-radius: 8px;
348+
padding-top: 6px;
349+
cursor: pointer;
350+
}
351+
352+
.code-more-img {
353+
cursor: pointer !important;
354+
display: block;
355+
margin: auto;
356+
width: 22px;
357+
height: 16px;
358+
}
359+
</style>
360+
361+
<script>
362+
function initCodeMoreBox() {
363+
let codeBlocks = document.querySelectorAll(".highlight");
364+
if (!codeBlocks) {
365+
return;
366+
}
367+
codeBlocks.forEach(codeBlock => {
368+
369+
if (codeBlock.scrollHeight <= codeBlock.clientHeight) {
370+
return;
371+
}
372+
373+
374+
let codeMoreBox = document.createElement('div');
375+
codeMoreBox.classList.add('code-more-box');
376+
377+
let codeMoreBtn = document.createElement('span');
378+
codeMoreBtn.classList.add('code-more-btn');
379+
codeMoreBtn.addEventListener('click', () => {
380+
codeBlock.classList.add('code-show');
381+
codeMoreBox.style.display = 'none';
382+
383+
window.dispatchEvent(new Event('resize'))
384+
})
385+
386+
let img = document.createElement('img');
387+
img.classList.add('code-more-img');
388+
img.src = "https://xenithya.github.io/icons/codeMore.png"
389+
390+
codeMoreBtn.appendChild(img);
391+
codeMoreBox.appendChild(codeMoreBtn);
392+
codeBlock.appendChild(codeMoreBox)
393+
})
394+
}
395+
396+
initCodeMoreBox();
397+
</script>
318398

319399
</body>
320400
</html>

archives/index.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,86 @@ <h2 class="article-title">Emoji Support</h2>
518518
document.head.appendChild(customFont);
519519
}());
520520
</script>
521+
<style>
522+
.highlight {
523+
524+
max-height: 400px;
525+
overflow: hidden;
526+
}
527+
528+
.code-show {
529+
max-height: none !important;
530+
}
531+
532+
.code-more-box {
533+
width: 100%;
534+
padding-top: 78px;
535+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#fff));
536+
position: absolute;
537+
left: 0;
538+
right: 0;
539+
bottom: 0;
540+
z-index: 1;
541+
}
542+
543+
.code-more-btn {
544+
display: block;
545+
margin: auto;
546+
width: 44px;
547+
height: 22px;
548+
background: #f0f0f5;
549+
border-top-left-radius: 8px;
550+
border-top-right-radius: 8px;
551+
padding-top: 6px;
552+
cursor: pointer;
553+
}
554+
555+
.code-more-img {
556+
cursor: pointer !important;
557+
display: block;
558+
margin: auto;
559+
width: 22px;
560+
height: 16px;
561+
}
562+
</style>
563+
564+
<script>
565+
function initCodeMoreBox() {
566+
let codeBlocks = document.querySelectorAll(".highlight");
567+
if (!codeBlocks) {
568+
return;
569+
}
570+
codeBlocks.forEach(codeBlock => {
571+
572+
if (codeBlock.scrollHeight <= codeBlock.clientHeight) {
573+
return;
574+
}
575+
576+
577+
let codeMoreBox = document.createElement('div');
578+
codeMoreBox.classList.add('code-more-box');
579+
580+
let codeMoreBtn = document.createElement('span');
581+
codeMoreBtn.classList.add('code-more-btn');
582+
codeMoreBtn.addEventListener('click', () => {
583+
codeBlock.classList.add('code-show');
584+
codeMoreBox.style.display = 'none';
585+
586+
window.dispatchEvent(new Event('resize'))
587+
})
588+
589+
let img = document.createElement('img');
590+
img.classList.add('code-more-img');
591+
img.src = "https://xenithya.github.io/icons/codeMore.png"
592+
593+
codeMoreBtn.appendChild(img);
594+
codeMoreBox.appendChild(codeMoreBtn);
595+
codeBlock.appendChild(codeMoreBox)
596+
})
597+
}
598+
599+
initCodeMoreBox();
600+
</script>
521601

522602
</body>
523603
</html>

categories/index.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,86 @@ <h2 class="article-title">Test With Whitespaces</h2>
482482
document.head.appendChild(customFont);
483483
}());
484484
</script>
485+
<style>
486+
.highlight {
487+
488+
max-height: 400px;
489+
overflow: hidden;
490+
}
491+
492+
.code-show {
493+
max-height: none !important;
494+
}
495+
496+
.code-more-box {
497+
width: 100%;
498+
padding-top: 78px;
499+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#fff));
500+
position: absolute;
501+
left: 0;
502+
right: 0;
503+
bottom: 0;
504+
z-index: 1;
505+
}
506+
507+
.code-more-btn {
508+
display: block;
509+
margin: auto;
510+
width: 44px;
511+
height: 22px;
512+
background: #f0f0f5;
513+
border-top-left-radius: 8px;
514+
border-top-right-radius: 8px;
515+
padding-top: 6px;
516+
cursor: pointer;
517+
}
518+
519+
.code-more-img {
520+
cursor: pointer !important;
521+
display: block;
522+
margin: auto;
523+
width: 22px;
524+
height: 16px;
525+
}
526+
</style>
527+
528+
<script>
529+
function initCodeMoreBox() {
530+
let codeBlocks = document.querySelectorAll(".highlight");
531+
if (!codeBlocks) {
532+
return;
533+
}
534+
codeBlocks.forEach(codeBlock => {
535+
536+
if (codeBlock.scrollHeight <= codeBlock.clientHeight) {
537+
return;
538+
}
539+
540+
541+
let codeMoreBox = document.createElement('div');
542+
codeMoreBox.classList.add('code-more-box');
543+
544+
let codeMoreBtn = document.createElement('span');
545+
codeMoreBtn.classList.add('code-more-btn');
546+
codeMoreBtn.addEventListener('click', () => {
547+
codeBlock.classList.add('code-show');
548+
codeMoreBox.style.display = 'none';
549+
550+
window.dispatchEvent(new Event('resize'))
551+
})
552+
553+
let img = document.createElement('img');
554+
img.classList.add('code-more-img');
555+
img.src = "https://xenithya.github.io/icons/codeMore.png"
556+
557+
codeMoreBtn.appendChild(img);
558+
codeMoreBox.appendChild(codeMoreBtn);
559+
codeBlock.appendChild(codeMoreBox)
560+
})
561+
}
562+
563+
initCodeMoreBox();
564+
</script>
485565

486566
</body>
487567
</html>

categories/syntax/index.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,86 @@ <h2 class="article-title">Markdown Syntax Guide</h2>
438438
document.head.appendChild(customFont);
439439
}());
440440
</script>
441+
<style>
442+
.highlight {
443+
444+
max-height: 400px;
445+
overflow: hidden;
446+
}
447+
448+
.code-show {
449+
max-height: none !important;
450+
}
451+
452+
.code-more-box {
453+
width: 100%;
454+
padding-top: 78px;
455+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#fff));
456+
position: absolute;
457+
left: 0;
458+
right: 0;
459+
bottom: 0;
460+
z-index: 1;
461+
}
462+
463+
.code-more-btn {
464+
display: block;
465+
margin: auto;
466+
width: 44px;
467+
height: 22px;
468+
background: #f0f0f5;
469+
border-top-left-radius: 8px;
470+
border-top-right-radius: 8px;
471+
padding-top: 6px;
472+
cursor: pointer;
473+
}
474+
475+
.code-more-img {
476+
cursor: pointer !important;
477+
display: block;
478+
margin: auto;
479+
width: 22px;
480+
height: 16px;
481+
}
482+
</style>
483+
484+
<script>
485+
function initCodeMoreBox() {
486+
let codeBlocks = document.querySelectorAll(".highlight");
487+
if (!codeBlocks) {
488+
return;
489+
}
490+
codeBlocks.forEach(codeBlock => {
491+
492+
if (codeBlock.scrollHeight <= codeBlock.clientHeight) {
493+
return;
494+
}
495+
496+
497+
let codeMoreBox = document.createElement('div');
498+
codeMoreBox.classList.add('code-more-box');
499+
500+
let codeMoreBtn = document.createElement('span');
501+
codeMoreBtn.classList.add('code-more-btn');
502+
codeMoreBtn.addEventListener('click', () => {
503+
codeBlock.classList.add('code-show');
504+
codeMoreBox.style.display = 'none';
505+
506+
window.dispatchEvent(new Event('resize'))
507+
})
508+
509+
let img = document.createElement('img');
510+
img.classList.add('code-more-img');
511+
img.src = "https://xenithya.github.io/icons/codeMore.png"
512+
513+
codeMoreBtn.appendChild(img);
514+
codeMoreBox.appendChild(codeMoreBtn);
515+
codeBlock.appendChild(codeMoreBox)
516+
})
517+
}
518+
519+
initCodeMoreBox();
520+
</script>
441521

442522
</body>
443523
</html>

0 commit comments

Comments
 (0)