Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorWang Chucheng <ccwangchn@gmail.com>2020-10-16 07:06:37 +0300
committerWang Chucheng <ccwangchn@gmail.com>2020-10-16 07:06:37 +0300
commit8987983acd6c668ad30c88409ee75f5c978e3d6c (patch)
treea6941cca861b9a2ca1302cb5e61481883b731adc /assets
parent89640f682b3c2f7f092ea7f630934120e14beae0 (diff)
feat: add doc layout
Diffstat (limited to 'assets')
-rw-r--r--assets/css/site.css1
-rw-r--r--assets/css/tailwind.config.js5
-rw-r--r--assets/js/eureka.js20
3 files changed, 24 insertions, 2 deletions
diff --git a/assets/css/site.css b/assets/css/site.css
index 288edb5..817d608 100644
--- a/assets/css/site.css
+++ b/assets/css/site.css
@@ -1,6 +1,5 @@
.sticky-toc {
@apply sticky z-0 ease-in-out duration-300;
- top: 8rem;
}
.sticky-toc a {
diff --git a/assets/css/tailwind.config.js b/assets/css/tailwind.config.js
index 20eee7d..bbf719d 100644
--- a/assets/css/tailwind.config.js
+++ b/assets/css/tailwind.config.js
@@ -20,8 +20,13 @@ module.exports = {
minHeight: {
'16': '4rem',
},
+ maxHeight: {
+ 'doc-sidebar': 'calc(100vh - 4rem - var(--height-doc-title, 4rem))',
+ },
inset: {
'16': '4rem',
+ '32': '8rem',
+ '48': '12rem',
},
colors: {
'eureka': 'var(--color-eureka)',
diff --git a/assets/js/eureka.js b/assets/js/eureka.js
index 117f934..d88c228 100644
--- a/assets/js/eureka.js
+++ b/assets/js/eureka.js
@@ -190,7 +190,7 @@ function switchDarkMode(e) {
}
}
-//swithch burger
+//switch burger
function switchBurger() {
let element = document.getElementById('navbar-btn');
let screen = document.getElementById('is-open-mobile');
@@ -227,4 +227,22 @@ function switchLanguage() {
targetDiv.classList.toggle('hidden')
screen.classList.toggle('hidden')
})
+}
+
+//switch doc toc
+function switchDocToc() {
+ let element = document.getElementById('sidebar-title');
+ let target = document.getElementById('sidebar-toc');
+ element.addEventListener('click', () => {
+ target.classList.toggle('hidden');
+ element.lastElementChild.classList.toggle('fa-caret-right');
+ element.lastElementChild.classList.toggle('fa-caret-down');
+ })
+}
+
+//change sidebar height
+function changeSidebarHeight() {
+ let element = document.getElementById('sidebar-title');
+ let target = document.getElementById('sidebar-toc');
+ target.style.setProperty('--height-doc-title', `${element.offsetHeight}px`);
} \ No newline at end of file