87 lines
No EOL
2.6 KiB
PHP
87 lines
No EOL
2.6 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Autonomiser la création graphique avec des outils web</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<link rel="stylesheet" href="2026.css">
|
|
</head>
|
|
<body>
|
|
<main class="row">
|
|
<div class="damier">
|
|
|
|
<?php
|
|
// error_reporting(E_ALL);
|
|
@include "utils.php";
|
|
include 'libs/Parsedown.php';
|
|
$Parsedown = new Parsedown();
|
|
$dirlist = getFileList("images");
|
|
array_multisort(array_column($dirlist, "name"), SORT_ASC, $dirlist );
|
|
|
|
echo "<ul class='liste-damier'>";
|
|
foreach($dirlist as $file){
|
|
$ext = pathinfo($file['name'], PATHINFO_EXTENSION);
|
|
if($ext == 'txt'){
|
|
$content = file_get_contents($file['name']);
|
|
echo "<li class='texte'>";
|
|
echo $Parsedown->text($content);
|
|
echo "</li>";
|
|
}
|
|
if($ext == 'mp4' || $ext == 'webm' || $ext == 'ogg'){
|
|
$fileName = str_replace('images/', '', $file['name']);
|
|
$filePath = $file['name'];
|
|
echo "<li class='video' data-video='{$filePath}'>";
|
|
echo "<h1>";
|
|
echo $fileName;
|
|
echo "</h1>";
|
|
echo "</li>";
|
|
}
|
|
if($ext == 'mp3' || $ext == 'wav'){
|
|
$fileName = str_replace('images/', '', $file['name']);
|
|
$filePath = $file['name'];
|
|
echo "<li class='audio' data-audio='{$filePath}'>";
|
|
echo "<h1>";
|
|
echo $fileName;
|
|
echo "</h1>";
|
|
echo "</li>";
|
|
}
|
|
if($ext == 'pdf'){
|
|
$fileName = str_replace('images/', '', $file['name']);
|
|
$filePath = $file['name'];
|
|
echo "<li class='pdf' data-pdf='{$filePath}'>";
|
|
echo "<h1>";
|
|
echo $fileName;
|
|
echo "</h1>";
|
|
echo "</li>";
|
|
}
|
|
if($ext == 'jpg' || $ext == 'png' || $ext == 'gif' ){
|
|
$fileName = str_replace('images/', '', $file['name']);
|
|
$filePath = $file['name'];
|
|
// $fileNameNoExt = pathinfo($file['name'])['filename'];
|
|
// $thumbPath = 'images/thumbs/'.$fileNameNoExt.'.jpg';
|
|
echo "<li class='image'>";
|
|
echo "<figure data-thumb='{$filePath}' data-image='{$filePath}'>";
|
|
echo "<img src='{$filePath}'/>";
|
|
echo "</figure>";
|
|
echo "</li>";
|
|
}
|
|
}
|
|
echo "</ul>";
|
|
|
|
?>
|
|
</div>
|
|
|
|
<div class="preview">
|
|
<div class="image-wrapper">
|
|
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<script src="js/jquery.min.js" type="text/javascript"></script>
|
|
<script src="js/script.js" type="text/javascript"></script>
|
|
|
|
</body>
|
|
</html>
|