Compare commits

...
3 Commits
Author SHA1 Message Date
copecone 7cf7c49937 Fix Dropdown Item Style Implementation 2026-04-07 13:04:57 +09:00
copecone 81bfd4a2b8 Fix Popup Implementation 2026-04-07 12:04:49 +09:00
copecone 44b7d6097e Fix Dark Theme Application Architecture 2026-04-07 11:58:12 +09:00
7 changed files with 33 additions and 32 deletions

No files matched your search

+8 -7
View File
@@ -2,9 +2,10 @@
@use "sass:color"; @use "sass:color";
@use "styles/library" as library; @use "styles/library" as library;
$default_bg: oklch(1 0 0); // #FFFFFF
$border_color: oklch(0 0 0 / 20%); $border_color: oklch(0 0 0 / 20%);
$border_dark_color: oklch(1 0 0 / 20%);
$hover_bg: oklch(0.9702 0 0); // #F5F5F5 $hover_bg: oklch(0.9702 0 0); // #F5F5F5
$hover_dark_bg: oklch(0.25 0 0);
$height: 40px; $height: 40px;
$border_radius: 8px; $border_radius: 8px;
@@ -19,9 +20,9 @@ $default_animation_duration: 0.2s;
--animation-duration: calc(#{$default_animation_duration} * var(--motion-duration-multiplier)); --animation-duration: calc(#{$default_animation_duration} * var(--motion-duration-multiplier));
padding: 0; margin: 0; padding: 0; margin: 0;
background-color: $default_bg; background-color: light-dark(oklch(1 0 0), oklch(0 0 0));
border-radius: $border_radius; border-radius: $border_radius;
box-shadow: 0 0 0 1px $border_color inset; box-shadow: 0 0 0 1px light-dark($border_color, $border_dark_color) inset;
cursor: pointer; cursor: pointer;
max-width: 100%; max-width: 100%;
@@ -73,7 +74,7 @@ $default_animation_duration: 0.2s;
padding: 0; padding: 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
background-color: $default_bg; background-color: light-dark(oklch(1 0 0), oklch(0 0 0));
border-radius: $border_radius; border-radius: $border_radius;
z-index: 1000; z-index: 1000;
max-height: 240px; max-height: 240px;
@@ -86,7 +87,7 @@ $default_animation_duration: 0.2s;
position: absolute; position: absolute;
top: 0; left: 0; right: 0; bottom: 0; top: 0; left: 0; right: 0; bottom: 0;
border-radius: $border_radius; border-radius: $border_radius;
box-shadow: 0 0 0 1px $border_color inset; box-shadow: 0 0 0 1px light-dark($border_color, $border_dark_color) inset;
pointer-events: none; pointer-events: none;
z-index: 1001; z-index: 1001;
} }
@@ -116,11 +117,11 @@ $default_animation_duration: 0.2s;
font-size: 16px; font-size: 16px;
&:hover, &.focused { &:hover, &.focused {
background-color: $hover_bg; background-color: light-dark($hover_bg, $hover_dark_bg);
} }
&.selected { &.selected {
background-color: list.nth(library.$brand_palette, 1); background-color: light-dark(list.nth(library.$brand_palette, 1), list.nth(library.$brand_palette, 11));
color: list.nth(library.$brand_palette, 5); color: list.nth(library.$brand_palette, 5);
font-weight: 600; font-weight: 600;
} }
+3 -3
View File
@@ -30,11 +30,11 @@ $default_animation_duration: 0.2s;
overflow: visible; overflow: visible;
animation: popup-enter var(--animation-duration) $animation_timing; animation: popup-enter var(--animation-duration) $animation_timing;
outline: oklch(0 0 0 / 20%) 2px solid; outline: light-dark(oklch(0 0 0 / 20%), oklch(1 0 0 / 20%)) 2px solid;
gap: 16px; gap: 16px;
&.variant-glass { &.variant-glass {
background-color: oklch(1 0 0 / 60%); background-color: light-dark(oklch(1 0 0 / 60%), oklch(0 0 0 / 60%));
backdrop-filter: blur(20px); backdrop-filter: blur(20px);
} }
@@ -67,7 +67,7 @@ $default_animation_duration: 0.2s;
align-items: center; align-items: center;
padding: 0 12px; padding: 0 12px;
height: 40px; height: 40px;
box-shadow: 0 1px 0 oklch(0 0 0 / 20%); box-shadow: 0 1px 0 light-dark(oklch(0 0 0 / 20%), oklch(1 0 0 / 20%));
.header-left { .header-left {
display: flex; display: flex;
+6 -14
View File
@@ -8,8 +8,10 @@ $off_dark_bg: oklch(0 0 0);
$dimension: (57px, 30px); $dimension: (57px, 30px);
$knob_dimension: (24px, 24px); $knob_dimension: (24px, 24px);
$internal_padding: (3px, 3px); $internal_padding: (3px, 3px);
$border_radius: 15px; $border_radius: 15px;
$border_color: oklch(0 0 0 / 20%); $border_color: oklch(0 0 0 / 20%);
$border_dark_color: oklch(1 0 0 / 40%);
$animation_timing: cubic-bezier(0.4, 0, 0.2, 1); $animation_timing: cubic-bezier(0.4, 0, 0.2, 1);
$default_animation_duration: 0.2s; $default_animation_duration: 0.2s;
@@ -19,17 +21,11 @@ $default_animation_duration: 0.2s;
width: list.nth($dimension, 1); height: list.nth($dimension, 2); width: list.nth($dimension, 1); height: list.nth($dimension, 2);
border-radius: $border_radius; border-radius: $border_radius;
background-color: $off_bg; background-color: light-dark($off_bg, $off_dark_bg);
box-shadow: 0 0 0 1px $border_color inset; box-shadow: 0 0 0 1px light-dark($border_color, $border_dark_color) inset;
--animation-duration: calc(#{$default_animation_duration} * var(--motion-duration-multiplier)); --animation-duration: calc(#{$default_animation_duration} * var(--motion-duration-multiplier));
transition: background-color var(--animation-duration) $animation_timing;
html.dark-theme & {
background-color: $off_dark_bg;
box-shadow: 0 0 0 1px oklch(1 0 0 / 40%) inset;
transition: background-color var(--animation-duration) $animation_timing, box-shadow var(--animation-duration) $animation_timing; transition: background-color var(--animation-duration) $animation_timing, box-shadow var(--animation-duration) $animation_timing;
}
cursor: pointer; cursor: pointer;
position: relative; position: relative;
@@ -42,12 +38,8 @@ $default_animation_duration: 0.2s;
} }
&.active { &.active {
background-color: list.nth(library.$brand_palette, 5); background-color: light-dark(list.nth(library.$brand_palette, 5), list.nth(library.$brand_palette, 9));
box-shadow: var(--if-dark, 0 0 0 1px list.nth(library.$brand_palette, 10) inset);
html.dark-theme & {
background-color: list.nth(library.$brand_palette, 9);
box-shadow: 0 0 0 1px list.nth(library.$brand_palette, 10) inset;
}
.switch-knob { .switch-knob {
transform: translate( transform: translate(
@@ -1,6 +1,6 @@
<div class="menu-left"> <div class="menu-left">
<a class="brand" [routerLink]="['/']"> <a class="brand" [routerLink]="['/']">
<img ngSrc="/logo_inverted.svg" alt="logo" height="20" width="59.52" /> <img [src]="settings.darkMode() ? '/logo.svg' : '/logo_inverted.svg'" alt="logo" height="20" width="59.52" />
<span><strong>ADOFAI Editor Forum</strong></span> <span><strong>ADOFAI Editor Forum</strong></span>
</a> </a>
@@ -11,8 +11,8 @@
min-width: 100%; min-width: 100%;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 2px 0 oklch(0 0 0 / 20%); box-shadow: 0 2px 0 light-dark(oklch(0 0 0 / 20%), oklch(1 0 0 / 20%));
background-color: oklch(1 0 0 / 60%); background-color: light-dark(oklch(1 0 0 / 60%), oklch(0 0 0 / 60%));
backdrop-filter: blur(20px); backdrop-filter: blur(20px);
+3 -3
View File
@@ -1,22 +1,22 @@
import { Component, inject } from '@angular/core'; import { Component, inject } from '@angular/core';
import { RouterLink } from '@angular/router'; import { RouterLink } from '@angular/router';
import { NgOptimizedImage } from '@angular/common';
import { PopupService } from '../../services/popup.service'; import { PopupService } from '../../services/popup.service';
import { SettingsPopup } from '../settings/settings'; import { SettingsPopup } from '../settings/settings';
import { TranslationService } from '../../services/translation.service'; import { TranslationService } from '../../services/translation.service';
import { SettingsService } from '../../services/settings.service';
@Component({ @Component({
selector: 'header-menu', selector: 'header-menu',
imports: [RouterLink, NgOptimizedImage], imports: [RouterLink],
templateUrl: './header-menu.html', templateUrl: './header-menu.html',
styleUrl: './header-menu.scss', styleUrl: './header-menu.scss',
}) })
export class HeaderMenu { export class HeaderMenu {
private popupService = inject(PopupService); private popupService = inject(PopupService);
protected translation = inject(TranslationService).translation; protected translation = inject(TranslationService).translation;
protected settings = inject(SettingsService);
onSettingsClick() { onSettingsClick() {
console.log('HeaderMenu: Settings clicked');
this.popupService.open(SettingsPopup, { position: { top: '84px', right: '20px' } }); this.popupService.open(SettingsPopup, { position: { top: '84px', right: '20px' } });
} }
} }
+10 -2
View File
@@ -13,7 +13,13 @@
--motion-duration-multiplier: 0 !important; --motion-duration-multiplier: 0 !important;
} }
html.dark-theme { html {
color-scheme: light;
--if-dark: initial;
&.dark-theme {
--if-dark: ;
color-scheme: dark;
color: white; color: white;
& > body { & > body {
@@ -22,6 +28,8 @@ html.dark-theme {
section.feature-block { section.feature-block {
background-color: oklch(0 0 0 / 60%); background-color: oklch(0 0 0 / 60%);
outline: 2px solid oklch(1 0 0 / 20%);
}
} }
} }
@@ -60,7 +68,7 @@ h1 {
h2 { h2 {
font-size: 24px; font-size: 24px;
color: oklch(0.5103 0 0); // #666 color: oklch(0.6830 0 0); // #999999
} }
h3 { h3 {