itskp-odense/Frontend/index.php

125 lines
4.6 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ITSKP</title>
<script type="text/javascript" src="Assets/JS/jquery-3.6.0.min.js"></script>
<script src="Assets/JS/swiper-bundle.min.js"></script>
<script type="text/javascript" src="Assets/JS/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="Assets/CSS/main.css"/>
<link rel="stylesheet" type="text/css" href="Assets/CSS/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="Assets/CSS/swiper-bundle.min.css"/>
<link rel="stylesheet" type="text/css" href="Assets/CSS/pagination.min.css"/>
<link rel="stylesheet" type="text/css" href="Assets/CSS/hover.css"/>
</head>
<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="admin.php">Admin panel</a></li>';
}else{
echo '<li class="content__item"><a class="link link--elara text-white" href="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 class="blog-slider__item swiper-slide">
<div class="blog-slider__content">
<span class="blog-slider__code">26 December 2019</span>
<div class="blog-slider__title">Lorem Ipsum Dolor</div>
<div class="blog-slider__text">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Recusandae voluptate repellendus magni illo ea animi? </div>
</div>
</div>-->
</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,
mousewheel: {
invert: false,
},
// autoHeight: true,
pagination: {
el: '.blog-slider__pagination',
type: 'bullets',
clickable: true,
dynamicBullets: true,
dynamicMainBullets: 1,
}
});
$(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">'+ el.created_at +'</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>