php short
This commit is contained in:
parent
95a8de862b
commit
60e9259c7a
109
assets/css/custom.css
Normal file
109
assets/css/custom.css
Normal file
@ -0,0 +1,109 @@
|
||||
|
||||
/* General Body Styles */
|
||||
body {
|
||||
background-color: #F5F5F7;
|
||||
color: #1D1D1F;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: 'Georgia', serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.display-4 {
|
||||
font-size: 3.5rem;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn-primary {
|
||||
background-image: linear-gradient(45deg, #5E5DF0, #8E8DFF);
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 1rem 2rem;
|
||||
border-radius: 0.75rem;
|
||||
font-weight: 600;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 20px rgba(94, 93, 240, 0.4);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background-color: #e9ecef;
|
||||
border-color: #e9ecef;
|
||||
color: #1D1D1F;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.form-control-lg {
|
||||
border-radius: 0.75rem;
|
||||
padding: 1rem 1.5rem;
|
||||
border: 1px solid #E5E5E7;
|
||||
}
|
||||
.form-control-lg:focus {
|
||||
border-color: #5E5DF0;
|
||||
box-shadow: 0 0 0 4px rgba(94, 93, 240, 0.1);
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
.hero {
|
||||
padding: 6rem 0;
|
||||
background-color: #FFFFFF;
|
||||
border-bottom: 1px solid #E5E5E7;
|
||||
}
|
||||
|
||||
/* Features Section */
|
||||
.features {
|
||||
padding: 5rem 0;
|
||||
}
|
||||
.feature-card {
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 0.75rem;
|
||||
padding: 2rem;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
border: 1px solid #E5E5E7;
|
||||
height: 100%;
|
||||
}
|
||||
.feature-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
.feature-card img {
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
/* Result Display */
|
||||
#result {
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 0.75rem;
|
||||
padding: 1.5rem;
|
||||
margin-top: 2rem;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
|
||||
border: 1px solid #E5E5E7;
|
||||
display: none; /* Hidden by default */
|
||||
}
|
||||
#result p {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
#short-url {
|
||||
font-weight: 600;
|
||||
color: #5E5DF0;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
padding: 3rem 0;
|
||||
font-size: 0.9rem;
|
||||
color: #6E6E73;
|
||||
}
|
||||
50
assets/js/main.js
Normal file
50
assets/js/main.js
Normal file
@ -0,0 +1,50 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const shortenForm = document.getElementById('shortenForm');
|
||||
const urlInput = document.getElementById('urlInput');
|
||||
const resultDiv = document.getElementById('result');
|
||||
const shortUrlSpan = document.getElementById('short-url');
|
||||
const copyBtn = document.getElementById('copyBtn');
|
||||
|
||||
shortenForm.addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const longUrl = urlInput.value.trim();
|
||||
|
||||
// Simple URL validation
|
||||
if (!isValidHttpUrl(longUrl)) {
|
||||
alert('Please enter a valid URL (e.g., https://example.com)');
|
||||
urlInput.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
// --- Dummy Shortener Logic ---
|
||||
// In a real app, this would be an API call.
|
||||
const randomString = Math.random().toString(36).substring(2, 8);
|
||||
const shortUrl = `yourdomain.com/${randomString}`;
|
||||
// --- End Dummy Logic ---
|
||||
|
||||
shortUrlSpan.textContent = shortUrl;
|
||||
resultDiv.style.display = 'block';
|
||||
});
|
||||
|
||||
copyBtn.addEventListener('click', function() {
|
||||
navigator.clipboard.writeText(shortUrlSpan.textContent).then(() => {
|
||||
copyBtn.textContent = 'Copied!';
|
||||
setTimeout(() => {
|
||||
copyBtn.textContent = 'Copy';
|
||||
}, 2000);
|
||||
}).catch(err => {
|
||||
console.error('Failed to copy: ', err);
|
||||
});
|
||||
});
|
||||
|
||||
function isValidHttpUrl(string) {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(string);
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
return url.protocol === "http:" || url.protocol === "https:";
|
||||
}
|
||||
});
|
||||
295
index.php
295
index.php
@ -1,150 +1,155 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php 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);
|
||||
}
|
||||
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;
|
||||
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>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- SEO & Meta Tags -->
|
||||
<title>Create a URL Shortener SaaS</title>
|
||||
<meta name="description" content="Generate beautiful bio profiles, share a single link and monitor traffic. Create custom QR codes and shorten URLs with advanced analytics.">
|
||||
<meta name="keywords" content="url shortener, link in bio, qr code generator, saas, link management, custom domains, analytics, bio profiles, digital marketing, social media links">
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="Create a URL Shortener SaaS">
|
||||
<meta property="og:description" content="Generate beautiful bio profiles, share a single link and monitor traffic. Create custom QR codes and shorten URLs with advanced analytics.">
|
||||
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? 'https://picsum.photos/seed/og/1200/630'); ?>">
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image">
|
||||
<meta property="twitter:title" content="Create a URL Shortener SaaS">
|
||||
<meta property="twitter:description" content="Generate beautiful bio profiles, share a single link and monitor traffic. Create custom QR codes and shorten URLs with advanced analytics.">
|
||||
<meta property="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? 'https://picsum.photos/seed/og/1200/630'); ?>">
|
||||
|
||||
<!-- Stylesheets -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
|
||||
<style>
|
||||
.hero {
|
||||
background-image: url('https://picsum.photos/seed/hero/1600/900');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
color: white;
|
||||
}
|
||||
.hero-overlay {
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
padding: 6rem 0;
|
||||
}
|
||||
.hero h1, .hero p {
|
||||
text-shadow: 0 2px 4px rgba(0,0,0,0.5);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
|
||||
<header class="py-3 mb-4 border-bottom bg-white">
|
||||
<div class="container d-flex flex-wrap justify-content-center">
|
||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
|
||||
<span class="fs-4 fw-bold">LinkHub</span>
|
||||
</a>
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item"><a href="#" class="nav-link active" aria-current="page">Home</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link text-dark">Features</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link text-dark">Pricing</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link text-dark">Login</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="hero text-center">
|
||||
<div class="hero-overlay">
|
||||
<div class="container">
|
||||
<h1 class="display-4 fw-bold">One Link to Rule Them All</h1>
|
||||
<p class="lead col-lg-8 mx-auto">Create short links, beautiful bio pages, and scannable QR codes. All in one platform designed to grow your brand.</p>
|
||||
<div class="col-lg-8 mx-auto mt-5">
|
||||
<form id="shortenForm" class="row g-2 align-items-center">
|
||||
<div class="col">
|
||||
<label for="urlInput" class="visually-hidden">URL to shorten</label>
|
||||
<input type="url" class="form-control form-control-lg" id="urlInput" placeholder="Enter your long URL here..." required>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary btn-lg">Shorten</button>
|
||||
</div>
|
||||
</form>
|
||||
<div id="result" class="mt-4 text-start">
|
||||
<p class="mb-2"><strong>Your short link is ready!</strong></p>
|
||||
<div class="d-flex justify-content-between align-items-center bg-light p-3 rounded">
|
||||
<span id="short-url" class="text-primary fw-bold"></span>
|
||||
<button id="copyBtn" class="btn btn-sm btn-secondary">Copy</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="features text-center">
|
||||
<div class="container">
|
||||
<h2 class="mb-5">A Powerful Suite of Tools</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="feature-card">
|
||||
<img src="https://picsum.photos/seed/bio/400/300" class="img-fluid mb-3" alt="Illustration of a mobile phone displaying a personal bio link profile.">
|
||||
<h3 class="h4">Bio Link Pages</h3>
|
||||
<p>Create a stunning "link in bio" page that directs your audience to all your important content with a single URL.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="feature-card">
|
||||
<img src="https://picsum.photos/seed/qr/400/300" class="img-fluid mb-3" alt="Stylized QR code with a logo in the center.">
|
||||
<h3 class="h4">Custom QR Codes</h3>
|
||||
<p>Generate unique QR codes with custom colors, shapes, and your own logo to bridge the physical and digital worlds.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="feature-card">
|
||||
<img src="https://picsum.photos/seed/stats/400/300" class="img-fluid mb-3" alt="Dashboard showing charts and graphs for analytics.">
|
||||
<h3 class="h4">Trackable Analytics</h3>
|
||||
<p>Monitor clicks, scans, and traffic with a powerful analytics dashboard to understand your audience better.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<span class="fs-5 fw-bold">LinkHub</span>
|
||||
<small class="d-block mb-3 text-muted">© 2025</small>
|
||||
</div>
|
||||
<div class="col-6 col-md">
|
||||
<h5>Features</h5>
|
||||
<ul class="list-unstyled text-small">
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Link Shortening</a></li>
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Bio Pages</a></li>
|
||||
<li><a class="link-secondary text-decoration-none" href="#">QR Codes</a></li>
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Analytics</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6 col-md">
|
||||
<h5>Resources</h5>
|
||||
<ul class="list-unstyled text-small">
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Blog</a></li>
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Help Center</a></li>
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Privacy Policy</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6 col-md">
|
||||
<h5>About</h5>
|
||||
<ul class="list-unstyled text-small">
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Team</a></li>
|
||||
<li><a class="link-secondary text-decoration-none" href="#">Contact Us</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user