75 lines
2.4 KiB
PHP
75 lines
2.4 KiB
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use PHPNative\Framework\Application;
|
|
use PHPNative\Ui\Widget\Button;
|
|
use PHPNative\Ui\Widget\Container;
|
|
use PHPNative\Ui\Widget\Label;
|
|
use PHPNative\Ui\Window;
|
|
|
|
// Create application
|
|
$app = new Application();
|
|
$window = new Window('Shadow Test', 800, 600);
|
|
|
|
// Main container
|
|
$mainContainer = new Container('flex flex-col gap-4 p-8');
|
|
|
|
// Title
|
|
$title = new Label('Tailwind Shadow Test', 'text-2xl font-bold text-black mb-4');
|
|
$mainContainer->addComponent($title);
|
|
|
|
// Container for buttons
|
|
$buttonContainer = new Container('flex flex-col gap-6 items-center');
|
|
|
|
// Test different shadow sizes
|
|
$shadows = [
|
|
'shadow-sm' => 'Small Shadow',
|
|
'shadow' => 'Base Shadow',
|
|
'shadow-md' => 'Medium Shadow',
|
|
'shadow-lg' => 'Large Shadow',
|
|
'shadow-xl' => 'Extra Large Shadow',
|
|
'shadow-2xl' => '2X Large Shadow',
|
|
'shadow-inner' => 'Inner Shadow',
|
|
];
|
|
|
|
foreach ($shadows as $shadowClass => $label) {
|
|
// Container for each example
|
|
$exampleContainer = new Container('flex flex-row gap-4 items-center w-full');
|
|
|
|
// Label
|
|
$labelWidget = new Label($label, 'w-48 text-black text-sm');
|
|
$exampleContainer->addComponent($labelWidget);
|
|
|
|
// Button with shadow
|
|
$button = new Button('Button with ' . $shadowClass, 'px-6 py-3 text-white ' . $shadowClass);
|
|
$exampleContainer->addComponent($button);
|
|
|
|
// Card with shadow
|
|
$card = new Container('px-6 py-4 ' . $shadowClass);
|
|
$cardLabel = new Label('Card', 'text-black text-sm');
|
|
$card->addComponent($cardLabel);
|
|
$exampleContainer->addComponent($card);
|
|
|
|
$buttonContainer->addComponent($exampleContainer);
|
|
}
|
|
|
|
// Add no shadow example
|
|
$noShadowContainer = new Container('flex flex-row gap-4 items-center w-full');
|
|
$noShadowLabel = new Label('No Shadow', 'w-48 text-black text-sm');
|
|
$noShadowContainer->addComponent($noShadowLabel);
|
|
$noShadowButton = new Button('Button without shadow', 'px-6 py-3 bg-blue-500 text-white rounded-lg shadow-none');
|
|
$noShadowContainer->addComponent($noShadowButton);
|
|
$noShadowCard = new Container('px-6 py-4 bg-white rounded-lg shadow-none');
|
|
$noShadowCardLabel = new Label('Card', 'text-black text-sm');
|
|
$noShadowCard->addComponent($noShadowCardLabel);
|
|
$noShadowContainer->addComponent($noShadowCard);
|
|
$buttonContainer->addComponent($noShadowContainer);
|
|
|
|
$mainContainer->addComponent($buttonContainer);
|
|
|
|
// Set window content and run
|
|
$window->setRoot($mainContainer);
|
|
$app->addWindow($window);
|
|
$app->run();
|