💄 Come true the comments switch button working.
This commit is contained in:
parent
d20198d956
commit
05ac33e27f
@ -1,5 +1,6 @@
|
||||
@if $utterances_enable {
|
||||
.utterances {
|
||||
max-width: unset;
|
||||
//max-width: unset;
|
||||
min-height: 300px;
|
||||
}
|
||||
}
|
||||
|
@ -67,10 +67,6 @@
|
||||
|
||||
.first-comment {
|
||||
color: $first_comment_color;
|
||||
|
||||
@if $two_comments_actived==$first_comment_name {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.second-comment {
|
||||
@ -82,6 +78,7 @@
|
||||
}
|
||||
|
||||
$switch_btn_bg_color: $first_comment_color;
|
||||
$switch_btn_move_bc: $second_comment_color;
|
||||
|
||||
.switch-btn {
|
||||
position: relative;
|
||||
@ -100,6 +97,7 @@
|
||||
|
||||
@if $two_comments_actived==$second_comment_name {
|
||||
$switch_btn_bg_color: $second_comment_color;
|
||||
$switch_btn_move_bc: $first_comment_color;
|
||||
}
|
||||
|
||||
background-color: $switch_btn_bg_color;
|
||||
@ -120,6 +118,10 @@
|
||||
transition: .4s
|
||||
}
|
||||
|
||||
&.move {
|
||||
background-color: $switch_btn_move_bc;
|
||||
}
|
||||
|
||||
&.move:before {
|
||||
-webkit-transform: translateX(20px);
|
||||
-moz-transform: translateX(20px);
|
||||
@ -129,6 +131,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ NexT.boot.refresh = function() {
|
||||
NexT.utils.registerLangSelect();*/
|
||||
NexT.utils.registerSidebarTOC();
|
||||
NexT.utils.registerPostReward();
|
||||
NexT.utils.registerCommonSwitch();
|
||||
NexT.utils.wrapTableWithBox();
|
||||
NexT.utils.registerVideoIframe();
|
||||
};
|
||||
|
@ -243,6 +243,20 @@ NexT.utils = {
|
||||
});
|
||||
},
|
||||
|
||||
registerCommonSwitch: function() {
|
||||
const button = document.querySelector('.comment-switch .switch-btn');
|
||||
if (!button) return;
|
||||
const cwrap = document.querySelector('.comment-wrap');
|
||||
button.addEventListener('click', () => {
|
||||
button.classList.toggle('move');
|
||||
const comms = document.querySelectorAll('.comment-wrap > div');
|
||||
let len = comms.length;
|
||||
while(len--){
|
||||
cwrap.appendChild(comms[len]);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
activateNavByIndex: function(index) {
|
||||
const target = document.querySelectorAll('.post-toc li a.nav-link')[index];
|
||||
if (!target || target.classList.contains('active-current')) return;
|
||||
|
@ -1,5 +1,6 @@
|
||||
{{- with .Site.Params.utterances }}
|
||||
<script src="https://utterances.njilc.com/client.js"
|
||||
{{- if .enable }}
|
||||
<script src="//utterances.njilc.com/client.js"
|
||||
repo="{{ .repo }}"
|
||||
issue-term="{{ .issueTerm }}"
|
||||
label="{{ .label }}"
|
||||
@ -7,3 +8,4 @@ crossorigin="anonymous"
|
||||
theme="{{ .theme }}" async>
|
||||
</script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
Loading…
Reference in New Issue
Block a user