Make side panel responsive
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
538be1490a
commit
c59accbbc4
@ -1,10 +1,11 @@
|
|||||||
.side-panel {
|
.side-panel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 50%;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
width: 22rem;
|
width: 100%;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
transition: left 0.3s;
|
height:100%;
|
||||||
|
transition: left 0.3s, top 0.3s;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
@ -31,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.side-panel.hidden {
|
.side-panel.hidden {
|
||||||
left: -24rem;
|
top:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@ -40,3 +41,18 @@
|
|||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
overflow-y:auto;
|
overflow-y:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width:44rem) {
|
||||||
|
.side-panel {
|
||||||
|
top:0px;
|
||||||
|
width: 22rem;
|
||||||
|
left:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-panel.hidden {
|
||||||
|
top:0px;
|
||||||
|
width: 22rem;
|
||||||
|
left:-24rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -3,9 +3,11 @@ import { RouterModule } from '@angular/router';
|
|||||||
|
|
||||||
import { AuthGuard } from '@farmmaps/common';
|
import { AuthGuard } from '@farmmaps/common';
|
||||||
import { AppContentComponent} from './app-content.component';
|
import { AppContentComponent} from './app-content.component';
|
||||||
|
import { AppSidePanelTestComponent } from './app-side-panel-test.component';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{ path: '', canLoad: [AuthGuard], component: AppContentComponent}
|
{ path: '', canLoad: [AuthGuard], component: AppContentComponent},
|
||||||
|
{ path: 'sidepanel', canLoad: [AuthGuard], component: AppSidePanelTestComponent}
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
29
src/app/app-side-panel-test.component.ts
Normal file
29
src/app/app-side-panel-test.component.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { Component ,ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-side-panel-test',
|
||||||
|
template: '<div><a (click)="handleOpen($event)" href="#">open</a> <side-panel [visible]="show"><a (click)="handleClose($event)" href="#">close</a></side-panel></div>'
|
||||||
|
})
|
||||||
|
export class AppSidePanelTestComponent {
|
||||||
|
|
||||||
|
public show:boolean = false;
|
||||||
|
|
||||||
|
constructor(public cr:ChangeDetectorRef ) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
handleClose(event:MouseEvent) {
|
||||||
|
event.preventDefault();
|
||||||
|
this.show=false;
|
||||||
|
//this.cr.detectChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
handleOpen(event:MouseEvent)
|
||||||
|
{
|
||||||
|
event.preventDefault();
|
||||||
|
this.show=true;
|
||||||
|
//this.cr.detectChanges();
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,3 @@
|
|||||||
<div style="text-align:center">
|
<div style="position:absolute;display: block;width:100%;height:100%;overflow: hidden;"><router-outlet></router-outlet></div>
|
||||||
<h1>
|
|
||||||
Welcome to {{ title }}!
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
<h2>Common Test</h2>
|
|
||||||
<router-outlet></router-outlet>
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
|||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { AppContentComponent } from './app-content.component';
|
import { AppContentComponent } from './app-content.component';
|
||||||
|
import { AppSidePanelTestComponent } from './app-side-panel-test.component';
|
||||||
import { AppCommonModule } from '@farmmaps/common';
|
import { AppCommonModule } from '@farmmaps/common';
|
||||||
|
|
||||||
import {StoreModule, Store} from '@ngrx/store';
|
import {StoreModule, Store} from '@ngrx/store';
|
||||||
@ -44,7 +45,8 @@ export function provideBootstrapEffects(effects: Type<any>[]) {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
AppContentComponent
|
AppContentComponent,
|
||||||
|
AppSidePanelTestComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
|
Loading…
Reference in New Issue
Block a user