FEATURE: try to color template

This commit is contained in:
Michal Kváček
2017-03-02 10:27:22 +01:00
parent 455b9d6d4e
commit 4353345b3e
5 changed files with 92 additions and 62 deletions
+3 -6
View File
@@ -6,9 +6,7 @@ use App\CMS\Contracts\Widgets\WidgetRenderer;
use App\CMS\Widgets\Menu\Menu as WidgetMenu;
use App\Models\Widgets\Widget;
use App\Models\Widgets\WidgetType;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Route;
class Menu implements WidgetRenderer
@@ -36,8 +34,8 @@ class Menu implements WidgetRenderer
return $a->order - $b->order;
});
$route = Request::route()
->getName();
$routeName = Route::current()
->getName();
$parameters = Route::current()
->parameters();
@@ -55,7 +53,7 @@ class Menu implements WidgetRenderer
}
$page = $pages[$pageId];
$active = ($page->isHomepage && $route == 'page.index') || ($route == 'page.content' && isset($parameters['url']) && $parameters['url'] == $page->url);
$active = ($page->isHomepage && $routeName == 'page.index') || ($routeName == 'page.content' && isset($parameters['url']) && $parameters['url'] == $page->url);
$route = $page->isHomepage ? route('page.index') : route('page.content', ['url' => $page->url]);
$code .= '<li';
@@ -87,7 +85,6 @@ class Menu implements WidgetRenderer
$widget->settings = new \stdClass();
$widget->settings->links = [];
return view('admin.widgets.menu.new', [
'type' => $type,
'widget' => $widget,
+49 -18
View File
@@ -1,16 +1,18 @@
/* https://coolors.co/3f3f37-eef4d4-983628-ff7f11-daefb3 */
body {
font-family: Ubuntu;
text-align: justify;
background: url("./images/bg.png");
background: #eef4d4 url("./images/bg.png");
}
header.top-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
background: rgba(0, 0, 0, 0.8);
background: #3f3f37;
padding: 0;
}
header.top-bar h1 {
font-size: 100%;
}
header.top-bar ul {
@@ -21,24 +23,20 @@ header.top-bar a {
color: white;
}
.menu .active > a {
background: #ff7f11;
}
.logo {
max-height: 35px;
}
h1, h2, h3, h4 {
font-family: Comfortaa;
color: rgb(81, 81, 81);
color: #ff7f11;
}
.over-slider-stripe {
position: absolute;
top: 25%;
font-size: 230%;
font-family: Comfortaa;
background: rgba(0, 0, 0, 0.8);
color: white;
}
.stripe {
padding: 50px;
@@ -59,9 +57,42 @@ h1, h2, h3, h4 {
padding-left: 150px;
}
.content-container {
margin-top: 70px;
.content-container.row {
line-height: 170%;
padding: 1em;
background: #FFFEF0;
}
.orbit {
position: relative;
overflow: hidden;
}
.orbit-bullets {
margin-top: -54px;
padding-bottom: 11px;
}
.orbit .stripe {
height: 20px;
background: rgba(255,255,255, 0.2);
position: absolute;
left: 0;
right: 0;
padding: 0;
margin: 0;
}
.orbit-top {
top: 0;
}
.orbit-bottom {
bottom: 0;
}
.slow {
transition-duration: 4500ms !important;
}
.trainee-team .thumbnail {
Binary file not shown.

After

Width:  |  Height:  |  Size: 697 KiB

@@ -1,50 +1,50 @@
@extendVisitor('defaultLayout')
@section('content')
@if(count($page->files) > 0)
@php $images = $page->files()->where('mime_type', 'like', 'image%')->get(); @endphp
@if(count($images) > 0)
<div class="orbit" role="region" data-orbit
data-options="animInFromLeft:fade-in; animInFromRight:fade-in; animOutToLeft:fade-out; animOutToRight:fade-out;">
data-options="animationDuration:3000; animInFromLeft:fade-in; animInFromRight:fade-in; animOutToLeft:fade-out; animOutToRight:fade-out;">
<ul class="orbit-container">
@foreach($page->files()->where('mime_type', 'like', 'image%')->get() as $i => $image)
<li class="orbit-slide @if($i == 0) is-active @endif">
@foreach($images as $i => $image)
<li class="orbit-slide slow @if($i == 0) is-active @endif">
<img class="orbit-image" src="@upload($image->filename)" alt="" />
</li>
@endforeach
</ul>
<nav class="orbit-bullets">
@foreach($images as $i => $image)
<button @if($i == 0) class="is-active" @endif data-slide="{{$i}}"></button>
@endforeach
</nav>
<div class="stripe orbit-top"></div>
<div class="stripe orbit-bottom"></div>
</div>
@endif
<div class="over-slider-stripe stripe">
<h1>{{$page->title}}</h1>
<p>{{$page->metaDescription}}</p>
</div>
<div class="row content-container">
{!! $page->pageContent !!}
<div class="text-center stripe light trainee-team">
<h2>{{$page->traineeTeamCategory->name}}</h2>
@foreach($page->traineeTeamCategory->content as $i => $subpage)
<div class="column text-center small-6 medium-{{ceil(12/count($page->traineeTeamCategory->content))}}"
data-equalizer-watch>
<a href="{{route('page.content', ['url' => $subpage->url])}}">
@if(empty($subpage->titlePhoto))
<img class="thumbnail" src="@asset('visitor/images/avatar.png')" alt="{{$subpage->title}}">
@else
<img class="thumbnail" src="@upload($subpage->titlePhoto)" alt="{{$subpage->title}}">
@endif
<h4>{{$subpage->title}}</h4>
</a>
</div>
@endforeach
<div class="clearfix"></div>
</div>
</div>
<div class="text-center stripe light trainee-team">
<h2>{{$page->traineeTeamCategory->name}}</h2>
@foreach($page->traineeTeamCategory->content as $i => $subpage)
<div class="column text-center small-6 medium-{{ceil(12/count($page->traineeTeamCategory->content))}}"
data-equalizer-watch>
<a href="{{route('page.content', ['url' => $subpage->url])}}">
@if(empty($subpage->titlePhoto))
<img class="thumbnail" src="@asset('visitor/images/avatar.png')" alt="{{$subpage->title}}">
@else
<img class="thumbnail" src="@upload($subpage->titlePhoto)" alt="{{$subpage->title}}">
@endif
<h4>{{$subpage->title}}</h4>
</a>
</div>
@endforeach
<div class="clearfix"></div>
</div>
@widgetArea('belowHomepage')
@endsection
@@ -35,10 +35,12 @@
</script>
@endif
<header class="top-bar">
<div class="top-bar-left">
<a href="{{route('page.index')}}">
<img src="@asset('visitor/images/logo.png')" class="logo" alt="">
</a>
<div class="top-bar-left hide-for-small-only">
<h1>
<a href="{{route('page.index')}}">
{{setting('pageName')}}
</a>
</h1>
</div>
<div class="top-bar-right">
@widgetArea('mainMenu')