Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6be5962f9e |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,14 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from .models import Category, Product
|
||||||
|
|
||||||
# Register your models here.
|
@admin.register(Category)
|
||||||
|
class CategoryAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ('name', 'slug')
|
||||||
|
prepopulated_fields = {'slug': ('name',)}
|
||||||
|
|
||||||
|
@admin.register(Product)
|
||||||
|
class ProductAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ('name', 'category', 'price', 'is_featured')
|
||||||
|
list_filter = ('category', 'is_featured')
|
||||||
|
search_fields = ('name', 'description')
|
||||||
|
prepopulated_fields = {'slug': ('name',)}
|
||||||
41
core/migrations/0001_initial.py
Normal file
41
core/migrations/0001_initial.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Generated by Django 5.2.7 on 2026-02-07 11:04
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Category',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=100)),
|
||||||
|
('slug', models.SlugField(unique=True)),
|
||||||
|
('icon', models.CharField(default='bi-tag', help_text='Bootstrap icon class', max_length=50)),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name_plural': 'Categories',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Product',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=200)),
|
||||||
|
('slug', models.SlugField(unique=True)),
|
||||||
|
('description', models.TextField()),
|
||||||
|
('price', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||||
|
('image_url', models.URLField(blank=True, max_length=500)),
|
||||||
|
('is_featured', models.BooleanField(default=False)),
|
||||||
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='core.category')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
Binary file not shown.
@ -1,3 +1,29 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.urls import reverse
|
||||||
|
|
||||||
# Create your models here.
|
class Category(models.Model):
|
||||||
|
name = models.CharField(max_length=100)
|
||||||
|
slug = models.SlugField(unique=True)
|
||||||
|
icon = models.CharField(max_length=50, help_text="Bootstrap icon class", default="bi-tag")
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name_plural = "Categories"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
class Product(models.Model):
|
||||||
|
name = models.CharField(max_length=200)
|
||||||
|
slug = models.SlugField(unique=True)
|
||||||
|
category = models.ForeignKey(Category, related_name='products', on_delete=models.CASCADE)
|
||||||
|
description = models.TextField()
|
||||||
|
price = models.DecimalField(max_digits=10, decimal_places=2)
|
||||||
|
image_url = models.URLField(max_length=500, blank=True)
|
||||||
|
is_featured = models.BooleanField(default=False)
|
||||||
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse('product_detail', args=[self.slug])
|
||||||
|
|||||||
@ -1,25 +1,131 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>{% block title %}Knowledge Base{% endblock %}</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
{% if project_description %}
|
<title>{% block title %}ShinaStore | Futuristic Gaming Gear{% endblock %}</title>
|
||||||
<meta name="description" content="{{ project_description }}">
|
|
||||||
<meta property="og:description" content="{{ project_description }}">
|
<!-- Bootstrap 5 & Icons -->
|
||||||
<meta property="twitter:description" content="{{ project_description }}">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
{% endif %}
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||||
{% if project_image_url %}
|
|
||||||
<meta property="og:image" content="{{ project_image_url }}">
|
<!-- Google Fonts -->
|
||||||
<meta property="twitter:image" content="{{ project_image_url }}">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
{% endif %}
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
{% load static %}
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
|
|
||||||
{% block head %}{% endblock %}
|
{% load static %}
|
||||||
|
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-dark: #0d0d12;
|
||||||
|
--surface: rgba(255, 255, 255, 0.05);
|
||||||
|
--neon-purple: #bc13fe;
|
||||||
|
--neon-blue: #00d1ff;
|
||||||
|
--text-light: #ffffff;
|
||||||
|
--glass-bg: rgba(255, 255, 255, 0.03);
|
||||||
|
--glass-border: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--bg-dark);
|
||||||
|
color: var(--text-light);
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, .orbitron {
|
||||||
|
font-family: 'Orbitron', sans-serif;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass {
|
||||||
|
background: var(--glass-bg);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
-webkit-backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid var(--glass-border);
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.neon-border-purple {
|
||||||
|
border: 1px solid var(--neon-purple);
|
||||||
|
box-shadow: 0 0 10px rgba(188, 19, 254, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.neon-border-blue {
|
||||||
|
border: 1px solid var(--neon-blue);
|
||||||
|
box-shadow: 0 0 10px rgba(0, 209, 255, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.neon-text-purple { color: var(--neon-purple); text-shadow: 0 0 8px rgba(188, 19, 254, 0.5); }
|
||||||
|
.neon-text-blue { color: var(--neon-blue); text-shadow: 0 0 8px rgba(0, 209, 255, 0.5); }
|
||||||
|
|
||||||
|
.btn-neon-purple {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--neon-purple);
|
||||||
|
border: 2px solid var(--neon-purple);
|
||||||
|
font-family: 'Orbitron', sans-serif;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.btn-neon-purple:hover {
|
||||||
|
background: var(--neon-purple);
|
||||||
|
color: #000;
|
||||||
|
box-shadow: 0 0 20px var(--neon-purple);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
background: rgba(13, 13, 18, 0.8) !important;
|
||||||
|
backdrop-filter: blur(15px);
|
||||||
|
border-bottom: 1px solid var(--glass-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
color: var(--text-light) !important;
|
||||||
|
font-family: 'Orbitron', sans-serif;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.nav-link:hover {
|
||||||
|
color: var(--neon-blue) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% block head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
{% block content %}{% endblock %}
|
<nav class="navbar navbar-expand-lg sticky-top">
|
||||||
</body>
|
<div class="container">
|
||||||
|
<a class="navbar-brand neon-text-purple fw-bold fs-3" href="/">SHINA<span class="neon-text-blue">STORE</span></a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<ul class="navbar-nav ms-auto align-items-center">
|
||||||
|
<li class="nav-item"><a class="nav-link" href="/">STORE</a></li>
|
||||||
|
<li class="nav-item"><a class="nav-link" href="#">CATEGORIES</a></li>
|
||||||
|
<li class="nav-item"><a class="nav-link" href="/admin/"><i class="bi bi-person-gear"></i> ADMIN</a></li>
|
||||||
|
<li class="nav-item ms-lg-3">
|
||||||
|
<a href="#" class="btn btn-neon-purple btn-sm py-2 px-3">
|
||||||
|
<i class="bi bi-cart3"></i> CART (0)
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
</html>
|
<main>
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="py-5 mt-5 border-top border-secondary">
|
||||||
|
<div class="container text-center">
|
||||||
|
<p class="text-secondary">© 2026 SHINASTORE. POWERED BY NEURAL TECHNOLOGY.</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
35
core/templates/core/includes/product_card.html
Normal file
35
core/templates/core/includes/product_card.html
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<div class="card glass h-100 product-card border-0">
|
||||||
|
<div class="product-img-wrapper position-relative">
|
||||||
|
{% if product.is_featured %}
|
||||||
|
<span class="badge bg-neon-purple position-absolute top-0 end-0 m-3 orbitron" style="background-color: var(--neon-purple); z-index: 1;">FEATURED</span>
|
||||||
|
{% endif %}
|
||||||
|
{% if product.image_url %}
|
||||||
|
<img src="{{ product.image_url }}" class="product-img" alt="{{ product.name }}">
|
||||||
|
{% else %}
|
||||||
|
<div class="d-flex align-items-center justify-content-center h-100 text-secondary">
|
||||||
|
<i class="bi bi-cpu fs-1"></i>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="card-body d-flex flex-column p-4">
|
||||||
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||||
|
<h5 class="card-title text-white mb-0">{{ product.name }}</h5>
|
||||||
|
<span class="neon-text-blue fw-bold">${{ product.price }}</span>
|
||||||
|
</div>
|
||||||
|
<p class="card-text text-secondary small flex-grow-1">{{ product.description|truncatewords:15 }}</p>
|
||||||
|
<div class="mt-auto pt-3">
|
||||||
|
<button class="btn btn-outline-info w-100 glass rounded-pill border-secondary text-white hover-blue">
|
||||||
|
<i class="bi bi-plus-circle me-2"></i>ADD TO CART
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.hover-blue:hover {
|
||||||
|
background: var(--neon-blue) !important;
|
||||||
|
border-color: var(--neon-blue) !important;
|
||||||
|
color: #000 !important;
|
||||||
|
box-shadow: 0 0 15px var(--neon-blue);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,145 +1,127 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{% load static %}
|
||||||
{% block title %}{{ project_name }}{% endblock %}
|
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
||||||
<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">
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
--bg-color-start: #6a11cb;
|
|
||||||
--bg-color-end: #2575fc;
|
|
||||||
--text-color: #ffffff;
|
|
||||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
|
||||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
|
||||||
color: var(--text-color);
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
body::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
inset: 0;
|
|
||||||
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: 2.5rem 2rem;
|
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
-webkit-backdrop-filter: blur(20px);
|
|
||||||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 0 1.2rem;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
opacity: 0.92;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loader {
|
|
||||||
margin: 1.5rem auto;
|
|
||||||
width: 56px;
|
|
||||||
height: 56px;
|
|
||||||
border: 4px solid rgba(255, 255, 255, 0.25);
|
|
||||||
border-top-color: #fff;
|
|
||||||
border-radius: 50%;
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes spin {
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.runtime code {
|
|
||||||
background: rgba(0, 0, 0, 0.25);
|
|
||||||
padding: 0.15rem 0.45rem;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sr-only {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px;
|
|
||||||
height: 1px;
|
|
||||||
padding: 0;
|
|
||||||
margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1rem;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
opacity: 0.75;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main>
|
<!-- Hero Section -->
|
||||||
<div class="card">
|
<section class="hero-section py-5 mb-5 position-relative overflow-hidden">
|
||||||
<h1>Analyzing your requirements and generating your app…</h1>
|
<div class="container py-5 position-relative" style="z-index: 2;">
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<div class="row align-items-center">
|
||||||
<span class="sr-only">Loading…</span>
|
<div class="col-lg-6">
|
||||||
|
<h1 class="display-3 fw-bold mb-4 animate-fade-in">GEAR UP FOR THE <span class="neon-text-purple">FUTURE</span></h1>
|
||||||
|
<p class="lead text-secondary mb-5 fs-4">Experience high-performance marketplace for futuristic tech and gaming gear. Neural peripherals, VR, and RGB-infused hardware.</p>
|
||||||
|
<div class="d-flex gap-3">
|
||||||
|
<a href="#store" class="btn btn-neon-purple px-4 py-3">Explore Gear</a>
|
||||||
|
<a href="#" class="btn btn-outline-light px-4 py-3 glass">New Arrivals</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 d-none d-lg-block">
|
||||||
|
<div class="position-relative">
|
||||||
|
<div class="hero-glow position-absolute top-50 start-50 translate-middle" style="width: 400px; height: 400px; background: radial-gradient(circle, rgba(188, 19, 254, 0.2) 0%, transparent 70%);"></div>
|
||||||
|
<img src="https://images.pexels.com/photos/7862591/pexels-photo-7862591.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2" alt="Future Tech" class="img-fluid rounded-4 shadow-lg glass neon-border-blue animate-float">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
|
<!-- Background Accents -->
|
||||||
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
|
<div class="position-absolute top-0 end-0 p-5 opacity-25">
|
||||||
<p class="runtime">
|
<div class="rounded-circle bg-purple shadow-lg" style="width: 300px; height: 300px; filter: blur(100px); background: var(--neon-purple);"></div>
|
||||||
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
|
</div>
|
||||||
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
|
</section>
|
||||||
</p>
|
|
||||||
</div>
|
<div id="store" class="container py-5">
|
||||||
</main>
|
<div class="row mb-5">
|
||||||
<footer>
|
<div class="col-md-8">
|
||||||
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
|
<h2 class="mb-4">NEURAL <span class="neon-text-blue">CATALOG</span></h2>
|
||||||
</footer>
|
<div class="d-flex flex-wrap gap-2 mb-4">
|
||||||
{% endblock %}
|
<a href="?" class="btn btn-sm {% if not current_category %}btn-neon-purple{% else %}btn-outline-secondary glass text-white{% endif %} px-3">ALL</a>
|
||||||
|
{% for cat in categories %}
|
||||||
|
<a href="?category={{ cat.slug }}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||||
|
class="btn btn-sm {% if current_category == cat.slug %}btn-neon-purple{% else %}btn-outline-secondary glass text-white{% endif %} px-3">
|
||||||
|
{{ cat.name|upper }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<form action="." method="get" class="search-form">
|
||||||
|
<div class="input-group glass rounded-pill p-1">
|
||||||
|
<input type="text" name="q" class="form-control bg-transparent border-0 text-white px-4" placeholder="Search gear..." value="{{ search_query }}">
|
||||||
|
<button class="btn btn-neon-purple rounded-pill px-4" type="submit"><i class="bi bi-search"></i></button>
|
||||||
|
</div>
|
||||||
|
{% if current_category %}
|
||||||
|
<input type="hidden" name="category" value="{{ current_category }}">
|
||||||
|
{% endif %}
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Featured Products -->
|
||||||
|
{% if not current_category and not search_query and featured_products %}
|
||||||
|
<div class="mb-5">
|
||||||
|
<h4 class="neon-text-purple mb-4">FEATURED TECH</h4>
|
||||||
|
<div class="row g-4">
|
||||||
|
{% for product in featured_products %}
|
||||||
|
<div class="col-md-3">
|
||||||
|
{% include "core/includes/product_card.html" with product=product %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Main Product Grid -->
|
||||||
|
<div class="row g-4">
|
||||||
|
{% for product in products %}
|
||||||
|
<div class="col-lg-4 col-md-6">
|
||||||
|
{% include "core/includes/product_card.html" with product=product %}
|
||||||
|
</div>
|
||||||
|
{% empty %}
|
||||||
|
<div class="col-12 text-center py-5 glass neon-border-blue">
|
||||||
|
<h3 class="text-secondary mb-3">NO GEAR FOUND IN THIS SECTOR</h3>
|
||||||
|
<a href="?" class="btn btn-neon-purple">RESET NEURAL SEARCH</a>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.animate-fade-in {
|
||||||
|
animation: fadeIn 1s ease-out;
|
||||||
|
}
|
||||||
|
.animate-float {
|
||||||
|
animation: float 6s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; transform: translateY(20px); }
|
||||||
|
to { opacity: 1; transform: translateY(0); }
|
||||||
|
}
|
||||||
|
@keyframes float {
|
||||||
|
0% { transform: translateY(0px); }
|
||||||
|
50% { transform: translateY(-20px); }
|
||||||
|
100% { transform: translateY(0px); }
|
||||||
|
}
|
||||||
|
.product-card {
|
||||||
|
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.product-card:hover {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
box-shadow: 0 10px 30px rgba(0, 209, 255, 0.2);
|
||||||
|
border-color: var(--neon-blue) !important;
|
||||||
|
}
|
||||||
|
.product-img-wrapper {
|
||||||
|
height: 250px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #1a1a23;
|
||||||
|
}
|
||||||
|
.product-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
transition: transform 0.5s ease;
|
||||||
|
}
|
||||||
|
.product-card:hover .product-img {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
from .views import home
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", home, name="home"),
|
path("", views.home, name="home"),
|
||||||
]
|
]
|
||||||
@ -1,25 +1,32 @@
|
|||||||
import os
|
import os
|
||||||
import platform
|
from django.shortcuts import render, get_object_or_404
|
||||||
|
from .models import Category, Product
|
||||||
from django import get_version as django_version
|
from django.db.models import Q
|
||||||
from django.shortcuts import render
|
|
||||||
from django.utils import timezone
|
|
||||||
|
|
||||||
|
|
||||||
def home(request):
|
def home(request):
|
||||||
"""Render the landing screen with loader and environment details."""
|
"""Render the ShinaStore landing page with products and filters."""
|
||||||
host_name = request.get_host().lower()
|
query = request.GET.get('q')
|
||||||
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
|
category_slug = request.GET.get('category')
|
||||||
now = timezone.now()
|
|
||||||
|
categories = Category.objects.all()
|
||||||
|
products = Product.objects.all()
|
||||||
|
|
||||||
|
if query:
|
||||||
|
products = products.filter(
|
||||||
|
Q(name__icontains=query) | Q(description__icontains=query)
|
||||||
|
)
|
||||||
|
|
||||||
|
if category_slug:
|
||||||
|
category = get_object_or_404(Category, slug=category_slug)
|
||||||
|
products = products.filter(category=category)
|
||||||
|
|
||||||
|
featured_products = Product.objects.filter(is_featured=True)[:4]
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"project_name": "New Style",
|
"categories": categories,
|
||||||
"agent_brand": agent_brand,
|
"products": products,
|
||||||
"django_version": django_version(),
|
"featured_products": featured_products,
|
||||||
"python_version": platform.python_version(),
|
"current_category": category_slug,
|
||||||
"current_time": now,
|
"search_query": query or "",
|
||||||
"host_name": host_name,
|
|
||||||
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
|
|
||||||
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
|
|
||||||
}
|
}
|
||||||
return render(request, "core/index.html", context)
|
return render(request, "core/index.html", context)
|
||||||
72
seed_data.py
Normal file
72
seed_data.py
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
from core.models import Category, Product
|
||||||
|
|
||||||
|
# Clear existing data
|
||||||
|
Product.objects.all().delete()
|
||||||
|
Category.objects.all().delete()
|
||||||
|
|
||||||
|
# Create Categories
|
||||||
|
categories = [
|
||||||
|
{'name': 'VR Headsets', 'slug': 'vr-headsets', 'icon': 'bi-headset-vr'},
|
||||||
|
{'name': 'Consoles', 'slug': 'consoles', 'icon': 'bi-controller'},
|
||||||
|
{'name': 'Neural Gear', 'slug': 'neural-gear', 'icon': 'bi-cpu'},
|
||||||
|
{'name': 'RGB Hardware', 'slug': 'rgb-hardware', 'icon': 'bi-lightning-charge'},
|
||||||
|
]
|
||||||
|
|
||||||
|
cat_objs = {}
|
||||||
|
for cat in categories:
|
||||||
|
c = Category.objects.create(**cat)
|
||||||
|
cat_objs[cat['slug']] = c
|
||||||
|
|
||||||
|
# Create Products
|
||||||
|
products = [
|
||||||
|
{
|
||||||
|
'name': 'NeuralLink X1',
|
||||||
|
'slug': 'neurallink-x1',
|
||||||
|
'category': cat_objs['neural-gear'],
|
||||||
|
'description': 'Direct brain-to-game interface with zero latency. Experience gaming like never before.',
|
||||||
|
'price': 1299.99,
|
||||||
|
'image_url': 'https://images.pexels.com/photos/8473479/pexels-photo-8473479.jpeg?auto=compress&cs=tinysrgb&w=800',
|
||||||
|
'is_featured': True,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'HoloVisor Pro',
|
||||||
|
'slug': 'holovisor-pro',
|
||||||
|
'category': cat_objs['vr-headsets'],
|
||||||
|
'description': '8K holographic display with 240Hz refresh rate and wide FOV.',
|
||||||
|
'price': 899.99,
|
||||||
|
'image_url': 'https://images.pexels.com/photos/3761153/pexels-photo-3761153.jpeg?auto=compress&cs=tinysrgb&w=800',
|
||||||
|
'is_featured': True,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Quantum Console S',
|
||||||
|
'slug': 'quantum-console-s',
|
||||||
|
'category': cat_objs['consoles'],
|
||||||
|
'description': 'Powered by quantum processing units for instant loading and photorealistic graphics.',
|
||||||
|
'price': 499.99,
|
||||||
|
'image_url': 'https://images.pexels.com/photos/5947116/pexels-photo-5947116.jpeg?auto=compress&cs=tinysrgb&w=800',
|
||||||
|
'is_featured': True,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Neon Striker Keyboard',
|
||||||
|
'slug': 'neon-striker-keyboard',
|
||||||
|
'category': cat_objs['rgb-hardware'],
|
||||||
|
'description': 'Mechanical keys with customizable OLED screens and liquid RGB cooling.',
|
||||||
|
'price': 249.99,
|
||||||
|
'image_url': 'https://images.pexels.com/photos/1779487/pexels-photo-1779487.jpeg?auto=compress&cs=tinysrgb&w=800',
|
||||||
|
'is_featured': False,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Synapse Controller',
|
||||||
|
'slug': 'synapse-controller',
|
||||||
|
'category': cat_objs['neural-gear'],
|
||||||
|
'description': 'Haptic feedback so precise you can feel the textures of the virtual world.',
|
||||||
|
'price': 149.99,
|
||||||
|
'image_url': 'https://images.pexels.com/photos/3945657/pexels-photo-3945657.jpeg?auto=compress&cs=tinysrgb&w=800',
|
||||||
|
'is_featured': False,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
for prod in products:
|
||||||
|
Product.objects.create(**prod)
|
||||||
|
|
||||||
|
print("Seed data created successfully!")
|
||||||
Loading…
x
Reference in New Issue
Block a user