Compare commits

...

1 Commits

Author SHA1 Message Date
ducoterra
a0e0afff1f switch to new ingress 2020-05-07 12:39:27 -04:00
7 changed files with 184 additions and 41 deletions

View File

@@ -1,46 +1,31 @@
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-redirect: "true"
name: $DEPLOY
spec:
tls:
- hosts:
- $DEPLOY.ducoterra.net
secretName: letsencrypt
rules:
- host: $DEPLOY.ducoterra.net
http:
paths:
- backend:
serviceName: $DEPLOY
servicePort: 8000
---
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute kind: IngressRoute
metadata: metadata:
name: $DEPLOY-external-tls name: $DEPLOY-internal-tls
annotations:
kubernetes.io/ingress.class: traefik-internal
spec: spec:
entryPoints: entryPoints:
- websecure - websecure
tls: tls:
secretName: letsencrypt certResolver: myresolver
domains:
- main: "*.ducoterra.net"
routes: routes:
- match: Host(`$DEPLOY.ducoterra.net`) - match: Host(`$DEPLOY.ducoterra.net`)
kind: Rule kind: Rule
services: services:
- name: $DEPLOY - name: $DEPLOY
port: 8000 port: 80
--- ---
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute kind: IngressRoute
metadata: metadata:
name: $DEPLOY-external-web name: $DEPLOY-internal-web
annotations:
kubernetes.io/ingress.class: traefik-internal
spec: spec:
entryPoints: entryPoints:
- web - web
@@ -49,6 +34,46 @@ spec:
kind: Rule kind: Rule
services: services:
- name: $DEPLOY - name: $DEPLOY
port: 8000 port: 80
middlewares:
- name: httpsredirect
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: $DEPLOY-external-tls
annotations:
kubernetes.io/ingress.class: traefik-external
spec:
entryPoints:
- websecure
tls:
certResolver: myresolver
routes:
- match: Host(`$DEPLOY.ducoterra.net`)
kind: Rule
services:
- name: $DEPLOY
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: $DEPLOY-external-web
annotations:
kubernetes.io/ingress.class: traefik-external
spec:
entryPoints:
- web
routes:
- match: Host(`$DEPLOY.ducoterra.net`)
kind: Rule
services:
- name: $DEPLOY
port: 80
middlewares: middlewares:
- name: httpsredirect - name: httpsredirect

View File

@@ -1,18 +1,39 @@
apiVersion: networking.k8s.io/v1beta1 apiVersion: traefik.containo.us/v1alpha1
kind: Ingress kind: IngressRoute
metadata: metadata:
name: $DEPLOY-internal-tls
annotations: annotations:
ingress.kubernetes.io/ssl-redirect: "true" kubernetes.io/ingress.class: traefik-internal
name: $DEPLOY
spec: spec:
entryPoints:
- websecure
tls: tls:
- hosts: certResolver: myresolver
- $DEPLOY.ducoterra.net domains:
secretName: letsencrypt - main: "*.ducoterra.net"
rules: routes:
- host: $DEPLOY.ducoterra.net - match: Host(`$DEPLOY.ducoterra.net`)
http: kind: Rule
paths: services:
- backend: - name: $DEPLOY
serviceName: $DEPLOY port: 80
servicePort: 8000
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: $DEPLOY-internal-web
annotations:
kubernetes.io/ingress.class: traefik-internal
spec:
entryPoints:
- web
routes:
- match: Host(`$DEPLOY.ducoterra.net`)
kind: Rule
services:
- name: $DEPLOY
port: 80
middlewares:
- name: httpsredirect

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 = [ urlpatterns = [
path('button/', views.button, name = 'button'), path('button/', views.button, name = 'button'),
path('smooth/', views.smooth, name = 'smooth'),
] ]

View File

@@ -73,4 +73,7 @@ def button(request):
response = {PRESSED: pressed} response = {PRESSED: pressed}
achieved = {k:v for k,v in achievements.items() if k <= pressed} achieved = {k:v for k,v in achievements.items() if k <= pressed}
response.update({ACHIEVE: achieved}) 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")