mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
Add "material theme link" component
This commit is contained in:
parent
d0b58820be
commit
f39f10c12d
18 changed files with 135 additions and 32 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="section middle">
|
<div class="section middle">
|
||||||
<nb-menu [items]="headerMenu"></nb-menu>
|
<nb-menu [items]="headerMenu"></nb-menu>
|
||||||
|
<ng-content></ng-content>
|
||||||
<a routerLink="/" fragment="backend-bundles" class="backend-bundles eva-parent-hover">
|
<a routerLink="/" fragment="backend-bundles" class="backend-bundles eva-parent-hover">
|
||||||
<i [innerHTML]="'gift-outline' | eva: { width: 24, height: 24, fill: '#ff4d6b', animationType: 'shake' }"></i>
|
<i [innerHTML]="'gift-outline' | eva: { width: 24, height: 24, fill: '#ff4d6b', animationType: 'shake' }"></i>
|
||||||
<span>Backend Bundles</span>
|
<span>Backend Bundles</span>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,17 @@ import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { LazyLoadImageModule } from 'ng-lazyload-image';
|
import { LazyLoadImageModule } from 'ng-lazyload-image';
|
||||||
|
import {
|
||||||
|
NbLayoutModule,
|
||||||
|
NbThemeModule,
|
||||||
|
NbMenuModule,
|
||||||
|
NbCheckboxModule,
|
||||||
|
NbCardModule,
|
||||||
|
NbSidebarModule,
|
||||||
|
NbTabsetModule,
|
||||||
|
} from '@nebular/theme';
|
||||||
|
|
||||||
|
import { LandingSharedModule } from '../shared/landing-shared.module';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import {
|
import {
|
||||||
|
|
@ -26,21 +37,6 @@ import {
|
||||||
import { ngxLandingServices } from './services';
|
import { ngxLandingServices } from './services';
|
||||||
// services
|
// services
|
||||||
|
|
||||||
// pipes
|
|
||||||
import { EvaIconsPipe } from './pipes/eva-icons.pipe';
|
|
||||||
import { CapitalizePipe } from './pipes/capitalize.pipe';
|
|
||||||
// pipes
|
|
||||||
|
|
||||||
import {
|
|
||||||
NbLayoutModule,
|
|
||||||
NbThemeModule,
|
|
||||||
NbMenuModule,
|
|
||||||
NbCheckboxModule,
|
|
||||||
NbCardModule,
|
|
||||||
NbSidebarModule,
|
|
||||||
NbTabsetModule,
|
|
||||||
} from '@nebular/theme';
|
|
||||||
|
|
||||||
const BASE_MODULES = [
|
const BASE_MODULES = [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
|
|
@ -67,14 +63,10 @@ const COMPONENTS = [
|
||||||
NgxDocsFooterComponent,
|
NgxDocsFooterComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const PIPES = [
|
|
||||||
EvaIconsPipe,
|
|
||||||
CapitalizePipe,
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule,
|
RouterModule,
|
||||||
|
LandingSharedModule,
|
||||||
|
|
||||||
...BASE_MODULES,
|
...BASE_MODULES,
|
||||||
|
|
||||||
|
|
@ -82,8 +74,6 @@ const PIPES = [
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...COMPONENTS,
|
...COMPONENTS,
|
||||||
|
|
||||||
...PIPES,
|
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
RouterModule,
|
RouterModule,
|
||||||
|
|
@ -93,10 +83,6 @@ const PIPES = [
|
||||||
...NB_MODULES,
|
...NB_MODULES,
|
||||||
|
|
||||||
...COMPONENTS,
|
...COMPONENTS,
|
||||||
|
|
||||||
...PIPES,
|
|
||||||
],
|
|
||||||
entryComponents: [
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class NgxLandingThemeModule {
|
export class NgxLandingThemeModule {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import { NgxLandingThemeModule } from './@theme/theme.module';
|
||||||
import { CoreModule } from './@core/core.module';
|
import { CoreModule } from './@core/core.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
|
import { LandingSharedModule } from './shared/landing-shared.module';
|
||||||
|
|
||||||
import { DOCS, STRUCTURE } from './app.options';
|
import { DOCS, STRUCTURE } from './app.options';
|
||||||
const docs = require('../output.json');
|
const docs = require('../output.json');
|
||||||
|
|
@ -28,6 +29,7 @@ import { structure } from '../structure';
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
|
|
||||||
|
LandingSharedModule,
|
||||||
NgxLandingThemeModule.forRoot(),
|
NgxLandingThemeModule.forRoot(),
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
<nb-layout>
|
<nb-layout>
|
||||||
<nb-layout-header fixed>
|
<nb-layout-header fixed>
|
||||||
<div class="content-center">
|
<div class="content-center">
|
||||||
<ngx-landing-header class="docs-header" [sidebarTag]="sidebarTag" [isDocs]="true"></ngx-landing-header>
|
<ngx-landing-header class="docs-header" [sidebarTag]="sidebarTag" [isDocs]="true">
|
||||||
|
<ngx-material-theme-link></ngx-material-theme-link>
|
||||||
|
</ngx-landing-header>
|
||||||
</div>
|
</div>
|
||||||
</nb-layout-header>
|
</nb-layout-header>
|
||||||
<nb-sidebar class="menu-sidebar" [tag]="sidebarTag" [responsive]="true" [compactedBreakpoints]="[]" [collapsedBreakpoints]="collapsedBreakpoints">
|
<nb-sidebar class="menu-sidebar" [tag]="sidebarTag" [responsive]="true" [compactedBreakpoints]="[]" [collapsedBreakpoints]="collapsedBreakpoints">
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import { NgxLandingThemeModule } from '../../@theme/theme.module';
|
||||||
import { SwiperModule } from 'ngx-swiper-wrapper';
|
import { SwiperModule } from 'ngx-swiper-wrapper';
|
||||||
import { NgxBlocksModule } from '../../blocks/blocks.module';
|
import { NgxBlocksModule } from '../../blocks/blocks.module';
|
||||||
import { LandingDocsRoutingModule } from './landing-docs-routing.module';
|
import { LandingDocsRoutingModule } from './landing-docs-routing.module';
|
||||||
|
import { LandingSharedModule } from '../../shared/landing-shared.module';
|
||||||
// modules
|
// modules
|
||||||
|
|
||||||
// components
|
// components
|
||||||
|
|
@ -32,6 +33,7 @@ const COMPONENTS = [
|
||||||
imports: [
|
imports: [
|
||||||
NgxLandingThemeModule,
|
NgxLandingThemeModule,
|
||||||
SwiperModule,
|
SwiperModule,
|
||||||
|
LandingSharedModule,
|
||||||
LandingDocsRoutingModule,
|
LandingDocsRoutingModule,
|
||||||
NgxBlocksModule,
|
NgxBlocksModule,
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { LandingHomeComponent } from './landing-home.component';
|
import { LandingHomeComponent } from './landing-home.component';
|
||||||
|
import { MaterialLandingComponent } from './material-landing/material-landing.component';
|
||||||
|
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
|
|
@ -14,6 +15,10 @@ export const routes: Routes = [
|
||||||
path: '',
|
path: '',
|
||||||
component: LandingHomeComponent,
|
component: LandingHomeComponent,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'material',
|
||||||
|
component: MaterialLandingComponent,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<nb-layout>
|
<nb-layout>
|
||||||
<nb-layout-header fixed>
|
<nb-layout-header fixed>
|
||||||
<ngx-landing-header></ngx-landing-header>
|
<ngx-landing-header>
|
||||||
|
<ngx-material-theme-link withPopover></ngx-material-theme-link>
|
||||||
|
</ngx-landing-header>
|
||||||
</nb-layout-header>
|
</nb-layout-header>
|
||||||
|
|
||||||
<nb-layout-column>
|
<nb-layout-column>
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,15 @@ import { NgxLandingSectionsContainerComponent } from './sections-container/ngx-l
|
||||||
import { BackendBundlesSectionComponent } from './backend-bundles-section/backend-bundles-section.component';
|
import { BackendBundlesSectionComponent } from './backend-bundles-section/backend-bundles-section.component';
|
||||||
import { LicensePipe } from './backend-bundles-section/license.pipe';
|
import { LicensePipe } from './backend-bundles-section/license.pipe';
|
||||||
import { BackgroundImagePipe } from './backend-bundles-section/background-image.pipe';
|
import { BackgroundImagePipe } from './backend-bundles-section/background-image.pipe';
|
||||||
|
import { MaterialLandingComponent } from './material-landing/material-landing.component';
|
||||||
|
import { LandingSharedModule } from '../../shared/landing-shared.module';
|
||||||
// components
|
// components
|
||||||
|
|
||||||
const PIPES = [LicensePipe, BackgroundImagePipe];
|
const PIPES = [LicensePipe, BackgroundImagePipe];
|
||||||
|
|
||||||
const COMPONENTS = [
|
const COMPONENTS = [
|
||||||
LandingHomeComponent,
|
LandingHomeComponent,
|
||||||
|
MaterialLandingComponent,
|
||||||
NgxLandingSectionsContainerComponent,
|
NgxLandingSectionsContainerComponent,
|
||||||
MainInfoSectionComponent,
|
MainInfoSectionComponent,
|
||||||
DescriptionSectionComponent,
|
DescriptionSectionComponent,
|
||||||
|
|
@ -53,6 +56,7 @@ const COMPONENTS = [
|
||||||
NgxLandingThemeModule,
|
NgxLandingThemeModule,
|
||||||
SwiperModule,
|
SwiperModule,
|
||||||
LandingHomeRoutingModule,
|
LandingHomeRoutingModule,
|
||||||
|
LandingSharedModule,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...PIPES,
|
...PIPES,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<nb-layout>
|
||||||
|
<nb-layout-header fixed>
|
||||||
|
<ngx-landing-header></ngx-landing-header>
|
||||||
|
</nb-layout-header>
|
||||||
|
|
||||||
|
<nb-layout-footer class="footer" fixed>
|
||||||
|
<ngx-landing-footer></ngx-landing-footer>
|
||||||
|
</nb-layout-footer>
|
||||||
|
</nb-layout>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-material-landing',
|
||||||
|
templateUrl: './material-landing.component.html',
|
||||||
|
styleUrls: [
|
||||||
|
'./material-landing.component.scss',
|
||||||
|
'../landing-home.component.scss'
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class MaterialLandingComponent {}
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
[swiper]="swiperConfig"
|
[swiper]="swiperConfig"
|
||||||
[(index)]="sliderIndex">
|
[(index)]="sliderIndex">
|
||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
<a href="https://hubs.ly/" target="_blank" class="image-container swiper-slide">
|
<a href="https://hubs.ly/todo" target="_blank" class="image-container swiper-slide">
|
||||||
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
data-src="assets/img/material-light-theme.png"
|
data-src="assets/img/material-light-theme.png"
|
||||||
class="swiper-lazy"
|
class="swiper-lazy"
|
||||||
|
|
@ -17,15 +17,15 @@
|
||||||
defaultImage="assets/img/default.png"
|
defaultImage="assets/img/default.png"
|
||||||
alt="Material Light Theme" />
|
alt="Material Light Theme" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://hubs.ly/" target="_blank" class="image-container swiper-slide">
|
<a href="https://hubs.ly/todo" target="_blank" class="image-container swiper-slide">
|
||||||
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
data-src="assets/img/material-dark-theme.png"
|
data-src="assets/img/material-dark-theme.png"
|
||||||
class="swiper-lazy"
|
class="swiper-lazy"
|
||||||
alt="Material Dark Theme" />
|
alt="Material Dark Theme" />
|
||||||
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
||||||
lazyLoad="assets/img/material-dark-theme.png"
|
lazyLoad="assets/img/material-dark-theme.png"
|
||||||
alt="Material Dark Theme"
|
defaultImage="assets/img/default.png"
|
||||||
defaultImage="assets/img/default.png" />
|
alt="Material Dark Theme" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://hubs.ly/H0n54_z0" target="_blank" class="image-container swiper-slide">
|
<a href="https://hubs.ly/H0n54_z0" target="_blank" class="image-container swiper-slide">
|
||||||
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<a
|
||||||
|
routerLink="/material"
|
||||||
|
class="eva-parent-hover"
|
||||||
|
[nbPopover]="popoverContent"
|
||||||
|
nbPopoverPlacement="bottom"
|
||||||
|
nbPopoverTrigger="noop"
|
||||||
|
>
|
||||||
|
<i [innerHTML]="'color-palette-outline' | eva: { width: 24, height: 24, fill: '#ff4d6b', animationType: 'shake' }"
|
||||||
|
></i>
|
||||||
|
Material Theme
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ng-template #popoverContent>
|
||||||
|
<p class="material-theme-popover" (mouseover)="hidePopover()">New theme is available!</p>
|
||||||
|
</ng-template>
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-right: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.material-theme-popover {
|
||||||
|
margin: 0;
|
||||||
|
padding: 1rem 2rem;
|
||||||
|
color: #ff4d6b;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
import { Component, ViewChild, AfterViewInit, Input } from '@angular/core';
|
||||||
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
||||||
|
import { NbPopoverDirective } from '@nebular/theme';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-material-theme-link',
|
||||||
|
templateUrl: './material-theme-link.component.html',
|
||||||
|
styleUrls: ['./material-theme-link.component.scss'],
|
||||||
|
})
|
||||||
|
export class MaterialThemeLinkComponent implements AfterViewInit {
|
||||||
|
public showPopover: boolean = false;
|
||||||
|
|
||||||
|
@Input() public set withPopover(value: any) {
|
||||||
|
this.showPopover = coerceBooleanProperty(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewChild(NbPopoverDirective, { static: true }) public popover: NbPopoverDirective;
|
||||||
|
|
||||||
|
public ngAfterViewInit(): void {
|
||||||
|
this.showPopover && this.popover && this.popover.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public hidePopover(): void {
|
||||||
|
this.popover && this.popover.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
16
docs/app/shared/landing-shared.module.ts
Normal file
16
docs/app/shared/landing-shared.module.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { NbPopoverModule } from '@nebular/theme';
|
||||||
|
import { MaterialThemeLinkComponent } from './components/material-theme-link/material-theme-link.component';
|
||||||
|
import { CapitalizePipe } from './pipes/capitalize.pipe';
|
||||||
|
import { EvaIconsPipe } from './pipes/eva-icons.pipe';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
const component = [MaterialThemeLinkComponent];
|
||||||
|
const pipes = [CapitalizePipe, EvaIconsPipe];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule, NbPopoverModule],
|
||||||
|
declarations: [...component, ...pipes],
|
||||||
|
exports: [NbPopoverModule, ...component, ...pipes],
|
||||||
|
})
|
||||||
|
export class LandingSharedModule {}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue