Compare commits

...

10 Commits

Author SHA1 Message Date
ShuriZma 68e6f93068
fix search bar 2023-10-18 17:47:33 +02:00
ShuriZma f8605673ff npm update
add grid to keybind list
add new invisible blade component for custom theme classes
2023-10-17 07:46:53 +02:00
ShuriZma ca82305bff
add accent color
add keybinds
2023-10-15 17:29:16 +02:00
ShuriZma 3388c95dc2
fix modal image size 2023-10-14 13:15:27 +02:00
ShuriZma f92f1248d9
add fields env functionality to grid mode 2023-10-14 13:11:34 +02:00
ShuriZma 7515d6fd5e
add DEFAULT_DISPLAY_MODE to .env.example 2023-10-14 12:55:50 +02:00
ShuriZma 801ae7c403
various fixes
add modal for images
add various new .env configurations
2023-10-14 12:45:53 +02:00
ShuriZma ab6f702569
allow specific fields to be null 2023-10-10 00:36:41 +02:00
ShuriZma fa32498fda
fix migrations 2023-10-09 23:19:06 +02:00
ShuriZma 6a3b0ba590
add empty sqlite db 2023-10-09 20:37:03 +02:00
49 changed files with 2290 additions and 2367 deletions

View File

@ -7,6 +7,17 @@ APP_URL=http://localhost # domain of your website. might want to use "https" ins
APP_COPYRIGHT=ShuriZma
APP_COPYRIGHT_SINCE=2023
FOOTER_IMAGE=img/header.png # can be any image type. path should start from public/ (ex. 'img/header.png')
LANDING_PAGE=false # if set to true a landing page will be added, if false the vehicle list is the landing page
ACCENT_COLOR=red-400 # https://tailwindcss.com/docs/background-color
KEYBIND_SEPERATOR=; # seperator for keybind combos, thats being used on the db to seperate multiple keys
# VEHICLE LIST
CURRENCY=$ # unit for prices etc
SPEED_UNIT=km/h # unit for top speed
FUEL_VOLUME_UNIT=l # unit for fuel volume
FIELDS=image,id,name,brand,class,storage,fuel_type,fuel_volume,seats,top_speed,price,vendor # list of fields that should be visible on the vehicle list (comma seperated). possible fields: image,id,name,brand,class,storage,fuel_type,fuel_volume,seats,top_speed,price,vendor
DEFAULT_DISPLAY_MODE=gridCards # default display mode for the vehicle list (gridCards, tableHorizontal, tableVertical)
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null

View File

@ -0,0 +1,73 @@
<?php
namespace App\Http\Controllers;
use App\Models\Keybind;
use App\Http\Requests\StoreKeybindRequest;
use App\Http\Requests\UpdateKeybindRequest;
class KeybindController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$keybinds = Keybind::all();
return response(
view('keybinds', [
'keybinds' => $keybinds,
])
);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(StoreKeybindRequest $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(Keybind $keybind)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Keybind $keybind)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateKeybindRequest $request, Keybind $keybind)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Keybind $keybind)
{
//
}
}

View File

@ -9,7 +9,8 @@ use App\Http\Requests\StoreVehicleRequest;
use App\Http\Requests\UpdateVehicleRequest;
use App\Models\VehicleClass;
use App\Models\Vendor;
use Schema;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class VehicleController extends Controller
{
@ -19,7 +20,7 @@ class VehicleController extends Controller
public function index()
{
$vehicles = Vehicle::filter(
request(['search', 'vehicle_class_id', 'brandId', 'fuelTypeId', 'vendorId'])
request(['search', 'vehicle_class_id', 'brand_id', 'fuel_type_id', 'vendor_id'])
)
->paginate(24)->withQueryString();
@ -86,4 +87,17 @@ class VehicleController extends Controller
{
//
}
public function autocomplete(Request $request): JsonResponse
{
$games = '';
if ($request->has('q')) {
$search = $request->q;
$games = Vehicle::select(['vehicle_name'])
->where('vehicle_name', 'LIKE', "%$search%")
->get();
}
return response()->json($games);
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreKeybindRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateKeybindRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@ -12,19 +12,19 @@ use Illuminate\Support\Carbon;
/**
* App\Models\Brand
*
* @property int $id
* @property int $brand_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $name
* @property string $description
* @property string $brand_name
* @property string|null $brand_description
* @method static BrandFactory factory($count = null, $state = [])
* @method static Builder|Brand newModelQuery()
* @method static Builder|Brand newQuery()
* @method static Builder|Brand query()
* @method static Builder|Brand whereBrandDescription($value)
* @method static Builder|Brand whereBrandId($value)
* @method static Builder|Brand whereBrandName($value)
* @method static Builder|Brand whereCreatedAt($value)
* @method static Builder|Brand whereDescription($value)
* @method static Builder|Brand whereId($value)
* @method static Builder|Brand whereName($value)
* @method static Builder|Brand whereUpdatedAt($value)
* @mixin Eloquent
*/
@ -35,19 +35,19 @@ class Brand extends Model
/**
* @return int
*/
public function getId(): int
public function getBrandId(): int
{
return $this->id;
return $this->brand_id;
}
/**
* @param int $id
* @param int $brand_id
*
* @return Brand
*/
public function setId(int $id): Brand
public function setBrandId(int $brand_id): Brand
{
$this->id = $id;
$this->brand_id = $brand_id;
return $this;
}
@ -55,39 +55,39 @@ class Brand extends Model
/**
* @return string
*/
public function getName(): string
public function getBrandName(): string
{
return $this->name;
return $this->brand_name;
}
/**
* @param string $name
* @param string $brand_name
*
* @return Brand
*/
public function setName(string $name): Brand
public function setBrandName(string $brand_name): Brand
{
$this->name = $name;
$this->brand_name = $brand_name;
return $this;
}
/**
* @return string
* @return string|null
*/
public function getDescription(): string
public function getBrandDescription(): ?string
{
return $this->description;
return $this->brand_description;
}
/**
* @param string $description
* @param string|null $brand_description
*
* @return Brand
*/
public function setDescription(string $description): Brand
public function setBrandDescription(?string $brand_description): Brand
{
$this->description = $description;
$this->brand_description = $brand_description;
return $this;
}

View File

@ -12,21 +12,21 @@ use Illuminate\Support\Carbon;
/**
* App\Models\FuelType
*
* @property int $id
* @property int $fuel_type_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $name
* @property string $description
* @property float $price
* @property string $fuel_type_name
* @property string|null $fuel_type_description
* @property float|null $fuel_type_price
* @method static FuelTypeFactory factory($count = null, $state = [])
* @method static Builder|FuelType newModelQuery()
* @method static Builder|FuelType newQuery()
* @method static Builder|FuelType query()
* @method static Builder|FuelType whereCreatedAt($value)
* @method static Builder|FuelType whereDescription($value)
* @method static Builder|FuelType whereId($value)
* @method static Builder|FuelType whereName($value)
* @method static Builder|FuelType wherePrice($value)
* @method static Builder|FuelType whereFuelTypeDescription($value)
* @method static Builder|FuelType whereFuelTypeId($value)
* @method static Builder|FuelType whereFuelTypeName($value)
* @method static Builder|FuelType whereFuelTypePrice($value)
* @method static Builder|FuelType whereUpdatedAt($value)
* @mixin Eloquent
*/
@ -37,19 +37,19 @@ class FuelType extends Model
/**
* @return int
*/
public function getId(): int
public function getFuelTypeId(): int
{
return $this->id;
return $this->fuel_type_id;
}
/**
* @param int $id
* @param int $fuel_type_id
*
* @return FuelType
*/
public function setId(int $id): FuelType
public function setFuelTypeId(int $fuel_type_id): FuelType
{
$this->id = $id;
$this->fuel_type_id = $fuel_type_id;
return $this;
}
@ -57,59 +57,59 @@ class FuelType extends Model
/**
* @return string
*/
public function getName(): string
public function getFuelTypeName(): string
{
return $this->name;
return $this->fuel_type_name;
}
/**
* @param string $name
* @param string $fuel_type_name
*
* @return FuelType
*/
public function setName(string $name): FuelType
public function setFuelTypeName(string $fuel_type_name): FuelType
{
$this->name = $name;
$this->fuel_type_name = $fuel_type_name;
return $this;
}
/**
* @return string
* @return string|null
*/
public function getDescription(): string
public function getFuelTypeDescription(): ?string
{
return $this->description;
return $this->fuel_type_description;
}
/**
* @param string $description
* @param string|null $fuel_type_description
*
* @return FuelType
*/
public function setDescription(string $description): FuelType
public function setFuelTypeDescription(?string $fuel_type_description): FuelType
{
$this->description = $description;
$this->fuel_type_description = $fuel_type_description;
return $this;
}
/**
* @return float
* @return float|null
*/
public function getPrice(): float
public function getFuelTypePrice(): ?float
{
return $this->price;
return $this->fuel_type_price;
}
/**
* @param float $price
* @param float|null $fuel_type_price
*
* @return FuelType
*/
public function setPrice(float $price): FuelType
public function setFuelTypePrice(?float $fuel_type_price): FuelType
{
$this->price = $price;
$this->fuel_type_price = $fuel_type_price;
return $this;
}

93
app/Models/Keybind.php Normal file
View File

@ -0,0 +1,93 @@
<?php
namespace App\Models;
use Database\Factories\KeybindFactory;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
/**
* App\Models\Keybind
*
* @property int $keybind_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $keybind_keys
* @property string $keybind_description
* @method static KeybindFactory factory($count = null, $state = [])
* @method static Builder|Keybind newModelQuery()
* @method static Builder|Keybind newQuery()
* @method static Builder|Keybind query()
* @method static Builder|Keybind whereCreatedAt($value)
* @method static Builder|Keybind whereKeybindDescription($value)
* @method static Builder|Keybind whereKeybindId($value)
* @method static Builder|Keybind whereKeybindKeys($value)
* @method static Builder|Keybind whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Keybind extends Model
{
use HasFactory;
/**
* @return int
*/
public function getKeybindId(): int
{
return $this->keybind_id;
}
/**
* @param int $keybind_id
*
* @return Keybind
*/
public function setKeybindId(int $keybind_id): Keybind
{
$this->keybind_id = $keybind_id;
return $this;
}
/**
* @return string
*/
public function getKeybindKeys(): string
{
return $this->keybind_keys;
}
/**
* @param string $keybind_keys
*
* @return Keybind
*/
public function setKeybindKeys(string $keybind_keys): Keybind
{
$this->keybind_keys = $keybind_keys;
return $this;
}
/**
* @return string
*/
public function getKeybindDescription(): string
{
return $this->keybind_description;
}
/**
* @param string $keybind_description
*
* @return Keybind
*/
public function setKeybindDescription(string $keybind_description): Keybind
{
$this->keybind_description = $keybind_description;
return $this;
}
}

View File

@ -13,59 +13,116 @@ use Schema;
/**
* App\Models\Vehicle
*
* @property int $id
* @property int $vehicle_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $name
* @property string $image_path
* @property int $storage
* @property int $fuel_volume
* @property int $seats
* @property float $price
* @property float $top_speed
* @property int $vehicle_storage
* @property int $vehicle_fuel_volume
* @property int $vehicle_seats
* @property float|null $vehicle_price
* @property float|null $vehicle_top_speed
* @property int $vehicle_class_id
* @property int $fuel_type_id
* @property int $brand_id
* @property int $vendor_id
* @method static VehicleFactory factory($count = null, $state = [])
* @method static Builder|Vehicle filter(array $filters)
* @method static Builder|Vehicle newModelQuery()
* @method static Builder|Vehicle newQuery()
* @method static Builder|Vehicle query()
* @method static Builder|Vehicle whereBrandId($value)
* @method static Builder|Vehicle whereCreatedAt($value)
* @method static Builder|Vehicle whereFuelTypeId($value)
* @method static Builder|Vehicle whereFuelVolume($value)
* @method static Builder|Vehicle whereId($value)
* @method static Builder|Vehicle whereName($value)
* @method static Builder|Vehicle wherePrice($value)
* @method static Builder|Vehicle whereSeats($value)
* @method static Builder|Vehicle whereStorage($value)
* @method static Builder|Vehicle whereTopSpeed($value)
* @method static Builder|Vehicle whereUpdatedAt($value)
* @method static Builder|Vehicle whereVehicleClassId($value)
* @method static Builder|Vehicle whereVehicleFuelVolume($value)
* @method static Builder|Vehicle whereVehicleId($value)
* @method static Builder|Vehicle whereVehiclePrice($value)
* @method static Builder|Vehicle whereVehicleSeats($value)
* @method static Builder|Vehicle whereVehicleStorage($value)
* @method static Builder|Vehicle whereVehicleTopSpeed($value)
* @method static Builder|Vehicle whereVendorId($value)
* @property string $vehicle_name
* @method static Builder|Vehicle whereVehicleName($value)
* @mixin Eloquent
*/
class Vehicle extends Model
{
use HasFactory;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
public function scopeFilter(
$query,
array $filters
): void {
$search = $filters['search'] ?? false;
if ($search) {
$query->where('vehicle_name', 'like', '%' . $search . '%');
}
unset($filters['search']);
$orderByOne = $filters['orderByOne'] ?? null;
$orderByTwo = $filters['orderByTwo'] ?? null;
if (!empty($orderByOne) || !empty($orderByTwo)) {
$orderBy = '';
if (!empty($orderByOne) && Schema::hasColumn('vehicles', $orderByOne)) {
$orderBy .= $orderByOne;
}
if (!empty($orderByTwo) && Schema::hasColumn('vehicles', $orderByTwo)) {
$orderBy .= empty($orderBy) ? $orderByTwo : ', ' . $orderByTwo;
}
$query->orderBy($orderBy);
}
foreach ($filters as $field => $filter) {
if (empty($filter)) {
continue;
}
switch ($field) {
case 'vehicle_class_id':
$query->join('vehicle_classes', 'vehicles.vehicle_class_id', '=', 'vehicle_classes.vehicle_class_id');
$query->where('vehicle_class_name', '=', $filter);
break;
case 'brand_id':
$query->join('brands', 'vehicles.brand_id', '=', 'brands.brand_id');
$query->where('brand_name', '=', $filter);
break;
case 'fuel_type_id':
$query->join('fuel_types', 'vehicles.fuel_type_id', '=', 'fuel_types.fuel_type_id');
$query->where('fuel_type_name', '=', $filter);
break;
case 'vendor_id':
$query->join('vendors', 'vehicles.vendor_id', '=', 'vendors.vendor_id');
$query->where('vendor_name', '=', $filter);
break;
default:
Schema::hasColumn('vehicles', $field);
$query->where($field, '=', $filter);
}
}
}
/**
* @param int $id
* @return int
*/
public function getVehicleId(): int
{
return $this->vehicle_id;
}
/**
* @param int $vehicle_id
*
* @return Vehicle
*/
public function setId(int $id): Vehicle
public function setVehicleId(int $vehicle_id): Vehicle
{
$this->id = $id;
$this->vehicle_id = $vehicle_id;
return $this;
}
@ -73,19 +130,19 @@ class Vehicle extends Model
/**
* @return string
*/
public function getName(): string
public function getVehicleName(): string
{
return $this->name;
return $this->vehicle_name;
}
/**
* @param string $name
* @param string $vehicle_name
*
* @return Vehicle
*/
public function setName(string $name): Vehicle
public function setVehicleName(string $vehicle_name): Vehicle
{
$this->name = $name;
$this->vehicle_name = $vehicle_name;
return $this;
}
@ -93,19 +150,19 @@ class Vehicle extends Model
/**
* @return int
*/
public function getStorage(): int
public function getVehicleStorage(): int
{
return $this->storage;
return $this->vehicle_storage;
}
/**
* @param int $storage
* @param int $vehicle_storage
*
* @return Vehicle
*/
public function setStorage(int $storage): Vehicle
public function setVehicleStorage(int $vehicle_storage): Vehicle
{
$this->storage = $storage;
$this->vehicle_storage = $vehicle_storage;
return $this;
}
@ -113,19 +170,19 @@ class Vehicle extends Model
/**
* @return int
*/
public function getFuelVolume(): int
public function getVehicleFuelVolume(): int
{
return $this->fuel_volume;
return $this->vehicle_fuel_volume;
}
/**
* @param int $fuel_volume
* @param int $vehicle_fuel_volume
*
* @return Vehicle
*/
public function setFuelVolume(int $fuel_volume): Vehicle
public function setVehicleFuelVolume(int $vehicle_fuel_volume): Vehicle
{
$this->fuel_volume = $fuel_volume;
$this->vehicle_fuel_volume = $vehicle_fuel_volume;
return $this;
}
@ -133,59 +190,59 @@ class Vehicle extends Model
/**
* @return int
*/
public function getSeats(): int
public function getVehicleSeats(): int
{
return $this->seats;
return $this->vehicle_seats;
}
/**
* @param int $seats
* @param int $vehicle_seats
*
* @return Vehicle
*/
public function setSeats(int $seats): Vehicle
public function setVehicleSeats(int $vehicle_seats): Vehicle
{
$this->seats = $seats;
$this->vehicle_seats = $vehicle_seats;
return $this;
}
/**
* @return float
* @return float|null
*/
public function getPrice(): float
public function getVehiclePrice(): ?float
{
return $this->price;
return $this->vehicle_price;
}
/**
* @param float $price
* @param float|null $vehicle_price
*
* @return Vehicle
*/
public function setPrice(float $price): Vehicle
public function setVehiclePrice(?float $vehicle_price): Vehicle
{
$this->price = $price;
$this->vehicle_price = $vehicle_price;
return $this;
}
/**
* @return float
* @return float|null
*/
public function getTopSpeed(): float
public function getVehicleTopSpeed(): ?float
{
return $this->top_speed;
return $this->vehicle_top_speed;
}
/**
* @param float $top_speed
* @param float|null $vehicle_top_speed
*
* @return Vehicle
*/
public function setTopSpeed(float $top_speed): Vehicle
public function setVehicleTopSpeed(?float $vehicle_top_speed): Vehicle
{
$this->top_speed = $top_speed;
$this->vehicle_top_speed = $vehicle_top_speed;
return $this;
}
@ -269,56 +326,4 @@ class Vehicle extends Model
return $this;
}
/**
* @return string
*/
public function getImagePath(): string
{
return $this->image_path;
}
/**
* @param string $image_path
*
* @return Vehicle
*/
public function setImagePath(string $image_path): Vehicle
{
$this->image_path = $image_path;
return $this;
}
public function scopeFilter(
$query,
array $filters
): void {
$search = $filters['search'] ?? false;
if ($search) {
$query->where('name', 'like', '%' . $search . '%');
}
unset($filters['search']);
$orderByOne = $filters['orderByOne'] ?? false;
$orderByTwo = $filters['orderByTwo'] ?? false;
if ($orderByOne || $orderByTwo) {
$orderBy = '';
if ($orderByOne && Schema::hasColumn('vehicles', $orderByOne)) {
$orderBy .= $orderByOne;
}
if ($orderByTwo && Schema::hasColumn('vehicles', $orderByTwo)) {
$orderBy .= empty($orderBy) ? $orderByTwo : ', ' . $orderByTwo;
}
$query->orderBy($orderBy);
}
foreach ($filters as $field => $filter) {
Schema::hasColumn('vehicles', $field);
$query->where($field, '=', $filter);
}
}
}

View File

@ -12,20 +12,20 @@ use Illuminate\Support\Carbon;
/**
* App\Models\VehicleClass
*
* @property int $id
* @property int $vehicle_class_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $name
* @property string $description
* @property string $vehicle_class_name
* @property string|null $vehicle_class_description
* @method static VehicleClassFactory factory($count = null, $state = [])
* @method static Builder|VehicleClass newModelQuery()
* @method static Builder|VehicleClass newQuery()
* @method static Builder|VehicleClass query()
* @method static Builder|VehicleClass whereCreatedAt($value)
* @method static Builder|VehicleClass whereDescription($value)
* @method static Builder|VehicleClass whereId($value)
* @method static Builder|VehicleClass whereName($value)
* @method static Builder|VehicleClass whereUpdatedAt($value)
* @method static Builder|VehicleClass whereVehicleClassDescription($value)
* @method static Builder|VehicleClass whereVehicleClassId($value)
* @method static Builder|VehicleClass whereVehicleClassName($value)
* @mixin Eloquent
*/
class VehicleClass extends Model
@ -35,19 +35,19 @@ class VehicleClass extends Model
/**
* @return int
*/
public function getId(): int
public function getVehicleClassId(): int
{
return $this->id;
return $this->vehicle_class_id;
}
/**
* @param int $id
* @param int $vehicle_class_id
*
* @return VehicleClass
*/
public function setId(int $id): VehicleClass
public function setVehicleClassId(int $vehicle_class_id): VehicleClass
{
$this->id = $id;
$this->vehicle_class_id = $vehicle_class_id;
return $this;
}
@ -55,39 +55,39 @@ class VehicleClass extends Model
/**
* @return string
*/
public function getName(): string
public function getVehicleClassName(): string
{
return $this->name;
return $this->vehicle_class_name;
}
/**
* @param string $name
* @param string $vehicle_class_name
*
* @return VehicleClass
*/
public function setName(string $name): VehicleClass
public function setVehicleClassName(string $vehicle_class_name): VehicleClass
{
$this->name = $name;
$this->vehicle_class_name = $vehicle_class_name;
return $this;
}
/**
* @return string
* @return string|null
*/
public function getDescription(): string
public function getVehicleClassDescription(): ?string
{
return $this->description;
return $this->vehicle_class_description;
}
/**
* @param string $description
* @param string|null $vehicle_class_description
*
* @return VehicleClass
*/
public function setDescription(string $description): VehicleClass
public function setVehicleClassDescription(?string $vehicle_class_description): VehicleClass
{
$this->description = $description;
$this->vehicle_class_description = $vehicle_class_description;
return $this;
}

View File

@ -12,26 +12,26 @@ use Illuminate\Support\Carbon;
/**
* App\Models\Vendor
*
* @property int $id
* @property int $vendor_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $name
* @property string $description
* @property string $position
* @property float $x
* @property float $y
* @property string $vendor_name
* @property string|null $vendor_description
* @property string|null $vendor_position
* @property float|null $vendor_x
* @property float|null $vendor_y
* @method static VendorFactory factory($count = null, $state = [])
* @method static Builder|Vendor newModelQuery()
* @method static Builder|Vendor newQuery()
* @method static Builder|Vendor query()
* @method static Builder|Vendor whereCreatedAt($value)
* @method static Builder|Vendor whereDescription($value)
* @method static Builder|Vendor whereId($value)
* @method static Builder|Vendor whereName($value)
* @method static Builder|Vendor wherePosition($value)
* @method static Builder|Vendor whereUpdatedAt($value)
* @method static Builder|Vendor whereX($value)
* @method static Builder|Vendor whereY($value)
* @method static Builder|Vendor whereVendorDescription($value)
* @method static Builder|Vendor whereVendorId($value)
* @method static Builder|Vendor whereVendorName($value)
* @method static Builder|Vendor whereVendorPosition($value)
* @method static Builder|Vendor whereVendorX($value)
* @method static Builder|Vendor whereVendorY($value)
* @mixin Eloquent
*/
class Vendor extends Model
@ -41,19 +41,19 @@ class Vendor extends Model
/**
* @return int
*/
public function getId(): int
public function getVendorId(): int
{
return $this->id;
return $this->vendor_id;
}
/**
* @param int $id
* @param int $vendor_id
*
* @return Vendor
*/
public function setId(int $id): Vendor
public function setVendorId(int $vendor_id): Vendor
{
$this->id = $id;
$this->vendor_id = $vendor_id;
return $this;
}
@ -61,99 +61,99 @@ class Vendor extends Model
/**
* @return string
*/
public function getName(): string
public function getVendorName(): string
{
return $this->name;
return $this->vendor_name;
}
/**
* @param string $name
* @param string $vendor_name
*
* @return Vendor
*/
public function setName(string $name): Vendor
public function setVendorName(string $vendor_name): Vendor
{
$this->name = $name;
$this->vendor_name = $vendor_name;
return $this;
}
/**
* @return string
* @return string|null
*/
public function getDescription(): string
public function getVendorDescription(): ?string
{
return $this->description;
return $this->vendor_description;
}
/**
* @param string $description
* @param string|null $vendor_description
*
* @return Vendor
*/
public function setDescription(string $description): Vendor
public function setVendorDescription(?string $vendor_description): Vendor
{
$this->description = $description;
$this->vendor_description = $vendor_description;
return $this;
}
/**
* @return string
* @return string|null
*/
public function getPosition(): string
public function getVendorPosition(): ?string
{
return $this->position;
return $this->vendor_position;
}
/**
* @param string $position
* @param string|null $vendor_position
*
* @return Vendor
*/
public function setPosition(string $position): Vendor
public function setVendorPosition(?string $vendor_position): Vendor
{
$this->position = $position;
$this->vendor_position = $vendor_position;
return $this;
}
/**
* @return float
* @return float|null
*/
public function getX(): float
public function getVendorX(): ?float
{
return $this->x;
return $this->vendor_x;
}
/**
* @param float $x
* @param float|null $vendor_x
*
* @return Vendor
*/
public function setX(float $x): Vendor
public function setVendorX(?float $vendor_x): Vendor
{
$this->x = $x;
$this->vendor_x = $vendor_x;
return $this;
}
/**
* @return float
* @return float|null
*/
public function getY(): float
public function getVendorY(): ?float
{
return $this->y;
return $this->vendor_y;
}
/**
* @param float $y
* @param float|null $vendor_y
*
* @return Vendor
*/
public function setY(float $y): Vendor
public function setVendorY(?float $vendor_y): Vendor
{
$this->y = $y;
$this->vendor_y = $vendor_y;
return $this;
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Keybind;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class KeybindPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
//
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Keybind $keybind): bool
{
//
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
//
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Keybind $keybind): bool
{
//
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Keybind $keybind): bool
{
//
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Keybind $keybind): bool
{
//
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Keybind $keybind): bool
{
//
}
}

0
database/database.sqlite Normal file
View File

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Keybind>
*/
class KeybindFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}

View File

@ -21,10 +21,6 @@ return new class extends Migration
$table->integer('seats');
$table->double('price');
$table->double('top_speed');
$table->foreignId('vehicle_class_id')->references('id')->on('vehicle_classes');
$table->foreignId('fuel_type_id')->references('id')->on('fuel_types');
$table->foreignId('brand_id')->references('id')->on('brands');
$table->foreignId('vendor_id')->references('id')->on('vendors');
});
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('vehicles', function (Blueprint $table) {
$table->foreignId('vehicle_class_id')->references('id')->on('vehicle_classes');
$table->foreignId('fuel_type_id')->references('id')->on('fuel_types');
$table->foreignId('brand_id')->references('id')->on('brands');
$table->foreignId('vendor_id')->references('id')->on('vendors');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('vehicles', function (Blueprint $table) {
$table->dropConstrainedForeignId('vehicle_class_id');
$table->dropConstrainedForeignId('fuel_type_id');
$table->dropConstrainedForeignId('brand_id');
$table->dropConstrainedForeignId('vendor_id');
});
}
};

View File

@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('brands', function (Blueprint $table) {
$table->string('name')->unique()->change();
$table->text('description')->nullable(true)->change();
});
Schema::table('fuel_types', function (Blueprint $table) {
$table->string('name')->unique()->change();
$table->text('description')->nullable(true)->change();
$table->double('price')->nullable(true)->change();
});
Schema::table('vehicle_classes', function (Blueprint $table) {
$table->string('name')->unique()->change();
$table->text('description')->nullable(true)->change();
});
Schema::table('vendors', function (Blueprint $table) {
$table->string('name')->unique()->change();
$table->text('description')->nullable(true)->change();
$table->string('position')->nullable(true)->change();
$table->double('x')->nullable(true)->change();
$table->double('y')->nullable(true)->change();
});
Schema::table('vehicles', function (Blueprint $table) {
$table->string('image_path')->nullable(true)->change();
$table->double('price')->nullable(true)->change();
$table->double('top_speed')->nullable(true)->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@ -0,0 +1,97 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('vehicles', function (Blueprint $table) {
$table->renameColumn('id', 'vehicle_id');
$table->renameColumn('name', 'vehicle_name');
$table->dropColumn('image_path');
$table->renameColumn('storage', 'vehicle_storage');
$table->renameColumn('fuel_volume', 'vehicle_fuel_volume');
$table->renameColumn('seats', 'vehicle_seats');
$table->renameColumn('price', 'vehicle_price');
$table->renameColumn('top_speed', 'vehicle_top_speed');
});
Schema::table('vendors', function (Blueprint $table) {
$table->renameColumn('id', 'vendor_id');
$table->renameColumn('name', 'vendor_name');
$table->renameColumn('description', 'vendor_description');
$table->renameColumn('position', 'vendor_position');
$table->renameColumn('x', 'vendor_x');
$table->renameColumn('y', 'vendor_y');
});
Schema::table('brands', function (Blueprint $table) {
$table->renameColumn('id', 'brand_id');
$table->renameColumn('name', 'brand_name');
$table->renameColumn('description', 'brand_description');
});
Schema::table('vehicle_classes', function (Blueprint $table) {
$table->renameColumn('id', 'vehicle_class_id');
$table->renameColumn('name', 'vehicle_class_name');
$table->renameColumn('description', 'vehicle_class_description');
});
Schema::table('fuel_types', function (Blueprint $table) {
$table->renameColumn('id', 'fuel_type_id');
$table->renameColumn('name', 'fuel_type_name');
$table->renameColumn('description', 'fuel_type_description');
$table->renameColumn('price', 'fuel_type_price');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('vehicles', function (Blueprint $table) {
$table->renameColumn('vehicle_id', 'id');
$table->string('image_path')->nullable(true);
$table->renameColumn('vehicle_storage', 'storage');
$table->renameColumn('vehicle_fuel_volume', 'fuel_volume');
$table->renameColumn('vehicle_seats', 'seats');
$table->renameColumn('vehicle_price', 'price');
$table->renameColumn('vehicle_top_speed', 'top_speed');
});
Schema::table('vendors', function (Blueprint $table) {
$table->renameColumn('vendor_id', 'id');
$table->renameColumn('vendor_name', 'name');
$table->renameColumn('vendor_description', 'description');
$table->renameColumn('vendor_position', 'position');
$table->renameColumn('vendor_x', 'x');
$table->renameColumn('vendor_y', 'y');
});
Schema::table('brands', function (Blueprint $table) {
$table->renameColumn('brand_id', 'id');
$table->renameColumn('brand_name', 'name');
$table->renameColumn('brand_description', 'description');
});
Schema::table('vehicle_classes', function (Blueprint $table) {
$table->renameColumn('vehicle_class_id', 'id');
$table->renameColumn('vehicle_class_name', 'name');
$table->renameColumn('vehicle_class_description', 'description');
});
Schema::table('fuel_types', function (Blueprint $table) {
$table->renameColumn('fuel_type_id', 'id');
$table->renameColumn('fuel_type_name', 'name');
$table->renameColumn('fuel_type_description', 'description');
$table->renameColumn('fuel_type_price', 'price');
});
}
};

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('keybinds', function (Blueprint $table) {
$table->id('keybind_id');
$table->timestamps();
$table->string('keybind_keys');
$table->text('keybind_description');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('keybinds');
}
};

View File

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class KeybindSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{
"name": "website",
"name": "fleetCatalogue",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@ -1,5 +1,5 @@
/*!
* Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2023 Fonticons, Inc.
*/
@ -8228,7 +8228,7 @@ readers do not read off random characters that represent icons */
}
/*!
* Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2023 Fonticons, Inc.
*/
@ -8242,7 +8242,7 @@ readers do not read off random characters that represent icons */
font-style: normal;
font-weight: 400;
font-display: block;
src: url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff2?3223dc79c1adee56370b19dca985aa17) format("woff2"), url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.ttf?d87474231f419288480274125e0e9767) format("truetype");
src: url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff2?b041b1fa4fe241b234458a565482c4c6) format("woff2"), url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.ttf?50701fbb8177c2dde530fc83add388ef) format("truetype");
}
.far,
.fa-regular {
@ -8250,7 +8250,7 @@ readers do not read off random characters that represent icons */
}
/*!
* Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2023 Fonticons, Inc.
*/
@ -8264,7 +8264,7 @@ readers do not read off random characters that represent icons */
font-style: normal;
font-weight: 900;
font-display: block;
src: url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?bb975c966c37455a1bc3c7e29971386c) format("woff2"), url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?4a2cd718d7031b732e7610fba99ecf74) format("truetype");
src: url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?b6879d41b0852f01ed5b0216c4c72e11) format("woff2"), url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?d75e3fd1eb12e9bd66550e304bdd1ec7) format("truetype");
}
.fas,
.fa-solid {
@ -8272,7 +8272,7 @@ readers do not read off random characters that represent icons */
}
/*!
* Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2023 Fonticons, Inc.
*/
@ -8286,7 +8286,7 @@ readers do not read off random characters that represent icons */
font-style: normal;
font-weight: 400;
font-display: block;
src: url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff2?e033a13ee751afc1860c3bc31ede1065) format("woff2"), url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.ttf?150de8eaa454d669c405d810c8dbbf14) format("truetype");
src: url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff2?878f31251d960bd6266f20ccdc4d738f) format("woff2"), url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.ttf?016b4a6cdced82ab3aa1907e3855cfd2) format("truetype");
}
.fab,
.fa-brands {
@ -8513,6 +8513,10 @@ readers do not read off random characters that represent icons */
content: "\f282";
}
.fa-threads:before {
content: "\e618";
}
.fa-napster:before {
content: "\f3d2";
}
@ -8737,6 +8741,10 @@ readers do not read off random characters that represent icons */
content: "\f28a";
}
.fa-debian:before {
content: "\e60b";
}
.fa-openid:before {
content: "\f19b";
}
@ -9057,6 +9065,10 @@ readers do not read off random characters that represent icons */
content: "\f612";
}
.fa-square-threads:before {
content: "\e619";
}
.fa-hackerrank:before {
content: "\f5f7";
}
@ -9513,6 +9525,10 @@ readers do not read off random characters that represent icons */
content: "\f39d";
}
.fa-x-twitter:before {
content: "\e61b";
}
.fa-cotton-bureau:before {
content: "\f89e";
}
@ -10173,6 +10189,10 @@ readers do not read off random characters that represent icons */
content: "\f2c4";
}
.fa-square-x-twitter:before {
content: "\e61a";
}
.fa-reacteurope:before {
content: "\f75d";
}
@ -10956,7 +10976,7 @@ readers do not read off random characters that represent icons */
border-color: rgb(63 63 70 / var(--tw-bg-opacity))
}
/*
! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com
! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com
*/
/*
@ -11126,6 +11146,8 @@ optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-feature-settings: inherit; /* 1 */
font-variation-settings: inherit; /* 1 */
font-size: 100%; /* 1 */
font-weight: inherit; /* 1 */
line-height: inherit; /* 1 */
@ -11263,6 +11285,14 @@ menu {
padding: 0;
}
/*
Reset default styling for dialogs.
*/
dialog {
padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
@ -11338,7 +11368,7 @@ video {
display: none;
}
[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select{
[type='text'],input:where(:not([type])),[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select{
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
@ -11355,7 +11385,7 @@ video {
--tw-shadow: 0 0 #0000;
}
[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus{
[type='text']:focus, input:where(:not([type])):focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus{
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
@ -11384,6 +11414,11 @@ input::placeholder,textarea::placeholder{
::-webkit-date-and-time-value{
min-height: 1.5em;
text-align: inherit;
}
::-webkit-datetime-edit{
display: inline-flex;
}
::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{
@ -11401,7 +11436,7 @@ select{
print-color-adjust: exact;
}
[multiple]{
[multiple],[size]:where(select:not([size="1"])){
background-image: initial;
background-position: initial;
background-repeat: unset;
@ -13153,6 +13188,22 @@ html{
.input-group > .select{
border-radius: 0px;
}
.kbd{
display: inline-flex;
align-items: center;
justify-content: center;
border-width: 1px;
border-color: hsl(var(--bc) / var(--tw-border-opacity));
--tw-border-opacity: 0.2;
--tw-bg-opacity: 1;
background-color: hsl(var(--b2, var(--b1)) / var(--tw-bg-opacity));
padding-left: 0.5rem;
padding-right: 0.5rem;
border-radius: var(--rounded-btn, 0.5rem);
border-bottom-width: 2px;
min-height: 2.2em;
min-width: 2.2em;
}
.link{
cursor: pointer;
text-decoration-line: underline;
@ -13244,6 +13295,15 @@ html{
visibility: visible;
opacity: 1;
}
.modal-toggle{
position: fixed;
height: 0px;
width: 0px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
opacity: 0;
}
.select{
display: inline-flex;
flex-shrink: 0;
@ -13276,18 +13336,6 @@ html{
.select[multiple]{
height: auto;
}
.stats{
display: inline-grid;
--tw-bg-opacity: 1;
background-color: hsl(var(--b1) / var(--tw-bg-opacity));
--tw-text-opacity: 1;
color: hsl(var(--bc) / var(--tw-text-opacity));
border-radius: var(--rounded-box, 1rem);
}
:where(.stats){
grid-auto-flow: column;
overflow-x: auto;
}
.tab{
position: relative;
display: inline-flex;
@ -13561,13 +13609,6 @@ html{
outline: 2px solid hsla(var(--bc) / 0.2);
outline-offset: 2px;
}
.input-error{
--tw-border-opacity: 1;
border-color: hsl(var(--er) / var(--tw-border-opacity));
}
.input-error:focus{
outline: 2px solid hsl(var(--er));
}
.input-disabled,
.input[disabled]{
cursor: not-allowed;
@ -13847,14 +13888,6 @@ html{
[dir="rtl"] .select{
background-position: calc(0% + 12px) calc(1px + 50%), calc(0% + 16px) calc(1px + 50%);
}
:where(.stats) > :not([hidden]) ~ :not([hidden]){
--tw-divide-x-reverse: 0;
border-right-width: calc(1px * var(--tw-divide-x-reverse));
border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse)));
--tw-divide-y-reverse: 0;
border-top-width: calc(0px * calc(1 - var(--tw-divide-y-reverse)));
border-bottom-width: calc(0px * var(--tw-divide-y-reverse));
}
.tab:hover{
--tw-text-opacity: 1;
}
@ -14068,9 +14101,6 @@ html{
white-space: nowrap;
border-width: 0;
}
.visible{
visibility: visible;
}
.fixed{
position: fixed;
}
@ -14111,22 +14141,22 @@ html{
margin-left: -0.5rem;
margin-right: -0.5rem;
}
.mx-8{
margin-left: 2rem;
margin-right: 2rem;
.mx-2{
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.mx-auto{
margin-left: auto;
margin-right: auto;
}
.my-1{
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}
.my-3{
margin-top: 0.75rem;
margin-bottom: 0.75rem;
}
.my-5{
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
.my-\[1rem\]{
margin-top: 1rem;
margin-bottom: 1rem;
@ -14141,15 +14171,9 @@ html{
.-ml-px{
margin-left: -1px;
}
.-mt-px{
margin-top: -1px;
}
.mb-0{
margin-bottom: 0px;
}
.mb-1{
margin-bottom: 0.25rem;
}
.mb-2{
margin-bottom: 0.5rem;
}
@ -14168,39 +14192,45 @@ html{
.mb-8{
margin-bottom: 2rem;
}
.ml-1{
margin-left: 0.25rem;
}
.ml-12{
margin-left: 3rem;
}
.ml-2{
margin-left: 0.5rem;
}
.ml-3{
margin-left: 0.75rem;
}
.ml-4{
.ml-\[1rem\]{
margin-left: 1rem;
}
.ml-\[2\.5rem\]{
margin-left: 2.5rem;
}
.ml-\[4\.25rem\]{
margin-left: 4.25rem;
}
.ml-\[4rem\]{
margin-left: 4rem;
}
.mr-1{
margin-right: 0.25rem;
}
.mr-2{
margin-right: 0.5rem;
}
.mr-3{
margin-right: 0.75rem;
}
.mr-4{
margin-right: 1rem;
}
.mr-\[\.5rem\]{
margin-right: .5rem;
}
.mr-\[13\.5rem\]{
margin-right: 13.5rem;
}
.mr-\[2\.74rem\]{
margin-right: 2.74rem;
}
.mr-\[2\.75rem\]{
margin-right: 2.75rem;
}
.mr-\[3\.25rem\]{
margin-right: 3.25rem;
}
.mt-1{
margin-top: 0.25rem;
}
@ -14234,33 +14264,15 @@ html{
.hidden{
display: none;
}
.h-12{
height: 3rem;
}
.h-14{
height: 3.5rem;
}
.h-16{
height: 4rem;
}
.h-4{
height: 1rem;
}
.h-5{
height: 1.25rem;
}
.h-6{
height: 1.5rem;
}
.h-7{
height: 1.75rem;
}
.h-8{
height: 2rem;
}
.h-\[220px\]{
height: 220px;
}
.h-\[2rem\]{
height: 2rem;
}
@ -14282,6 +14294,9 @@ html{
.h-\[83rem\]{
height: 83rem;
}
.h-auto{
height: auto;
}
.h-full{
height: 100%;
}
@ -14300,21 +14315,6 @@ html{
.max-h-\[90vh\]{
max-height: 90vh;
}
.min-h-\[15rem\]{
min-height: 15rem;
}
.min-h-\[25rem\]{
min-height: 25rem;
}
.min-h-\[30rem\]{
min-height: 30rem;
}
.min-h-\[4\.5rem\]{
min-height: 4.5rem;
}
.min-h-\[40\.2rem\]{
min-height: 40.2rem;
}
.min-h-\[40rem\]{
min-height: 40rem;
}
@ -14324,9 +14324,6 @@ html{
.min-h-screen{
min-height: 100vh;
}
.w-1\/5{
width: 20%;
}
.w-14{
width: 3.5rem;
}
@ -14342,18 +14339,18 @@ html{
.w-60{
width: 15rem;
}
.w-8{
width: 2rem;
}
.w-\[1\.5rem\]{
width: 1.5rem;
}
.w-\[11rem\]{
width: 11rem;
}
.w-\[13rem\]{
width: 13rem;
}
.w-\[17\.2rem\]{
width: 17.2rem;
}
.w-\[2\.5rem\]{
width: 2.5rem;
}
.w-\[20rem\]{
width: 20rem;
}
@ -14363,23 +14360,32 @@ html{
.w-\[23rem\]{
width: 23rem;
}
.w-\[560px\]{
width: 560px;
.w-\[3\.2rem\]{
width: 3.2rem;
}
.w-auto{
width: auto;
.w-\[3\.5rem\]{
width: 3.5rem;
}
.w-\[3rem\]{
width: 3rem;
}
.w-\[4\.2rem\]{
width: 4.2rem;
}
.w-\[5\.2rem\]{
width: 5.2rem;
}
.w-\[6\.5rem\]{
width: 6.5rem;
}
.w-full{
width: 100%;
}
.min-w-\[1\.5rem\]{
min-width: 1.5rem;
.min-w-\[6rem\]{
min-width: 6rem;
}
.min-w-\[10rem\]{
min-width: 10rem;
}
.min-w-\[20rem\]{
min-width: 20rem;
.min-w-\[70vw\]{
min-width: 70vw;
}
.min-w-full{
min-width: 100%;
@ -14388,24 +14394,21 @@ html{
min-width: -moz-max-content;
min-width: max-content;
}
.max-w-6xl{
max-width: 72rem;
}
.max-w-7xl{
max-width: 80rem;
}
.max-w-\[25rem\]{
max-width: 25rem;
}
.max-w-\[2rem\]{
max-width: 2rem;
}
.max-w-\[32rem\]{
max-width: 32rem;
}
.max-w-\[40rem\]{
max-width: 40rem;
}
.max-w-\[70vw\]{
max-width: 70vw;
}
.max-w-\[8rem\]{
max-width: 8rem;
}
.max-w-md{
max-width: 28rem;
}
@ -14419,9 +14422,6 @@ html{
.flex-1{
flex: 1 1 0%;
}
.flex-shrink-0{
flex-shrink: 0;
}
.grow{
flex-grow: 1;
}
@ -14461,8 +14461,8 @@ html{
.cursor-default{
cursor: default;
}
.grid-cols-1{
grid-template-columns: repeat(1, minmax(0, 1fr));
.cursor-pointer{
cursor: pointer;
}
.grid-cols-2{
grid-template-columns: repeat(2, minmax(0, 1fr));
@ -14568,18 +14568,12 @@ html{
.overflow-y-hidden{
overflow-y: hidden;
}
.whitespace-nowrap{
white-space: nowrap;
}
.rounded{
border-radius: 0.25rem;
}
.rounded-\[1rem\]{
border-radius: 1rem;
}
.rounded-full{
border-radius: 9999px;
}
.rounded-lg{
border-radius: 0.5rem;
}
@ -14619,10 +14613,6 @@ html{
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
.rounded-t-\[1rem\]{
border-top-left-radius: 1rem;
border-top-right-radius: 1rem;
}
.border{
border-width: 1px;
}
@ -14632,9 +14622,6 @@ html{
.border-b-2{
border-bottom-width: 2px;
}
.border-b-4{
border-bottom-width: 4px;
}
.border-l{
border-left-width: 1px;
}
@ -14647,39 +14634,28 @@ html{
.border-t{
border-top-width: 1px;
}
.border-none{
border-style: none;
}
.border-gray-200{
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity));
}
.border-gray-300{
--tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity));
}
.border-gray-400{
--tw-border-opacity: 1;
border-color: rgb(156 163 175 / var(--tw-border-opacity));
}
.border-indigo-400{
--tw-border-opacity: 1;
border-color: rgb(129 140 248 / var(--tw-border-opacity));
}
.border-transparent{
border-color: transparent;
}
.border-cyan-600{
--tw-border-opacity: 1;
border-color: rgb(8 145 178 / var(--tw-border-opacity));
}
.border-red-400{
--tw-border-opacity: 1;
border-color: rgb(248 113 113 / var(--tw-border-opacity));
}
.border-transparent{
border-color: transparent;
}
.border-opacity-40{
--tw-border-opacity: 0.4;
}
.bg-gray-100{
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}
.bg-gray-500{
--tw-bg-opacity: 1;
background-color: rgb(107 114 128 / var(--tw-bg-opacity));
@ -14711,12 +14687,13 @@ html{
--tw-bg-opacity: 1;
background-color: rgb(39 39 42 / var(--tw-bg-opacity));
}
.fill-red-400{
fill: #f87171;
.bg-cyan-600{
--tw-bg-opacity: 1;
background-color: rgb(8 145 178 / var(--tw-bg-opacity));
}
.object-cover{
-o-object-fit: cover;
object-fit: cover;
.bg-red-400{
--tw-bg-opacity: 1;
background-color: rgb(248 113 113 / var(--tw-bg-opacity));
}
.p-2{
padding: 0.5rem;
@ -14750,10 +14727,6 @@ html{
padding-left: 1.25rem;
padding-right: 1.25rem;
}
.px-6{
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.px-8{
padding-left: 2rem;
padding-right: 2rem;
@ -14778,10 +14751,6 @@ html{
padding-top: 0.75rem;
padding-bottom: 0.75rem;
}
.py-4{
padding-top: 1rem;
padding-bottom: 1rem;
}
.py-6{
padding-top: 1.5rem;
padding-bottom: 1.5rem;
@ -14789,9 +14758,6 @@ html{
.pb-4{
padding-bottom: 1rem;
}
.pb-6{
padding-bottom: 1.5rem;
}
.pl-3{
padding-left: 0.75rem;
}
@ -14804,9 +14770,6 @@ html{
.pt-2{
padding-top: 0.5rem;
}
.pt-8{
padding-top: 2rem;
}
.text-left{
text-align: left;
}
@ -14819,10 +14782,6 @@ html{
.align-middle{
vertical-align: middle;
}
.text-2xl{
font-size: 1.5rem;
line-height: 2rem;
}
.text-3xl{
font-size: 1.875rem;
line-height: 2.25rem;
@ -14843,10 +14802,6 @@ html{
font-size: 0.875rem;
line-height: 1.25rem;
}
.text-xl{
font-size: 1.25rem;
line-height: 1.75rem;
}
.text-xs{
font-size: 0.75rem;
line-height: 1rem;
@ -14875,12 +14830,6 @@ html{
.leading-5{
line-height: 1.25rem;
}
.leading-7{
line-height: 1.75rem;
}
.tracking-wider{
letter-spacing: 0.05em;
}
.tracking-widest{
letter-spacing: 0.1em;
}
@ -14888,10 +14837,6 @@ html{
--tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity));
}
.text-gray-300{
--tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity));
}
.text-gray-400{
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity));
@ -14928,10 +14873,6 @@ html{
--tw-text-opacity: 1;
color: rgb(254 202 202 / var(--tw-text-opacity));
}
.text-red-400{
--tw-text-opacity: 1;
color: rgb(248 113 113 / var(--tw-text-opacity));
}
.text-red-600{
--tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity));
@ -14944,6 +14885,14 @@ html{
--tw-text-opacity: 1;
color: rgb(161 161 170 / var(--tw-text-opacity));
}
.text-cyan-600{
--tw-text-opacity: 1;
color: rgb(8 145 178 / var(--tw-text-opacity));
}
.text-red-400{
--tw-text-opacity: 1;
color: rgb(248 113 113 / var(--tw-text-opacity));
}
.underline{
text-decoration-line: underline;
}
@ -15024,11 +14973,6 @@ html{
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.transition-colors{
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.duration-150{
transition-duration: 150ms;
}
@ -15094,6 +15038,9 @@ html{
.scrollbar-track-zinc-700{
--scrollbar-track: #3f3f46 !important;
}
.scrollbar-thumb-cyan-600{
--scrollbar-thumb: #0891b2 !important;
}
.scrollbar-thumb-red-400{
--scrollbar-thumb: #f87171 !important;
}
@ -15137,10 +15084,6 @@ html{
--tw-bg-opacity: 1;
background-color: rgb(153 27 27 / var(--tw-bg-opacity));
}
.hover\:bg-zinc-600:hover{
--tw-bg-opacity: 1;
background-color: rgb(82 82 91 / var(--tw-bg-opacity));
}
.hover\:bg-zinc-700:hover{
--tw-bg-opacity: 1;
background-color: rgb(63 63 70 / var(--tw-bg-opacity));
@ -15169,10 +15112,6 @@ html{
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.hover\:text-red-400:hover{
--tw-text-opacity: 1;
color: rgb(248 113 113 / var(--tw-text-opacity));
}
.hover\:underline:hover{
text-decoration-line: underline;
}
@ -15297,10 +15236,6 @@ html{
--tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity));
}
.active\:text-red-400:active{
--tw-text-opacity: 1;
color: rgb(248 113 113 / var(--tw-text-opacity));
}
.active\:text-zinc-700:active{
--tw-text-opacity: 1;
color: rgb(63 63 70 / var(--tw-text-opacity));
@ -15310,11 +15245,6 @@ html{
}
@media (prefers-color-scheme: dark){
.dark\:bg-gray-900{
--tw-bg-opacity: 1;
background-color: rgb(17 24 39 / var(--tw-bg-opacity));
}
.dark\:text-gray-400{
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity));
@ -15401,10 +15331,6 @@ html{
align-items: center;
}
.sm\:justify-start{
justify-content: flex-start;
}
.sm\:justify-between{
justify-content: space-between;
}
@ -15426,10 +15352,6 @@ html{
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.sm\:pt-0{
padding-top: 0px;
}
}
@media (min-width: 768px){

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
<div class="bg-red-400 text-red-400 border-red-400 scrollbar-thumb-red-400 hidden"></div>

View File

@ -0,0 +1,5 @@
@props(['image', 'id'])
<input type="checkbox" id="{{ $id }}" class="modal-toggle" />
<div class="modal">
<label class="w-full h-full flex" for="{{ $id }}"><img class="h-auto min-w-[70vw] max-w-[70vw] m-auto" src="{{ asset($image) }}"></label>
</div>

View File

@ -0,0 +1,19 @@
@props(['keys'])
@php
$layout = [
0 => ['ESC' => ['ESC'],'F1' => ['F1', 'ml-[2.5rem] w-[2.5rem]'],'F2' => ['F2'],'F3' => ['F3'],'F4' => ['F4'],'F5' => ['F5', 'ml-[1rem] w-[2.5rem]'],'F6' => ['F6'],'F7' => ['F7'],'F8' => ['F8'],'F9' => ['F9', 'ml-[1rem] w-[2.5rem]'],'F10' => ['F10'],'F11' => ['F11'],'F12' => ['F12'], 'DRUCK' => ['DRUCK', 'ml-[1rem] w-[3rem] text-sm'], 'ROLLEN' => ['ROLLEN', 'w-[3rem] text-sm'], 'PAUSE' => ['PAUSE', 'w-[3rem] text-sm'], 'CAL' => ['CAL', 'ml-[1rem] w-[2.5rem]'], 'SPEAKER' => ['🔈'], 'SPEAKER_LOW' => ['🔉'], 'SPEAKER_HIGH' => ['🔊']],
1 => ['^' => ['^'], '1' => ['1'], '2' => ['2'], '3' => ['3'], '4' => ['4'], '5' => ['5'], '6' => ['6'], '7' => ['7'], '8' => ['8'], '9' => ['9'], '0' => ['0'], 'ß' => ['ß'], '´' => ['´'], 'BACKSPACE' => ['←', 'w-[4.2rem]'], 'EINFG' => ['EINFG', 'ml-[1rem] w-[3rem] text-sm'], 'POS1' => ['POS1', 'w-[3rem] text-sm'], 'BILD▲' => ['BILD▲', 'w-[3rem] text-sm'], 'NUM' => ['NUM', 'ml-[1rem] w-[2.5rem]'], 'NUM÷' => ['÷'], 'NUM*' => ['*'], 'NUM-' => ['-']],
2 => ['TAB' => ['⇄', 'w-[3.2rem]'], 'Q' => ['Q'], 'W' => ['W'], 'E' => ['E'], 'R' => ['R'], 'T' => ['T'], 'Z' => ['Z'], 'U' => ['U'], 'I' => ['I'], 'O' => ['O'], 'P' => ['P'], 'Ü' => ['Ü'], '+' => ['+'], 'RETURN' => ['↵', 'w-[3.5rem]'], 'ENTF' => ['ENTF', 'ml-[1rem] w-[3rem] text-sm'], 'ENDE' => ['ENDE', 'w-[3rem] text-sm'], 'BILD▼' => ['BILD▼', 'w-[3rem] text-sm'], 'NUM7' => ['7', 'ml-[1rem] w-[2.5rem]'], 'NUM8' => ['8'], 'NUM9' => ['9'], 'NUM+' => ['+']],
3 => ['CAPS' => ['⇓', 'w-[4.2rem]'], 'A' => ['A'], 'S' => ['S'], 'D' => ['D'], 'F' => ['F'], 'G' => ['G'], 'H' => ['H'], 'J' => ['J'], 'K' => ['K'], 'L' => ['L'], 'Ö' => ['Ö'], 'Ä' => ['Ä'], '#' => ['#', 'mr-[13.5rem] w-[2.5rem]'], 'NUM4' => ['4', 'ml-[1rem] w-[2.5rem]'], 'NUM5' => ['5'], 'NUM6' => ['6', 'mr-[2.74rem] w-[2.5rem]']],
4 => ['SHIFT' => ['⇧', 'w-[3rem]'], '<' => ['<'], 'Y' => ['Y'], 'X' => ['X'], 'C' => ['C'], 'V' => ['V'], 'B' => ['B'], 'N' => ['N'], 'M' => ['M'], ',' => [','], '.' => ['.'], '-' => ['-'], 'RSHIFT' => ['⇧', 'w-[6.5rem]'], 'UP' => ['▲', 'mr-[3.25rem] ml-[4.25rem] w-[3rem]'], 'NUM1' => ['1', 'ml-[1rem] w-[2.5rem]'], 'NUM2' => ['2'], 'NUM3' => ['3'], 'NUM↵' => ['↵']],
5 => ['CTRL' => ['CTRL', 'w-[3rem]'], 'HOME' => ['⌘', 'w-[3rem]'], 'ALT' => ['ALT', 'w-[3rem]'], 'SPACE' => ['SPACE', 'w-[17.2rem]'], 'ALTGR' => ['ALTGR', 'w-[3rem]'], 'RHOME' => ['⌘', 'w-[3rem]'], 'FN' => ['FN', 'w-[3rem]'], 'RCTRL' => ['CTRL', 'w-[3rem]'], 'LEFT' => ['◀︎', 'ml-[1rem] w-[3rem]'], 'DOWN' => ['▼', 'w-[3rem]'], 'RIGHT' => ['▶', 'w-[3rem]'], 'NUM0' => ['0', 'ml-[1rem] w-[5.2rem]'], 'NUM.' => ['.', 'mr-[2.75rem] w-[2.5rem]']],
]
@endphp
@foreach($layout as $row)
<div class="flex justify-center gap-1 my-1 w-full">
@foreach($row as $dbString => $key)
<kbd
class="kbd border-{{ env('ACCENT_COLOR') }} {{ in_array($dbString, $keys, true) ? ' bg-zinc-700' : ' bg-zinc-800' }} {{ $key[1] ?? 'w-[2.5rem]' }}">{{ $key[0] }}</kbd>
@endforeach
</div>
@endforeach

View File

@ -37,8 +37,9 @@
<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>
</head>
<body x-data="{ sidebarOpen: false }" class="antialiased bg-zinc-700 text-gray-400 scrollbar-thin scrollbar-thumb-red-400 scrollbar-track-zinc-700 scrollbar-corner-zinc-800 scrollbar-thumb-rounded"
<body x-data="{ sidebarOpen: false }" class="antialiased bg-zinc-700 text-gray-400 scrollbar-thin scrollbar-thumb-{{ env('ACCENT_COLOR') }} scrollbar-track-zinc-700 scrollbar-corner-zinc-800 scrollbar-thumb-rounded"
style="font-family: 'PT Sans',sans-serif;">
<x-env-tailwind-class-generator />
<div class="min-h-screen">
<x-layout.sidebar/>
<div class="mr-[.5rem] min-h-screen -mb-[6.5rem] ml-[4rem]"
@ -47,9 +48,9 @@
<header>
<div class="h-[6rem] bg-zinc-800 -mx-2 flex">
<div class="my-auto mx-auto flex">
<img src="{{ asset('img/shurizma.png') }}" alt="" class="h-[3.5rem]"/>
<img src="{{ asset('img/logo.png') }}" alt="" class="h-[3.5rem] mx-2"/>
<div>
<h2 class="text-lg font-bold text-red-400">{{ env('APP_NAME') }}</h2>
<h2 class="text-lg font-bold text-{{ env('ACCENT_COLOR') }}">{{ env('APP_NAME') }}</h2>
<p>{{ env('APP_TITLE') }}</p>
</div>
</div>

View File

@ -1,6 +1,6 @@
@unless ($breadcrumbs->isEmpty())
<nav aria-label="breadcrumb" class="text-red-400 font-semibold">
<ol class="flex h-8 space-x-2 text-red-400">
<nav aria-label="breadcrumb" class="text-{{ env('ACCENT_COLOR') }} font-semibold">
<ol class="flex h-8 space-x-2 text-{{ env('ACCENT_COLOR') }}">
@foreach ($breadcrumbs as $breadcrumb)
@if (!is_null($breadcrumb->url) && $loop->first)
<li class="flex items-center">
@ -9,7 +9,7 @@
</li>
@elseif(!is_null($breadcrumb->url) && !$loop->last)
<li class="flex items-center space-x-1">
<span class="text-red-400">/</span>
<span class="text-{{ env('ACCENT_COLOR') }}">/</span>
<a rel="noopener noreferrer" href="{{ $breadcrumb->url }}"
class="flex items-center px-1 capitalize hover:underline">{{ $breadcrumb->title }}</a>
</li>

View File

@ -4,22 +4,29 @@
class="flex flex-col p-3 bg-zinc-800 text-gray-400 h-screen w-14"
:class="sidebarOpen ? 'w-60' : ''">
<div class="space-y-3 h-full">
<div class="flex items-center justify-between text-red-400 h-[5rem]">
<div class="flex items-center justify-between text-{{ env('ACCENT_COLOR') }} h-[5rem]">
<h2 x-show="sidebarOpen" style="display: none;">{{ __('This is a sidebar') }}</h2>
<button x-on:click="sidebarOpen = ! sidebarOpen" class="p-2">
<i class="fas fa-bars fa-lg text-red-400"></i>
<i class="fas fa-bars fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</button>
</div>
<div class="flex-1">
<ul class="pt-2 pb-4 space-y-1 text-sm">
<x-layout.sidebar.list-element href="{{ route('home') }}" title="{{ __('Home') }}">
<x-slot:icon>
<i class="fa-solid fa-house-chimney fa-lg text-red-400"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@if(env('LANDING_PAGE', false))
<x-layout.sidebar.list-element href="{{ route('home') }}" title="{{ __('Home') }}">
<x-slot:icon>
<i class="fa-solid fa-house-chimney fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@endif
<x-layout.sidebar.list-element href="{{ route('keybinds') }}" title="{{ __('Keybinds') }}" class="h-[2rem]">
<x-slot:icon>
<i class="fa-solid fa-keyboard fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
<x-layout.sidebar.list-element href="{{ route('vehicles') }}" title="{{ __('Vehicles') }}" class="h-[2rem]">
<x-slot:icon>
<i class="fa-solid fa-car fa-lg text-red-400"></i>
<i class="fa-solid fa-car fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
</ul>
@ -30,19 +37,19 @@
@if(!Auth::check())
<x-layout.sidebar.list-element href="{{ route('login') }}" title="{{ __('Login')}}">
<x-slot:icon>
<i class="fa-solid fa-right-to-bracket fa-lg text-red-400"></i>
<i class="fa-solid fa-right-to-bracket fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@endif
@if(Auth::check())
<x-layout.sidebar.list-element href="{{ route('logout') }}" title="{{ __('Logout') }}">
<x-slot:icon>
<i class="fa-solid fa-door-open fa-lg text-red-400"></i>
<i class="fa-solid fa-door-open fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
<x-layout.sidebar.list-element href="{{ route('dashboard') }}" title="{{ __('Dashboard') }}">
<x-slot:icon>
<i class="fa-solid fa-user fa-lg text-red-400"></i>
<i class="fa-solid fa-user fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@endif
@ -50,7 +57,7 @@
</div>
@auth()
<div x-show="sidebarOpen" style="display: none;" class="flex items-center space-x-4 justify-self-end">
<h2 class="text-lg font-semibold text-red-400"><a rel="noopener noreferrer" href="{{ route('profile.edit') }}">{{ Auth::getUser()->getName() }}</a></h2>
<h2 class="text-lg font-semibold text-{{ env('ACCENT_COLOR') }}"><a rel="noopener noreferrer" href="{{ route('profile.edit') }}">{{ Auth::getUser()->getName() }}</a></h2>
</div>
@endauth
</div>

View File

@ -1,3 +1,3 @@
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'w-full border border-red-400 px-8 py-3 font-semibold rounded-md hover:bg-zinc-700 active:bg-zinc-700 focus-visible:outline-none focus:border-red-500 focus:ring-red-500']) }}>
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'w-full border border-' . env('ACCENT_COLOR') . ' px-8 py-3 font-semibold rounded-md hover:bg-zinc-700 active:bg-zinc-700 focus-visible:outline-none focus:border-red-500 focus:ring-red-500']) }}>
{{ $slot }}
</button>

View File

@ -7,10 +7,10 @@
<div id="searchContainer" class="flex max-w-min md:min-w-[25rem] mx-auto">
<noscript class="flex">
<input id="search" name="search"
class="input input-bordered bg-zinc-800 border-red-400 focus:bg-zinc-700 placeholder-gray-400 rounded-l-lg rounded-r-none w-[23rem]" placeholder="{{ $placeholder }}"/>
class="input input-bordered bg-zinc-800 border-{{ env('ACCENT_COLOR') }} focus:bg-zinc-700 placeholder-gray-400 rounded-l-lg rounded-r-none w-[23rem]" placeholder="{{ $placeholder }}"/>
<button type="submit" id="select2-btn"
class="btn btn-square bg-zinc-800 border-red-400 hover:bg-zinc-700 rounded-l-none rounded-r-lg">
<i class="fa-solid fa-magnifying-glass fa-lg text-red-400"></i>
class="btn btn-square bg-zinc-800 border-{{ env('ACCENT_COLOR') }} hover:bg-zinc-700 rounded-l-none rounded-r-lg">
<i class="fa-solid fa-magnifying-glass fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</button>
</noscript>
</div>
@ -42,11 +42,11 @@
}
window.addEventListener('load', () => {
document.getElementById('searchContainer').innerHTML = '<button type="button" x-on:click="$(\'#search\').val(\'\').change();" class="btn btn-square bg-zinc-800 border-red-400 hover:bg-zinc-700 rounded-l-lg rounded-r-none">'
+ '<i class="fa-solid fa-x fa-xs text-red-400"></i></button>'
+ '<select id="search" name="search" class="bg-zinc-800 border-red-400 focus:bg-zinc-700 placeholder-gray-400 rounded-none w-[21rem]"></select>'
+ '<button type="submit" id="select2-btn" class="btn btn-square bg-zinc-800 border-red-400 hover:bg-zinc-700 rounded-l-none rounded-r-lg">'
+ '<i class="fa-solid fa-magnifying-glass fa-lg text-red-400"></i></button>';
document.getElementById('searchContainer').innerHTML = '<button type="button" x-on:click="$(\'#search\').val(\'\').change();" class="btn btn-square bg-zinc-800 border-{{ env('ACCENT_COLOR') }} hover:bg-zinc-700 rounded-l-lg rounded-r-none">'
+ '<i class="fa-solid fa-x fa-xs text-{{ env('ACCENT_COLOR') }}"></i></button>'
+ '<select id="search" name="search" class="bg-zinc-800 border-{{ env('ACCENT_COLOR') }} focus:bg-zinc-700 placeholder-gray-400 rounded-none w-[21rem]"></select>'
+ '<button type="submit" id="select2-btn" class="btn btn-square bg-zinc-800 border-{{ env('ACCENT_COLOR') }} hover:bg-zinc-700 rounded-l-none rounded-r-lg">'
+ '<i class="fa-solid fa-magnifying-glass fa-lg text-{{ env('ACCENT_COLOR') }}"></i></button>';
$('#search').on('select2:select', function (e) {
document.getElementById('select2-btn').focus();

View File

@ -1,3 +1,3 @@
<section {{ $attributes(['class' => 'border-b-2 border-red-400 pb-4']) }}>
<section {{ $attributes(['class' => 'border-b-2 border-' . env('ACCENT_COLOR') . ' pb-4']) }}>
{{ $slot }}
</section>

View File

@ -1,7 +1,7 @@
@props(['enums' => null, 'alpineVariable', 'placeholder', 'default' => null, 'functionCall' => null, 'bool' => false, 'boolTrue' => 'True', 'boolFalse' => 'False', 'multiple' => false])
<noscript>
<select id="{{ $alpineVariable }}" tabindex="0"
class="border w-[20rem] bg-zinc-800 border-red-400 placeholder-gray-400 rounded-lg max-h-[20rem] overflow-y-auto text-left text-wrap" {{ $multiple && !$bool ? 'multiple' : '' }}>
class="border w-[20rem] bg-zinc-800 border-{{ env('ACCENT_COLOR') }} placeholder-gray-400 rounded-lg max-h-[20rem] overflow-y-auto text-left text-wrap" {{ $multiple && !$bool ? 'multiple' : '' }}>
<option
class="focus:bg-zinc-700 hover:bg-zinc-700 active:bg-zinc-700 hover:text-gray-200 active:text-gray-200 focus:text-gray-200"
value="">{{ $placeholder }}</option>
@ -27,10 +27,10 @@
window.addEventListener('load', () => {
document.getElementById('{{ $alpineVariable }}-container').innerHTML = '<div class="dropdown dropdown-hover mx-auto" x-data="{ {{ $alpineVariable }}: {{ !empty(app('request')->input($alpineVariable)) ? json_encode(explode(',', app('request')->input($alpineVariable))) : json_encode([]) }} }">'
+ '<div class="flex"><input name="{{ $alpineVariable }}" class="hidden" value="" x-bind:value="{{ $alpineVariable }}"/>'
+ '<label tabindex="0" class="btn w-[11rem] bg-zinc-800 border-red-400 focus:bg-zinc-700 hover:bg-zinc-700 placeholder-gray-400 rounded-l-lg rounded-r-none normal-case font-normal" x-text="{{ $alpineVariable }}.length != 0 ? ({{ json_encode($multiple) }} ? {{ "'" . $placeholder . " ('" }} + {{ $alpineVariable }}.length + \' picked)\' : {{ $alpineVariable }}.join(\', \')) : {{ "'" . $placeholder . "'" }}"></label>'
+ '<button type="button" x-on:click="{{ $alpineVariable }} = []" class="btn btn-square bg-zinc-800 border-red-400 hover:bg-zinc-700 rounded-l-none rounded-r-lg max-w-[2rem]">'
+ '<i class="fa-solid fa-x fa-xs text-red-400"></i></button></div>'
+ '<ul tabindex="0" class="dropdown-content border menu flex-nowrap shadow rounded-box w-[13rem] bg-zinc-800 border-red-400 placeholder-gray-400 rounded-lg max-h-[20rem] overflow-y-auto text-left">'
+ '<label tabindex="0" class="btn w-[11rem] bg-zinc-800 border-{{ env('ACCENT_COLOR') }} focus:bg-zinc-700 hover:bg-zinc-700 placeholder-gray-400 rounded-l-lg rounded-r-none normal-case font-normal" x-text="{{ $alpineVariable }}.length != 0 ? ({{ json_encode($multiple) }} ? {{ "'" . $placeholder . " ('" }} + {{ $alpineVariable }}.length + \' picked)\' : {{ $alpineVariable }}.join(\', \')) : {{ "'" . $placeholder . "'" }}"></label>'
+ '<button type="button" x-on:click="{{ $alpineVariable }} = []" class="btn btn-square bg-zinc-800 border-{{ env('ACCENT_COLOR') }} hover:bg-zinc-700 rounded-l-none rounded-r-lg max-w-[2rem]">'
+ '<i class="fa-solid fa-x fa-xs text-{{ env('ACCENT_COLOR') }}"></i></button></div>'
+ '<ul tabindex="0" class="dropdown-content border menu flex-nowrap shadow rounded-box w-[13rem] bg-zinc-800 border-{{ env('ACCENT_COLOR') }} placeholder-gray-400 rounded-lg max-h-[20rem] overflow-y-auto text-left">'
@if($bool)
+ '<li><a class="focus:bg-zinc-700 hover:bg-zinc-700 active:bg-zinc-700 hover:text-gray-200 active:text-gray-200 focus:text-gray-200" x-on:click="{{ $alpineVariable . '.includes(\'' . $boolTrue . '\') ? ' . $alpineVariable . '.splice(' . $alpineVariable .'.indexOf(\'' . $boolTrue . '\'), 1) : ' . $alpineVariable . ' = [\'' . $boolTrue . '\'];' }}">{{ $boolTrue }}</a></li>'
+ '<li><a class="focus:bg-zinc-700 hover:bg-zinc-700 active:bg-zinc-700 hover:text-gray-200 active:text-gray-200 focus:text-gray-200" x-on:click="{{ $alpineVariable . '.includes(\'' . $boolFalse . '\') ? ' . $alpineVariable . '.splice(' . $alpineVariable .'.indexOf(\'' . $boolFalse . '\'), 1) : ' . $alpineVariable . ' = [\'' . $boolFalse . '\'];' }}">{{ $boolFalse }}</a></li>'

View File

@ -5,16 +5,16 @@
$type = $args['type'];
$value = $args['value'] ?? ($type === 'int' ? 0 : '');
$rowType = 'div';
$classes = ['p-3 border-opacity-40 border-red-400 grow basis-0 border min-w-[10rem] min-h-[5rem]', ($type === 'int' ? 'text-right' : 'text-left'), ($mode === 'tableVertical' ? 'min-w-[10rem] min-h-[5rem]' : ''), ($header ? 'font-bold' : '')];
$classes = ['p-3 border-opacity-40 border-' . env('ACCENT_COLOR') . ' grow basis-0 border min-w-[6rem]', ($type === 'int' ? 'text-right' : 'text-left'), ($mode === 'tableVertical' ? 'max-w-[8rem] min-h-[5rem]' : ''), ($header ? 'font-bold' : '')];
$html = '<' . $rowType . ' class="' . implode(' ', $classes) . '">';
$valueHtml = match ($type) {
'string' => $value,
'int' => $value . ($args['unit'] ?? ''),
'image' => '<img class="max-h-[3.5rem]" src="' . $value . '" alt="' . $field . '">'
'image' => '<label for="image_modal_' . $value . '"><img class="max-h-[3.5rem] cursor-pointer" src="' . $value . '" alt="' . $field . '"></label>'
};
if (!empty($args['link'])) {
$html .= '<a class="text-red-400" href="' . $args['link'] . '">' . $valueHtml . '</a>';
$html .= '<a class="text-' . env('ACCENT_COLOR') . '" href="' . $args['link'] . '">' . $valueHtml . '</a>';
} else {
$html .= $valueHtml;
}
@ -28,5 +28,8 @@
<div class="bg-zinc-800 hover:bg-zinc-700 first:hover:bg-zinc-800 flex {{ $mode === 'tableVertical' ? 'flex-col' : 'last:rounded-b-[1rem] first:rounded-t-[1rem]' }} {{ $header ? 'sticky self-start ' . ($mode === 'tableVertical' ? 'left-0' : 'top-0') : '' }}">
@foreach($values as $field => $value)
{!! getFieldHtml($value, $field, $header, $mode) !!}
@if($value['type'] === 'image')
<x-image-modal image="{{ $value['value'] }}" id="image_modal_{{ $value['value'] }}" />
@endif
@endforeach
</div>

View File

@ -1,6 +1,6 @@
@props(['mode', 'values'])
<div
class="min-w-full max-h-[90vh] bg-zinc-800 rounded-[1rem] overflow-y-auto border-opacity-40 border-red-400 border-l border-t {{ $mode === 'tableVertical' ? 'border-r' : 'border-b' }} last:border-none scrollbar-thin">
class="min-w-full max-h-[90vh] bg-zinc-800 rounded-[1rem] overflow-y-auto border-opacity-40 border-{{ env('ACCENT_COLOR') }} border-l border-t {{ $mode === 'tableVertical' ? 'border-r' : 'border-b' }} last:border-none scrollbar-thin">
<div class="mx-auto min-w-max {{ $mode === 'tableVertical' ? 'flex' : '' }}">
@foreach($values as $index => $value)
<x-table.row :header="$index === 0" :values="$value"

View File

@ -1,3 +1,3 @@
@props(['disabled' => false])
<input {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'border-red-400 focus:border-red-500 focus:ring-red-500 rounded-md shadow-sm w-full px-3 py-2 border bg-transparent']) !!}>
<input {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'border-' . env('ACCENT_COLOR') . ' focus:border-red-500 focus:ring-red-500 rounded-md shadow-sm w-full px-3 py-2 border bg-transparent']) !!}>

View File

@ -5,24 +5,46 @@
@endphp
<div
class="flex flex-col w-full max-w-[40rem] min-h-[40rem] p-6 space-y-6 overflow-hidden rounded-lg shadow-md bg-zinc-800 text-red-400 m-auto border border-red-400">
class="flex flex-col w-full max-w-[40rem] min-h-[40rem] p-6 space-y-6 overflow-hidden rounded-lg shadow-md bg-zinc-800 text-{{ env('ACCENT_COLOR') }} m-auto border border-{{ env('ACCENT_COLOR') }}">
<div>
<img src="{{ asset('img/vehicles/' . $vehicle->getImagePath()) }}" alt="Photo of {{ $vehicle->getName() }}"
class="rounded-xl" width="100%">
<label for="image_modal_{{ 'img/vehicles/' . $vehicle->getVehicleId() . '.png' }}"><img src="{{ asset('img/vehicles/' . $vehicle->getVehicleId() . '.png') }}" alt="Photo of {{ $vehicle->getVehicleName() }}"
class="rounded-xl cursor-pointer" width="100%"></label>
<x-image-modal image="{{ 'img/vehicles/' . $vehicle->getVehicleId() . '.png' }}" id="image_modal_{{ 'img/vehicles/' . $vehicle->getVehicleId() . '.png' }}"/>
</div>
<div class="flex flex-col justify-between flex-1">
<header>
<div class="mt-4">
<h1 class="text-3xl clamp one-line">{{ $vehicle->getName() }}</h1>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Brand') }}: {{ $brand }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Class') }}: {{ $class }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Storage') }}: {{ $vehicle->getStorage() }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Fuel Type') }}: {{ $fuelType }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Fuel Volume') }}: {{ $vehicle->getFuelVolume() }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Seats') }}: {{ $vehicle->getSeats() }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Price') }}: {{ $vehicle->getPrice() }}</span>
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Top Speed') }}: {{ $vehicle->getTopSpeed() }}</span>
<h1 class="text-3xl clamp one-line">{{ $vehicle->getVehicleName() }}</h1>
@foreach(explode(',', env('FIELDS')) as $field)
@switch($field)
@case('brand')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Brand') }}: {{ $brand }}</span>
@break
@case('class')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Class') }}: {{ $class }}</span>
@break
@case('storage')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Storage') }}: {{ $vehicle->getVehicleStorage() }}</span>
@break
@case('fuel_type')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Fuel Type') }}: {{ $fuelType }}</span>
@break
@case('fuel_volume')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Fuel Volume') }}: {{ $vehicle->getVehicleFuelVolume() }}</span>
@break
@case('seats')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Seats') }}: {{ $vehicle->getVehicleSeats() }}</span>
@break
@case('price')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Price') }}: {{ $vehicle->getVehiclePrice() }}</span>
@break
@case('top_speed')
<span class="mt-2 block text-zinc-400 text-xs">{{ __('Top Speed') }}: {{ $vehicle->getVehicleTopSpeed() }}</span>
@break
@default
@endswitch
@endforeach
</div>
</header>
@ -32,6 +54,11 @@
<p>{{ __('Sold at') }}: {{ $vendor }}</p>
</h5>
</div>
<div class="flex items-center text-sm">
<h5 class="font-bold mr-3">
<p>{{ __('ID') }}: {{ $vehicle->getVehicleId() }}</p>
</h5>
</div>
</footer>
</div>
</div>

View File

@ -3,9 +3,54 @@
{{ Breadcrumbs::render('home') }}
</x-slot:breadcrumb>
<x-slot name="header">
<h1 class="text-lg text-center font-bold">{{ __('Welcome home') }}</h1>
{{ __('GG man! You just found my website.') }}<br>
{{ __('You can leave again tho. Nothing to see here.') }}
<h1 class="text-lg text-center font-bold">{{ __('Keyboard test') }}</h1>
<div class="flex justify-center gap-1 my-1 w-full">
<kbd class="kbd">ESC</kbd>
<kbd class="kbd">F1</kbd>
<kbd class="kbd">F2</kbd>
<kbd class="kbd">F3</kbd>
<kbd class="kbd">F4</kbd>
<kbd class="kbd">F5</kbd>
<kbd class="kbd">F6</kbd>
<kbd class="kbd">F7</kbd>
<kbd class="kbd">F8</kbd>
<kbd class="kbd">F9</kbd>
<kbd class="kbd">F10</kbd>
<kbd class="kbd">F11</kbd>
<kbd class="kbd">F12</kbd>
</div>
<div class="flex justify-center gap-1 my-1 w-full">
<kbd class="kbd">q</kbd>
<kbd class="kbd">w</kbd>
<kbd class="kbd">e</kbd>
<kbd class="kbd">r</kbd>
<kbd class="kbd">t</kbd>
<kbd class="kbd">z</kbd>
<kbd class="kbd">u</kbd>
<kbd class="kbd">i</kbd>
<kbd class="kbd">o</kbd>
<kbd class="kbd">p</kbd>
</div>
<div class="flex justify-center gap-1 my-1 w-full">
<kbd class="kbd">a</kbd>
<kbd class="kbd">s</kbd>
<kbd class="kbd">d</kbd>
<kbd class="kbd">f</kbd>
<kbd class="kbd">g</kbd>
<kbd class="kbd">h</kbd>
<kbd class="kbd">j</kbd>
<kbd class="kbd">k</kbd>
<kbd class="kbd">l</kbd>
</div>
<div class="flex justify-center gap-1 my-1 w-full">
<kbd class="kbd">y</kbd>
<kbd class="kbd">x</kbd>
<kbd class="kbd">c</kbd>
<kbd class="kbd">v</kbd>
<kbd class="kbd">b</kbd>
<kbd class="kbd">n</kbd>
<kbd class="kbd">m</kbd>
<kbd class="kbd">/</kbd>
</div>
</x-slot>
<img alt="" src="{{ asset('img/emotes/shurizGG/shurizGG_original.png') }}" class="max-h-[20rem] block mx-auto"/>
</x-layout>

View File

@ -0,0 +1,28 @@
@php
/** @var \App\Models\Keybind $keybind */
$allKeys = [];
foreach ($keybinds as $keybind) {
$allKeys = array_merge(explode(env('KEYBIND_SEPERATOR'), $keybind->getKeybindKeys()), $allKeys);
}
@endphp
<x-layout title="{{ __('Keybinds') }}">
<x-slot:breadcrumb>
{{ Breadcrumbs::render('keybinds') }}
</x-slot:breadcrumb>
<x-slot name="header">
<h1 class="text-lg text-center font-bold">{{ __('Keybinds') }}</h1>
<x-keyboard :keys="$allKeys"/>
</x-slot>
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8 bg-zinc-800 rounded-[1rem] my-[1rem] text-center grid grid-cols-2">
@foreach($keybinds as $keybind)
<div class="grid grid-cols-2 py-6">
<div>
@foreach(explode(env('KEYBIND_SEPERATOR'), $keybind->getKeybindKeys()) as $index => $key)
@if($index > 0) + @endif<kbd class="kbd bg-zinc-800 border-{{ env('ACCENT_COLOR') }}">{{ $key }}</kbd>
@endforeach
</div>
{{ $keybind->getKeybindDescription() }}
</div>
@endforeach
</div>
</x-layout>

View File

@ -10,60 +10,76 @@
<h2>{{ __('Vehicles') }}</h2>
<x-searchbar-select2 post="{{ route('vehicles') }}" inputClasses="w-[20rem]"
autocomplete="{{ route('vehicles.autocomplete') }}"
placeholder="Select Game or AppId" templateResult="true"
templateSelection="true" text="item.name + '|AppID: ' + item.appID">
placeholder="Select Vehicle" templateResult="true"
templateSelection="true" text="item.vehicle_name">
<x-select-dropdown-hover alpineVariable="vehicle_class_id" placeholder="Pick a Vehicle Class..."
:enums="$vehicleClasses" functionCall="getDescription"/>
:enums="$vehicleClasses" functionCall="getVehicleClassName"/>
<x-select-dropdown-hover alpineVariable="brand_id" placeholder="Pick a Brand..."
:enums="$brands" functionCall="getDescription"/>
:enums="$brands" functionCall="getBrandName"/>
<x-select-dropdown-hover alpineVariable="fuel_type_id" placeholder="Pick a Fuel Type..."
:enums="$fuelTypes"/>
:enums="$fuelTypes" functionCall="getFuelTypeName"/>
<x-select-dropdown-hover alpineVariable="vendor_id" placeholder="Pick a Vendor..."
:enums="$vendors"/>
:enums="$vendors" functionCall="getVendorName"/>
<x-select-dropdown-hover alpineVariable="listMode" :enums="['gridCards', 'tableHorizontal', 'tableVertical']" placeholder="Pick a display mode for the list..." default="gridCards"/>
</x-searchbar-select2>
</x-slot>
@php
$values = [[
'image_path' => ['type' => 'string', 'value' => __('Photo')],
'id' => ['type' => 'string', 'value' => __('Id')],
'name' => ['type' => 'string', 'value' => __('Name')],
'brand' => ['type' => 'string', 'value' => __('Brand')],
'class' => ['type' => 'string', 'value' => __('Class')],
'storage' => ['type' => 'string', 'value' => __('Storage')],
'fuel_type' => ['type' => 'string', 'value' => __('Fuel Type')],
'fuel_volume' => ['type' => 'string', 'value' => __('Fuel Volume')],
'seats' => ['type' => 'string', 'value' => __('Seats')],
'top_speed' => ['type' => 'string', 'value' => __('Top Speed')],
'price' => ['type' => 'string', 'value' => __('Price')],
'vendor' => ['type' => 'string', 'value' => __('Vendor')],
]];
$fields = explode(',', env('FIELDS', ''));
$headerValues = [
'image' => ['type' => 'string', 'value' => __('Photo'),],
'id' => ['type' => 'string', 'value' => __('Id')],
'name' => ['type' => 'string', 'value' => __('Name')],
'brand' => ['type' => 'string', 'value' => __('Brand')],
'class' => ['type' => 'string', 'value' => __('Class')],
'storage' => ['type' => 'string', 'value' => __('Storage')],
'fuel_type' => ['type' => 'string', 'value' => __('Fuel Type')],
'fuel_volume' => ['type' => 'string', 'value' => __('Fuel Volume')],
'seats' => ['type' => 'string', 'value' => __('Seats')],
'top_speed' => ['type' => 'string', 'value' => __('Top Speed')],
'price' => ['type' => 'string', 'value' => __('Price')],
'vendor' => ['type' => 'string', 'value' => __('Vendor')],
];
$values = [];
foreach ($fields as $field) {
$values[0][$field] = $headerValues[$field];
}
$index = 0;
foreach ($vehicles as $key => $vehicle) {
$values[] = [
'image_path' => ['type' => 'image', 'value' => asset('img/vehicles/' . $vehicle->getImagePath())],
'id' => ['type' => 'int', 'value' => $game->getId()],
'name' => ['type' => 'string', 'value' => $game->getName()],
'brand' => ['type' => 'string', 'value' => $brands->firstWhere('id', '=', $vehicle->getBrandId())->getName()],
'class' => ['type' => 'string', 'value' => $vehicleClasses->firstWhere('id', '=', $vehicle->getVehicleClassId())->getName()],
'storage' => ['type' => 'int', 'value' => $vehicle->getStorage()],
'fuel_type' => ['type' => 'string', 'value' => $fuelTypes->firstWhere('id', '=', $vehicle->getFuelTypeId())->getName()],
'fuel_volume' => ['type' => 'int', 'value' => $vehicle->getFuelVolume()],
'seats' => ['type' => 'int', 'value' => $vehicle->getSeats()],
'top_speed' => ['type' => 'int', 'value' => $vehicle->getTopSpeed()],
'price' => ['type' => 'int', 'value' => $vehicle->getPrice(), 'unit' => env('CURRENCY', '$')],
'vendor' => ['type' => 'string', 'value' => $vendors->firstWhere('id', '=', $vehicle->getVendorId())->getName()],
];
$index++;
$fieldValues = [
'image' => ['type' => 'image', 'value' => asset('img/vehicles/' . $vehicle->getVehicleId() . '.png')],
'id' => ['type' => 'int', 'value' => $vehicle->getVehicleId()],
'name' => ['type' => 'string', 'value' => $vehicle->getVehicleName()],
'brand' => ['type' => 'string', 'value' => $brands->firstWhere('brand_id', '=', $vehicle->getBrandId())->getBrandName()],
'class' => ['type' => 'string', 'value' => $vehicleClasses->firstWhere('vehicle_class_id', '=', $vehicle->getVehicleClassId())->getVehicleClassName()],
'storage' => ['type' => 'int', 'value' => $vehicle->getVehicleStorage()],
'fuel_type' => ['type' => 'string', 'value' => $fuelTypes->firstWhere('fuel_type_id', '=', $vehicle->getFuelTypeId())->getFuelTypeName()],
'fuel_volume' => ['type' => 'int', 'value' => $vehicle->getVehicleFuelVolume(), 'unit' => env('FUEL_VOLUME_UNIT', 'l')],
'seats' => ['type' => 'int', 'value' => $vehicle->getVehicleSeats()],
'top_speed' => ['type' => 'int', 'value' => $vehicle->getVehicleTopSpeed(), 'unit' => env('SPEED_UNIT', 'km/h')],
'price' => ['type' => 'int', 'value' => $vehicle->getVehiclePrice(), 'unit' => env('CURRENCY', '$')],
'vendor' => ['type' => 'string', 'value' => $vendors->firstWhere('vendor_id', '=', $vehicle->getVendorId())->getVendorName()],
];
foreach ($fields as $field) {
$values[$index][$field] = $fieldValues[$field];
}
}
@endphp
@switch(app('request')->input('listMode'))
@switch(app('request')->input('listMode') ?? env('DEFAULT_DISPLAY_MODE'))
@case('tableHorizontal')
@case('tableVertical')
<x-table.table :mode="app('request')->input('listMode')" :values="$values" />
<x-table.table :mode="app('request')->input('listMode') ?? env('DEFAULT_DISPLAY_MODE')" :values="$values" />
@break
@default
<x-grid>
@foreach($vehicles as $key => $vehicle)
<x-vehicles.card :vehicle="$vehicle"/>
<x-vehicles.card :vehicle="$vehicle"
:brand="$brands->firstWhere('brand_id', '=', $vehicle->getBrandId())->getBrandName()"
:class="$vehicleClasses->firstWhere('vehicle_class_id', '=', $vehicle->getVehicleClassId())->getVehicleClassName()"
:vendor="$vendors->firstWhere('vendor_id', '=', $vehicle->getVendorId())->getVendorName()"
:fuel-type="$fuelTypes->firstWhere('fuel_type_id', '=', $vehicle->getFuelTypeId())->getFuelTypeName()"/>
@endforeach
</x-grid>
@endswitch

View File

@ -4,24 +4,24 @@
<div class="flex justify-between flex-1 md:hidden">
@if ($paginator->onFirstPage())
<span
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-red-400 bg-zinc-700 hover:bg-zinc-700 border border-red-400 cursor-default leading-5 rounded-md">
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-700 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} cursor-default leading-5 rounded-md">
{!! __('pagination.previous') !!}
</span>
@else
<a href="{{ $paginator->previousPageUrl() }}"
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 leading-5 rounded-md focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-zinc-700 transition ease-in-out duration-150">
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} leading-5 rounded-md focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-zinc-700 transition ease-in-out duration-150">
{!! __('pagination.previous') !!}
</a>
@endif
@if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}"
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 leading-5 rounded-md focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-zinc-700 transition ease-in-out duration-150">
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} leading-5 rounded-md focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-zinc-700 transition ease-in-out duration-150">
{!! __('pagination.next') !!}
</a>
@else
<span
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-red-400 bg-zinc-700 hover:bg-zinc-700 border border-red-400 cursor-default leading-5 rounded-md">
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-700 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} cursor-default leading-5 rounded-md">
{!! __('pagination.next') !!}
</span>
@endif
@ -46,7 +46,7 @@
@if ($paginator->onFirstPage())
<span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
<span
class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 cursor-default rounded-l-md leading-5"
class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} cursor-default rounded-l-md leading-5"
aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
@ -57,7 +57,7 @@
</span>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev"
class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 rounded-l-md leading-5 hover:text-red-400 focus:z-10 focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-red-400 transition ease-in-out duration-150"
class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} rounded-l-md leading-5 hover:text-{{ env('ACCENT_COLOR') }} focus:z-10 focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-{{ env('ACCENT_COLOR') }} transition ease-in-out duration-150"
aria-label="{{ __('pagination.previous') }}">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
@ -73,7 +73,7 @@
@if (is_string($element))
<span aria-disabled="true">
<span
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 cursor-default leading-5">{{ $element }}</span>
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} cursor-default leading-5">{{ $element }}</span>
</span>
@endif
@ -83,11 +83,11 @@
@if ($page == $paginator->currentPage())
<span aria-current="page">
<span
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-red-400 bg-zinc-700 hover:bg-zinc-700 border border-red-400 cursor-default leading-5">{{ $page }}</span>
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-700 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} cursor-default leading-5">{{ $page }}</span>
</span>
@else
<a href="{{ $url }}"
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 leading-5 hover:text-red-400 focus:z-10 focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-red-400 transition ease-in-out duration-150"
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} leading-5 hover:text-{{ env('ACCENT_COLOR') }} focus:z-10 focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-{{ env('ACCENT_COLOR') }} transition ease-in-out duration-150"
aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
{{ $page }}
</a>
@ -99,7 +99,7 @@
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}" rel="next"
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 rounded-r-md leading-5 hover:text-red-400 focus:z-10 focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-red-400 transition ease-in-out duration-150"
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} rounded-r-md leading-5 hover:text-{{ env('ACCENT_COLOR') }} focus:z-10 focus:outline-none focus:border-blue-300 active:bg-zinc-100 active:text-{{ env('ACCENT_COLOR') }} transition ease-in-out duration-150"
aria-label="{{ __('pagination.next') }}">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
@ -110,7 +110,7 @@
@else
<span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
<span
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-red-400 bg-zinc-800 hover:bg-zinc-700 border border-red-400 cursor-default rounded-r-md leading-5"
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-{{ env('ACCENT_COLOR') }} bg-zinc-800 hover:bg-zinc-700 border border-{{ env('ACCENT_COLOR') }} cursor-default rounded-r-md leading-5"
aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"

View File

@ -16,6 +16,12 @@ Breadcrumbs::for('404', function (BreadcrumbTrail $trail) {
$trail->push(__('404 | Not found'), route('home'));
});
// Home > Keybinds
Breadcrumbs::for('keybinds', function (BreadcrumbTrail $trail) {
$trail->parent('home');
$trail->push(__('Keybinds'), route('keybinds'));
});
// Home > Vehicles
Breadcrumbs::for('vehicles', function (BreadcrumbTrail $trail) {
$trail->parent('home');

View File

@ -1,5 +1,6 @@
<?php
use App\Http\Controllers\KeybindController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\VehicleController;
use Illuminate\Support\Facades\Route;
@ -16,9 +17,15 @@ use Illuminate\Support\Facades\Route;
*/
Route::get('/', static function () {
if (!env('LANDING_PAGE', false)) {
return redirect(route('vehicles'));
}
return view('home');
})->name('home');
Route::get('/keybinds', [KeybindController::class, 'index'])->name('keybinds');
Route::get('/vehicles', [VehicleController::class, 'index'])->name('vehicles');
Route::get('/vehicles/autocomplete', [VehicleController::class, 'autocomplete'])->name('vehicles.autocomplete');