2017-03-06 20:11:00 +00:00
<!DOCTYPE html>
< html >
< head >
2017-03-11 10:49:47 +00:00
< title > Alles wat ik voel - Stine Jensen - Ruben van de Ven - St. Jan< / title >
2017-03-06 20:11:00 +00:00
< style type = "text/css" >
body{
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QAdwB3AHctbh3qAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QMFFQkN1CxOCgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAXElEQVRo3u3YQRHAIAxFwVAT1L85gopgoNdc6D4DmZ1/y8hcFc3N+XafiCcuCQQEBAQEBAQEBAQEBAQEBATkV5BRVe0Pur3TIiAgICAgICAgICAgICAgICAgIB8dr84LFaZAYuYAAAAASUVORK5CYII=');
font-family: monospace;
font-size: 12pt;
2017-03-08 10:09:39 +00:00
height:100%;
margin:0;
2017-03-06 20:11:00 +00:00
}
body.loading #colourImage{
opacity: 0;
transition: opacity .4s;
}
#main svg{
z-index: -1;
position: absolute;
left:0;top:0;right:0;bottom: 0;
}
2017-03-11 10:49:47 +00:00
#main svg circle:hover{
stroke:yellow;
}
svg.hoverTitles text{
/*display:none;*/
opacity: 0.2;
}
svg.hoverTitles path:hover + text{
/*display:block;*/
opacity: 1;
z-index:9;
font-size:110%;
/*fill:yellow;*/
}
2017-03-08 10:09:39 +00:00
aside{
padding:0.3em;
}
2017-03-06 20:11:00 +00:00
aside ul{
list-style: none;
}
aside ul li{
padding: 0.1em;
cursor: pointer;
2017-03-11 10:49:47 +00:00
white-space: nowrap;
2017-03-06 20:11:00 +00:00
}
aside ul li span{
background:#ff0;
transition: max-width 0.5s;
max-width: 0%;
display: inline-block;
overflow: visible;
}
aside ul li:hover span{
max-width: 100%;
}
aside ul li.selected span{
max-width: 100%;
}
aside#selects{
float:left;
2017-03-11 10:49:47 +00:00
margin-bottom: 3em;
2017-03-06 20:11:00 +00:00
}
2017-03-08 10:09:39 +00:00
aside#works{
overflow-y: auto;
2017-03-11 10:49:47 +00:00
display: flex;
flex-wrap: nowrap;
position: fixed;
bottom: -2em;
transition: bottom 0.5s ease;
left: 0;
right: 0;
/*justify-content: center; /*Screws up with overflow-y*/
/*height: 1em;*/
2017-03-08 10:09:39 +00:00
}
2017-03-11 10:49:47 +00:00
aside#works:hover{
bottom:0;
}
aside#works img, aside#works .group{
margin-right: 0.4em;
flex: 0 0 auto;
height:4em;
/*transition: height 0.5s ease;*/
cursor: pointer;
box-shadow: 0 0 0.2em rgba(0,0,0,0.5);
}
aside#works:hover img{
/*height:7em;*/
}
aside#works .group{
background: black;
color: white;
padding: 1.5em;
box-sizing: border-box;
}
aside#works .group:hover{
background:yellow;
color:black;
2017-03-08 10:09:39 +00:00
}
2017-03-06 20:11:00 +00:00
aside#stats{
float:right;
2017-03-08 10:09:39 +00:00
text-align: center;
padding-right:1em;
2017-03-11 12:25:48 +00:00
padding-top:3em;
2017-03-08 10:09:39 +00:00
}
aside#stats svg{
2017-03-11 10:49:47 +00:00
width:20em;
height:20em;
2017-03-06 20:11:00 +00:00
}
#spinner{
display:none;
}
body.loading #spinner{
display: block;
animation: rotate 3s infinite linear;
}
2017-03-11 10:49:47 +00:00
#detail{
position:absolute;
width:20em;
margin-left:-10em;
background:rgba(0,0,0,0.8);
border-radius: 1em;
display: none;
overflow: hidden;
padding:0;
}
#detail.active{
display:block;
}
#detail img{
width:100%;
}
2017-03-06 20:11:00 +00:00
2017-03-11 11:42:21 +00:00
#info{
background: blue;color:white;
width: 30em;
height: 30em;
padding: 1em;
border-radius: 50%;
margin: auto;
text-align: center;
position: absolute;
top: calc(47.5% - 15em);
left: calc(50% - 15em);
display: none;
flex-direction: column;
justify-content: center;
}
#info.show{
display:flex;
}
a:link, a:visited{
color:yellow;
text-decoration: none;
}
a:hover{
color:red;
text-decoration: underline;
}
h3{
cursor:pointer;
}
2017-03-11 12:25:48 +00:00
h3#infoToggle{
position: absolute;
right:1em;
top:0em;
z-index: 999;
color:blue;
}
#selects h3:hover:after{
2017-03-11 11:42:21 +00:00
content:' (?)';
color:blue;
}
2017-03-11 12:08:28 +00:00
@keyframes rotate {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
@media screen and (orientation:portrait) {
#stats{
display:block;
clear:both;
padding-bottom:4em;
}
#stats > div {
2017-03-11 12:25:48 +00:00
float:left;
2017-03-11 12:08:28 +00:00
}
#main svg{
width:80% !important;
left:20%;
}
#main svg#spinner{
width:5%;
/*top: 44.5% !important;*/
left:20.5% !important;
}
#info{
left: calc(60% - 15em);
}
}
2017-03-06 20:11:00 +00:00
< / style >
< / head >
< body >
2017-03-11 12:25:48 +00:00
< h3 id = 'infoToggle' onclick = 'toggleInfo()' > (?)< / h3 >
2017-03-06 20:11:00 +00:00
< aside id = 'selects' >
2017-03-11 11:42:21 +00:00
< h3 onclick = 'toggleInfo()' > Alles wat ik voel< / h3 >
2017-03-11 10:49:47 +00:00
<!-- <h3>Toon op basis van...</h3>
2017-03-06 20:11:00 +00:00
< h4 > groep< / h4 >
< ul >
{% for group in groups %}
< li data-param = "group" data-id = "{{group.id}}" > < span > {{group.name.replace(" ", " ")}}< / span > < / li >
{% end %}
< / ul >
2017-03-11 10:49:47 +00:00
< h4 > emotie< / h4 > -->
2017-03-06 20:11:00 +00:00
< ul >
{% for emotion in emotions %}
< li data-param = "emotion" data-id = "{{emotion.id}}" > < span > {{emotion.name}}< / span > < / li >
{% end %}
< / ul >
< ul >
< li data-param = "no" data-id = "thing" > < span > toon alles< / span > < / li >
< / ul >
<!-- <h4>Kleur???</h4> -->
< / aside >
< aside id = 'works' >
< / aside >
< aside id = 'stats' >
< h4 > Emoties< / h4 >
< h4 > Licht/donker< / h4 >
< / aside >
< div id = 'main' >
2017-03-11 10:49:47 +00:00
< svg viewBox = "-160 -160 320 320" xmlns = "http://www.w3.org/2000/svg" style = "width:100%;height:95%" >
2017-03-06 20:11:00 +00:00
< defs >
< mask id = "mask1" x = "0" y = "0" width = "100" height = "100" >
2017-03-11 19:12:48 +00:00
< circle r = '155' cx = "0" cy = "0" style = 'fill:white;' > < / circle >
< circle r = '50' cx = "0" cy = "0" style = "fill:black" > < / circle >
2017-03-06 20:11:00 +00:00
< / mask >
< / defs >
2017-03-11 19:12:48 +00:00
< circle r = '155' cx = "0" cy = "0" style = 'stroke:none;fill:rgba(0,0,0,0.1);mask: url(#mask1);' > < / circle >
2017-03-06 20:11:00 +00:00
< / svg >
2017-03-11 12:08:28 +00:00
< svg id = "spinner" version = "1.1" xmlns = "http://www.w3.org/2000/svg" x = "0px" y = "0px" viewBox = "0 0 1000 1000" style = "width:5%;height:5%;top:45%;left:47.5%;" >
2017-03-11 21:04:12 +00:00
< g > < path d = "M500,964.2c-130.9,0-253.9-51-346.5-143.5C61,728.1,10,605.1,10,474.2c0-92.7,26-182.9,75.2-261C133.1,137.3,200.7,76,280.8,35.8l41.2,82.1c-65.1,32.6-120.1,82.5-159,144.2c-40,63.4-61.1,136.6-61.1,212c0,219.5,178.6,398.1,398.1,398.1c219.5,0,398.1-178.6,398.1-398.1c0-75.3-21.1-148.6-61.1-212c-38.9-61.7-93.9-111.6-159-144.2l41.2-82.1C799.3,76,866.9,137.3,914.8,213.2c49.2,78.1,75.2,168.3,75.2,261c0,130.9-51,253.9-143.5,346.5C753.9,913.2,630.9,964.2,500,964.2z" > < / path > < / g >
2017-03-06 20:11:00 +00:00
< / svg >
2017-03-11 10:49:47 +00:00
< svg viewBox = "-160 -160 320 320" xmlns = "http://www.w3.org/2000/svg" style = "width:100%;height:95%" id = "colourImage" >
2017-03-06 20:11:00 +00:00
< / svg >
< / div >
2017-03-11 10:49:47 +00:00
< div id = 'detail' > < img id = 'detail-img' src = '' > < / div >
2017-03-11 11:42:21 +00:00
< section id = 'info' >
< h4 > Over deze publicatie.< / h4 >
< p > Op deze pagina zie je een automatische categorisering van de kleuren in kunstwerkjes die zijn gemaakt door scholieren van de Sint Janschool, in Amsterdam. Ze zijn gemaakt in maart 2017 ter gelegenheid van het uitkomen van < em > Alles wat ik voel< / em > , het nieuwe boek van < a href = "http://stinejensen.nl" > Stine Jensen< / a > (uitgegeven door < a href = "http://www.kluitman.nl" > Kluitman< / a > ).< / p >
< p > Deze pagina is ontworpen en uitgevoerd door media-ontwerper < a href = "https://rubenvandeven.com" > Ruben van de Ven< / a > .< / p >
< p > [ < a href = "" onclick = "toggleInfo();return false;" > sluiten< / a > ]< / p >
< / section >
2017-03-06 20:11:00 +00:00
< script type = "text/javascript" >
function updateProgress(evt)
{
2017-03-11 21:04:12 +00:00
// console.log(evt);
2017-03-06 20:11:00 +00:00
}
function transferComplete(evt, r)
{
var div = document.createElement('div');
div.innerHTML = evt.target.response;
2017-03-11 21:04:12 +00:00
// document.getElementById('colourImage').innerHTML = div.children[0].innerHTML;
2017-03-08 10:09:39 +00:00
document.getElementById('works').innerHTML = div.children[1].innerHTML;
document.getElementById('stats').innerHTML = div.children[2].innerHTML;
2017-03-11 21:04:12 +00:00
let svgEl = document.getElementById('colourImage');
svgEl.parentNode.replaceChild(div.children[0], svgEl);
// console.log(div.children[0]);
2017-03-06 20:11:00 +00:00
document.body.classList.remove('loading');
}
function transferFailed(evt)
{
2017-03-11 21:04:12 +00:00
// console.log(evt);
2017-03-06 20:11:00 +00:00
}
function transferCanceled(evt)
{
2017-03-11 21:04:12 +00:00
// console.log(evt);
2017-03-06 20:11:00 +00:00
}
var links = document.getElementById('selects').getElementsByTagName("li");
2017-03-08 10:09:39 +00:00
function loadResults(type, value)
2017-03-06 20:11:00 +00:00
{
2017-03-08 10:09:39 +00:00
document.body.classList.add('loading');
// document.getElementById('colourImage').innerHTML = "";
var oReq = new XMLHttpRequest();
oReq.addEventListener("progress", updateProgress);
oReq.addEventListener("load", transferComplete);
oReq.addEventListener("error", transferFailed);
oReq.addEventListener("abort", transferCanceled);
oReq.open("GET", "/colours?"+type+"="+value);
2017-03-11 19:12:48 +00:00
oReq.send();
2017-03-08 10:09:39 +00:00
2017-03-11 21:04:12 +00:00
// for(let unsetLink of links) {
for (let i = links.length - 1; i >= 0; i--) {
let unsetLink = links[i];
2017-03-08 10:09:39 +00:00
if(unsetLink.dataset.param == type & & unsetLink.dataset.id == value) {
unsetLink.classList.add('selected');
} else {
2017-03-06 20:11:00 +00:00
unsetLink.classList.remove('selected');
}
2017-03-08 10:09:39 +00:00
}
}
2017-03-11 21:04:12 +00:00
// for(let link of links)
for (let i = links.length - 1; i >= 0; i--)
2017-03-08 10:09:39 +00:00
{
2017-03-11 21:04:12 +00:00
let link = links[i];
2017-03-08 10:09:39 +00:00
link.onclick = function() {
loadResults(this.dataset.param, this.dataset.id);
2017-03-06 20:11:00 +00:00
}.bind(link)
}
2017-03-08 10:09:39 +00:00
loadResults("no", "thing");
2017-03-11 10:49:47 +00:00
function triggerover(layerId, el)
{
let url = '/images/'+layerId+'.png';
let position = el.getBoundingClientRect();
let detailEl = document.getElementById('detail');
document.getElementById('detail-img').src = url;
el.onmouseout = triggerout;
// show below icon if higher item, otherwise above it.
if(el.attributes.cy.value < = 0) {
detailEl.style.top = (position.top + position.height + window.scrollY) + 'px';
detailEl.style.bottom = 'auto';
} else {
detailEl.style.top = 'auto';
detailEl.style.bottom = 'calc(100% - ' + ( position.top + window.scrollY ) + 'px)';
}
detailEl.style.left = (position.left - position.width/2) + 'px';
detailEl.classList.add('active');
}
function triggerout()
{
document.getElementById('detail').classList.remove('active');
}
2017-03-11 11:42:21 +00:00
var infoEl = document.getElementById('info');
2017-03-11 21:04:12 +00:00
2017-03-11 11:42:21 +00:00
function toggleInfo()
{
infoEl.classList.toggle('show');
}
2017-03-06 20:11:00 +00:00
< / script >
< / body >
< / html >