mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
fix(header): improve header styles, add nebular icons
This commit is contained in:
parent
429fd095cf
commit
3febc37ed7
5 changed files with 99 additions and 105 deletions
30
src/app/@theme/components/header/header.component.html
Normal file
30
src/app/@theme/components/header/header.component.html
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<div class="header-container"
|
||||||
|
[class.left]="position === 'normal'"
|
||||||
|
[class.right]="position === 'inverse'">
|
||||||
|
<a (click)="toggleSidebar()" href="#" class="navigation"><i class="ion-navicon"></i></a>
|
||||||
|
<div class="logo" (click)="goToHome()">NgX <span>Admin</span></div>
|
||||||
|
<label class="theme-switch">
|
||||||
|
<span class="light">Light</span>
|
||||||
|
<div class="switch">
|
||||||
|
<input type="checkbox" (change)="toggleTheme(theme.checked)" #theme>
|
||||||
|
<span class="slider"></span>
|
||||||
|
</div>
|
||||||
|
<span class="cosmic">Cosmic</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nb-actions
|
||||||
|
size="medium"
|
||||||
|
class="header-container"
|
||||||
|
[class.right]="position === 'normal'"
|
||||||
|
[class.left]="position === 'inverse'">
|
||||||
|
<nb-action icon="nb-grid-b" class="toggle-layout" (click)="toggleSettings()"></nb-action>
|
||||||
|
<nb-action>
|
||||||
|
<nb-user [menu]="userMenu" [name]="user?.name" [picture]="user?.picture"></nb-user>
|
||||||
|
</nb-action>
|
||||||
|
<nb-action disabled icon="nb-notifications"></nb-action>
|
||||||
|
<nb-action icon="nb-email"></nb-action>
|
||||||
|
<nb-action>
|
||||||
|
<nb-search type="rotate-layout"></nb-search>
|
||||||
|
</nb-action>
|
||||||
|
</nb-actions>
|
||||||
|
|
@ -34,83 +34,83 @@
|
||||||
font-weight: nb-theme(font-weight-normal);
|
font-weight: nb-theme(font-weight-normal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.theme-switch {
|
.theme-switch {
|
||||||
margin: 0 6rem;
|
margin: 0 6rem;
|
||||||
width: 12rem;
|
width: 12rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
& > span {
|
& > span {
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
font-weight: nb-theme(font-weight-bold);
|
font-weight: nb-theme(font-weight-bold);
|
||||||
transition: opacity 0.3s ease;
|
transition: opacity 0.3s ease;
|
||||||
|
|
||||||
|
&.light {
|
||||||
|
color: nb-theme(color-fg-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.cosmic {
|
||||||
|
color: nb-theme(color-fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@include nb-for-theme(cosmic) {
|
||||||
&.light {
|
&.light {
|
||||||
color: nb-theme(color-fg-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.cosmic {
|
|
||||||
color: nb-theme(color-fg);
|
color: nb-theme(color-fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include nb-for-theme(cosmic) {
|
&.cosmic {
|
||||||
&.light {
|
color: nb-theme(color-white);
|
||||||
color: nb-theme(color-fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.cosmic {
|
|
||||||
color: nb-theme(color-white);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
opacity: 0.78;
|
opacity: 0.78;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 4rem;
|
||||||
|
height: 1.75rem;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
input {
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
&:checked + .slider::before {
|
||||||
|
transform: translateX(2.25rem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.switch {
|
.slider {
|
||||||
position: relative;
|
position: absolute;
|
||||||
display: inline-block;
|
top: 0;
|
||||||
width: 4rem;
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
border-radius: 1.75rem;
|
||||||
|
background-color: nb-theme(layout-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider::before {
|
||||||
|
position: absolute;
|
||||||
|
content: '';
|
||||||
height: 1.75rem;
|
height: 1.75rem;
|
||||||
margin: 0;
|
width: 1.75rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: nb-theme(color-success);
|
||||||
|
transition: 0.2s;
|
||||||
|
|
||||||
input {
|
box-shadow: 0 0 0.25rem 0 rgba(nb-theme(color-fg), 0.4);
|
||||||
display: none;
|
|
||||||
|
|
||||||
&:checked + .slider::before {
|
@include nb-for-theme(cosmic) {
|
||||||
transform: translateX(2.25rem);
|
@include btn-hero-primary-gradient();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
border-radius: 1.75rem;
|
|
||||||
background-color: nb-theme(layout-bg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider::before {
|
|
||||||
position: absolute;
|
|
||||||
content: '';
|
|
||||||
height: 1.75rem;
|
|
||||||
width: 1.75rem;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: nb-theme(color-success);
|
|
||||||
transition: 0.2s;
|
|
||||||
|
|
||||||
box-shadow: 0 0 0.25rem 0 rgba(nb-theme(color-fg), 0.4);
|
|
||||||
|
|
||||||
@include nb-for-theme(cosmic) {
|
|
||||||
@include btn-hero-primary-gradient();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,36 +6,7 @@ import { UserService } from '../../../@core/data/users.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-header',
|
selector: 'ngx-header',
|
||||||
styleUrls: ['./header.component.scss'],
|
styleUrls: ['./header.component.scss'],
|
||||||
template: `
|
templateUrl: './header.component.html',
|
||||||
<div class="header-container" [class.left]="position === 'normal'" [class.right]="position === 'inverse'">
|
|
||||||
<a (click)="toggleSidebar()" href="#" class="navigation"><i class="ion-navicon"></i></a>
|
|
||||||
<div class="logo" (click)="goToHome()">NgX <span>Admin</span></div>
|
|
||||||
<label class="theme-switch">
|
|
||||||
<span class="light">Light</span>
|
|
||||||
<div class="switch">
|
|
||||||
<input type="checkbox" (change)="toggleTheme(theme.checked)" #theme>
|
|
||||||
<span class="slider"></span>
|
|
||||||
</div>
|
|
||||||
<span class="cosmic">Cosmic</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nb-actions
|
|
||||||
size="medium"
|
|
||||||
class="header-container"
|
|
||||||
[class.right]="position === 'normal'"
|
|
||||||
[class.left]="position === 'inverse'">
|
|
||||||
<nb-action icon="nb-grid-b" class="toggle-layout" (click)="toggleSettings()"></nb-action>
|
|
||||||
<nb-action>
|
|
||||||
<nb-user [menu]="userMenu" [name]="user?.name" [picture]="user?.picture"></nb-user>
|
|
||||||
</nb-action>
|
|
||||||
<nb-action disabled icon="ion-ios-bell-outline"></nb-action>
|
|
||||||
<nb-action icon="ion-ios-email-outline"></nb-action>
|
|
||||||
<nb-action>
|
|
||||||
<nb-search type="rotate-layout"></nb-search>
|
|
||||||
</nb-action>
|
|
||||||
</nb-actions>
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class HeaderComponent implements OnInit {
|
export class HeaderComponent implements OnInit {
|
||||||
|
|
||||||
|
|
@ -44,14 +15,7 @@ export class HeaderComponent implements OnInit {
|
||||||
|
|
||||||
user: any;
|
user: any;
|
||||||
|
|
||||||
userMenu = [
|
userMenu = [{ title: 'Profile' }, { title: 'Log out' }];
|
||||||
{
|
|
||||||
title: 'Profile',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Log out',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
constructor(private sidebarService: NbSidebarService,
|
constructor(private sidebarService: NbSidebarService,
|
||||||
private menuService: NbMenuService,
|
private menuService: NbMenuService,
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
@import '../../styles/themes';
|
@import '../../styles/themes';
|
||||||
|
|
||||||
@include nb-install-component() {
|
@include nb-install-component() {
|
||||||
h5 {
|
h6 {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-row {
|
.settings-row {
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 auto 2rem;
|
margin: 0 0 1rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { StateService } from '../../../@core/data/state.service';
|
||||||
selector: 'ngx-theme-settings',
|
selector: 'ngx-theme-settings',
|
||||||
styleUrls: ['./theme-settings.component.scss'],
|
styleUrls: ['./theme-settings.component.scss'],
|
||||||
template: `
|
template: `
|
||||||
<h5>LAYOUTS</h5>
|
<h6>LAYOUTS</h6>
|
||||||
<div class="settings-row">
|
<div class="settings-row">
|
||||||
<a *ngFor="let layout of layouts"
|
<a *ngFor="let layout of layouts"
|
||||||
href="#"
|
href="#"
|
||||||
|
|
@ -16,7 +16,7 @@ import { StateService } from '../../../@core/data/state.service';
|
||||||
<i [attr.class]="layout.icon"></i>
|
<i [attr.class]="layout.icon"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<h5>SIDEBAR</h5>
|
<h6>SIDEBAR</h6>
|
||||||
<div class="settings-row">
|
<div class="settings-row">
|
||||||
<a *ngFor="let sidebar of sidebars"
|
<a *ngFor="let sidebar of sidebars"
|
||||||
href="#"
|
href="#"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue