From 5d0874eab1904cfb0c7974858cb92ab7720b6ae3 Mon Sep 17 00:00:00 2001 From: Lumerel Deploy Date: Sat, 14 Feb 2026 23:00:52 +0000 Subject: [PATCH] Deploy from Lumerel --- .dockerignore | 3 + .htaccess | 20 ++++++ Dockerfile | 7 +++ README.md | 116 +++++++++++++++++++++++++++++++++++ assets/css/style.css | 137 ++++++++++++++++++++++++++++++++++++++++++ assets/js/main.js | 27 +++++++++ config/config.php | 5 ++ includes/footer.php | 7 +++ includes/header.php | 19 ++++++ index.php | 10 +++ templates/about.php | 13 ++++ templates/contact.php | 18 ++++++ templates/error.php | 34 +++++++++++ templates/home.php | 27 +++++++++ 14 files changed, 443 insertions(+) create mode 100644 .dockerignore create mode 100644 .htaccess create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 assets/css/style.css create mode 100644 assets/js/main.js create mode 100644 config/config.php create mode 100644 includes/footer.php create mode 100644 includes/header.php create mode 100644 index.php create mode 100644 templates/about.php create mode 100644 templates/contact.php create mode 100644 templates/error.php create mode 100644 templates/home.php diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..17896fe --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +Dockerfile +.dockerignore diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..0bc4b06 --- /dev/null +++ b/.htaccess @@ -0,0 +1,20 @@ +RewriteEngine On +RewriteBase / + +# Redirect all requests to index.php +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ index.php [L] + +# Prevent directory listing +Options -Indexes + +# Secure config and includes + + Order Allow,Deny + Deny from all + + + Order Allow,Deny + Deny from all + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c60a8c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM webdevops/php-nginx:8.3-alpine +ENV WEB_DOCUMENT_ROOT=/app +ARG CACHE_BUST=1771110052 +COPY . /app +RUN echo "index index.php index.html index.htm;" > /opt/docker/etc/nginx/vhost.common.d/01-index.conf \ + && echo "add_header Cache-Control 'no-cache, no-store, must-revalidate';" > /opt/docker/etc/nginx/vhost.common.d/02-no-cache.conf \ + && chown -R application:application /app diff --git a/README.md b/README.md new file mode 100644 index 0000000..56cffac --- /dev/null +++ b/README.md @@ -0,0 +1,116 @@ +# Simple Framework + +A lightweight PHP framework with clean routing and template management. + +## Features + +- **Simple Routing**: Clean URLs through `index.php` (e.g., `/index.php/about`) +- **Template System**: Organized template files with reusable header/footer +- **Output Buffering**: Templates can set variables that are used in header/footer +- **Configuration Management**: Centralized constants in `assets/config.php` +- **No Dependencies**: Pure PHP, no external libraries required + +## Structure + +``` +/ +├── assets/ +│ ├── config.php # Site configuration and constants +│ ├── css/ +│ │ └── style.css # Main stylesheet +│ └── js/ +│ └── main.js # Main JavaScript +├── includes/ +│ ├── header.php # Site header +│ └── footer.php # Site footer +├── templates/ +│ ├── home.php # Home page template +│ ├── about.php # About page template +│ └── contact.php # Contact page template +├── index.php # Bootstrap/Router +└── README.md +``` + +## How It Works + +1. **index.php** receives all requests and parses the URL +2. It determines which template to load from `PAGE_TEMPLATES` in config +3. The template file is loaded with `ob_start()` to buffer output +4. Templates can set variables like `$pageTitle`, `$pageDescription`, `$additionalHead`, etc. +5. The header is rendered (with access to template variables) +6. The buffered template content is output +7. The footer is rendered + +## Configuration + +Edit `assets/config.php` to customize: + +- `SITE_NAME` - Your site name +- `SITE_URL` - Your site URL +- `PAGE_TEMPLATES` - Add/remove pages and their settings + +## Adding New Pages + +1. Add a new entry to `PAGE_TEMPLATES` in `assets/config.php`: + +```php +'services' => [ + 'file' => 'services.php', + 'title' => 'Services' +] +``` + +2. Create the template file in `templates/services.php` +3. The page will automatically appear in the navigation + +## Template Variables + +Templates can set these variables to customize the output: + +- `$pageTitle` - Page title (appears in `` tag) +- `$pageDescription` - Meta description +- `$bodyClass` - CSS class for `<body>` tag +- `$additionalHead` - Extra HTML for `<head>` section +- `$footerExtra` - Extra content in the footer + +## Example Template + +```php +<?php +$pageTitle = 'My Page'; +$pageDescription = 'This is my page description'; +$bodyClass = 'my-custom-class'; +?> + +<section> + <h1>My Page Content</h1> + <p>This content will be wrapped by header and footer.</p> +</section> +``` + +## Server Configuration + +### Apache + +Enable mod_rewrite and use this `.htaccess` for cleaner URLs (optional): + +```apache +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ index.php/$1 [L] +``` + +### PHP Built-in Server + +For development: + +```bash +php -S localhost:8000 +``` + +Then visit: `http://localhost:8000/index.php/about` + +## License + +Free to use for any purpose. diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..6223c33 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,137 @@ +/* Reset and Base Styles */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Poppins', sans-serif; + line-height: 1.6; + background-color: #f4f6f9; + color: #333; +} + +/* Header Styles */ +.site-header { + background-color: #ffffff; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + padding: 1rem 0; +} + +.header-container { + max-width: 1200px; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 15px; +} + +.logo a { + font-size: 1.8rem; + font-weight: 600; + color: #2c3e50; + text-decoration: none; +} + +.main-nav ul { + display: flex; + list-style: none; +} + +.main-nav ul li { + margin-left: 20px; +} + +.main-nav ul li a { + text-decoration: none; + color: #34495e; + font-weight: 500; + transition: color 0.3s ease; +} + +.main-nav ul li a:hover { + color: #3498db; +} + +/* Container Styles */ +.container { + max-width: 1200px; + margin: 0 auto; + padding: 2rem 15px; +} + +/* Home Page Styles */ +.home-columns { + display: flex; + justify-content: space-between; + gap: 30px; +} + +.home-column { + background-color: white; + border-radius: 15px; + padding: 30px; + box-shadow: 0 10px 20px rgba(0,0,0,0.1); + flex: 1; +} + +/* Contact Form Styles */ +.contact-form { + background-color: white; + border-radius: 15px; + padding: 30px; + box-shadow: 0 10px 20px rgba(0,0,0,0.1); +} + +.contact-form input, +.contact-form textarea { + width: 100%; + padding: 12px; + margin-bottom: 15px; + border: 1px solid #e0e0e0; + border-radius: 8px; + transition: border-color 0.3s ease; +} + +.contact-form input:focus, +.contact-form textarea:focus { + outline: none; + border-color: #3498db; +} + +.contact-form button { + background-color: #3498db; + color: white; + border: none; + padding: 12px 25px; + border-radius: 8px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +.contact-form button:hover { + background-color: #2980b9; +} + +/* Responsive Adjustments */ +@media (max-width: 768px) { + .header-container { + flex-direction: column; + text-align: center; + } + + .main-nav ul { + flex-direction: column; + align-items: center; + } + + .main-nav ul li { + margin: 10px 0; + } + + .home-columns { + flex-direction: column; + } +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..f8a3c7e --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,27 @@ +document.addEventListener('DOMContentLoaded', () => { + // Smooth scroll for internal links + document.querySelectorAll('a[href^="/"]').forEach(anchor => { + anchor.addEventListener('click', function (e) { + e.preventDefault(); + + const targetPath = this.getAttribute('href'); + + // Optional: Add a subtle fade out/in transition + document.body.style.opacity = '0'; + setTimeout(() => { + window.location.href = targetPath; + }, 300); + }); + }); + + // Optional: Add hover effects or other interactive elements + const buttons = document.querySelectorAll('.btn'); + buttons.forEach(btn => { + btn.addEventListener('mouseenter', function() { + this.style.transform = 'scale(1.05)'; + }); + btn.addEventListener('mouseleave', function() { + this.style.transform = 'scale(1)'; + }); + }); +}); \ No newline at end of file diff --git a/config/config.php b/config/config.php new file mode 100644 index 0000000..fe277e9 --- /dev/null +++ b/config/config.php @@ -0,0 +1,5 @@ +<?php +class SiteConfig { + const SITE_NAME = 'Simple Framework'; + const SITE_URL = 'https://simple-framework-klby21.lumerel.app'; +} \ No newline at end of file diff --git a/includes/footer.php b/includes/footer.php new file mode 100644 index 0000000..0dc2f24 --- /dev/null +++ b/includes/footer.php @@ -0,0 +1,7 @@ + </main> + <footer> + <p>© <?= date('Y') ?> <?= SiteConfig::SITE_NAME ?>. All rights reserved.</p> + </footer> + <script src="/assets/js/main.js"></script> +</body> +</html> \ No newline at end of file diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..249e78e --- /dev/null +++ b/includes/header.php @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title><?php echo $pageTitle; ?> + + + +
+ +
+
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..1c6d0e2 --- /dev/null +++ b/index.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/templates/about.php b/templates/about.php new file mode 100644 index 0000000..38b965a --- /dev/null +++ b/templates/about.php @@ -0,0 +1,13 @@ + +

About

+

This is a lightweight PHP framework designed for simplicity and ease of use.

+

Key features:

+ \ No newline at end of file diff --git a/templates/contact.php b/templates/contact.php new file mode 100644 index 0000000..3faea6e --- /dev/null +++ b/templates/contact.php @@ -0,0 +1,18 @@ + + +
+
+

Get in Touch

+

Have a project in mind? Let's discuss how we can bring your vision to life.

+ +
+ + + + + +
+
+
+ + \ No newline at end of file diff --git a/templates/error.php b/templates/error.php new file mode 100644 index 0000000..65f0da2 --- /dev/null +++ b/templates/error.php @@ -0,0 +1,34 @@ + + + + + Error | Simple Framework + + + +
+

Oops! Something went wrong

+

We're sorry, but an unexpected error occurred. Our team has been notified.

+

Return to Home

+
+ + \ No newline at end of file diff --git a/templates/home.php b/templates/home.php new file mode 100644 index 0000000..1b898d4 --- /dev/null +++ b/templates/home.php @@ -0,0 +1,27 @@ + + +
+
+

Welcome to Todd Low Media

+

Innovative Solutions for Modern Challenges

+
+ +
+
+

Creative Strategy

+

We transform complex ideas into elegant, actionable strategies that drive meaningful results and push boundaries of innovation.

+
+ +
+

Technology Solutions

+

Leveraging cutting-edge technologies to build scalable, efficient digital solutions that adapt and evolve with your business needs.

+
+ +
+

Digital Transformation

+

Our holistic approach merges design, technology, and strategic thinking to reimagine how businesses operate in the digital landscape.

+
+
+
+ + \ No newline at end of file