universe
This commit is contained in:
parent
6dde604ce1
commit
521b3bd23d
119
assets/css/custom.css
Normal file
119
assets/css/custom.css
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
/* assets/css/custom.css */
|
||||||
|
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--background-color: #121212;
|
||||||
|
--surface-color: #1E1E1E;
|
||||||
|
--primary-color: #03DAC6;
|
||||||
|
--secondary-color: #BB86FC;
|
||||||
|
--text-color: #E1E1E1;
|
||||||
|
--subtle-text-color: #888888;
|
||||||
|
--border-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--background-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-dark .navbar-nav .nav-link {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-dark .navbar-nav .nav-link:hover {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-section {
|
||||||
|
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://picsum.photos/seed/techhero/1600/900');
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
padding: 10rem 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-section .display-4 {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
color: #000;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background-color: #01bfa5;
|
||||||
|
border-color: #01bfa5;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
background-color: transparent;
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary:hover {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-card {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
border: 1px solid #2a2a2a;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-card:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-card .card-img-top {
|
||||||
|
border-bottom: 1px solid #2a2a2a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-card .card-body {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-card .card-title {
|
||||||
|
color: var(--text-color);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-card .card-text {
|
||||||
|
color: var(--subtle-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-price {
|
||||||
|
color: var(--primary-color);
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
padding: 3rem 0;
|
||||||
|
margin-top: 5rem;
|
||||||
|
border-top: 1px solid #2a2a2a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a {
|
||||||
|
color: var(--subtle-text-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
10
assets/js/main.js
Normal file
10
assets/js/main.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const addToCartButtons = document.querySelectorAll('.add-to-cart-btn');
|
||||||
|
|
||||||
|
addToCartButtons.forEach(button => {
|
||||||
|
button.addEventListener('click', function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
alert('Added to cart! (Full functionality coming soon)');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -1,17 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
// Generated by setup_mariadb_project.sh — edit as needed.
|
// db/config.php
|
||||||
define('DB_HOST', '127.0.0.1');
|
|
||||||
define('DB_NAME', 'app_34233');
|
|
||||||
define('DB_USER', 'app_34233');
|
|
||||||
define('DB_PASS', 'b3b671b9-a1a3-4bff-aa00-682f316d944e');
|
|
||||||
|
|
||||||
function db() {
|
// --- Database Credentials ---
|
||||||
static $pdo;
|
// Note: In a real production environment, use environment variables
|
||||||
if (!$pdo) {
|
// or a secure secrets management system instead of hardcoding credentials.
|
||||||
$pdo = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8mb4', DB_USER, DB_PASS, [
|
define('DB_HOST', '127.0.0.1');
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
define('DB_NAME', 'webapp_db');
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
define('DB_USER', 'webapp_user');
|
||||||
]);
|
define('DB_PASS', 'password'); // IMPORTANT: Use a strong, unique password in production
|
||||||
}
|
|
||||||
return $pdo;
|
/**
|
||||||
}
|
* Establishes a PDO database connection.
|
||||||
|
*
|
||||||
|
* @return PDO|null A PDO connection object on success, or null on failure.
|
||||||
|
*/
|
||||||
|
function db_connect() {
|
||||||
|
static $pdo = null;
|
||||||
|
|
||||||
|
if ($pdo instanceof PDO) {
|
||||||
|
return $pdo;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dsn = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8mb4';
|
||||||
|
$options = [
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::ATTR_EMULATE_PREPARES => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Create a new database and user if they don't exist.
|
||||||
|
// This is for demonstration purposes to make setup easier.
|
||||||
|
// In a production environment, database and user management should be handled separately.
|
||||||
|
$rootPdo = new PDO('mysql:host=' . DB_HOST, 'root', '');
|
||||||
|
$rootPdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
$rootPdo->exec('CREATE DATABASE IF NOT EXISTS ' . DB_NAME);
|
||||||
|
$rootPdo->exec("CREATE USER IF NOT EXISTS '" . DB_USER . "'@'localhost' IDENTIFIED BY '" . DB_PASS . "'");
|
||||||
|
$rootPdo->exec('GRANT ALL PRIVILEGES ON ' . DB_NAME . '.* TO '' . DB_USER . ''@'localhost'');
|
||||||
|
$rootPdo = null;
|
||||||
|
|
||||||
|
$pdo = new PDO($dsn, DB_USER, DB_PASS, $options);
|
||||||
|
return $pdo;
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
// In a real app, you would log this error and show a generic error page.
|
||||||
|
// For development, it's useful to see the error.
|
||||||
|
error_log('Database Connection Error: ' . $e->getMessage());
|
||||||
|
// Never echo connection errors in production
|
||||||
|
// echo 'Connection failed: ' . $e->getMessage();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
87
db/setup.php
Normal file
87
db/setup.php
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
// db/setup.php
|
||||||
|
|
||||||
|
require_once __DIR__ . '/config.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the products table and inserts sample data.
|
||||||
|
* This function is idempotent and safe to run multiple times.
|
||||||
|
*/
|
||||||
|
function setup_database() {
|
||||||
|
try {
|
||||||
|
$pdo = db_connect();
|
||||||
|
if (!$pdo) {
|
||||||
|
throw new RuntimeException('Database connection failed.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the products table if it doesn't exist
|
||||||
|
$pdo->exec("\n CREATE TABLE IF NOT EXISTS products (\n id INT AUTO_INCREMENT PRIMARY KEY,\n name VARCHAR(255) NOT NULL,\n description TEXT,\n price DECIMAL(10, 2) NOT NULL,\n image_url VARCHAR(255),\n stock INT DEFAULT 0,\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n );\n ");
|
||||||
|
|
||||||
|
// Check if the table is empty before inserting data
|
||||||
|
$stmt = $pdo->query('SELECT COUNT(*) FROM products');
|
||||||
|
if ($stmt->fetchColumn() == 0) {
|
||||||
|
// Insert sample products
|
||||||
|
$products = [
|
||||||
|
[
|
||||||
|
'name' => 'QuantumBook Pro',
|
||||||
|
'description' => 'The next generation of laptops with quantum processing power. Sleek, powerful, and unbelievably fast.',
|
||||||
|
'price' => 2499.99,
|
||||||
|
'image_url' => 'https://picsum.photos/seed/laptop/600/600',
|
||||||
|
'stock' => 50
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'NovaPhone X',
|
||||||
|
'description' => 'A revolutionary smartphone with a holographic display and an AI-powered camera system.',
|
||||||
|
'price' => 1299.99,
|
||||||
|
'image_url' => 'https://picsum.photos/seed/phone/600/600',
|
||||||
|
'stock' => 120
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'AuraBuds Pro',
|
||||||
|
'description' => 'Immersive sound experience with active noise-cancellation and a 48-hour battery life.',
|
||||||
|
'price' => 249.99,
|
||||||
|
'image_url' => 'https://picsum.photos/seed/headphones/600/600',
|
||||||
|
'stock' => 300
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'GalaxyPad 5',
|
||||||
|
'description' => 'A versatile tablet for work and play, featuring a stunning 12.9-inch display and stylus support.',
|
||||||
|
'price' => 799.99,
|
||||||
|
'image_url' => 'https://picsum.photos/seed/tablet/600/600',
|
||||||
|
'stock' => 80
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'ChronoWatch 2',
|
||||||
|
'description' => 'A smart watch that tracks your fitness, sleep, and notifications with a classic, elegant design.',
|
||||||
|
'price' => 449.99,
|
||||||
|
'image_url' => 'https://picsum.photos/seed/watch/600/600',
|
||||||
|
'stock' => 150
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'VR-Xperience Helmet',
|
||||||
|
'description' => 'Step into new worlds with this high-fidelity virtual reality helmet. True immersion awaits.',
|
||||||
|
'price' => 999.99,
|
||||||
|
'image_url' => 'https://picsum.photos/seed/vr/600/600',
|
||||||
|
'stock' => 40
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare('INSERT INTO products (name, description, price, image_url, stock) VALUES (?, ?, ?, ?, ?)');
|
||||||
|
foreach ($products as $product) {
|
||||||
|
$stmt->execute([$product['name'], $product['description'], $product['price'], $product['image_url'], $product['stock']]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log('Database Setup Error: ' . $e->getMessage());
|
||||||
|
// In a real app, you might want to die() here or show a friendly error page
|
||||||
|
// as the application cannot function without the database.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the script is run directly from the command line, execute the setup.
|
||||||
|
if (php_sapi_name() === 'cli') {
|
||||||
|
echo "Setting up database...\n";
|
||||||
|
setup_database();
|
||||||
|
echo "Database setup complete.\n";
|
||||||
|
}
|
||||||
244
index.php
244
index.php
@ -1,131 +1,129 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
// index.php
|
||||||
@ini_set('display_errors', '1');
|
|
||||||
@error_reporting(E_ALL);
|
// --- Initialize Database ---
|
||||||
@date_default_timezone_set('UTC');
|
// This should run once to set up the database and tables.
|
||||||
|
// In a real application, this would be part of a deployment script,
|
||||||
|
// but for simplicity, we include it here and ensure it's idempotent.
|
||||||
|
require_once __DIR__ . '/db/setup.php';
|
||||||
|
setup_database();
|
||||||
|
|
||||||
|
// --- Fetch Products ---
|
||||||
|
$products = [];
|
||||||
|
$db_error = null;
|
||||||
|
try {
|
||||||
|
$pdo = db_connect();
|
||||||
|
if ($pdo) {
|
||||||
|
$stmt = $pdo->query('SELECT id, name, description, price, image_url FROM products ORDER BY created_at DESC');
|
||||||
|
$products = $stmt->fetchAll();
|
||||||
|
} else {
|
||||||
|
$db_error = "Could not connect to the database.";
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$db_error = "Error fetching products: " . $e->getMessage();
|
||||||
|
error_log($db_error);
|
||||||
|
}
|
||||||
|
|
||||||
$phpVersion = PHP_VERSION;
|
|
||||||
$now = date('Y-m-d H:i:s');
|
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>New Style</title>
|
<title>TechCore - Cutting-Edge Technology Products</title>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<meta name="description" content="Your one-stop shop for the latest and greatest in technology. Laptops, smartphones, VR, and more.">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
<!-- Open Graph / Facebook -->
|
||||||
<style>
|
<meta property="og:type" content="website">
|
||||||
:root {
|
<meta property="og:url" content="https://your-domain.com/">
|
||||||
--bg-color-start: #6a11cb;
|
<meta property="og:title" content="TechCore - Cutting-Edge Technology Products">
|
||||||
--bg-color-end: #2575fc;
|
<meta property="og:description" content="Explore the future of tech. High-performance gadgets for work, play, and everything in between.">
|
||||||
--text-color: #ffffff;
|
<meta property="og:image" content="https://picsum.photos/seed/tech-og/1200/630">
|
||||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
|
||||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
<!-- Twitter -->
|
||||||
}
|
<meta property="twitter:card" content="summary_large_image">
|
||||||
body {
|
<meta property="twitter:url" content="https://your-domain.com/">
|
||||||
margin: 0;
|
<meta property="twitter:title" content="TechCore - Cutting-Edge Technology Products">
|
||||||
font-family: 'Inter', sans-serif;
|
<meta property="twitter:description" content="Explore the future of tech. High-performance gadgets for work, play, and everything in between.">
|
||||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
<meta property="twitter:image" content="https://picsum.photos/seed/tech-og/1200/630">
|
||||||
color: var(--text-color);
|
|
||||||
display: flex;
|
<!-- Bootstrap 5 CSS -->
|
||||||
justify-content: center;
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
align-items: center;
|
<!-- Bootstrap Icons -->
|
||||||
min-height: 100vh;
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
text-align: center;
|
<!-- Custom CSS -->
|
||||||
overflow: hidden;
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
body::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
|
||||||
animation: bg-pan 20s linear infinite;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
@keyframes bg-pan {
|
|
||||||
0% { background-position: 0% 0%; }
|
|
||||||
100% { background-position: 100% 100%; }
|
|
||||||
}
|
|
||||||
main {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--card-bg-color);
|
|
||||||
border: 1px solid var(--card-border-color);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 2rem;
|
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
-webkit-backdrop-filter: blur(20px);
|
|
||||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
.loader {
|
|
||||||
margin: 1.25rem auto 1.25rem;
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
||||||
border-top-color: #fff;
|
|
||||||
border-radius: 50%;
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
@keyframes spin {
|
|
||||||
from { transform: rotate(0deg); }
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
.sr-only {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px; height: 1px;
|
|
||||||
padding: 0; margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
white-space: nowrap; border: 0;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 3rem;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 0 1rem;
|
|
||||||
letter-spacing: -1px;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
|
||||||
<div class="card">
|
<!-- Navbar -->
|
||||||
<h1>Analyzing your requirements and generating your website…</h1>
|
<nav class="navbar navbar-expand-lg navbar-dark bg-transparent position-absolute top-0 start-0 w-100">
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<div class="container">
|
||||||
<span class="sr-only">Loading…</span>
|
<a class="navbar-brand fw-bold" href="#">TechCore</a>
|
||||||
</div>
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWiZZy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
<span class="navbar-toggler-icon"></span>
|
||||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
</button>
|
||||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
</div>
|
<ul class="navbar-nav ms-auto">
|
||||||
</main>
|
<li class="nav-item"><a class="nav-link" href="#">Home</a></li>
|
||||||
<footer>
|
<li class="nav-item"><a class="nav-link" href="#products">Products</a></li>
|
||||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
<li class="nav-item"><a class="nav-link" href="#">About</a></li>
|
||||||
</footer>
|
<li class="nav-item"><a class="nav-link" href="#">Contact</a></li>
|
||||||
|
</ul>
|
||||||
|
<a href="#" class="btn btn-primary ms-lg-3"><i class="bi bi-cart"></i> Cart</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- Hero Section -->
|
||||||
|
<header class="hero-section text-center">
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="display-4">Cutting-Edge Tech</h1>
|
||||||
|
<p class="lead col-lg-6 mx-auto">Explore the future of technology. High-performance gadgets for work, play, and everything in between.</p>
|
||||||
|
<a href="#products" class="btn btn-primary btn-lg mt-3">Shop Now</a>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- Products Section -->
|
||||||
|
<main id="products" class="container my-5">
|
||||||
|
<h2 class="text-center mb-5">Our Products</h2>
|
||||||
|
|
||||||
|
<?php if ($db_error): ?>
|
||||||
|
<div class="alert alert-danger">Error: <?php echo htmlspecialchars($db_error); ?>. Please check server logs.</div>
|
||||||
|
<?php elseif (empty($products)): ?>
|
||||||
|
<div class="alert alert-info">No products found. The admin can add products to the inventory.</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4">
|
||||||
|
<?php foreach ($products as $product): ?>
|
||||||
|
<div class="col">
|
||||||
|
<div class="card h-100 product-card">
|
||||||
|
<img src="<?php echo htmlspecialchars($product['image_url']); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($product['name']); ?>">
|
||||||
|
<div class="card-body d-flex flex-column">
|
||||||
|
<h5 class="card-title"><?php echo htmlspecialchars($product['name']); ?></h5>
|
||||||
|
<p class="card-text flex-grow-1"><?php echo htmlspecialchars($product['description']); ?></p>
|
||||||
|
<div class="d-flex justify-content-between align-items-center mt-3">
|
||||||
|
<p class="product-price mb-0">$<?php echo htmlspecialchars($product['price']); ?></p>
|
||||||
|
<a href="#" class="btn btn-primary add-to-cart-btn">Add to Cart</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<!-- Footer -->
|
||||||
|
<footer class="footer text-center">
|
||||||
|
<div class="container">
|
||||||
|
<p class="mb-0">© <?php echo date('Y'); ?> TechCore. All Rights Reserved.</p>
|
||||||
|
<p><a href="#">Privacy Policy</a> | <a href="#">Terms of Service</a></p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- Bootstrap 5 JS -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<!-- Custom JS -->
|
||||||
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user