Tronscript
Member
- Aug 18, 2012
- 93
- 8
Tired of seeing that old, bland HTDOCS directory? Well, it's about time you cleaned it up! The script below will style your HTDOCS, using buttons! It's a simple release, but I take little-to-no credit, as I've used open-source code to construct/learn this.
How it works?
Make a new file called index.php, and paste this script into it. Then, on line 2, edit that one variable, and set it to whatever page title you want.
PHP:
<?php
$sitename = 'Site Projects';
?>
<html>
<head>
<title><?php echo $sitename; ?></title>
<style type="text/css">
a{
text-decoration: none;
color: white;
}
body{
margin: 300 auto;
font-size: 12px;
color: white;
font-family: Sans-serif;
background: #DDDDDD;
}
.content{
margin: 0 auto;
text-align: center;
}
.button {
display: inline-block;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffc930), color-stop(100%,#ffa403));
background: -moz-linear-gradient(center top, #ffc930 0%, #ffa403 100%);
-webkit-box-shadow: 1px 1px 2px #e6e6e6, 0.5px 1px #ffd96f inset;
-moz-box-shadow: 1px 1px 2px #e6e6e6, 0.5px 1px #ffd96f inset;
box-shadow: 1px 1px 2px #e6e6e6, 0.5px 1px #ffd96f inset;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
text-shadow: 1px 1px 0px #b27b0d;
padding: 11px 15px;
border-color: #e39304;
border-width: 1px;
border-style: solid;
font-family: Helvetica;
font-size: 14px;
color: #ffffff;
font-weight: bold;
}
.button:hover {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffd766), color-stop(100%,#ffa403));
background: -moz-linear-gradient(center top, #ffd766 0%, #ffa403 100%);
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.button:active {
-webkit-box-shadow: 1px 1px 1px 1px #ffa403 inset;
-moz-box-shadow: 1px 1px 1px 1px #ffa403 inset;
box-shadow: 1px 1px 1px 1px #ffa403 inset;
}
</style>
</head>
<body>
<?php
//$fileList = '<div class="button"><a target="_new" href="'.$file.'">'.$file.'</a></div>';
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && is_dir($file))
{
@$fileList .= '<a target="_new" href="'.$file.'">
<div style="margin-right: 2px;" class="button">'.$file.'</div>
</a>';
}
}
closedir($handle);
}
?>
<div class="content">
<?php echo $fileList; ?>
</div>
</body>
</html>
How it works?
Make a new file called index.php, and paste this script into it. Then, on line 2, edit that one variable, and set it to whatever page title you want.