event-timeline/app/templates/timeline.html

118 lines
3.2 KiB
HTML
Raw Normal View History

2022-04-12 13:50:11 +00:00
<!doctype html>{% load sass_tags static %}
<html>
2021-11-12 18:23:11 +00:00
<head>
<title>{{ settings.title }}</title>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
2022-04-12 13:50:11 +00:00
<link href="{% sass_src 'css/style.scss' %}" rel="stylesheet" type="text/css">
2022-04-12 13:54:56 +00:00
<base target="_blank" >
2021-11-12 18:23:11 +00:00
<link rel="stylesheet" href="{% static 'timeline/css/timeline.css' %}">
<link rel="stylesheet" href="{% static 'timeline/css/fonts/font.default.css' %}">
<style>
html, body {
height:100%;
width:100%;
padding: 0px;
margin: 0px;
}
.tl-timeline {
}
2022-04-12 13:50:11 +00:00
.tl-attribution {
display: none !important;
}
2022-04-19 12:11:16 +00:00
.tl-timeline h1, .tl-timeline h2, .tl-timeline h3, .tl-timeline h4, .tl-timeline h5, .tl-timeline h6 {
text-transform: initial !important;
}
2022-04-12 13:50:11 +00:00
.active {
display: block
}
#intro, #contact {
display: none;
}
2022-04-22 18:12:13 +00:00
#intro {
line-height: 1.33em;
}
2022-04-22 17:57:55 +00:00
#intro img {
width: 100%;
2022-04-22 18:12:13 +00:00
margin: auto;
}
#intro .row {
display: flex;
flex-direction: row;
gap: 20px;
}
#intro .row .block {
width: 100%
}
@media screen and (max-width: 799px) {
#intro {
margin: 16px;
}
#intro .row {
display: flex;
flex-direction: column;
}
2022-04-22 17:57:55 +00:00
}
2021-11-12 18:23:11 +00:00
</style>
2022-04-12 13:50:11 +00:00
</head>
<body>
<div id="intro">
{{ intro.body | safe }}
</div>
2021-11-12 18:23:11 +00:00
<div id="timeline"></div>
2022-04-12 13:50:11 +00:00
<div id="contact">
<form method="post">
<input type="text" placeholder="Subject"/><br>
<textarea placeholder="Message"></textarea><br>
<input type="submit" value="Send message">
</form>
{{ contact.body | safe }}
</div>
2021-11-12 18:23:11 +00:00
<script src="{% static 'timeline/js/timeline.js' %}"></script>
<script>
var data = {{ timeline_json | safe }};
2022-04-12 13:50:11 +00:00
var timeline
function load_timeline() {
timeline = new TL.Timeline('timeline', data, {
hash_bookmark: true,
debug: false,
timenav_height: 100,
});
}
2022-04-22 18:02:20 +00:00
document.querySelector('#intro a[href="#title"]').addEventListener('click', event => {
2022-04-22 18:04:05 +00:00
document.querySelector('#intro').style.display = 'none'
document.querySelector('#contact').style.display = 'none'
document.querySelector('#timeline').style.display = 'block'
2022-04-12 13:50:11 +00:00
load_timeline()
})
if (document.location.hash.slice(1).length) {
load_timeline()
}
function hashchange(event) {
console.log('hc', document.location.hash.slice(1).length, document.location.hash.slice(1))
if (document.location.hash.slice(1) == 'contact') {
document.querySelector('#intro').style.display = 'none'
document.querySelector('#contact').style.display = 'block'
document.querySelector('#timeline').style.display = 'none'
} else if (document.location.hash.slice(1).length) {
document.querySelector('#intro').style.display = 'none'
document.querySelector('#contact').style.display = 'none'
document.querySelector('#timeline').style.display = 'block'
} else {
document.querySelector('#intro').style.display = 'block'
document.querySelector('#contact').style.display = 'none'
document.querySelector('#timeline').style.display = 'none'
}
}
window.addEventListener('hashchange', hashchange)
hashchange()
2021-11-12 18:23:11 +00:00
</script>
</body>
</html>