160 lines
5.4 KiB
PHP
160 lines
5.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>ITSKP</title>
|
|
|
|
<script type="text/javascript" src="Frontend/Assets/JS/jquery-3.6.0.min.js"></script>
|
|
<script src="Frontend/Assets/JS/swiper-bundle.min.js"></script>
|
|
<script type="text/javascript" src="Frontend/Assets/JS/bootstrap.min.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="Frontend/Assets/CSS/main.css"/>
|
|
<link rel="stylesheet" type="text/css" href="Frontend/Assets/CSS/bootstrap.min.css"/>
|
|
<link rel="stylesheet" type="text/css" href="Frontend/Assets/CSS/swiper-bundle.min.css"/>
|
|
<link rel="stylesheet" type="text/css" href="Frontend/Assets/CSS/pagination.min.css"/>
|
|
<link rel="stylesheet" type="text/css" href="Frontend/Assets/CSS/hover.css"/>
|
|
</head>
|
|
<style>
|
|
.swiper-slide-active .blog-slider__content {
|
|
height: -webkit-fill-available;
|
|
overflow-y: auto;
|
|
height: 100%;
|
|
}
|
|
|
|
.swiper-slide-active .blog-slider__content::-webkit-scrollbar {
|
|
width: 12px;
|
|
}
|
|
.swiper-slide-active .blog-slider__content::-webkit-scrollbar-track {
|
|
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.swiper-slide-active .blog-slider__content::-webkit-scrollbar-thumb {
|
|
border-radius: 10px;
|
|
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
|
|
}
|
|
</style>
|
|
<body class="position-relative">
|
|
<nav class="layer" id="layer">
|
|
<ul>
|
|
<li class="content__item"><a class="link link--elara text-white" href="index.php">Home</a></li>
|
|
<li class="content__item"><a class="link link--elara text-white" href="https://bib.itskp-odense.dk/">Bulltitin Board</a></li>
|
|
<li class="content__item"><a class="link link--elara text-white" href="https://udlaan.itskp-odense.dk/">Udlån af udstyr</a></li>
|
|
<?php
|
|
session_start();
|
|
|
|
if (isset($_SESSION['token'])){
|
|
echo '<li class="content__item"><a class="link link--elara text-white" href="Frontend/admin.php">Admin panel</a></li>';
|
|
}else{
|
|
echo '<li class="content__item"><a class="link link--elara text-white" href="Frontend/login.php">Login</a></li>';
|
|
}
|
|
|
|
|
|
?>
|
|
</ul>
|
|
</nav>
|
|
<input type="checkbox" name="hamburger" id="hamburger" onclick="shownav()"/>
|
|
<label for="hamburger">
|
|
<ul><li></li><li></li><li></li></ul>
|
|
</label>
|
|
<div id="app" class="min-vh-100 d-flex flex-column">
|
|
<main class="d-flex position-relative" style="flex: auto;">
|
|
<div class="container d-grid align-items-center pt-5 pb-5" style="contain: content">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-12 h-100" style="border-radius: 4px">
|
|
<div class="blog-slider front home" id="front">
|
|
<div class="blog-slider__wrp swiper-wrapper" id="swiper-wrapper">
|
|
</div>
|
|
<div class="blog-slider__pagination"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<div id="K"></div>
|
|
|
|
<script type="text/javascript">
|
|
var swiper = new Swiper('.blog-slider', {
|
|
spaceBetween: 30,
|
|
effect: 'fade',
|
|
loop: true,
|
|
observer: true,
|
|
observeParents: true,
|
|
updateOnWindowResize: true,
|
|
mousewheel: {
|
|
invert: false,
|
|
},
|
|
// autoHeight: true,
|
|
pagination: {
|
|
el: '.blog-slider__pagination',
|
|
type: 'bullets',
|
|
clickable: true,
|
|
dynamicBullets: true,
|
|
dynamicMainBullets: 1,
|
|
}
|
|
});
|
|
|
|
var rtime;
|
|
var timeout = false;
|
|
var delta = 200;
|
|
$(window).resize(function() {
|
|
rtime = new Date();
|
|
if (timeout === false) {
|
|
timeout = true;
|
|
setTimeout(resizeend, delta);
|
|
}
|
|
});
|
|
|
|
function resizeend() {
|
|
if (new Date() - rtime < delta) {
|
|
setTimeout(resizeend, delta);
|
|
} else {
|
|
timeout = false;
|
|
swiper.update();
|
|
swiper.updateSize();
|
|
}
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
$('#layer').removeClass('showlayer');
|
|
$('#front').addClass('transform-none');
|
|
$('#hamburger').prop('checked', '');
|
|
|
|
|
|
$.ajax({
|
|
url: '../Backend/controller/getPost.php',
|
|
type: 'POST',
|
|
success: function (data) {
|
|
console.log(data);
|
|
data.forEach(el =>
|
|
document.getElementById('swiper-wrapper').innerHTML += ('<div class="blog-slider__item swiper-slide">'+
|
|
'<div class="blog-slider__content">'+
|
|
'<span class="blog-slider__code">'+ new Date(el.created_at).getDate() + '/' + (new Date(el.created_at).getMonth()+1) + '-' + new Date(el.created_at).getFullYear() +'</span>'+
|
|
'<div class="blog-slider__title">'+ el.title +'</div>'+
|
|
'<div class="blog-slider__text">'+ el.description +'</div>'+
|
|
'</div>'+
|
|
'</div>')
|
|
);
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
|
|
})
|
|
|
|
function shownav() {
|
|
if($('#layer').hasClass('showlayer')) {
|
|
$('#layer').removeClass('showlayer');
|
|
$('#front').addClass('transform-none');
|
|
}
|
|
else {
|
|
$('#layer').addClass('showlayer');
|
|
$('#front').removeClass('transform-none');
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|