Initial PHP Slim project structure; built a very basic site template

This commit is contained in:
2022-09-22 20:37:29 -04:00
parent 26a7ab742e
commit 8c15b10389
12 changed files with 1342 additions and 24 deletions

5
public/.htaccess Normal file
View File

@ -0,0 +1,5 @@
# rewrite rules
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

46
public/css/wyrm.css Normal file
View File

@ -0,0 +1,46 @@
body{
background-color: #e6e6e6;
}
/* set the max-width for centered content */
.container{
max-width: 1100px;
}
#main-content{
margin-top: 25px;
padding: 12px 25px;
background: white;
}
/* global navigation bar styles */
.navbar{
padding: 10px 18px;
background-color: #212121;
color: white;
font-size: 2.5rem;
font-weight: bold;
}
.navbar ul{
margin: 0;
padding: 0;
list-style: none;
}
.navbar li{
display: inline-block;
margin-bottom: 0;
}
.navbar li:not(:first-child){
margin-left: 10px;
}
.navbar li>a{
color: #eee;
text-decoration: none;
transition: color 220ms ease-in-out;
}
.navbar li>a:hover{
color: white;
}

24
public/index.php Normal file
View File

@ -0,0 +1,24 @@
<?php
// if we're looking for static files in dev, return false so they can be served.
if (PHP_SAPI == 'cli-server') {
$url = parse_url($_SERVER['REQUEST_URI']);
$file = __DIR__ . $url['path'];
// check the file types, only serve standard files
if (preg_match('/\.(?:png|js|jpg|jpeg|gif|css)$/', $file)) {
// does the file exist? If so, return it
if (is_file($file))
return false;
// file does not exist. return a 404
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
printf('"%s" does not exist', $_SERVER['REQUEST_URI']);
return false;
}
}
require_once __DIR__ . '/../src/app.php';
$app->run();

3
public/js/drake.js Normal file
View File

@ -0,0 +1,3 @@
$(document).ready(function () {
// this will be used later.
});