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
+2 -5
View File
@@ -6,9 +6,7 @@ use App\CMS\Contracts\Widgets\WidgetRenderer;
use App\CMS\Widgets\Menu\Menu as WidgetMenu; use App\CMS\Widgets\Menu\Menu as WidgetMenu;
use App\Models\Widgets\Widget; use App\Models\Widgets\Widget;
use App\Models\Widgets\WidgetType; use App\Models\Widgets\WidgetType;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
class Menu implements WidgetRenderer class Menu implements WidgetRenderer
@@ -36,7 +34,7 @@ class Menu implements WidgetRenderer
return $a->order - $b->order; return $a->order - $b->order;
}); });
$route = Request::route() $routeName = Route::current()
->getName(); ->getName();
$parameters = Route::current() $parameters = Route::current()
->parameters(); ->parameters();
@@ -55,7 +53,7 @@ class Menu implements WidgetRenderer
} }
$page = $pages[$pageId]; $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]); $route = $page->isHomepage ? route('page.index') : route('page.content', ['url' => $page->url]);
$code .= '<li'; $code .= '<li';
@@ -87,7 +85,6 @@ class Menu implements WidgetRenderer
$widget->settings = new \stdClass(); $widget->settings = new \stdClass();
$widget->settings->links = []; $widget->settings->links = [];
return view('admin.widgets.menu.new', [ return view('admin.widgets.menu.new', [
'type' => $type, 'type' => $type,
'widget' => $widget, 'widget' => $widget,
+49 -18
View File
@@ -1,16 +1,18 @@
/* https://coolors.co/3f3f37-eef4d4-983628-ff7f11-daefb3 */
body { body {
font-family: Ubuntu; font-family: Ubuntu;
text-align: justify; text-align: justify;
background: url("./images/bg.png"); background: #eef4d4 url("./images/bg.png");
} }
header.top-bar { header.top-bar {
position: fixed; background: #3f3f37;
top: 0; padding: 0;
left: 0; }
right: 0;
z-index: 100; header.top-bar h1 {
background: rgba(0, 0, 0, 0.8); font-size: 100%;
} }
header.top-bar ul { header.top-bar ul {
@@ -21,24 +23,20 @@ header.top-bar a {
color: white; color: white;
} }
.menu .active > a {
background: #ff7f11;
}
.logo { .logo {
max-height: 35px; max-height: 35px;
} }
h1, h2, h3, h4 { h1, h2, h3, h4 {
font-family: Comfortaa; 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 { .stripe {
padding: 50px; padding: 50px;
@@ -59,9 +57,42 @@ h1, h2, h3, h4 {
padding-left: 150px; padding-left: 150px;
} }
.content-container { .content-container.row {
margin-top: 70px;
line-height: 170%; 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 { .trainee-team .thumbnail {
Binary file not shown.

After

Width:  |  Height:  |  Size: 697 KiB

@@ -1,29 +1,31 @@
@extendVisitor('defaultLayout') @extendVisitor('defaultLayout')
@section('content') @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 <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"> <ul class="orbit-container">
@foreach($page->files()->where('mime_type', 'like', 'image%')->get() as $i => $image) @foreach($images as $i => $image)
<li class="orbit-slide @if($i == 0) is-active @endif"> <li class="orbit-slide slow @if($i == 0) is-active @endif">
<img class="orbit-image" src="@upload($image->filename)" alt="" /> <img class="orbit-image" src="@upload($image->filename)" alt="" />
</li> </li>
@endforeach @endforeach
</ul> </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> </div>
@endif @endif
<div class="over-slider-stripe stripe">
<h1>{{$page->title}}</h1>
<p>{{$page->metaDescription}}</p>
</div>
<div class="row content-container"> <div class="row content-container">
{!! $page->pageContent !!} {!! $page->pageContent !!}
</div>
<div class="text-center stripe light trainee-team"> <div class="text-center stripe light trainee-team">
@@ -44,7 +46,5 @@
@endforeach @endforeach
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div>
@widgetArea('belowHomepage')
@endsection @endsection
@@ -35,10 +35,12 @@
</script> </script>
@endif @endif
<header class="top-bar"> <header class="top-bar">
<div class="top-bar-left"> <div class="top-bar-left hide-for-small-only">
<h1>
<a href="{{route('page.index')}}"> <a href="{{route('page.index')}}">
<img src="@asset('visitor/images/logo.png')" class="logo" alt=""> {{setting('pageName')}}
</a> </a>
</h1>
</div> </div>
<div class="top-bar-right"> <div class="top-bar-right">
@widgetArea('mainMenu') @widgetArea('mainMenu')