From 1d98258ca627ba075f2c4080a0215ffb263191e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20L=C3=B3pez?= <80982226+hnslopez@users.noreply.github.com> Date: Thu, 16 May 2024 13:14:46 -0400 Subject: [PATCH] update ux --- src/app/app.component.ts | 8 +++++--- src/app/shared/components/navbar/navbar.component.css | 2 +- src/app/shared/components/navbar/navbar.component.html | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0a44cd7..6035b49 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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'; @@ -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); } @@ -41,7 +44,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { - console.log( window.matchMedia('(prefers-color-scheme: dark)').matches); this.router.events.pipe( diff --git a/src/app/shared/components/navbar/navbar.component.css b/src/app/shared/components/navbar/navbar.component.css index 0645a5e..2229b0a 100644 --- a/src/app/shared/components/navbar/navbar.component.css +++ b/src/app/shared/components/navbar/navbar.component.css @@ -1,5 +1,5 @@ .toc-affix { position: absolute; top: 80px; - left: 0px; + right: 0px; } \ No newline at end of file diff --git a/src/app/shared/components/navbar/navbar.component.html b/src/app/shared/components/navbar/navbar.component.html index 9e9ca46..484bbf1 100644 --- a/src/app/shared/components/navbar/navbar.component.html +++ b/src/app/shared/components/navbar/navbar.component.html @@ -15,7 +15,7 @@
-