Skip to content

Commit 984c6b5

Browse files
committed
chore: add welcome page for serving framework
1 parent ec93b59 commit 984c6b5

9 files changed

Lines changed: 1128 additions & 121 deletions

File tree

app/routes/web.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,5 @@
22

33
use app\core\{Router};
44

5+
Router::get('/', 'WelcomeController', 'index');
56

6-
Router::get('/', 'HomeController', 'index');
7-
// Home routes
8-
Router::get('/home', 'HomeController', 'index');
9-
Router::get('/home/create', 'HomeController', 'create');
10-
Router::post('/home/store', 'HomeController', 'store');
11-
Router::get('/home/show', 'HomeController', 'show');
12-
Router::get('/home/edit', 'HomeController', 'edit');
13-
Router::post('/home/update', 'HomeController', 'update');
14-
Router::post('/home/destroy', 'HomeController', 'destroy');

app/shared/layouts/welcome.php

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title><?= htmlspecialchars($title ?? 'WarvilPHP Framework') ?></title>
7+
8+
<!-- Meta -->
9+
<meta name="description" content="A lightweight PHP framework inspired by Laravel">
10+
<meta name="author" content="WardVisual">
11+
12+
<!-- Tailwind CSS from CDN -->
13+
<script src="https://cdn.tailwindcss.com"></script>
14+
15+
<!-- Fonts -->
16+
<link rel="preconnect" href="https://fonts.googleapis.com">
17+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
18+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
19+
20+
<style>
21+
/* Base styles */
22+
body {
23+
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
24+
}
25+
26+
/* Pulse animation for the logo */
27+
@keyframes pulse {
28+
0%, 100% {
29+
opacity: 1;
30+
}
31+
50% {
32+
opacity: 0.8;
33+
}
34+
}
35+
.pulse-animation {
36+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
37+
}
38+
39+
/* Custom scrollbar */
40+
::-webkit-scrollbar {
41+
width: 8px;
42+
height: 8px;
43+
}
44+
45+
::-webkit-scrollbar-track {
46+
background: #1a1a1a;
47+
}
48+
49+
::-webkit-scrollbar-thumb {
50+
background: #4f46e5;
51+
border-radius: 4px;
52+
}
53+
54+
::-webkit-scrollbar-thumb:hover {
55+
background: #6366f1;
56+
}
57+
58+
/* Code block styling */
59+
pre {
60+
border-radius: 0.375rem;
61+
padding: 1rem;
62+
overflow-x: auto;
63+
}
64+
</style>
65+
</head>
66+
<body class="bg-gray-900 text-white antialiased">
67+
<!-- Page Content -->
68+
<?= $this->content ?? '' ?>
69+
70+
<!-- Optional JavaScript -->
71+
<script>
72+
// Add any JavaScript needed for the welcome page
73+
document.addEventListener('DOMContentLoaded', function() {
74+
console.log('WarvilPHP - Welcome!');
75+
76+
// Add subtle animation to feature boxes on hover
77+
const featureBoxes = document.querySelectorAll('.bg-gray-800');
78+
featureBoxes.forEach(box => {
79+
box.addEventListener('mouseenter', () => {
80+
box.classList.add('transform', 'scale-105', 'transition-all');
81+
});
82+
box.addEventListener('mouseleave', () => {
83+
box.classList.remove('transform', 'scale-105');
84+
});
85+
});
86+
});
87+
</script>
88+
</body>
89+
</html>

app/views/welcome/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* Welcome page custom styles */
2+
body {
3+
margin: 0;
4+
padding: 0;
5+
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
6+
}

app/views/welcome/index.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!-- <div class="min-h-screen flex items-center justify-center bg-cover bg-center bg-no-repeat" style="background-image: url('/public/assets/warvilphp.jpg');"> -->
2+
<div class="min-h-screen bg-gradient-to-br from-gray-900 via-purple-900 to-gray-900 flex items-center justify-center">
3+
<div class="mt-[4em] w-full max-w-6xl bg-gray-900 bg-opacity-80 rounded-xl shadow-2xl overflow-hidden">
4+
<div class="p-8 md:p-12">
5+
<!-- Header -->
6+
<div class="text-center mb-12">
7+
<h1 class="text-purple-400 text-6xl md:text-7xl lg:text-8xl font-bold mb-4">WarvilPHP</h1>
8+
<p class="text-gray-300 text-2xl md:text-3xl font-light">
9+
The elegance of frameworks, the freedom of pure PHP.
10+
</p>
11+
</div>
12+
13+
<!-- Feature Grid -->
14+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
15+
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-lg hover:bg-purple-900 hover:bg-opacity-30 transition-all duration-300">
16+
<div class="text-purple-400 text-4xl mb-4">🏗️</div>
17+
<h3 class="text-white text-xl font-semibold mb-2">MVC Architecture</h3>
18+
<p class="text-gray-300">Clean separation of Model, View and Controller for organized code structure.</p>
19+
</div>
20+
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-lg hover:bg-purple-900 hover:bg-opacity-30 transition-all duration-300">
21+
<div class="text-purple-400 text-4xl mb-4">🌐</div>
22+
<h3 class="text-white text-xl font-semibold mb-2">Simple Routing</h3>
23+
<p class="text-gray-300">Intuitive routing system for both web pages and API endpoints.</p>
24+
</div>
25+
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-lg hover:bg-purple-900 hover:bg-opacity-30 transition-all duration-300">
26+
<div class="text-purple-400 text-4xl mb-4">🔧</div>
27+
<h3 class="text-white text-xl font-semibold mb-2">CLI Tools</h3>
28+
<p class="text-gray-300">Built-in command line tools for scaffolding your application.</p>
29+
</div>
30+
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-lg hover:bg-purple-900 hover:bg-opacity-30 transition-all duration-300">
31+
<div class="text-purple-400 text-4xl mb-4">🧩</div>
32+
<h3 class="text-white text-xl font-semibold mb-2">Components</h3>
33+
<p class="text-gray-300">Reusable view components for consistent interfaces.</p>
34+
</div>
35+
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-lg hover:bg-purple-900 hover:bg-opacity-30 transition-all duration-300">
36+
<div class="text-purple-400 text-4xl mb-4">🛡️</div>
37+
<h3 class="text-white text-xl font-semibold mb-2">Middleware</h3>
38+
<p class="text-gray-300">Request filtering for authentication, validation, and more.</p>
39+
</div>
40+
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-lg hover:bg-purple-900 hover:bg-opacity-30 transition-all duration-300">
41+
<div class="text-purple-400 text-4xl mb-4">🔌</div>
42+
<h3 class="text-white text-xl font-semibold mb-2">API Development</h3>
43+
<p class="text-gray-300">Tools for building robust RESTful APIs quickly.</p>
44+
</div>
45+
</div>
46+
47+
<!-- Get Started -->
48+
<div class="bg-gray-800 bg-opacity-50 p-8 rounded-lg mb-8">
49+
<h2 class="text-white text-2xl font-semibold mb-4">Get Started</h2>
50+
<div class="bg-gray-900 p-4 rounded-md overflow-x-auto mb-4">
51+
<pre class="text-green-400">$ php warvil make:controller UserController</pre>
52+
</div>
53+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
54+
<a href="/docs" class="block bg-purple-700 hover:bg-purple-600 text-white text-center py-3 px-4 rounded-md transition-colors">Documentation</a>
55+
<a href="https://github.com/wardvisual/warvilphp" target="_blank" class="block bg-gray-700 hover:bg-gray-600 text-white text-center py-3 px-4 rounded-md transition-colors">GitHub</a>
56+
<a href="/examples" class="block bg-gray-700 hover:bg-gray-600 text-white text-center py-3 px-4 rounded-md transition-colors">Examples</a>
57+
</div>
58+
</div>
59+
60+
<!-- Footer -->
61+
<div class="text-center text-gray-400">
62+
<p>WarvilPHP v<?= WARVIL_VERSION ?? '1.0.0' ?> • Made with ❤️ by <a href="https://github.com/wardvisual" class="text-purple-400 hover:text-purple-300">WardVisual</a></p>
63+
<p class="text-sm mt-2">Under active development. While we strive for stability, use in production is at your own risk.</p>
64+
</div>
65+
</div>
66+
</div>
67+
</div>

0 commit comments

Comments
 (0)