mirror of
https://github.com/shadawck/awesome-cli-frameworks.git
synced 2026-04-29 15:47:37 -05:00
add nim lang
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
// Un-active everything when you click it
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function(el, i) {
|
||||
el.addEventHandler("click", function() {
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function(el, i) {
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el, i) {
|
||||
el.addEventHandler("click", function () {
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el, i) {
|
||||
el.classList.remove("active");
|
||||
});
|
||||
el.classList.add("active");
|
||||
});
|
||||
});
|
||||
|
||||
var updateFunction = function() {
|
||||
var updateFunction = function () {
|
||||
|
||||
var id;
|
||||
var elements = document.getElementsByClassName("header");
|
||||
Array.prototype.forEach.call(elements, function(el, i) {
|
||||
Array.prototype.forEach.call(elements, function (el, i) {
|
||||
if (window.pageYOffset >= el.offsetTop) {
|
||||
id = el;
|
||||
}
|
||||
});
|
||||
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function(el, i) {
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el, i) {
|
||||
el.classList.remove("active");
|
||||
});
|
||||
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function(el, i) {
|
||||
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el, i) {
|
||||
if (id.href.localeCompare(el.href) == 0) {
|
||||
el.classList.add("active");
|
||||
}
|
||||
@@ -30,10 +30,10 @@ var updateFunction = function() {
|
||||
};
|
||||
|
||||
// Populate sidebar on load
|
||||
window.addEventListener('load', function() {
|
||||
window.addEventListener('load', function () {
|
||||
var pagetoc = document.getElementsByClassName("pagetoc")[0];
|
||||
var elements = document.getElementsByClassName("header");
|
||||
Array.prototype.forEach.call(elements, function(el, i) {
|
||||
Array.prototype.forEach.call(elements, function (el, i) {
|
||||
var link = document.createElement("a");
|
||||
|
||||
// Indent shows hierarchy
|
||||
|
||||
@@ -8,16 +8,19 @@
|
||||
main {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sidetoc {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
left: calc(100% + (var(--content-max-width))/4 - 140px);
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.pagetoc {
|
||||
position: fixed;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.pagetoc a {
|
||||
border-left: 1px solid var(--sidebar-bg);
|
||||
color: var(--fg) !important;
|
||||
@@ -28,13 +31,15 @@
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.pagetoc a:hover,
|
||||
.pagetoc a.active {
|
||||
background: var(--sidebar-bg);
|
||||
color: var(--sidebar-fg) !important;
|
||||
}
|
||||
|
||||
.pagetoc .active {
|
||||
background: var(--sidebar-bg);
|
||||
color: var(--sidebar-fg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user