You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
juice/templates/index.html

124 lines
3.8 KiB
HTML

{% import "_macros.html" as macros %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#F9BB2D">
{% block head %}
{% endblock head %}
<link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ get_url(path="index.css") }}">
</head>
<body>
{% block header %}
<header class="pos-absolute" style="background-color: transparent" ;>
{{ macros::render_header() }}
</header>
{% block hero %}
<div class="hero">
<section style="padding:10px">
<h1 class="text-center heading-text">
Intuitive, elegant and lightweight Zola™ theme for product site.
</h1>
<h3 class="text" style="text-align: center;">
By Huhu.io.
</h3>
</section>
<img src="{{ get_url(path="juice.svg") }}">
<div class="explore-more text"
onclick="document.getElementById('features').scrollIntoView({behavior: 'smooth'})">
Explore More ⇩
</div>
</div>
{% endblock hero %}
{% endblock header %}
<main>
{% block toc %}
<div class="toc">
<div class="toc-sticky">
{% if section.toc %}
{% set toc = section.toc %}
{% elif page.toc %}
{% set toc = page.toc %}
{% endif %}
{% if toc %}
{% for h in toc %}
<div class="toc-item">
<a class="subtext" href="{{h.permalink | safe}}">{{ h.title }}</a>
</div>
{% if h.children %}
{% for h2 in h.children %}
<div class="toc-item-child">
<a class="subtext" href="{{h2.permalink | safe}}"><small>- {{ h2.title }}</small></a>
</div>
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endblock toc %}
<div class="content text">
{% block content %}
<div id="features" class="heading-text">Overview</div>
{{ section.content | safe }}
{% endblock content %}
</div>
</main>
{% block footer %}
<footer>
<small class="subtext">
<a href="https://huhu.io">Huhu.io</a> © 2020
</small>
</footer>
{% endblock footer %}
</body>
<script>
function highlightNav(heading) {
let pathname = location.pathname;
document.querySelectorAll(".toc a").forEach((item) => {
item.classList.remove("active")
});
document.querySelector(".toc a[href='" + pathname + "#" + heading + "']").classList.add("active");
}
let currentHeading = "";
window.onscroll = function () {
let h = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
let elementArr = [];
h.forEach(item => {
if (item.id !== "") {
elementArr[item.id] = item.getBoundingClientRect().top;
}
});
elementArr.sort();
for (let key in elementArr) {
if (!elementArr.hasOwnProperty(key)) {
continue;
}
if (elementArr[key] > 0 && elementArr[key] < 300) {
if (currentHeading !== key) {
highlightNav(key);
currentHeading = key;
}
break;
}
}
}
</script>
</html>