display mobile menu on stepper

This commit is contained in:
Tykayn 2022-02-11 11:43:50 +01:00 committed by tykayn
parent cc79114c79
commit d097d80dda
12 changed files with 110 additions and 17 deletions

View File

@ -54,7 +54,11 @@
<div class="step-info"> <div class="step-info">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<a class="logo-home-link navbar-item pull-left" routerLink="/" routerLinkActive="active"> <a
class="logo-home-link logo-home-link-img navbar-item pull-left"
routerLink="/"
routerLinkActive="active"
>
<img <img
class="stepper-app-logo" class="stepper-app-logo"
*ngIf="environment.appLogo" *ngIf="environment.appLogo"
@ -83,9 +87,10 @@
</h1> </h1>
</div> </div>
<div class="column has-text-right is-narrow"> <div class="column has-text-right is-narrow">
<span class="is-visible-smallest-screen" (click)="toggle_mobile_menu()"> <button class="is-visible-smallest-screen pull-right menu-button" (click)="toggle_mobile_menu()">
menu burger {{ 'nav.menu' | translate }}
</span> <img class="icon" aria-hidden="true" src="assets/icons/book.svg" />
</button>
<span class="is-hidden-smallest-screen"> <span class="is-hidden-smallest-screen">
<app-language-selector class="nav-button"></app-language-selector> <app-language-selector class="nav-button"></app-language-selector>
<button <button
@ -119,7 +124,7 @@
<div class="top"> <div class="top">
<button <button
id="close_dialog" id="close_dialog"
class="button cancel-button-reject pull-right" class="button cancel-button-reject pull-right img-marged-left"
(click)="focusOnCancelButton()" (click)="focusOnCancelButton()"
> >
{{ 'SENTENCES.Close' | translate }} {{ 'SENTENCES.Close' | translate }}
@ -147,6 +152,19 @@
</ng-template> </ng-template>
</p-dialog> </p-dialog>
<div id="mobile_menu" *ngIf="display_mobile_menu"> <div id="mobile_menu" *ngIf="display_mobile_menu">
coucou le menu mobile <h2 class="title is-2 has-text-primary">Menu</h2>
<div class="langs">
<app-language-selector class="nav-button" [idSuffix]="'_mobile'"></app-language-selector>
</div>
<div class="actions">
<button
class="button cancel-button-stepper is-fullwidth"
(click)="showCancelDialog()"
id="display_cancel_popup_button_mobile"
aria-haspopup="dialog"
>
{{ 'nav.leave' | translate }}
</button>
</div>
</div> </div>
</section> </section>

View File

@ -14,14 +14,18 @@
} }
} }
.step-counter-text {
margin-top: -5px;
}
.title-section { .title-section {
display: inline-block; display: inline-block;
width: 40%; width: 50%;
float: left; float: left;
} }
.step-title-poll { .step-title-poll {
max-width: 40ch; margin-top: 5px;
max-width: 45ch;
text-overflow: ellipsis; text-overflow: ellipsis;
display: inline-block !important; display: inline-block !important;
overflow: hidden; overflow: hidden;
@ -124,7 +128,7 @@
} }
h2 { h2 {
margin-bottom: 0rem; margin-bottom: 0;
} }
.step-counter-text { .step-counter-text {
@ -148,6 +152,11 @@
border-color: $primary_color; border-color: $primary_color;
color: $primary_color; color: $primary_color;
} }
#mobile_menu {
.cancel-button-stepper {
padding: 1rem 2rem;
}
}
.cancel-button-confirm { .cancel-button-confirm {
color: $white !important; color: $white !important;
@ -192,10 +201,15 @@
.logo-home-link { .logo-home-link {
padding: 0; padding: 0;
} }
.logo-home-link-img {
&:hover {
background: #ccc;
}
}
.stepper-app-logo { .stepper-app-logo {
max-width: $main-column-width-inner; max-width: $logo-side;
max-height: $main-column-width-inner; max-height: $logo-side;
margin: 10px 16px; margin: 10px 16px;
height: $logo-side; height: $logo-side;
width: $logo-side; width: $logo-side;
@ -206,3 +220,18 @@
min-width: 7em; // to adapt other lang without making the nav move min-width: 7em; // to adapt other lang without making the nav move
z-index: 10; z-index: 10;
} }
.menu-button {
border: 0;
color: $primary_color;
img {
margin-left: 1ch;
float: right;
}
}
#mobile_menu {
width: 100%;
background: #fff;
padding: 0.75rem;
height: 100vh;
}

View File

@ -1,3 +1,4 @@
<app-header></app-header>
<section class="hero is-warning is-medium"> <section class="hero is-warning is-medium">
<div class="hero-body"> <div class="hero-body">
<div class="container"> <div class="container">
@ -5,3 +6,4 @@
</div> </div>
</div> </div>
</section> </section>
<app-footer></app-footer>

View File

@ -1,5 +1,5 @@
<div class="selector language-selector-container"> <div class="selector language-selector-container">
<button id="lang_button_popup" class="lang-button" (click)="openDialogLang()"> <button id="lang_button_popup{{ idSuffix }}" class="lang-button" (click)="openDialogLang()">
<i class="fa fa-language"></i> <i class="fa fa-language"></i>
{{ 'LANGUAGES_SHORT.' + currentLang.toUpperCase() | translate }} {{ 'LANGUAGES_SHORT.' + currentLang.toUpperCase() | translate }}
<!-- <i class="fa fa-language lang-selector-icon clickable" ></i>--> <!-- <i class="fa fa-language lang-selector-icon clickable" ></i>-->
@ -17,8 +17,8 @@
<ng-template pTemplate="titlebar"> <ng-template pTemplate="titlebar">
<div class="top"> <div class="top">
<button <button
id="close_dialog" id="close_dialog{{ idSuffix }}"
class="button cancel-button-reject pull-right" class="button cancel-button-reject pull-right img-marged-left"
(click)="focusOnCancelButton()" (click)="focusOnCancelButton()"
> >
{{ 'SENTENCES.Close' | translate }} {{ 'SENTENCES.Close' | translate }}

View File

@ -3,11 +3,13 @@
#lang_selector { #lang_selector {
max-width: 15em; max-width: 15em;
width: 15em !important; width: 15em !important;
.top { .top {
clear: both; clear: both;
width: 100%; width: 100%;
} }
} }
#lang_button_popup { #lang_button_popup {
background: transparent !important; background: transparent !important;
} }
@ -15,21 +17,26 @@
.language-selector-container { .language-selector-container {
cursor: pointer; cursor: pointer;
color: $primary-color; color: $primary-color;
&:hover { &:hover {
color: $secondary_color; color: $secondary_color;
} }
i { i {
color: $primary-color; color: $primary-color;
} }
} }
.lang-element { .lang-element {
float: left; float: left;
margin: 0.5em; margin: 0.5em;
min-width: 11em; min-width: 11em;
} }
.is-current { .is-current {
font-weight: bold; font-weight: bold;
} }
.lang-button { .lang-button {
color: $secondary_color; color: $secondary_color;
border: none; border: none;
@ -38,3 +45,9 @@
line-height: 2rem; line-height: 2rem;
height: $stepper-nav-height; height: $stepper-nav-height;
} }
#lang_button_popup_mobile {
.lang-button {
width: 100% !important;
}
}

View File

@ -1,4 +1,4 @@
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, Input, OnInit } from '@angular/core';
import { LanguageEnum } from '../../../../core/enums/language.enum'; import { LanguageEnum } from '../../../../core/enums/language.enum';
import { LanguageService } from '../../../../core/services/language.service'; import { LanguageService } from '../../../../core/services/language.service';
@ -11,6 +11,7 @@ import { DOCUMENT } from '@angular/common';
styleUrls: ['./language-selector.component.scss'], styleUrls: ['./language-selector.component.scss'],
}) })
export class LanguageSelectorComponent implements OnInit { export class LanguageSelectorComponent implements OnInit {
@Input() idSuffix: string = '';
public currentLang: string; public currentLang: string;
public availableLanguages: any = ['FR', 'EN', 'ES']; public availableLanguages: any = ['FR', 'EN', 'ES'];
language: string; language: string;

View File

@ -12,6 +12,7 @@
"search_button": "Search" "search_button": "Search"
}, },
"nav": { "nav": {
"menu": "Menu",
"leave": "Leave", "leave": "Leave",
"previous": "Previous", "previous": "Previous",
"next": "Next", "next": "Next",

View File

@ -12,6 +12,7 @@
"search_button": "Rechercher" "search_button": "Rechercher"
}, },
"nav": { "nav": {
"menu": "Menu",
"leave": "Quitter", "leave": "Quitter",
"previous": "Précédent", "previous": "Précédent",
"step": "Étape", "step": "Étape",

View File

@ -41,3 +41,21 @@ $input-shadow: none;
.round-borders { .round-borders {
border-radius: 1rem !important; border-radius: 1rem !important;
} }
.img-marged-left {
img {
margin-left: 1rem;
}
}
.img-marged-right {
img {
margin-right: 1rem;
}
}
.button .icon:first-child:last-child,
button .icon:first-child:last-child,
.btn .icon:first-child:last-child {
margin-left: 1rem;
margin-right: auto;
}

View File

@ -2,6 +2,16 @@
// small screens // small screens
@media (max-width: 487px) { @media (max-width: 487px) {
.logo-home-link-img {
display: inline-block;
margin-top: 8px;
width: 50px;
padding: 8px !important;
}
.title-section {
width: 60%;
}
.is-hidden-smallest-screen { .is-hidden-smallest-screen {
display: none; display: none;
} }

View File

@ -25,7 +25,7 @@ main {
} }
.min-height { .min-height {
margin-bottom: 1em; padding-bottom: 1em;
min-height: 50vh; min-height: 50vh;
overflow-x: hidden; overflow-x: hidden;
} }

View File

@ -74,7 +74,7 @@ $title_font: 'helvetica', 'proza_libre', 'Arial', 'DejaVu Sans Mono';
$large-column-width: 588px; $large-column-width: 588px;
$main-column-width: 25rem; $main-column-width: 25rem;
$main-column-width-inner: 23.75rem; $main-column-width-inner: 23.75rem;
$logo-side: 31px; $logo-side: 40px;
$mobile-size: 25rem; $mobile-size: 25rem;
$header-nav-height: 4.85rem; $header-nav-height: 4.85rem;
$header-nav-inner-height: 4.5rem; $header-nav-inner-height: 4.5rem;