detect homepage to add container

This commit is contained in:
Tykayn 2021-11-18 14:57:07 +01:00 committed by tykayn
parent 34632957fb
commit d009f42a56
7 changed files with 166 additions and 140 deletions

View File

@ -5,8 +5,8 @@
<mat-sidenav-content> <mat-sidenav-content>
<div id="big_container" [class]="themeClass"> <div id="big_container" [class]="themeClass">
<div class="container">
<app-header [appTitle]="appTitle" [appLogo]="appLogo"></app-header> <app-header [appTitle]="appTitle" [appLogo]="appLogo"></app-header>
<div [class.container]="onHomePage">
<main [@routeAnimations]="prepareRoute(outlet)"> <main [@routeAnimations]="prepareRoute(outlet)">
<router-outlet #outlet></router-outlet> <router-outlet #outlet></router-outlet>
</main> </main>

View File

@ -35,6 +35,7 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit {
private themeSubscription: Subscription; private themeSubscription: Subscription;
public environment = environment; public environment = environment;
public onHomePage = false;
constructor( constructor(
private router: Router, private router: Router,
@ -67,6 +68,9 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit {
if (!(evt instanceof NavigationEnd)) { if (!(evt instanceof NavigationEnd)) {
return; return;
} }
console.log('evt', evt);
this.onHomePage = evt.url === '/';
let mainelem = this.document.querySelector('#big_container main'); let mainelem = this.document.querySelector('#big_container main');
console.log('mainelem', mainelem); console.log('mainelem', mainelem);

View File

@ -1,4 +1,5 @@
<header class="big-header"> <header class="big-header">
<div class="container">
<nav class="navbar" role="navigation" aria-label="main navigation"> <nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand"> <div class="navbar-brand">
<a class="navbar-item" routerLink="/"> <a class="navbar-item" routerLink="/">
@ -13,7 +14,12 @@
</div> </div>
<div class="navbar-start"> <div class="navbar-start">
<span class="navbar-item"> <span class="navbar-item">
<a class="button is-primary" role="button" routerLink="/administration" routerLinkActive="is-active"> <a
class="button is-primary"
role="button"
routerLink="/administration"
routerLinkActive="is-active"
>
<i class="fa fa-plus-circle"></i> <i class="fa fa-plus-circle"></i>
<div class="is-hidden-touch"> <div class="is-hidden-touch">
{{ 'config.title' | translate }} {{ 'config.title' | translate }}
@ -129,4 +135,5 @@
> >
<i class="fa fa-hand-paper-o"></i> test admin link to edit poll <i class="fa fa-hand-paper-o"></i> test admin link to edit poll
</a> </a>
</div>
</header> </header>

View File

@ -1,12 +1,14 @@
@charset "UTF-8"; @charset "UTF-8";
body,
html {
background: $white;
}
main { main {
display: block; display: block;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
} }
.creation,
.search { .search {
@extend main; @extend main;
} }

View File

@ -1,6 +1,28 @@
app-header {
background: $primary_color;
color: $white;
}
.big-header {
background: $secondary-color;
color: $white;
.container {
background: $secondary-color;
color: $white;
box-shadow: none;
}
}
// material override
.navbar {
margin-bottom: 0;
background: $secondary-color;
color: $white;
}
nav { nav {
background: $primary-color;
text-align: center; text-align: center;
border-bottom: 2px solid $primary; border-bottom: 2px solid $primary-color;
a { a {
&::before { &::before {
@ -81,10 +103,6 @@ a {
padding-left: 1rem; padding-left: 1rem;
} }
} }
// material override
.navbar {
margin-bottom: 0;
}
a span.ui-steps-number { a span.ui-steps-number {
padding: 0; padding: 0;
} }

View File

@ -1,5 +1,5 @@
#big_container { #big_container {
background: $primary; background: $white;
main { main {
margin-bottom: 2em; margin-bottom: 2em;
@ -11,9 +11,6 @@
.container { .container {
padding-bottom: 5em; padding-bottom: 5em;
@extend .boxed-shadow;
.column:last-of-type { .column:last-of-type {
text-align: right; text-align: right;
} }

View File

@ -1,6 +1,4 @@
#big_container { #big_container {
background: $primary;
&.theme-light-watermelon { &.theme-light-watermelon {
.big-header { .big-header {
.container { .container {