xppl/app/templates/base.html

127 lines
3.4 KiB
HTML
Raw Normal View History

2018-05-20 00:10:01 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
2018-05-23 14:12:24 +02:00
<title>XPPL</title>
2018-05-20 00:10:01 +02:00
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="/static/css/style.css">
2018-05-31 18:04:05 +02:00
<link rel="stylesheet" href="/static/js/jquery-ui-1.12.1.custom/jquery-ui.css">
2018-05-20 00:10:01 +02:00
{% block css %} {% endblock%}
</head>
<body>
2018-05-23 14:12:24 +02:00
{% block header %}
2018-05-20 00:10:01 +02:00
<header>
{% include "header.html" %}
</header>
2018-05-23 14:12:24 +02:00
{% endblock %}
2018-05-20 00:10:01 +02:00
<main>
<div class="container">
{% block main %}{% endblock %}
</div>
</main>
<footer>
<div class="container">
{% include "footer.html" %}
</div>
</footer>
{% block js %} {% endblock%}
2018-05-23 14:12:24 +02:00
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="{{ url_for("static", filename="js/app.js") }}"></script>
2018-05-27 22:32:17 +02:00
<script>
2018-05-29 16:18:00 +02:00
2018-05-27 22:32:17 +02:00
$( ".no_cover" ).each(function() {
2018-05-31 20:06:13 +02:00
var string = $(this).attr('id')
2018-05-29 16:18:00 +02:00
var randomColor = colorHash(string).rgb
2018-05-27 22:32:17 +02:00
$(this).css({
'background-color' : randomColor,
});
2018-05-29 16:18:00 +02:00
2018-05-27 22:32:17 +02:00
}
)
2018-05-29 16:18:00 +02:00
function colorHash(inputString){
var sum = 0;
for(var i in inputString){
sum += inputString.charCodeAt(i);
}
r = ~~(('0.'+Math.sin(sum+1).toString().substr(6))*256);
g = ~~(('0.'+Math.sin(sum+2).toString().substr(6))*256);
b = ~~(('0.'+Math.sin(sum+3).toString().substr(6))*256);
var rgb = "rgb("+r+", "+g+", "+b+")";
var hex = "#";
hex += ("00" + r.toString(16)).substr(-2,2).toUpperCase();
hex += ("00" + g.toString(18)).substr(-2,2).toUpperCase();
hex += ("00" + b.toString(20)).substr(-2,2).toUpperCase();
return {
r: r
,g: g
,b: b
,rgb: rgb
,hex: hex
};
}
2018-05-27 22:32:17 +02:00
</script>
2018-05-31 18:04:05 +02:00
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
$( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
} );
</script>
<script>
$( function() {
$( "#draggable" ).draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
}
});
} );
2018-06-01 20:26:37 +02:00
$( "#title" ).click(function() {
generateTitle(this);
});
$( document ).ready(function() {
generateTitle("#title");
});
function generateTitle(elem){
var x = ["XPERIMENTAL"]
var p1 = ["POTENTIAL", "PUBLIC", "POST", "PI", "PLATFORM FOR", "PRETENTIOUS"]
var p2 = ["PIRATE", "PERFORMATIVE", "PUBLIC", "PUBLISHING", "POTENTIAL"]
var l = ["LIBRARY", "LIAISON", "LAB", "LEGALITY", "LABOUR"]
$(elem).text(x[Math.floor(Math.random()*x.length)]+" "+p1[Math.floor(Math.random()*p1.length)]+" "+p2[Math.floor(Math.random()*p2.length)]+" "+l[Math.floor(Math.random()*l.length)]);
}
2018-05-31 18:04:05 +02:00
</script>
2018-05-20 00:10:01 +02:00
</body>
</html>