Created
September 8, 2017 21:10
-
-
Save maniflames/cd3ede88211ab8783769dc71315a3f53 to your computer and use it in GitHub Desktop.
Custom Xampp Dashboard (Xampp Project Finder)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Xampp Project Finder (xpf) | |
* Author: Maniflames <[email protected]> | |
* | |
* Not a front-ender | |
* Styling Cred: https://codepen.io/acjdesigns/pen/vZKLyX | |
*/ | |
//Load CSS | |
function load_css( $css_file ){ | |
?> | |
<link href="https://fonts.googleapis.com/css?family=Roboto:100" rel="stylesheet"> | |
<style media="screen"> | |
<?php require_once $css_file; ?> | |
</style> | |
<?php | |
} | |
load_css('xpf.css'); | |
//Scan working directory | |
$cwd_path = getcwd(); | |
$cwd = scandir( $cwd_path ); | |
//Filter and only keep the directories | |
function is_directory( $value ){ | |
if( $value == "." || $value == ".."){ | |
return ; | |
} | |
$path = getcwd() . "\\" . $value; | |
return is_dir( $path ); | |
} | |
$directories = array_filter($cwd , "is_directory"); | |
//show directories on screen | |
function directory_html( $value ){ | |
?> | |
<div class="directory"> | |
<a href="/<?php echo $value ?>"> | |
<h3><?php echo $value ?></h3> | |
</a> | |
</div> | |
<?php | |
} | |
?> | |
<div class="wrapper"><?php array_map("directory_html", $directories); ?> </div> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-image: linear-gradient(to bottom right, #C4D8D5, #D3D1C5); | |
font-family: 'Roboto', sans-serif; | |
} | |
.wrapper{ | |
display: flex; | |
margin: 20px; | |
flex-direction: row; | |
flex-wrap: wrap; | |
} | |
.directory { | |
background-color: rgba(255, 255, 255, 0.4); | |
min-width: 230px; | |
min-height: 230px; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
padding: 20px; | |
margin: 10px; | |
} | |
.directory > a { | |
letter-spacing: 2px; | |
text-transform: uppercase; | |
text-decoration: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Xampp Project Finder
Custom Xampp Dashboard
I got tired of the clutter in my htdocs folder and made some changes. One of them is this dashboard. Place the files in any folder you want, XPF takes care of everything else. If everything works like it should the result should look something like this:
The only things I do in XAMPP is creating short snippets of websites, emails or tools. I prefer to put these in folders. Right now the project finder only lists folders but feel free to extend and play with the code!