Redesign study navigation and light theme
This commit is contained in:
+110
-18
@@ -11,6 +11,11 @@ const AMBER := Color("f59e0b")
|
||||
const SLATE := Color("94a3b8")
|
||||
const DARK_TEXT := Color("f8fafc")
|
||||
const LIGHT_TEXT := Color("0f172a")
|
||||
const LIGHT_BACKGROUND := Color("f1f5f9")
|
||||
const LIGHT_SURFACE := Color("ffffff")
|
||||
const LIGHT_SURFACE_SUBTLE := Color("f8fafc")
|
||||
const LIGHT_BORDER := Color("dbe3ef")
|
||||
const LIGHT_MUTED := Color("64748b")
|
||||
|
||||
static var font: Font = preload("res://assets/fonts/Inter-Variable.ttf")
|
||||
|
||||
@@ -20,36 +25,80 @@ static func text_color(dark: bool) -> Color:
|
||||
|
||||
|
||||
static func muted_color(dark: bool) -> Color:
|
||||
return Color("a9b5ca") if dark else Color("53627a")
|
||||
return Color("a9b5ca") if dark else LIGHT_MUTED
|
||||
|
||||
|
||||
static func background_color(dark: bool) -> Color:
|
||||
return DEEP_NAVY if dark else Color("f5f8ff")
|
||||
return DEEP_NAVY if dark else LIGHT_BACKGROUND
|
||||
|
||||
|
||||
static func background_material(dark: bool) -> ShaderMaterial:
|
||||
var shader := Shader.new()
|
||||
shader.code = """
|
||||
shader_type canvas_item;
|
||||
uniform bool dark_mode = true;
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV;
|
||||
vec3 base = dark_mode ? vec3(0.018, 0.043, 0.090) : vec3(0.965, 0.975, 0.990);
|
||||
float left_glow = 1.0 - smoothstep(0.0, 0.58, distance(uv, vec2(-0.02, 0.12)));
|
||||
float right_glow = 1.0 - smoothstep(0.0, 0.58, distance(uv, vec2(1.02, 0.92)));
|
||||
vec3 blue = dark_mode ? vec3(0.075, 0.055, 0.35) : vec3(0.70, 0.80, 1.0);
|
||||
vec3 purple = dark_mode ? vec3(0.18, 0.035, 0.52) : vec3(0.86, 0.78, 1.0);
|
||||
vec3 color = base + blue * left_glow * (dark_mode ? 0.55 : 0.28);
|
||||
color += purple * right_glow * (dark_mode ? 0.62 : 0.12);
|
||||
COLOR = vec4(color, 1.0);
|
||||
}
|
||||
"""
|
||||
var material := ShaderMaterial.new()
|
||||
material.shader = shader
|
||||
material.set_shader_parameter("dark_mode", dark)
|
||||
return material
|
||||
|
||||
|
||||
static func logo_cutout_material() -> ShaderMaterial:
|
||||
var shader := Shader.new()
|
||||
shader.code = """
|
||||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
vec4 source = texture(TEXTURE, UV);
|
||||
float brightness = max(source.r, max(source.g, source.b));
|
||||
float alpha = smoothstep(0.10, 0.24, brightness);
|
||||
COLOR = vec4(source.rgb, source.a * alpha);
|
||||
}
|
||||
"""
|
||||
var material := ShaderMaterial.new()
|
||||
material.shader = shader
|
||||
return material
|
||||
|
||||
|
||||
static func panel_box(dark: bool) -> StyleBoxFlat:
|
||||
var box := StyleBoxFlat.new()
|
||||
box.bg_color = Color("0b1427cc") if dark else Color("ffffffee")
|
||||
box.border_color = Color("33415d") if dark else Color("d4def0")
|
||||
box.bg_color = Color("0b1427cc") if dark else LIGHT_SURFACE
|
||||
box.border_color = Color("33415d") if dark else LIGHT_BORDER
|
||||
box.set_border_width_all(1)
|
||||
box.set_corner_radius_all(8)
|
||||
box.content_margin_left = 54
|
||||
box.content_margin_right = 54
|
||||
box.content_margin_top = 48
|
||||
box.content_margin_bottom = 42
|
||||
box.set_corner_radius_all(26)
|
||||
if not dark:
|
||||
box.shadow_color = Color(0.15, 0.23, 0.38, 0.12)
|
||||
box.shadow_size = 12
|
||||
box.content_margin_left = 64
|
||||
box.content_margin_right = 64
|
||||
box.content_margin_top = 62
|
||||
box.content_margin_bottom = 48
|
||||
return box
|
||||
|
||||
|
||||
static func field_box(dark: bool, focused: bool = false) -> StyleBoxFlat:
|
||||
var box := StyleBoxFlat.new()
|
||||
box.bg_color = Color("0d172a") if dark else Color("f8faff")
|
||||
box.border_color = ROYAL_BLUE if focused else (Color("33415d") if dark else Color("cbd6e8"))
|
||||
box.bg_color = Color("0d172a") if dark else LIGHT_SURFACE
|
||||
box.border_color = ROYAL_BLUE if focused else (Color("33415d") if dark else LIGHT_BORDER)
|
||||
box.set_border_width_all(1)
|
||||
box.set_corner_radius_all(8)
|
||||
box.content_margin_left = 18
|
||||
box.content_margin_right = 18
|
||||
box.content_margin_top = 15
|
||||
box.content_margin_bottom = 15
|
||||
box.set_corner_radius_all(10)
|
||||
box.content_margin_left = 22
|
||||
box.content_margin_right = 22
|
||||
box.content_margin_top = 18
|
||||
box.content_margin_bottom = 18
|
||||
return box
|
||||
|
||||
|
||||
@@ -59,6 +108,49 @@ static func secondary_button_box(dark: bool, hover: bool = false) -> StyleBoxFla
|
||||
return box
|
||||
|
||||
|
||||
static func shell_box(dark: bool, edge: String) -> StyleBoxFlat:
|
||||
var box := StyleBoxFlat.new()
|
||||
box.bg_color = Color("071224") if dark else LIGHT_SURFACE
|
||||
box.border_color = Color("1c2b49") if dark else LIGHT_BORDER
|
||||
if edge == "right":
|
||||
box.border_width_right = 1
|
||||
elif edge == "bottom":
|
||||
box.border_width_bottom = 1
|
||||
return box
|
||||
|
||||
|
||||
static func content_card_box(dark: bool, active: bool, accent: Color = ROYAL_BLUE) -> StyleBoxFlat:
|
||||
var box := StyleBoxFlat.new()
|
||||
box.bg_color = (Color("07192c") if active else Color("11182e")) if dark else LIGHT_SURFACE
|
||||
box.border_color = accent if active else (Color("2a365a") if dark else LIGHT_BORDER)
|
||||
box.set_border_width_all(1)
|
||||
box.set_corner_radius_all(12)
|
||||
if not dark:
|
||||
box.shadow_color = Color(0.15, 0.23, 0.38, 0.06)
|
||||
box.shadow_size = 5
|
||||
return box
|
||||
|
||||
|
||||
static func icon_circle_box(dark: bool, accent: Color, radius: int, filled: bool = false) -> StyleBoxFlat:
|
||||
var box := StyleBoxFlat.new()
|
||||
box.bg_color = Color(accent, 0.62 if filled else (0.06 if dark else 0.045))
|
||||
box.border_color = Color(accent, 0.48 if dark else 0.18)
|
||||
box.set_border_width_all(1)
|
||||
box.set_corner_radius_all(radius)
|
||||
return box
|
||||
|
||||
|
||||
static func badge_box(dark: bool, accent: Color) -> StyleBoxFlat:
|
||||
var box := StyleBoxFlat.new()
|
||||
box.bg_color = Color(accent, 0.12 if dark else 0.09)
|
||||
box.set_corner_radius_all(7)
|
||||
box.content_margin_left = 10
|
||||
box.content_margin_right = 10
|
||||
box.content_margin_top = 5
|
||||
box.content_margin_bottom = 5
|
||||
return box
|
||||
|
||||
|
||||
static func gradient_button_box() -> StyleBoxTexture:
|
||||
var gradient := Gradient.new()
|
||||
gradient.colors = PackedColorArray([Color("1677ff"), Color("8f3ff4")])
|
||||
@@ -70,8 +162,8 @@ static func gradient_button_box() -> StyleBoxTexture:
|
||||
texture.fill_to = Vector2(1, 0.5)
|
||||
var box := StyleBoxTexture.new()
|
||||
box.texture = texture
|
||||
box.content_margin_top = 14
|
||||
box.content_margin_bottom = 14
|
||||
box.content_margin_top = 18
|
||||
box.content_margin_bottom = 18
|
||||
return box
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user