Skip to content

Commit

Permalink
adds footer and improves styling and navigation (closes #326)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfroeller committed Jan 15, 2025
1 parent 5ab845e commit 1f53514
Show file tree
Hide file tree
Showing 26 changed files with 358 additions and 231 deletions.
41 changes: 27 additions & 14 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
@import './light-theme.css';
@import './dark-theme.css';
@import url('https://api.fonts.coollabs.io/css2?family=Koulen');
@import url('https://api.fonts.coollabs.io/css2?family=Source+Sans+3:wght@700;400&display=swap');
@import "./light-theme.css";
@import "./dark-theme.css";
@import url("https://api.fonts.coollabs.io/css2?family=Koulen");
@import url("https://api.fonts.coollabs.io/css2?family=Source+Sans+3:wght@700;400&display=swap");

@tailwind base;
@tailwind components;
@tailwind utilities;


/* Overwriting Custom Component Styles */
sl-input, sl-button { /* colors are applied via css-vars in the themes files (using tailwind colors for primary and neutral) */
sl-input,
sl-button {
/* colors are applied via css-vars in the themes files (using tailwind colors for primary and neutral) */
all: revert; /*!important*/ /* purge tailwind classes for all sl components */
}

Expand All @@ -19,11 +20,11 @@ sl-input, sl-button { /* colors are applied via css-vars in the themes files (us
}

#url {
@apply w-full
@apply w-full;
}

sl-input::part(base){
@apply font-sourceSansPro
sl-input::part(base) {
@apply font-sourceSansPro;
}

sl-alert::part(base) {
Expand All @@ -32,7 +33,11 @@ sl-alert::part(base) {

/* Input */
sl-button::part(base) {
@apply cursor-pointer bg-primary-blue text-white rounded-md font-sourceSansPro font-bold; /* add tailwind classes */
@apply cursor-pointer rounded-md font-sourceSansPro font-bold; /* add tailwind classes */
}

sl-button[variant="default"]::part(base) {
@apply bg-primary-blue text-white; /* add tailwind classes */
}

.loader {
Expand All @@ -47,11 +52,19 @@ sl-button::part(base) {

/* Safari */
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
70 changes: 70 additions & 0 deletions resources/views/components/breadcrumbs.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@props([
'location' => 'top',
'route' => null
])

@php
$routeMap = [
'home.index' => 'home',
'monitors.index' => 'monitors',
'monitors.show' => 'monitor',
'monitors.custom.index' => 'monitors',
'monitors.custom.show' => 'monitor',
'milestone.show' => 'milestone',
'pdf.index' => 'pdf',
'settings.index' => 'home',
'settings.monitors.index' => 'home',
'repositories.list' => 'monitors'
];
$breadcrumbName = $route && isset($routeMap[$route]) ? $routeMap[$route] : $route;
$breadcrumbs = $breadcrumbName ? Breadcrumbs::generate($breadcrumbName) : collect([]);
@endphp

@unless ($breadcrumbs->isEmpty())
@if($location === 'top')
<div class="flex flex-col gap-1">
<nav class="flex gap-2 items-center">
@foreach ($breadcrumbs as $breadcrumb)
@if (!is_null($breadcrumb->url) && !$loop->last)
<a
href="{{ $breadcrumb->url }}"
class="transition-colors duration-200 text-primary-blue/70 hover:text-primary-blue font-sourceSansPro"
>
{{ $breadcrumb->title }}
</a>
@else
<span class="font-semibold font-sourceSansPro text-primary-blue">
{{ $breadcrumb->title }}
</span>
@endif

@unless($loop->last)
<sl-icon name="chevron-right" class="text-sm text-primary-blue/40"></sl-icon>
@endunless
@endforeach
</nav>
</div>
@else
<nav class="flex items-center space-x-2 text-sm font-sourceSansPro text-primary-blue/70">
@foreach ($breadcrumbs as $breadcrumb)
@if (!is_null($breadcrumb->url) && !$loop->last)
<a
href="{{ $breadcrumb->url }}"
class="transition-colors duration-200 hover:text-primary-blue"
>
{{ $breadcrumb->title }}
</a>
@else
<span class="text-primary-blue">
{{ $breadcrumb->title }}
</span>
@endif

@unless($loop->last)
<sl-icon name="chevron-right" class="text-sm opacity-70"></sl-icon>
@endunless
@endforeach
</nav>
@endif
@endunless
20 changes: 20 additions & 0 deletions resources/views/components/footer.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<footer class="py-6 mt-auto border-t bg-primary-blue/5 border-primary-blue/10">
<div class="container px-8 mx-auto">
<div class="flex flex-col justify-between items-center space-y-4 md:flex-row md:space-y-0">
<div class="flex gap-4 items-center text-sm text-primary-blue/70">
<span{{ date('Y') }} Propromo. All rights reserved.</span>
<a
href="https://github.com/propromo-software"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center transition-colors duration-200 hover:text-primary-blue"
>
<sl-icon style="font-size: 16px; margin-top: -1px;" name="github"></sl-icon>
<span class="ml-1">GitHub</span>
</a>
</div>

<x-breadcrumbs :route="$route" location="footer" />
</div>
</div>
</footer>
53 changes: 33 additions & 20 deletions resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ isset($title) ? $title.' - '.config('app.name') : config('app.name') }}</title>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ isset($title) ? $title.' - '.config('app.name') : config('app.name') }}</title>

@vite(['resources/css/app.css', 'resources/js/app.js'])
@vite(['resources/css/app.css', 'resources/js/app.js'])

</head>
<body class="min-h-screen font-sans antialiased bg-base-200/50 dark:bg-base-200">
</head>
<body class="relative min-h-screen font-sans antialiased bg-base-200/50 dark:bg-base-200">
<header class="sticky top-0 z-50">
@if(request()->path() !== '/' && request()->path() !== 'create-monitor' && request()->path() !== 'create-open-source-monitor' && request()->path() !== 'register' && request()->path() !== 'login' && request()->path() !== 'join')
@include('components.layouts.navigation-logged-in')
@else
@include('components.layouts.navigation-logged-out')
@endif
</header>

@if(request()->path() !== '/' && request()->path() !== 'create-monitor' && request()->path() !== 'create-open-source-monitor' && request()->path() !== 'register' && request()->path() !== 'login' && request()->path() !== 'join')
@include('components.layouts.navigation-logged-in')
@else
@include('components.layouts.navigation-logged-out')
@endif
<main class="p-8 min-h-screen">
@if(request()->path() !== '/' &&
request()->path() !== 'create-monitor' &&
request()->path() !== 'create-open-source-monitor' &&
request()->path() !== 'register' &&
request()->path() !== 'login' &&
request()->path() !== 'join' &&
request()->path() !== 'settings/profile')
<div class="container px-8 py-4 mx-auto">
<x-breadcrumbs route="{{ request()->route()->getName() }}" location="top" />
</div>
@endif

<main>
@yield('content')
{{ $slot }}
</main>
@yield('content')
{{ $slot }}

<livewire:base.api-changed-toast></livewire:base.api-changed-toast>
</main>

<livewire:base.api-changed-toast></livewire:base.api-changed-toast>

</body>
<x-footer :route="request()->route()->getName()" />
</body>
</html>
49 changes: 27 additions & 22 deletions resources/views/components/layouts/navigation-logged-in.blade.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
<?php
use Livewire\Volt\Component;
new class extends Component {
public $monitor_hash;
}
?>


<div class="flex justify-between items-center gap-2 mt-5 mx-8 border-2 border-other-grey p-6 rounded-2xl">
<a class="font-koulen text-primary-blue text-5xl" href="{{ url('/') }}">PROPROMO</a>

<div class="flex gap-x-5">

@if(count(request()->segments()) == 2 && request()->segment(1) == 'monitors')
<livewire:base.copy-monitor-id>
@endif

<div class="flex items-center gap-2">

<a href="/settings/profile">
<sl-icon name="gear-wide-connected" class="text-3xl font-bold text-primary-blue"></sl-icon>
</a>
<a href="/settings/profile">
<sl-icon name="person-circle" class="text-3xl font-bold text-primary-blue"></sl-icon>
</a>
<div class="p-8">
<div class="flex justify-between items-center p-6 rounded-2xl border-2 backdrop-blur-sm bg-base-200/50 border-other-grey">
<a class="text-5xl font-koulen text-primary-blue text-uppercase" href="{{ url('/') }}">Propromo</a>

<div class="flex gap-x-5 items-center">
@if(count(request()->segments()) == 2 && request()->segment(1) == 'monitors')
<livewire:base.copy-monitor-id>
@endif

<nav class="flex gap-4 items-center">
<a href="{{ route('monitors.index') }}" class="flex gap-1 items-center transition-colors duration-200 text-primary-blue/70 hover:text-primary-blue">
<sl-icon name="display" class="text-xl"></sl-icon>
<span>Monitors</span>
</a>

<div class="w-px h-6 bg-primary-blue/20"></div>

<a href="{{ route('settings.index') }}" class="flex gap-1 items-center transition-colors duration-200 text-primary-blue/70 hover:text-primary-blue">
<sl-icon name="gear-wide-connected" class="text-xl"></sl-icon>
<span>Settings</span>
</a>

<a href="{{ url('/logout') }}" class="flex gap-1 items-center transition-colors duration-200 text-primary-blue/70 hover:text-primary-blue">
<sl-icon name="box-arrow-right" class="text-xl"></sl-icon>
<span>Logout</span>
</a>
</nav>
</div>
</div>
</div>
55 changes: 33 additions & 22 deletions resources/views/components/layouts/navigation-logged-out.blade.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
@auth
<div class="flex justify-between mt-5 mx-8 items-center">
<div>
<a class="font-koulen text-primary-blue text-3xl" href="{{ url('/') }}">PROPROMO</a>
</div>
<div class="px-8">
<div class="flex justify-between items-center p-6 rounded-2xl border-2 backdrop-blur-sm bg-base-200/50 border-other-grey">
<a class="text-5xl font-koulen text-primary-blue text-uppercase" href="{{ url('/') }}">Propromo</a>

<nav class="flex gap-4 items-center">
<a href="{{ route('monitors.index') }}" class="flex gap-1 items-center transition-colors duration-200 text-primary-blue/70 hover:text-primary-blue">
<sl-icon name="display" class="text-xl"></sl-icon>
<span>Monitors</span>
</a>

<div class="flex gap-2">
<sl-button>
<a href="{{ url('/monitors') }}">MONITORS</a>
</sl-button>
<sl-button>
<a href="{{ url('/logout') }}">LOG OUT</a>
</sl-button>
<div class="w-px h-6 bg-primary-blue/20"></div>

<a href="{{ url('/logout') }}" class="flex gap-1 items-center transition-colors duration-200 text-primary-blue/70 hover:text-primary-blue">
<sl-icon name="box-arrow-right" class="text-xl"></sl-icon>
<span>Logout</span>
</a>
</nav>
</div>
</div>
@else
<div class="flex justify-between mt-5 mx-8 items-center">
<div>
<a class="font-koulen text-primary-blue text-3xl" href="{{ url('/') }}">PROPROMO</a>
</div>
<div class="px-8">
<div class="flex justify-between items-center p-6 backdrop-blur-sm bg-base-200/50">
<a class="text-3xl font-koulen text-primary-blue text-uppercase" href="{{ url('/') }}">Propromo</a>

<div class="flex gap-2">
<sl-button>
<a href="{{ url('login') }}">LOG IN</a>
</sl-button>
<nav class="flex gap-4 items-center">
<a href="{{ url('login') }}" class="[&_sl-button::part(base)]:flex [&_sl-button::part(base)]:items-center [&_sl-button::part(base)]:gap-1">
<sl-button variant="default">
<sl-icon slot="prefix" name="box-arrow-in-right" class="text-lg align-middle"></sl-icon>
<span class="align-middle">Login</span>
</sl-button>
</a>

<sl-button>
<a href="{{ url('register') }}">REGISTER</a>
</sl-button>
<a href="{{ url('register') }}" class="[&_sl-button::part(base)]:flex [&_sl-button::part(base)]:items-center [&_sl-button::part(base)]:gap-1">
<sl-button variant="default">
<sl-icon slot="prefix" name="person-plus" class="text-lg align-middle"></sl-icon>
<span class="align-middle">Register</span>
</sl-button>
</a>
</nav>
</div>
</div>
@endauth
8 changes: 4 additions & 4 deletions resources/views/livewire/auth/create-monitor.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ function switchTo()


<div class="flex flex-col items-center mt-4 bg-gray-100 sm:justify-center sm:pt-0 dark:bg-gray-900">
<div class="w-full sm:max-w-md mt-6 p-12 bg-white dark:bg-gray-800 border-[1px] border-border-color overflow-hidden sm:rounded-lg">
<div class="w-full sm:max-w-md mt-6 p-12 bg-white dark:bg-gray-800 border-[1px] border-border-color sm:rounded-lg">
<div class="flex justify-center">
<div class="w-full max-w-md">
<h1 class="text-6xl font-koulen text-primary-blue mb-9">CREATE MONITOR</h1>
<h1 class="mb-9 text-6xl font-koulen text-primary-blue">CREATE MONITOR</h1>

<form wire:submit.prevent="create">
<sl-input required wire:model="pat_token" placeholder="Your PAT-Token" type="text"></sl-input>
Expand All @@ -53,7 +53,7 @@ function switchTo()
<br>
<sl-switch wire:click="switchTo()">Open Source</sl-switch>

<div class="relative w-full mt-2 aspect-video">
<div class="relative mt-2 w-full aspect-video">
<iframe
class="absolute top-0 left-0 w-full h-full rounded-lg"
src="https://player.vimeo.com/video/953693369?badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479&background=1&responsive=1"
Expand All @@ -63,7 +63,7 @@ class="absolute top-0 left-0 w-full h-full rounded-lg"
</iframe>
</div>

<div class="flex items-center justify-between mt-5">
<div class="flex justify-between items-center mt-5">
<a class="text-sm text-gray-600 underline rounded-md dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800" href="{{ url('join') }}">
Already existing monitor?
</a>
Expand Down
Loading

0 comments on commit 1f53514

Please sign in to comment.