Skip to content

Commit

Permalink
update ux
Browse files Browse the repository at this point in the history
  • Loading branch information
hnslopez committed May 16, 2024
1 parent a01add8 commit 1d98258
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Inject, LOCALE_ID } from '@angular/core';

import { Title } from '@angular/platform-browser';
import { TranslateService } from '@ngx-translate/core';
import { Application } from '@splinetool/runtime';
Expand All @@ -16,11 +17,13 @@ export class AppComponent implements OnInit {
title = 'Portafolio';
loading = true;

constructor(public translate: TranslateService, private router: Router, private titleService: Title) {
constructor(public translate: TranslateService, private router: Router, private titleService: Title, @Inject(LOCALE_ID) private locale: string) {
let defaultLenguage = localStorage.getItem('locale') || 'es';
console.log('Idioma del navegador:', this.locale);


if (!['es', 'en'].includes(defaultLenguage)) {

defaultLenguage = 'es';
localStorage.setItem('locale', defaultLenguage);
}
Expand All @@ -41,7 +44,6 @@ export class AppComponent implements OnInit {

ngOnInit(): void {

console.log( window.matchMedia('(prefers-color-scheme: dark)').matches);


this.router.events.pipe(
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/components/navbar/navbar.component.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.toc-affix {
position: absolute;
top: 80px;
left: 0px;
right: 0px;
}
2 changes: 1 addition & 1 deletion src/app/shared/components/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h6>

<ng-template #navbarMobile>
<nz-affix class="toc-affix" [nzOffsetTop]="80" >
<button nz-button nzType="default" (click)="open()" style="height: 40px; width: 40px; border-left: 0px;">
<button nz-button nzType="default" (click)="open()" style="height: 40px; width: 40px; border-right: 0px;">
<span nz-icon [nzType]="isOpen() ? 'menu-unfold' : 'menu-fold'"></span>
</button>
</nz-affix>
Expand Down

0 comments on commit 1d98258

Please sign in to comment.