codiad/index.php

152 lines
3.1 KiB
PHP
Raw Normal View History

2020-06-29 16:59:37 +02:00
<?php
require_once( __DIR__ . "/components/initialize/class.initialize.php" );
Initialize::get_instance();
$valid_session = Authentication::check_session();
$components = scandir( COMPONENTS );
unset( $components["."], $components[".."] );
2020-06-29 16:59:37 +02:00
// Theme
$theme = THEME;
2020-06-29 16:59:37 +02:00
if( isset( $_SESSION['theme'] ) ) {
$theme = $_SESSION['theme'];
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="
width=device-width,
initial-scale=1.0,
maximum-scale=1.0,
user-scalable=no">
<meta name="theme-color" content="#1a1a1a">
2020-06-29 16:59:37 +02:00
<title><?php echo SITE_NAME;?></title>
<link rel="manifest" href="manifest.php">
<script>
var theme = `<?php echo $theme;?>`;
var themes = `<?php echo THEMES;?>`;
</script>
<script src="./assets/js/jquery-3.5.1.js" defer></script>
<script src="./assets/js/jquery.toastmessage.js" defer></script>
<script src="./assets/js/codiad.js" defer></script>
<script src="./assets/js/message.js" defer></script>
<script src="./assets/js/events.js" defer></script>
<script src="./assets/js/loading.js" defer></script>
<script src="./assets/js/common.js" defer></script>
<script src="./assets/js/forms.js" defer></script>
2020-06-29 16:59:37 +02:00
<?php
if( file_exists( THEMES . "/". $theme . "/favicon.ico" ) ) {
echo( '<link rel="icon" href="' . THEMES . '/' . $theme . '/favicon.ico" type="image/x-icon" />' );
} else {
echo( '<link rel="icon" href="./assets/images/favicon.ico" type="image/x-icon" />' );
}
2020-06-29 16:59:37 +02:00
if( $valid_session ) {
echo( '<script src="./assets/js/initialize.js" defer></script>' );
} else {
2020-06-29 16:59:37 +02:00
echo( '<script src="./assets/js/login.js" defer></script>' );
}
?>
</head>
<body>
<div id="container">
<noscript>
<p style="color: #FFF;text-align:center;">This page requires javascript!<br>Please enable javascript and come back!</p>
</noscript>
<div class="lds-container">
<div class="lds-dual-ring"></div>
</div>
</div>
<style>
html, body {
2020-06-29 16:59:37 +02:00
background-color: #1a1a1a;
color: #fff;
font: normal 13px 'Ubuntu', sans-serif;
height: 100%;
margin: 0;
overflow: hidden;
width: 100%;
}
#container {
2020-06-29 16:59:37 +02:00
overflow-y: auto;
position: fixed;
right: 50%;
text-align: left;
top: 50%;
transform: translate( 50%,-50% );
width: 25%;
2020-06-29 16:59:37 +02:00
}
.lds-container {
2020-06-29 16:59:37 +02:00
text-align: center;
}
.lds-dual-ring {
2020-06-29 16:59:37 +02:00
display: inline-block;
height: 90px;
width: 90px;
}
.lds-dual-ring:after {
content: " ";
display: block;
width: 64px;
height: 64px;
margin: 0;
border-radius: 50%;
border: 6px solid #fff;
border-color: #fff transparent #fff transparent;
animation: lds-dual-ring 1.2s linear infinite;
}
@media only screen and (max-width: 850px) {
#container {
2020-06-29 16:59:37 +02:00
width: 50%;
2020-06-29 16:59:37 +02:00
}
}
@media only screen and (max-width: 650px) {
2020-06-29 16:59:37 +02:00
#container {
width: 75%;
}
}
@keyframes lds-dual-ring {
2020-06-29 16:59:37 +02:00
0% {
2020-06-29 16:59:37 +02:00
transform: rotate(0deg);
}
100% {
2020-06-29 16:59:37 +02:00
transform: rotate(360deg);
2020-06-29 16:59:37 +02:00
}
}
</style>
2020-06-29 16:59:37 +02:00
</body>
</html>