trying to port web app starter from PHP
This commit is contained in:
@@ -0,0 +1,604 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
void marketing_default_features(DTree& features)
|
||||
{
|
||||
if(features.get_type_name() == "array" && features["0"]["title"].to_string() != "")
|
||||
return;
|
||||
DTree item;
|
||||
|
||||
item["icon"] = "⚡";
|
||||
item["title"] = "Lightning Fast";
|
||||
item["description"] = "Optimized for speed and performance with modern web technologies.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🎨";
|
||||
item["title"] = "Beautiful Design";
|
||||
item["description"] = "Carefully crafted components with attention to detail and user experience.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "📱";
|
||||
item["title"] = "Mobile First";
|
||||
item["description"] = "Fully responsive design that works perfectly on all devices.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🔧";
|
||||
item["title"] = "Easy to Use";
|
||||
item["description"] = "Simple and intuitive component system for rapid development.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🛡️";
|
||||
item["title"] = "Secure";
|
||||
item["description"] = "Built with security best practices and server-side rendering first.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🚀";
|
||||
item["title"] = "Scalable";
|
||||
item["description"] = "Architecture designed to grow with your application needs.";
|
||||
features.push(item);
|
||||
}
|
||||
|
||||
RENDER:HERO_SECTION(Request& context)
|
||||
{
|
||||
String title = first(context.call["title"].to_string(), "Welcome to the Present");
|
||||
String subtitle = first(context.call["subtitle"].to_string(), "Experience no-quite-modern web development with our cutting-edge framework");
|
||||
String cta_text = first(context.call["cta_text"].to_string(), "Get Started");
|
||||
String cta_link = first(context.call["cta_link"].to_string(), "#");
|
||||
|
||||
<>
|
||||
<div class="hero-section">
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title"><?= title ?></h1>
|
||||
<p class="hero-subtitle"><?= subtitle ?></p>
|
||||
<div class="hero-actions">
|
||||
<a href="<?= cta_link ?>" class="btn btn-large hero-cta"><?= cta_text ?></a>
|
||||
<a href="#features" class="btn btn-outline btn-large">Learn More</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-visual">
|
||||
<div class="floating-card">
|
||||
<div class="card-header"></div>
|
||||
<div class="card-content">
|
||||
<div class="line"></div>
|
||||
<div class="line short"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="floating-elements">
|
||||
<div class="element element-1"></div>
|
||||
<div class="element element-2"></div>
|
||||
<div class="element element-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.hero-section {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
align-items: center;
|
||||
min-height: 70vh;
|
||||
padding: 4rem 2rem;
|
||||
background: var(--bg-gradient);
|
||||
color: var(--text-primary);
|
||||
border-radius: var(--radius-xl);
|
||||
margin-bottom: 4rem;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.hero-section::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox=\"0 0 100 100\"><defs><pattern id=\"grain\" width=\"100\" height=\"100\" patternUnits=\"userSpaceOnUse\"><circle cx=\"25\" cy=\"25\" r=\"1\" fill=\"white\" opacity=\"0.1\"/><circle cx=\"75\" cy=\"75\" r=\"1\" fill=\"white\" opacity=\"0.1\"/><circle cx=\"50\" cy=\"10\" r=\"0.5\" fill=\"white\" opacity=\"0.1\"/><circle cx=\"10\" cy=\"90\" r=\"0.5\" fill=\"white\" opacity=\"0.1\"/></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(%23grain)\"/></svg>');
|
||||
}
|
||||
.hero-content { position: relative; z-index: 2; }
|
||||
.hero-title {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.1;
|
||||
background: none;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.hero-subtitle {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 2rem;
|
||||
opacity: 0.9;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.hero-cta {
|
||||
background: var(--surface);
|
||||
color: var(--primary);
|
||||
border: none;
|
||||
}
|
||||
.hero-visual {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 400px;
|
||||
}
|
||||
.floating-card {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
width: 280px;
|
||||
animation: float 6s ease-in-out infinite;
|
||||
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.card-header {
|
||||
height: 60px;
|
||||
background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
|
||||
border-radius: 8px;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.card-content .line {
|
||||
height: 12px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.card-content .line.short { width: 60%; }
|
||||
.floating-elements { position: absolute; width: 100%; height: 100%; }
|
||||
.element {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
.element-1 { width: 60px; height: 60px; top: 20%; left: 10%; animation: float 4s ease-in-out infinite; }
|
||||
.element-2 { width: 40px; height: 40px; top: 60%; right: 15%; animation: float 5s ease-in-out infinite reverse; }
|
||||
.element-3 { width: 80px; height: 80px; bottom: 20%; left: 20%; animation: float 7s ease-in-out infinite; }
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
||||
50% { transform: translateY(-20px) rotate(10deg); }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.hero-section { grid-template-columns: 1fr; text-align: center; padding: 3rem 1rem; gap: 2rem; }
|
||||
.hero-title { font-size: 2.5rem; }
|
||||
.hero-subtitle { font-size: 1.1rem; }
|
||||
.hero-visual { height: 300px; }
|
||||
.floating-card { width: 240px; padding: 1.5rem; }
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$.ready(() => {
|
||||
const heroTitle = document.querySelector('.hero-title');
|
||||
if (!heroTitle || heroTitle.dataset.typed === '1') return;
|
||||
heroTitle.dataset.typed = '1';
|
||||
const text = heroTitle.textContent;
|
||||
heroTitle.textContent = '';
|
||||
let i = 0;
|
||||
const typeWriter = () => {
|
||||
heroTitle.textContent += text.charAt(i);
|
||||
i += 1;
|
||||
if (i < text.length) setTimeout(typeWriter, 24);
|
||||
};
|
||||
typeWriter();
|
||||
});
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:FEATURES_GRID(Request& context)
|
||||
{
|
||||
DTree features = context.call["features"];
|
||||
marketing_default_features(features);
|
||||
|
||||
<>
|
||||
<div class="features-section" id="features">
|
||||
<div class="features-header">
|
||||
<h2>Why Choose Our Framework?</h2>
|
||||
<p>Discover the powerful features that make development a breeze</p>
|
||||
</div>
|
||||
<div class="features-grid">
|
||||
<? features.each([&](DTree feature, String key) {
|
||||
?><div class="feature-card">
|
||||
<div class="feature-icon"><?: feature["icon"].to_string() ?></div>
|
||||
<h3 class="feature-title"><?= feature["title"].to_string() ?></h3>
|
||||
<p class="feature-description"><?= feature["description"].to_string() ?></p>
|
||||
<div class="feature-overlay"></div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.features-section { padding: 4rem 0; background: var(--bg-color); }
|
||||
.features-header { text-align: center; margin-bottom: 4rem; }
|
||||
.features-header h2 {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 1rem;
|
||||
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.features-header p { font-size: 1.25rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
|
||||
.features-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 2rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
.feature-card {
|
||||
background: var(--surface);
|
||||
padding: 2.5rem 2rem;
|
||||
border-radius: var(--radius-xl);
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border);
|
||||
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
}
|
||||
.feature-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-xl); border-color: var(--primary); }
|
||||
.feature-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--primary), var(--secondary));
|
||||
transform: scaleX(0);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.feature-card:hover::before { transform: scaleX(1); }
|
||||
.feature-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1.5rem;
|
||||
display: inline-block;
|
||||
padding: 1rem;
|
||||
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
||||
border-radius: 50%;
|
||||
color: white;
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
.feature-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
|
||||
.feature-description { color: var(--text-secondary); line-height: 1.6; }
|
||||
.feature-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.feature-card:hover .feature-overlay { opacity: 0.05; }
|
||||
@media (max-width: 768px) {
|
||||
.features-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 0 0.5rem; }
|
||||
.features-header h2 { font-size: 2rem; }
|
||||
.feature-card { padding: 2rem 1.5rem; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:STATS_SECTION(Request& context)
|
||||
{
|
||||
DTree stats = context.call["stats"];
|
||||
if(stats.get_type_name() != "array" || stats["0"]["label"].to_string() == "")
|
||||
{
|
||||
DTree item;
|
||||
item["number"] = "99.9%"; item["label"] = "Uptime"; stats.push(item); item.clear();
|
||||
item["number"] = "500ms"; item["label"] = "Average Response"; stats.push(item); item.clear();
|
||||
item["number"] = "50K+"; item["label"] = "Active Users"; stats.push(item); item.clear();
|
||||
item["number"] = "24/7"; item["label"] = "Support"; stats.push(item);
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="stats-section">
|
||||
<div class="stats-container">
|
||||
<div class="stats-header">
|
||||
<h2>Trusted by Developers Worldwide</h2>
|
||||
<p>Join thousands of developers who have chosen our framework</p>
|
||||
</div>
|
||||
<div class="stats-grid">
|
||||
<? stats.each([&](DTree stat, String key) {
|
||||
?><div class="stat-item">
|
||||
<div class="stat-number"><?= stat["number"].to_string() ?></div>
|
||||
<div class="stat-label"><?= stat["label"].to_string() ?></div>
|
||||
<div class="stat-bar"><div class="stat-fill"></div></div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.stats-section {
|
||||
background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
|
||||
color: var(--text-primary);
|
||||
padding: 4rem 0;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid var(--border);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.stats-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; position: relative; z-index: 2; }
|
||||
.stats-header { text-align: center; margin-bottom: 4rem; }
|
||||
.stats-header h2 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 700; }
|
||||
.stats-header p { font-size: 1.25rem; opacity: 0.8; }
|
||||
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; }
|
||||
.stat-item {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
background: var(--glass-bg);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: var(--radius-xl);
|
||||
}
|
||||
.stat-number {
|
||||
font-size: 3rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 0.5rem;
|
||||
background: linear-gradient(135deg, var(--primary), var(--accent));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.stat-label { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1rem; font-weight: 500; }
|
||||
.stat-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
|
||||
.stat-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); width: 100%; }
|
||||
@media (max-width: 768px) {
|
||||
.stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
|
||||
.stats-header h2 { font-size: 2rem; }
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.stats-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:BRANDS_SHOWCASE(Request& context)
|
||||
{
|
||||
DTree logos = context.call["logos"];
|
||||
if(logos.get_type_name() != "array" || logos["0"]["name"].to_string() == "")
|
||||
{
|
||||
DTree item;
|
||||
for(s32 i = 1; i <= 6; i++)
|
||||
{
|
||||
item["name"] = "Brand " + std::to_string(i);
|
||||
item["url"] = "img/cat0" + std::to_string(i) + ".jpg";
|
||||
logos.push(item);
|
||||
item.clear();
|
||||
}
|
||||
}
|
||||
String title = first(context.call["title"].to_string(), "Trusted by Leading Companies");
|
||||
|
||||
<>
|
||||
<div class="brands-section">
|
||||
<div class="brands-container">
|
||||
<h3 class="brands-title"><?= title ?></h3>
|
||||
<div class="brands-grid">
|
||||
<? logos.each([&](DTree logo, String key) {
|
||||
?><div class="brand-item">
|
||||
<img src="<?= logo["url"].to_string() ?>" alt="<?= logo["name"].to_string() ?>" />
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.brands-section { padding: 3rem 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
|
||||
.brands-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; text-align: center; }
|
||||
.brands-title { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 2rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.brands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem; align-items: center; }
|
||||
.brand-item { display: flex; align-items: center; justify-content: center; padding: 1rem; border-radius: var(--radius); transition: all 0.3s ease; }
|
||||
.brand-item:hover { transform: scale(1.05); background: var(--surface-hover); }
|
||||
.brand-item img { max-width: 100%; height: auto; opacity: 0.6; transition: opacity 0.3s ease; filter: grayscale(100%); }
|
||||
.brand-item:hover img { opacity: 1; filter: grayscale(0%); }
|
||||
@media (max-width: 768px) {
|
||||
.brands-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
|
||||
.brands-section { padding: 2rem 0; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:TESTIMONIALS(Request& context)
|
||||
{
|
||||
DTree testimonials = context.call["testimonials"];
|
||||
if(testimonials.get_type_name() != "array" || testimonials["0"]["name"].to_string() == "")
|
||||
{
|
||||
DTree item;
|
||||
item["name"] = "Sarah Johnson"; item["role"] = "Senior Developer at TechCorp"; item["avatar"] = "img/cat01.jpg"; item["content"] = "This framework has revolutionized our development process."; item["rating"] = "5"; testimonials.push(item); item.clear();
|
||||
item["name"] = "Michael Chen"; item["role"] = "CTO at StartupX"; item["avatar"] = "img/cat02.jpg"; item["content"] = "We switched from our legacy system and saw immediate improvements."; item["rating"] = "5"; testimonials.push(item); item.clear();
|
||||
item["name"] = "Emily Rodriguez"; item["role"] = "Full Stack Developer"; item["avatar"] = "img/cat03.jpg"; item["content"] = "The documentation is excellent and the learning curve is gentle."; item["rating"] = "5"; testimonials.push(item);
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="testimonials-section">
|
||||
<div class="testimonials-container">
|
||||
<div class="testimonials-header">
|
||||
<h2>What Developers Say</h2>
|
||||
<p>Don't just take our word for it - hear from the community</p>
|
||||
</div>
|
||||
<div class="testimonials-grid">
|
||||
<? testimonials.each([&](DTree testimonial, String key) {
|
||||
?><div class="testimonial-card">
|
||||
<div class="testimonial-content">
|
||||
<div class="quote-icon">"</div>
|
||||
<p><?= testimonial["content"].to_string() ?></p>
|
||||
<div class="stars"><? for(s32 i = 0; i < int_val(first(testimonial["rating"].to_string(), "5")); i++) { ?><span class="star">★</span><? } ?></div>
|
||||
</div>
|
||||
<div class="testimonial-author">
|
||||
<img src="<?= testimonial["avatar"].to_string() ?>" alt="<?= testimonial["name"].to_string() ?>" class="avatar">
|
||||
<div class="author-info">
|
||||
<div class="author-name"><?= testimonial["name"].to_string() ?></div>
|
||||
<div class="author-role"><?= testimonial["role"].to_string() ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.testimonials-section { padding: 4rem 0; background: var(--bg-color); }
|
||||
.testimonials-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
|
||||
.testimonials-header { text-align: center; margin-bottom: 4rem; }
|
||||
.testimonials-header h2 { font-size: 2.5rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
|
||||
.testimonials-header p { font-size: 1.25rem; color: var(--text-secondary); }
|
||||
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
|
||||
.testimonial-card { background: var(--surface); border-radius: var(--radius-xl); padding: 2.5rem 2rem; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
|
||||
.quote-icon { font-size: 4rem; color: var(--primary); opacity: 0.3; line-height: 1; margin-bottom: 1rem; font-family: serif; }
|
||||
.testimonial-content p { font-size: 1.1rem; line-height: 1.7; color: var(--text-primary); margin-bottom: 1.5rem; }
|
||||
.stars { display: flex; gap: 0.25rem; }
|
||||
.star { color: #fbbf24; font-size: 1.25rem; }
|
||||
.testimonial-author { display: flex; align-items: center; gap: 1rem; }
|
||||
.avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }
|
||||
.author-name { font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
|
||||
.author-role { color: var(--text-secondary); font-size: 0.9rem; }
|
||||
@media (max-width: 768px) {
|
||||
.testimonials-grid { grid-template-columns: 1fr; gap: 1.5rem; }
|
||||
.testimonial-card { padding: 2rem 1.5rem; }
|
||||
.testimonials-header h2 { font-size: 2rem; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:PRICING_TABLE(Request& context)
|
||||
{
|
||||
DTree plans = context.call["plans"];
|
||||
if(plans.get_type_name() != "array" || plans["0"]["name"].to_string() == "")
|
||||
{
|
||||
DTree plan;
|
||||
DTree feature;
|
||||
|
||||
plan["name"] = "Starter"; plan["price"] = "Free"; plan["period"] = ""; plan["description"] = "Perfect for small projects and learning"; plan["cta"] = "Start Free"; feature = "Up to 3 projects"; plan["features"].push(feature); feature = "Community support"; plan["features"].push(feature); feature = "Basic components"; plan["features"].push(feature); plans.push(plan); plan.clear();
|
||||
plan["name"] = "Pro"; plan["price"] = "$24"; plan["period"] = "/mo"; plan["description"] = "For serious products and teams"; plan["cta"] = "Choose Pro"; plan["popular"].set_bool(true); feature = "Unlimited projects"; plan["features"].push(feature); feature = "Priority support"; plan["features"].push(feature); feature = "Advanced components"; plan["features"].push(feature); plans.push(plan); plan.clear();
|
||||
plan["name"] = "Enterprise"; plan["price"] = "$99"; plan["period"] = "/mo"; plan["description"] = "For larger teams and custom deployments"; plan["cta"] = "Contact Sales"; feature = "Custom integrations"; plan["features"].push(feature); feature = "Dedicated support"; plan["features"].push(feature); feature = "Architecture help"; plan["features"].push(feature); plans.push(plan);
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="pricing-section">
|
||||
<div class="pricing-container">
|
||||
<div class="pricing-header">
|
||||
<h2>Simple Pricing</h2>
|
||||
<p>Choose the plan that fits your product stage.</p>
|
||||
</div>
|
||||
<div class="pricing-grid">
|
||||
<? plans.each([&](DTree plan, String key) {
|
||||
bool popular = plan["popular"].to_string() != "";
|
||||
?><div class="pricing-card<?= popular ? " popular" : "" ?>">
|
||||
<? if(popular) { ?><div class="popular-badge">Most Popular</div><? } ?>
|
||||
<div class="plan-header">
|
||||
<div class="plan-name"><?= plan["name"].to_string() ?></div>
|
||||
<div class="plan-price">
|
||||
<span class="price"><?= plan["price"].to_string() ?></span>
|
||||
<span class="period"><?= plan["period"].to_string() ?></span>
|
||||
</div>
|
||||
<p class="plan-description"><?= plan["description"].to_string() ?></p>
|
||||
</div>
|
||||
<ul class="plan-features">
|
||||
<? plan["features"].each([&](DTree feature, String feature_key) { ?><li><?= feature.to_string() ?></li><? }); ?>
|
||||
</ul>
|
||||
<div class="plan-footer">
|
||||
<button class="btn <?= popular ? "btn-primary" : "btn-outline" ?> btn-large plan-cta"><?= first(plan["cta"].to_string(), "Choose Plan") ?></button>
|
||||
</div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
<div class="pricing-footer">
|
||||
<p>All plans include a 30-day money-back guarantee. No setup fees.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.pricing-section { padding: 5rem 0; background: var(--bg-color); }
|
||||
.pricing-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
|
||||
.pricing-header { text-align: center; margin-bottom: 4rem; }
|
||||
.pricing-header h2 { font-size: 2.5rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
|
||||
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
|
||||
.pricing-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-xl); padding: 2.5rem 2rem; position: relative; }
|
||||
.pricing-card.popular { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: scale(1.05); }
|
||||
.popular-badge { position: absolute; top: -1rem; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 0.5rem 1.5rem; border-radius: 50px; font-size: 0.875rem; font-weight: 600; }
|
||||
.plan-header { text-align: center; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
|
||||
.plan-name { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
|
||||
.price { font-size: 3rem; font-weight: 800; color: var(--primary); }
|
||||
.period { font-size: 1.125rem; color: var(--text-secondary); margin-left: 0.25rem; }
|
||||
.plan-description { color: var(--text-secondary); line-height: 1.6; }
|
||||
.plan-features { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.75rem; }
|
||||
.plan-features li { color: var(--text-primary); }
|
||||
.plan-footer { text-align: center; }
|
||||
.pricing-footer { text-align: center; color: var(--text-secondary); }
|
||||
@media (max-width: 768px) {
|
||||
.pricing-grid { grid-template-columns: 1fr; }
|
||||
.pricing-card.popular { transform: none; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:CTA_SECTION(Request& context)
|
||||
{
|
||||
String title = first(context.call["title"].to_string(), "Ready to Get Started?");
|
||||
String subtitle = first(context.call["subtitle"].to_string(), "Join thousands of developers building amazing applications with our framework.");
|
||||
String cta_text = first(context.call["cta_text"].to_string(), "Start Building Now");
|
||||
String cta_link = first(context.call["cta_link"].to_string(), "#");
|
||||
String secondary_text = first(context.call["secondary_text"].to_string(), "View Documentation");
|
||||
String secondary_link = first(context.call["secondary_link"].to_string(), "#");
|
||||
|
||||
<>
|
||||
<div class="cta-section">
|
||||
<div class="cta-container">
|
||||
<div class="cta-content">
|
||||
<h2 class="cta-title"><?= title ?></h2>
|
||||
<p class="cta-subtitle"><?= subtitle ?></p>
|
||||
<div class="cta-actions">
|
||||
<a href="<?= cta_link ?>" class="btn btn-large cta-primary"><?= cta_text ?></a>
|
||||
<a href="<?= secondary_link ?>" class="btn btn-outline btn-large cta-secondary"><?= secondary_text ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cta-visual">
|
||||
<div class="floating-shapes">
|
||||
<div class="shape shape-1"></div>
|
||||
<div class="shape shape-2"></div>
|
||||
<div class="shape shape-3"></div>
|
||||
<div class="shape shape-4"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.cta-section { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white; padding: 5rem 0; position: relative; overflow: hidden; }
|
||||
.cta-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: grid; grid-template-columns: 2fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 2; }
|
||||
.cta-title { font-size: 3rem; font-weight: 800; margin-bottom: 1.5rem; line-height: 1.1; }
|
||||
.cta-subtitle { font-size: 1.25rem; margin-bottom: 2.5rem; opacity: 0.9; line-height: 1.6; }
|
||||
.cta-actions { display: flex; gap: 1.5rem; flex-wrap: wrap; }
|
||||
.cta-primary { background: white; color: var(--primary); border: 2px solid white; }
|
||||
.cta-secondary { border-color: rgba(255, 255, 255, 0.5); color: white; }
|
||||
.cta-visual { position: relative; height: 300px; display: flex; align-items: center; justify-content: center; }
|
||||
.floating-shapes { position: relative; width: 200px; height: 200px; }
|
||||
.shape { position: absolute; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.2); }
|
||||
.shape-1 { width: 80px; height: 80px; border-radius: 20px; top: 0; left: 0; }
|
||||
.shape-2 { width: 60px; height: 60px; border-radius: 50%; top: 20px; right: 0; }
|
||||
.shape-3 { width: 100px; height: 40px; border-radius: 20px; bottom: 40px; left: 20px; }
|
||||
.shape-4 { width: 50px; height: 50px; border-radius: 10px; bottom: 0; right: 30px; transform: rotate(45deg); }
|
||||
@media (max-width: 968px) {
|
||||
.cta-container { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
|
||||
.cta-title { font-size: 2.5rem; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.cta-section { padding: 3rem 0; }
|
||||
.cta-title { font-size: 2rem; }
|
||||
.cta-subtitle { font-size: 1.1rem; }
|
||||
.cta-actions { justify-content: center; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
String current_theme = starter_theme_value("key", context);
|
||||
String current_label = first(starter_theme_value("label", context), current_theme);
|
||||
String route_path = context.var["starter"]["route"]["l_path"].to_string();
|
||||
|
||||
<>
|
||||
<div id="theme-switcher" style="position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 9999; font-family: inherit;">
|
||||
<style>
|
||||
#theme-switcher .theme-launcher {
|
||||
min-width: 56px;
|
||||
height: 56px;
|
||||
padding: 0 1rem;
|
||||
border-radius: 999px;
|
||||
background: var(--surface, #fff);
|
||||
border: 1px solid var(--border, rgba(0,0,0,0.15));
|
||||
box-shadow: var(--shadow-lg, 0 14px 32px rgba(0,0,0,0.18));
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.65rem;
|
||||
color: var(--text-primary, #111827);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
font: inherit;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
#theme-switcher .theme-launcher:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--shadow-xl, 0 22px 42px rgba(0,0,0,0.22));
|
||||
border-color: var(--primary, #2563eb);
|
||||
background: var(--surface-elevated, var(--surface, #fff));
|
||||
}
|
||||
#theme-switcher .theme-launcher-label {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#theme-switcher .theme-menu {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 68px;
|
||||
width: min(280px, calc(100vw - 2rem));
|
||||
padding: 0.6rem;
|
||||
border-radius: 14px;
|
||||
border: 1px solid var(--border, rgba(0,0,0,0.15));
|
||||
background: color-mix(in srgb, var(--surface, #fff) 92%, transparent 8%);
|
||||
box-shadow: var(--shadow-xl, 0 22px 42px rgba(0,0,0,0.22));
|
||||
}
|
||||
#theme-switcher .theme-menu[hidden] {
|
||||
display: none;
|
||||
}
|
||||
#theme-switcher .theme-menu-title {
|
||||
margin: 0 0 0.45rem;
|
||||
padding: 0.1rem 0.25rem 0.35rem;
|
||||
color: var(--text-secondary, #6b7280);
|
||||
font-size: 0.74rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
#theme-switcher .theme-menu-list {
|
||||
display: grid;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
#theme-switcher .theme-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
padding: 0.7rem 0.8rem;
|
||||
border-radius: 10px;
|
||||
border: 1px solid transparent;
|
||||
color: var(--text-primary, #111827);
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
#theme-switcher .theme-option:hover {
|
||||
background: color-mix(in srgb, var(--primary, #2563eb) 10%, transparent 90%);
|
||||
border-color: color-mix(in srgb, var(--primary, #2563eb) 22%, transparent 78%);
|
||||
text-decoration: none;
|
||||
}
|
||||
#theme-switcher .theme-option.is-active {
|
||||
background: color-mix(in srgb, var(--primary, #2563eb) 16%, transparent 84%);
|
||||
border-color: color-mix(in srgb, var(--primary, #2563eb) 28%, transparent 72%);
|
||||
}
|
||||
#theme-switcher .theme-option small {
|
||||
color: var(--text-secondary, #6b7280);
|
||||
font-size: 0.76rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
@media (min-width: 860px) {
|
||||
#theme-switcher .theme-launcher-label {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<button id="theme-toggle" class="theme-launcher" aria-haspopup="true" aria-expanded="false" aria-label="Switch theme" title="Switch Theme" type="button">
|
||||
<i class="fas fa-palette" aria-hidden="true"></i>
|
||||
<span class="theme-launcher-label"><?= current_label ?></span>
|
||||
</button>
|
||||
<div id="theme-menu" class="theme-menu" hidden>
|
||||
<div class="theme-menu-title">Available Themes</div>
|
||||
<div class="theme-menu-list">
|
||||
<? starter_cfg("theme/options", context).each([&](DTree theme_info, String theme_key) {
|
||||
StringMap params;
|
||||
params["theme"] = theme_key;
|
||||
String href = starter_link(route_path == "index" ? "" : route_path, params, context);
|
||||
?><a class="theme-option<?= theme_key == current_theme ? " is-active" : "" ?>" href="<?= href ?>">
|
||||
<span><?= theme_info["label"].to_string() ?></span>
|
||||
<? if(theme_key == current_theme) { ?><small>Active</small><? } ?>
|
||||
</a><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
const themeToggle = document.getElementById('theme-toggle');
|
||||
const themeMenu = document.getElementById('theme-menu');
|
||||
|
||||
if (!themeToggle || !themeMenu) return;
|
||||
|
||||
themeToggle.addEventListener('click', function() {
|
||||
const isOpen = !themeMenu.hasAttribute('hidden');
|
||||
themeMenu.toggleAttribute('hidden', isOpen);
|
||||
themeToggle.setAttribute('aria-expanded', isOpen ? 'false' : 'true');
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(event) {
|
||||
if (!themeMenu.hasAttribute('hidden') && !document.getElementById('theme-switcher').contains(event.target)) {
|
||||
themeMenu.setAttribute('hidden', 'hidden');
|
||||
themeToggle.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.key === 'Escape' && !themeMenu.hasAttribute('hidden')) {
|
||||
themeMenu.setAttribute('hidden', 'hidden');
|
||||
themeToggle.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
Reference in New Issue
Block a user