switch to new ingress

This commit is contained in:
ducoterra
2020-05-07 12:39:27 -04:00
parent 8db4d5afed
commit a0e0afff1f
7 changed files with 184 additions and 41 deletions

23
ui/static/ui/smooth.css Normal file
View File

@@ -0,0 +1,23 @@
html, body, .section, .container {
height: 100%;
}
.container {
overflow-y: hidden;
}
.element::-webkit-scrollbar { width: 0 !important }
.element { overflow: -moz-scrollbars-none; }
.element { -ms-overflow-style: none; }
.hide-overflow {
overflow: hidden;
}
.h-100 {
height: 100%;
}
.w-100 {
width: 100%;
}

39
ui/static/ui/smooth.js Normal file
View File

@@ -0,0 +1,39 @@
// temp0.scrollIntoView({behavior: "smooth"});
const scroll0 = document.getElementById("scroll-0");
const scroll1 = document.getElementById("scroll-1");
const scroll2 = document.getElementById("scroll-2");
const scroll3 = document.getElementById("scroll-3");
window.addEventListener("scroll", function(event) {
window.addEventListener("mouseup", event => {
console.log("hello");
});
event.preventDefault();
document.querySelector("html").classList.add("hide-overflow");
if (scroll0.dataset.isScrolling != "true") {
scroll0.dataset.isScrolling = 'true';
if (scroll1.dataset.seen != "true") {
scroll1.dataset.seen = "true";
scroll1.scrollIntoView({behavior: "smooth"});
}
else if (scroll2.dataset.seen != "true") {
scroll2.dataset.seen = "true";
scroll2.scrollIntoView({behavior: "smooth"});
}
else if (scroll3.dataset.seen != "true") {
scroll3.dataset.seen = "true";
scroll3.scrollIntoView({behavior: "smooth"});
}
else {
scroll1.dataset.seen = "false";
scroll2.dataset.seen = "false";
scroll3.dataset.seen = "false";
scroll0.scrollIntoView({behavior: "smooth"});
}
setTimeout(() => {
scroll0.dataset.isScrolling = false;
document.querySelector("html").classList.remove("hide-overflow");
}, 1000)
}
});

View File

@@ -0,0 +1,31 @@
{% extends 'ui/base.html' %}
{% load static %}
{% block css %}
<link rel="stylesheet" href="{% static 'ui/smooth.css' %}">
{% endblock %}
{% block js %}
<script src="{% static 'ui/smooth.js' %}"></script>
{% endblock %}
{% block body %}
<div class="container">
<div id="scroll-0" class="h-100 w-100">
<h1 class="title">Hello There</h1>
</div>
<div id="scroll-1" class="h-100 w-100">
<h1 class="title">I'm an Apple Ad</h1>
</div>
<div id="scroll-2" class="h-100 w-100">
<h1 class="title">See me scroll</h1>
</div>
<div id="scroll-3" class="h-100 w-100">
<h1 class="title">You owe me $3,000 dollars for this</h1>
</div>
</div>
{% endblock %}

View File

@@ -3,4 +3,5 @@ from . import views
urlpatterns = [
path('button/', views.button, name = 'button'),
path('smooth/', views.smooth, name = 'smooth'),
]

View File

@@ -73,4 +73,7 @@ def button(request):
response = {PRESSED: pressed}
achieved = {k:v for k,v in achievements.items() if k <= pressed}
response.update({ACHIEVE: achieved})
return render(request, "ui/button.html", response)
return render(request, "ui/button.html", response)
def smooth(request):
return render(request, "ui/smooth.html")