<?php
session_start();
if(isset($_SESSION['user'])) {
	header("Location: /home");
}
require_once 'core/classes.php';

$getitstarted = new PartyStarter;
$getitstarted->bootstrap();
$countofarray = rand(0, count($arraybackground)-1);
$background = "$arraybackground[$countofarray]";
$getthecount = rand(0, count($youtubefunnies)-1);
$youtubevideo = "$youtubefunnies[$getthecount]";
?>
<link rel="stylesheet" href="css/index.css">
<style>
body {
  display: block;
  background-image: url('/assets/<?php echo $background; ?>');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}
</style>
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
<body data-bs-theme="dark">
<div class="position-absolute top-50 start-50 translate-middle col d-flex justify-content-center align-middle">
<div class="card shadow-sm bg-dark text-white text-center">
<div class="card-body">
<h1><?php echo $sitename; ?></h1>
<h3>the funny website with</h3>
<a type="button" class="btn btn-secondary" href="/register">Register</a>
<a type="button" class="btn btn-secondary" href="/login">Login</a>

<div class="youtube-embed"><iframe width="470" height="295"
src="https://www.youtube.com/embed/<?php echo $youtubevideo; ?>">
</iframe></div>
</div>
</div>
</div>
</body>
