LA MORENITA RADIO

This commit is contained in:
Flatlogic Bot 2026-02-02 00:29:30 +00:00
parent 3d92f80fed
commit 570f7d228d
11 changed files with 427 additions and 173 deletions

View File

@ -1,3 +1,10 @@
from django.contrib import admin
from .models import RadioConfig
# Register your models here.
@admin.register(RadioConfig)
class RadioConfigAdmin(admin.ModelAdmin):
def has_add_permission(self, request):
# Limit to only one configuration object
if self.model.objects.count() >= 1:
return False
return super().has_add_permission(request)

View File

@ -0,0 +1,29 @@
# Generated by Django 5.2.7 on 2026-02-02 00:17
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RadioConfig',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(default='La Morenita Radio', max_length=255)),
('stream_url', models.URLField(help_text='Direct link to the audio stream')),
('whatsapp_number', models.CharField(default='+52 844 218 8814', max_length=20)),
('facebook_url', models.URLField(default='https://www.facebook.com/profile.php?id=61583511337947')),
('tiktok_url', models.URLField(default='https://www.tiktok.com/@chikipapiradio')),
],
options={
'verbose_name': 'Radio Configuration',
'verbose_name_plural': 'Radio Configuration',
},
),
]

View File

@ -1,3 +1,15 @@
from django.db import models
# Create your models here.
class RadioConfig(models.Model):
title = models.CharField(max_length=255, default="La Morenita Radio")
stream_url = models.URLField(help_text="Direct link to the audio stream")
whatsapp_number = models.CharField(max_length=20, default="+52 844 218 8814")
facebook_url = models.URLField(default="https://www.facebook.com/profile.php?id=61583511337947")
tiktok_url = models.URLField(default="https://www.tiktok.com/@chikipapiradio")
class Meta:
verbose_name = "Radio Configuration"
verbose_name_plural = "Radio Configuration"
def __str__(self):
return self.title

View File

@ -1,145 +1,80 @@
{% extends "base.html" %}
{% load static %}
{% block title %}{{ project_name }}{% endblock %}
{% block title %}{{ config.title }}{% 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>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
{% endblock %}
{% 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="radio-container">
<header>
<h1 class="brand-font" style="color: var(--primary-yellow); margin-bottom: 0;">{{ config.title }}</h1>
<p style="color: var(--primary-red); letter-spacing: 2px; font-weight: 600;">MÚSICA 24/7</p>
</header>
<div class="disc-container">
<div class="disc" id="radio-disc"></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>
{% endblock %}
<div class="controls">
<button id="play-btn" class="btn-play">
<i class="fas fa-play" id="play-icon"></i>
</button>
<p id="status-text" style="margin-top: 1rem; font-size: 0.9rem; opacity: 0.7;">Presiona Play para escuchar</p>
</div>
<div class="social-links">
<a href="https://wa.me/{{ config.whatsapp_number|cut:' '|cut:'+' }}" class="social-icon whatsapp" target="_blank" title="WhatsApp">
<i class="fab fa-whatsapp"></i>
</a>
<a href="{{ config.facebook_url }}" class="social-icon facebook" target="_blank" title="Facebook">
<i class="fab fa-facebook-f"></i>
</a>
<a href="{{ config.tiktok_url }}" class="social-icon tiktok" target="_blank" title="TikTok">
<i class="fab fa-tiktok"></i>
</a>
</div>
<audio id="radio-player">
<source src="{{ config.stream_url }}" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</div>
<a href="/admin/" class="admin-link">Admin Panel</a>
<script>
const player = document.getElementById('radio-player');
const playBtn = document.getElementById('play-btn');
const playIcon = document.getElementById('play-icon');
const disc = document.getElementById('radio-disc');
const statusText = document.getElementById('status-text');
let isPlaying = false;
playBtn.addEventListener('click', () => {
if (!isPlaying) {
player.play().then(() => {
isPlaying = true;
playIcon.classList.remove('fa-play');
playIcon.classList.add('fa-pause');
disc.classList.add('playing');
statusText.innerText = 'Transmitiendo en vivo...';
}).catch(error => {
console.error("Playback error:", error);
statusText.innerText = 'Error al cargar el stream.';
});
} else {
player.pause();
isPlaying = false;
playIcon.classList.remove('fa-pause');
playIcon.classList.add('fa-play');
disc.classList.remove('playing');
statusText.innerText = 'Presiona Play para escuchar';
}
});
</script>
{% endblock %}

View File

@ -1,25 +1,23 @@
import os
import platform
from django import get_version as django_version
from django.shortcuts import render
from django.utils import timezone
from .models import RadioConfig
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()
"""Render the landing screen for La Morenita Radio."""
config = RadioConfig.objects.first()
# Provide default data if not configured in admin yet
if not config:
config = {
"title": "La Morenita Radio",
"stream_url": "https://streaming.hostpannel.lat:8054/stream",
"whatsapp_number": "+52 844 218 8814",
"facebook_url": "https://www.facebook.com/profile.php?id=61583511337947",
"tiktok_url": "https://www.tiktok.com/@chikipapiradio",
}
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", ""),
"config": config,
"project_description": os.getenv("PROJECT_DESCRIPTION", "La Morenita Radio - Música 24/7"),
}
return render(request, "core/index.html", context)

View File

@ -1,4 +1,149 @@
/* Custom styles for the application */
body {
font-family: system-ui, -apple-system, sans-serif;
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Open+Sans:wght@400;600&display=swap');
:root {
--primary-black: #0a0a0a;
--primary-red: #ff0000;
--primary-yellow: #ffcc00;
--text-white: #ffffff;
--bg-gradient: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}
body {
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
background: var(--bg-gradient);
color: var(--text-white);
min-height: 100vh;
overflow-x: hidden;
}
h1, h2, h3, .brand-font {
font-family: 'Montserrat', sans-serif;
text-transform: uppercase;
font-weight: 700;
}
/* Radio Hub Layout */
.radio-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
text-align: center;
max-width: 600px;
margin: 0 auto;
}
/* Rotating Disc Animation */
.disc-container {
position: relative;
width: 250px;
height: 250px;
margin: 2rem 0;
}
.disc {
width: 100%;
height: 100%;
border-radius: 50%;
background: radial-gradient(circle, #333 10%, #111 20%, #000 70%);
border: 5px solid #222;
box-shadow: 0 0 30px rgba(0,0,0,0.5);
position: relative;
animation: rotate 10s linear infinite;
animation-play-state: paused;
}
.disc.playing {
animation-play-state: running;
}
.disc::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80px;
height: 80px;
background: var(--primary-red);
border-radius: 50%;
border: 4px solid var(--primary-yellow);
background-image: url('https://via.placeholder.com/80?text=La+Morenita'); /* Placeholder for Logo */
background-size: cover;
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* Player Controls */
.controls {
margin: 2rem 0;
}
.btn-play {
background: var(--primary-red);
border: none;
color: white;
width: 80px;
height: 80px;
border-radius: 50%;
font-size: 2rem;
cursor: pointer;
transition: transform 0.2s, background 0.3s;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}
.btn-play:hover {
transform: scale(1.1);
background: #cc0000;
}
/* Social Icons */
.social-links {
display: flex;
gap: 1.5rem;
margin-top: 2rem;
}
.social-icon {
width: 50px;
height: 50px;
border-radius: 50%;
background: rgba(255,255,255,0.1);
display: flex;
align-items: center;
justify-content: center;
color: var(--primary-yellow);
font-size: 1.5rem;
text-decoration: none;
transition: background 0.3s, color 0.3s, transform 0.2s;
border: 1px solid rgba(255, 204, 0, 0.3);
}
.social-icon:hover {
background: var(--primary-yellow);
color: var(--primary-black);
transform: translateY(-5px);
}
.whatsapp:hover { background: #25D366; border-color: #25D366; color: white; }
.facebook:hover { background: #1877F2; border-color: #1877F2; color: white; }
.tiktok:hover { background: #010101; border-color: #010101; color: white; }
/* Admin Link */
.admin-link {
position: fixed;
bottom: 1rem;
right: 1rem;
font-size: 0.8rem;
color: rgba(255,255,255,0.3);
text-decoration: none;
}

View File

@ -1,21 +1,149 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Open+Sans:wght@400;600&display=swap');
: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);
--primary-black: #0a0a0a;
--primary-red: #ff0000;
--primary-yellow: #ffcc00;
--text-white: #ffffff;
--bg-gradient: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}
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;
padding: 0;
font-family: 'Open Sans', sans-serif;
background: var(--bg-gradient);
color: var(--text-white);
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
overflow-x: hidden;
}
h1, h2, h3, .brand-font {
font-family: 'Montserrat', sans-serif;
text-transform: uppercase;
font-weight: 700;
}
/* Radio Hub Layout */
.radio-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
text-align: center;
max-width: 600px;
margin: 0 auto;
}
/* Rotating Disc Animation */
.disc-container {
position: relative;
width: 250px;
height: 250px;
margin: 2rem 0;
}
.disc {
width: 100%;
height: 100%;
border-radius: 50%;
background: radial-gradient(circle, #333 10%, #111 20%, #000 70%);
border: 5px solid #222;
box-shadow: 0 0 30px rgba(0,0,0,0.5);
position: relative;
animation: rotate 10s linear infinite;
animation-play-state: paused;
}
.disc.playing {
animation-play-state: running;
}
.disc::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80px;
height: 80px;
background: var(--primary-red);
border-radius: 50%;
border: 4px solid var(--primary-yellow);
background-image: url('https://via.placeholder.com/80?text=La+Morenita'); /* Placeholder for Logo */
background-size: cover;
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* Player Controls */
.controls {
margin: 2rem 0;
}
.btn-play {
background: var(--primary-red);
border: none;
color: white;
width: 80px;
height: 80px;
border-radius: 50%;
font-size: 2rem;
cursor: pointer;
transition: transform 0.2s, background 0.3s;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}
.btn-play:hover {
transform: scale(1.1);
background: #cc0000;
}
/* Social Icons */
.social-links {
display: flex;
gap: 1.5rem;
margin-top: 2rem;
}
.social-icon {
width: 50px;
height: 50px;
border-radius: 50%;
background: rgba(255,255,255,0.1);
display: flex;
align-items: center;
justify-content: center;
color: var(--primary-yellow);
font-size: 1.5rem;
text-decoration: none;
transition: background 0.3s, color 0.3s, transform 0.2s;
border: 1px solid rgba(255, 204, 0, 0.3);
}
.social-icon:hover {
background: var(--primary-yellow);
color: var(--primary-black);
transform: translateY(-5px);
}
.whatsapp:hover { background: #25D366; border-color: #25D366; color: white; }
.facebook:hover { background: #1877F2; border-color: #1877F2; color: white; }
.tiktok:hover { background: #010101; border-color: #010101; color: white; }
/* Admin Link */
.admin-link {
position: fixed;
bottom: 1rem;
right: 1rem;
font-size: 0.8rem;
color: rgba(255,255,255,0.3);
text-decoration: none;
}