mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
Add material themes to themes carousel
This commit is contained in:
parent
57a1695b7e
commit
d0b58820be
5 changed files with 47 additions and 23 deletions
|
|
@ -7,25 +7,45 @@
|
||||||
[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">
|
||||||
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
|
data-src="assets/img/material-light-theme.png"
|
||||||
|
class="swiper-lazy"
|
||||||
|
alt="Material Light Theme" />
|
||||||
|
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
||||||
|
lazyLoad="assets/img/material-light-theme.png"
|
||||||
|
defaultImage="assets/img/default.png"
|
||||||
|
alt="Material Light Theme" />
|
||||||
|
</a>
|
||||||
|
<a href="https://hubs.ly/" target="_blank" class="image-container swiper-slide">
|
||||||
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
|
data-src="assets/img/material-dark-theme.png"
|
||||||
|
class="swiper-lazy"
|
||||||
|
alt="Material Dark Theme" />
|
||||||
|
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
||||||
|
lazyLoad="assets/img/material-dark-theme.png"
|
||||||
|
alt="Material Dark Theme"
|
||||||
|
defaultImage="assets/img/default.png" />
|
||||||
|
</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"
|
||||||
data-src="assets/img/light-theme.png"
|
data-src="assets/img/light-theme.png"
|
||||||
class="swiper-lazy"
|
class="swiper-lazy"
|
||||||
alt="Light Theme" />
|
alt="Eva Light Theme" />
|
||||||
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
||||||
lazyLoad="assets/img/light-theme.png"
|
lazyLoad="assets/img/light-theme.png"
|
||||||
defaultImage="assets/img/default.png"
|
defaultImage="assets/img/default.png"
|
||||||
alt="Light Theme" />
|
alt="Eva Light Theme" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://hubs.ly/H0n54SN0" target="_blank" class="image-container swiper-slide">
|
<a href="https://hubs.ly/H0n54SN0" target="_blank" class="image-container swiper-slide">
|
||||||
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
data-src="assets/img/dark-theme.png"
|
data-src="assets/img/dark-theme.png"
|
||||||
class="swiper-lazy"
|
class="swiper-lazy"
|
||||||
alt="Dark Theme" />
|
alt="Eva Dark Theme" />
|
||||||
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
||||||
lazyLoad="assets/img/dark-theme.png"
|
src="assets/img/dark-theme.png"
|
||||||
defaultImage="assets/img/default.png"
|
alt="Eva Dark Theme"
|
||||||
alt="Dark Theme" />
|
class="ng-lazyloaded" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://hubs.ly/H0n55cG0" target="_blank" class="image-container swiper-slide">
|
<a href="https://hubs.ly/H0n55cG0" target="_blank" class="image-container swiper-slide">
|
||||||
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
|
|
@ -33,9 +53,9 @@
|
||||||
class="swiper-lazy"
|
class="swiper-lazy"
|
||||||
alt="Cosmic Theme" />
|
alt="Cosmic Theme" />
|
||||||
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
<img *ngIf="!(breakpoint.width <= breakpoints.sm)"
|
||||||
lazyLoad="assets/img/cosmic-theme.png"
|
src="assets/img/cosmic-theme.png"
|
||||||
defaultImage="assets/img/default.png"
|
alt="Cosmic Theme"
|
||||||
alt="Cosmic Theme" />
|
class="ng-lazyloaded"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://hubs.ly/H0n55170" target="_blank" class="image-container swiper-slide">
|
<a href="https://hubs.ly/H0n55170" target="_blank" class="image-container swiper-slide">
|
||||||
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
<img *ngIf="breakpoint.width <= breakpoints.sm"
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
span {
|
span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.75rem 3.5rem;
|
padding: 0.75rem 1.5rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,6 +205,7 @@
|
||||||
|
|
||||||
span {
|
span {
|
||||||
padding: 0.75rem 0;
|
padding: 0.75rem 0;
|
||||||
|
white-space: pre;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.swiper-pagination-bullet-active {
|
&.swiper-pagination-bullet-active {
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,10 @@ export class ThemeSectionComponent implements OnDestroy {
|
||||||
|
|
||||||
private alive = true;
|
private alive = true;
|
||||||
private themes: string[] = [
|
private themes: string[] = [
|
||||||
'Light',
|
'Material\nLight',
|
||||||
'Dark',
|
'Material\nDark',
|
||||||
|
'Eva\nLight',
|
||||||
|
'Eva\nDark',
|
||||||
'Cosmic',
|
'Cosmic',
|
||||||
'Corporate',
|
'Corporate',
|
||||||
];
|
];
|
||||||
|
|
@ -32,6 +34,7 @@ export class ThemeSectionComponent implements OnDestroy {
|
||||||
breakpoints: any;
|
breakpoints: any;
|
||||||
sliderIndex: number = 1;
|
sliderIndex: number = 1;
|
||||||
initialSwiperConfig: SwiperConfigInterface = {
|
initialSwiperConfig: SwiperConfigInterface = {
|
||||||
|
initialSlide: 1,
|
||||||
direction: 'horizontal',
|
direction: 'horizontal',
|
||||||
spaceBetween: 200,
|
spaceBetween: 200,
|
||||||
slidesPerView: 'auto',
|
slidesPerView: 'auto',
|
||||||
|
|
@ -55,9 +58,7 @@ export class ThemeSectionComponent implements OnDestroy {
|
||||||
renderBullet: (index, className) => {
|
renderBullet: (index, className) => {
|
||||||
return `
|
return `
|
||||||
<span class="${className}">
|
<span class="${className}">
|
||||||
<span>
|
<span>${this.themes[index]}</span>
|
||||||
${this.themes[index]}
|
|
||||||
</span>
|
|
||||||
</span>`;
|
</span>`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -66,8 +67,10 @@ export class ThemeSectionComponent implements OnDestroy {
|
||||||
...this.initialSwiperConfig,
|
...this.initialSwiperConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(private themeService: NbThemeService,
|
constructor(
|
||||||
private breakpointService: NbMediaBreakpointsService) {
|
private themeService: NbThemeService,
|
||||||
|
private breakpointService: NbMediaBreakpointsService,
|
||||||
|
) {
|
||||||
this.breakpoints = this.breakpointService.getBreakpointsMap();
|
this.breakpoints = this.breakpointService.getBreakpointsMap();
|
||||||
this.themeService.onMediaQueryChange()
|
this.themeService.onMediaQueryChange()
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
|
|
|
||||||
BIN
docs/assets/img/material-dark-theme.png
Normal file
BIN
docs/assets/img/material-dark-theme.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 658 KiB |
BIN
docs/assets/img/material-light-theme.png
Normal file
BIN
docs/assets/img/material-light-theme.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 656 KiB |
Loading…
Add table
Add a link
Reference in a new issue