Skip to content
Snippets Groups Projects
Commit ea4be3ee authored by Jan Grewe's avatar Jan Grewe
Browse files

improve webinterface design

parent ddc01303
No related merge requests found
Pipeline #
public/images/bg.png

36.3 KiB

public/images/no_photo.png

141 KiB

$(document).ready(function() { $(document).ready(function() {
$('body').height($(window).height()); $('body').height($(window).height());
centerImage();
getLatest(); getLatest();
setInterval(function() { setInterval(function() {
getLatest(); getLatest();
}, 3000); }, 1000);
$(window).resize(function () {
centerImage();
});
$('#latest').one('load', function(){
$(this).one('load', function(){
$(this).addClass('imgBorder');
});
});
$('#latest').on('load', function(){
centerImage();
$(this).animate({opacity: 1}, 400);
});
}); });
function getLatest() { function getLatest() {
$.getJSON('/latest', function(data) { $.getJSON('/latest', function(data) {
if('/previews/'+data.name != $('#latest').attr('src')) { if('/previews/'+data.name != $('#latest').attr('src')) {
$('#latest').attr('src', '/previews/'+data.name); $('#latest').animate({opacity: 0}, 400, function() {
$(this).attr('src', '/previews/'+data.name);
});
} }
}); });
} }
function centerImage() {
$('#latest').css({
position: 'absolute',
left: ($(window).width() - $('#latest').outerWidth()) / 2,
top: ($(window).height() - $('#latest').outerHeight()) / 2,
});
}
\ No newline at end of file
body { body {
overflow:hidden;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
background-color: #000000;
background-image: url("../images/bg.png");
} }
a { a {
...@@ -8,6 +11,14 @@ a { ...@@ -8,6 +11,14 @@ a {
} }
#latest { #latest {
max-width: 100%; margin-top: -0.5%;
max-height: 100%; max-width: 93%;
max-height: 93%;
}
.imgBorder {
border: solid 5px #222;
-moz-box-shadow: 5px 5px 15px #000;
-webkit-box-shadow: 5px 5px 15px #000;
box-shadow: 5px 5px 15px #000;
} }
\ No newline at end of file
...@@ -3,4 +3,4 @@ extends layout ...@@ -3,4 +3,4 @@ extends layout
block content block content
//h1= title //h1= title
//p Welcome to #{title} //p Welcome to #{title}
img(id='latest' src='') img(id='latest' src='images/no_photo.png')
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment