Merge pull request 'issue #7' (#19) from issue#7 into master

Reviewed-on: 20xd6/simple_blog#19
This commit is contained in:
20xd6 2022-07-26 11:28:32 -04:00
commit 25f1887590
5 changed files with 0 additions and 148 deletions

View File

@ -1,79 +0,0 @@
/* Style the Image Used to Trigger the Modal */
#myImg {
border-radius: 5px;
cursor: pointer;
transition: 0.3s;
}
img:hover {opacity: 0.7;}
/* The Modal (background) */
.modal_gal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}
/* Modal Content (Image) */
.gallery_img {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
}
/* Caption of Modal Image (Image Text) - Same Width as the Image */
#modal_img_caption {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
text-align: center;
color: #ccc;
padding: 10px 0;
height: 150px;
}
/* Add Animation - Zoom in the Modal */
.gallery_img, #caption {
animation-name: zoom;
animation-duration: 0.6s;
}
@keyframes zoom {
from {transform:scale(0)}
to {transform:scale(1)}
}
/* The Close Button */
.close_modal {
position: absolute;
top: 15px;
right: 35px;
color: #00cc00;
font-size: 40px;
font-weight: bold;
transition: 0.3s;
}
.close_modal:hover,
.close_modal:focus {
color: #bbb;
text-decoration: none;
cursor: pointer;
}
/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
.gallery_img {
width: 100%;
}
}

View File

@ -1 +0,0 @@

View File

@ -1,32 +0,0 @@
var modalEle = document.querySelector(".modal_gal");
var modalImage = document.querySelector(".gallery_img");
Array.from(document.querySelectorAll(".img_thumb")).forEach(item => {
item.addEventListener("click", event => {
modalEle.style.display = "block";
modalImage.src = event.target.src;
});
});
document.querySelector(".close").addEventListener("click", () => {
modalEle.style.display = "none";
});
function image_modal(document){
// Get the modal
var modal = document.getElementById("modal_gallery");
// Get the image and insert it inside the modal - use its "alt" text as a caption
var img = document.getElementById("myImg");
var modalImg = document.getElementById("modal_img");
var captionText = document.getElementById("modal_img_caption");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
captionText.innerHTML = this.alt;
}
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close_modal")[0];
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
}

View File

View File

@ -1,36 +0,0 @@
<table border="1" class="pmenu">
<tr>
<td><a href=/>Home</a></td>
</tr>
<?php
$dir = '.';
// Check if the directory exists
if (file_exists($dir) && is_dir($dir) ) {
// Get the files of the directory as an array
$scan_arr = scandir($dir);
$files_arr = array_diff($scan_arr, array('.','..','index.php','common','.htaccess') );
// echo "<pre>"; print_r( $files_arr ); echo "</pre>";
// Get each files of our directory with line break
foreach ($files_arr as $file) {
//Get the file path
$file_path = "./".$file;
// Get the file extension
$file_ext = pathinfo($file_path, PATHINFO_EXTENSION);
if ($file_ext=="php" || $file_ext=="html" || $file_ext=="htm" || $file_ext == "") {
$file_array[] = $file;
}
}
foreach($file_array as $file) {
$_replace = array('.php', '.html', '.htm');
$link_title = str_replace('_',' ',$file);
$link_title = str_replace($_replace,'',$link_title);
$link_title = ucwords($link_title);
echo("<tr><td><a href='$file'> $link_title </a></td></tr>\n");
}
}
else {
echo "Directory does not exists";
}
?>
</table>