Compare commits

..

1 Commits

Author SHA1 Message Date
Flatlogic Bot
b7f4c6b9fa 1.1 2025-11-02 16:46:22 +00:00
11 changed files with 268 additions and 182 deletions

View File

@ -1,3 +1,5 @@
from django.contrib import admin
from .models import Skill
# Register your models here.
admin.site.register(Skill)

View File

@ -1,3 +1,13 @@
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Skill(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
creator = models.ForeignKey(User, on_delete=models.CASCADE, related_name='skills')
price = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self):
return self.title

View File

@ -1,11 +1,59 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8">
<title>{% block title %}Knowledge Base{% endblock %}</title>
{% block head %}{% endblock %}
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SkillXchange - Share Your Skills</title>
<meta name="description" content="A platform for creators to share their skills through videos and PDFs.">
<!-- Google Fonts -->
<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=Poppins:wght@400;600;700&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" href="{% static 'css/custom.css' %}">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="{% url 'index' %}">SkillXchange</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#skills-section">Browse Skills</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'admin:index' %}">Login</a>
</li>
<li class="nav-item">
<a class="btn btn-primary ms-2" href="{% url 'admin:index' %}">Become a Creator</a>
</li>
</ul>
</div>
</div>
</nav>
<main>
{% block content %}
{% endblock %}
</main>
<footer class="py-4 mt-5 bg-light">
<div class="container text-center">
<p class="mb-0">&copy; {% now "Y" %} SkillXchange. All Rights Reserved.</p>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View File

@ -1,154 +1,47 @@
{% extends "base.html" %}
{% block title %}{{ project_name }}{% endblock %}
{% block head %}
{% if project_description %}
<meta name="description" content="{{ project_description }}">
<meta property="og:description" content="{{ project_description }}">
<meta property="twitter:description" content="{{ project_description }}">
{% endif %}
{% if project_image_url %}
<meta property="og:image" content="{{ project_image_url }}">
<meta property="twitter:image" content="{{ project_image_url }}">
{% endif %}
<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 %}
{% load static %}
{% block content %}
<main>
<div class="card">
<h1>Analyzing your requirements and generating your app…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<div class="hero-section">
<div class="container">
<div class="row align-items-center text-center text-md-start">
<div class="col-md-8 mx-auto">
<h1 class="hero-title">Share Your Passion. Shape the Future.</h1>
<p class="hero-subtitle">Join a community of creators and learners. Upload your skills, share your knowledge, and start earning today.</p>
<a href="#skills-section" class="btn btn-lg btn-accent">Explore Skills</a>
</div>
</div>
</div>
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
<p class="runtime">
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
</p>
</div>
</main>
<footer>
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
</footer>
</div>
<section id="skills-section" class="py-5">
<div class="container">
<h2 class="section-title text-center mb-5">Latest Skills</h2>
{% if skills %}
<div class="row">
{% for skill in skills %}
<div class="col-md-4 mb-4">
<div class="card skill-card h-100">
<div class="card-body">
<h5 class="card-title">{{ skill.title }}</h5>
<p class="card-text">{{ skill.description|truncatewords:20 }}</p>
<p class="card-creator">By {{ skill.creator.get_full_name|default:skill.creator.username }}</p>
</div>
<div class="card-footer">
<span class="skill-price">${{ skill.price }}</span>
<a href="{% url 'article_detail' skill.pk %}" class="btn btn-sm btn-primary-outline float-end">View Details</a>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center p-5 bg-light rounded">
<h3 class="mb-3">The Stage is Set!</h3>
<p class="lead">No skills have been shared yet. Be the first to inspire others.</p>
<a href="{% url 'admin:index' %}" class="btn btn-primary mt-3">Become a Creator</a>
</div>
{% endif %}
</div>
</section>
{% endblock %}

View File

@ -1,7 +1,7 @@
from django.urls import path
from .views import home
from .views import index, article_detail
urlpatterns = [
path("", home, name="home"),
path("", index, name="index"),
path("skill/<int:pk>/", article_detail, name="article_detail"),
]

View File

@ -1,25 +1,14 @@
import os
import platform
from django import get_version as django_version
from django.shortcuts import render
from django.utils import timezone
def home(request):
"""Render the landing screen with loader and environment details."""
host_name = request.get_host().lower()
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
now = timezone.now()
from .models import Skill
def index(request):
"""Render the landing screen with a list of skills."""
skills = Skill.objects.all().order_by('-created_at')
context = {
"project_name": "New Style",
"agent_brand": agent_brand,
"django_version": django_version(),
"python_version": platform.python_version(),
"current_time": now,
"host_name": host_name,
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
'skills': skills,
}
return render(request, "core/index.html", context)
return render(request, 'core/index.html', context)
def article_detail(request, pk):
# This is a placeholder for a future skill detail page
return render(request, 'core/article_detail.html')

144
static/css/custom.css Normal file
View File

@ -0,0 +1,144 @@
/*
SkillXchange Custom Stylesheet
------------------------------
Palette:
- Primary: #1A2E4C (Deep Blue)
- Secondary: #FFFFFF (White)
- Accent: #FFC107 (Vibrant Yellow)
- Background/Neutral: #F8F9FA (Light Gray)
- Text: #212529
Typography:
- Headings: 'Poppins', sans-serif
- Body: 'Roboto', sans-serif
*/
body {
font-family: 'Roboto', sans-serif;
color: #212529;
background-color: #FFFFFF;
}
h1, h2, h3, h4, h5, h6, .navbar-brand, .hero-title, .section-title, .card-title {
font-family: 'Poppins', sans-serif;
font-weight: 600;
}
/* Navbar */
.navbar {
border-bottom: 1px solid #eee;
}
.navbar-brand {
font-weight: 700;
font-size: 1.5rem;
color: #1A2E4C !important;
}
.btn-primary {
background-color: #1A2E4C;
border-color: #1A2E4C;
}
.btn-primary:hover {
background-color: #2E4A6E;
border-color: #2E4A6E;
}
.btn-accent {
background-color: #FFC107;
border-color: #FFC107;
color: #1A2E4C;
font-weight: 500;
}
.btn-accent:hover {
background-color: #ffca2c;
border-color: #ffca2c;
color: #1A2E4C;
}
/* Hero Section */
.hero-section {
background: linear-gradient(to right, #1A2E4C, #2E4A6E);
color: white;
padding: 6rem 0;
text-align: center;
}
.hero-title {
font-size: 3.5rem;
font-weight: 700;
margin-bottom: 1rem;
}
.hero-subtitle {
font-size: 1.25rem;
font-weight: 400;
color: rgba(255, 255, 255, 0.8);
margin-bottom: 2rem;
}
/* Skills Section */
.section-title {
color: #1A2E4C;
font-weight: 700;
}
.skill-card {
border: 1px solid #e9ecef;
border-radius: 0.5rem;
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.skill-card:hover {
transform: translateY(-5px);
box-shadow: 0 12px 20px rgba(0,0,0,0.08);
}
.skill-card .card-body {
padding: 1.5rem;
}
.skill-card .card-title {
color: #1A2E4C;
margin-bottom: 0.75rem;
}
.skill-card .card-creator {
font-size: 0.9rem;
color: #6c757d;
margin-bottom: 1rem;
}
.skill-card .card-footer {
background-color: #f8f9fa;
border-top: 1px solid #e9ecef;
padding: 0.75rem 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.skill-price {
font-weight: 700;
font-size: 1.1rem;
color: #1A2E4C;
}
.btn-primary-outline {
border: 1px solid #1A2E4C;
color: #1A2E4C;
}
.btn-primary-outline:hover {
background-color: #1A2E4C;
color: white;
}
/* Footer */
footer {
background-color: #f8f9fa !important;
}