python-gallery/templates/layout.html
2022-12-19 21:15:56 +00:00

59 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gallery</title>
<link rel="stylesheet" href="{{url_for('static', filename='css/style.css')}}" defer>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</script>
<script src="https://unpkg.com/phosphor-icons" defer></script>
</head>
<body>
<nav id="navRoot">
<div>
<a href="{{ url_for('home') }}"><i class="ph-house-line"></i><span>Home</span></a>
<a href=""><i class="ph-package"></i><span>Groups</span></a>
<a href=""><i class="ph-upload"></i><span>Upload</span></a>
</div>
<div>
<a href=""><i class="ph-user-circle"></i><span>Profile</span></a>
<a href=""><i class="ph-gear"></i><span>Settings</span></a>
</div>
</nav>
<main>
{% block content %}
{% endblock %}
<i class="ph-arrow-circle-up" id="topButton"></i>
</main>
<script>
let navToggle = true;
document.onscroll = function() {
document.querySelector('header').style.opacity = `${1 - window.scrollY / 169}`;
document.querySelector('header img').style.cssText = `object-position: center ${window.scrollY / 2}px`;
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
document.querySelector('#topButton').style.opacity = 1;
document.querySelector('#topButton').style.right = "0.75rem";
} else {
document.querySelector('#topButton').style.opacity = 0;
document.querySelector('#topButton').style.right = "-3rem";
}
}
document.querySelector('#topButton').onclick = function() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
function imgFade(obj) {
$(obj).fadeIn(621);
}
</script>
</body>
</html>