40 lines
1.9 KiB
PHP
40 lines
1.9 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Tux gallery !</title>
|
|
<link rel="stylesheet" href="static/css/stylesheet.css">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
|
</head>
|
|
<body>
|
|
<?php include 'include/nav.php'?>
|
|
|
|
<div class="wrapper">
|
|
<section class="info-part">
|
|
<h1>Tux gallery</h1>
|
|
<p>Tux is awesome ! So I made this extremely secure gallery app.</p>
|
|
<p>You can also add tux pictures to the gallery, first <a href="login.php">login</a> and then you should be able to upload a new image of tux.</p>
|
|
</section>
|
|
<section class="gallery-part">
|
|
<div class="gallery">
|
|
<?php
|
|
foreach (new DirectoryIterator('static/img/gallery') as $file) {
|
|
if($file->isDot()) continue;
|
|
print '<img class="tux-img" src="static/img/gallery/'. $file->getFilename() . '">'; // to do, is there an 'fstring' like for php ? just like in python
|
|
} // xss ? i call it a feature
|
|
?>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
|
<script>
|
|
window.addEventListener("load", (event) => {
|
|
console.log(document.getElementsByClassName("tux-img"))
|
|
Array.from(document.getElementsByClassName("tux-img")).forEach(img => {
|
|
img.addEventListener('click',function(){window.open(img.src)})
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|