diff --git a/src/vn.rs b/src/vn.rs index c8c9537..fd6f0dd 100644 --- a/src/vn.rs +++ b/src/vn.rs @@ -79,7 +79,7 @@ fn generate_html(mut scenes: Vec, sections: Vec, choices: Markup } fn global_styles() -> Markup { - let base_styles = r" + const BASE_STYLES: &str = r" :root { --border-color: #3a3a3a; --box-shadow: 0 0.4vw 0.6vw rgba(0, 0, 0, 0.1); @@ -88,7 +88,7 @@ fn global_styles() -> Markup { --border-radius: 1vw; }"; - let navigation = r" + const NAVIGATION: &str = r" .nav-controls { display: flex; justify-content: center; @@ -112,13 +112,6 @@ fn global_styles() -> Markup { margin: 0; padding: 0; } - .nav-button:hover { - background: #e0e0e0; - transform: scale(1.1); - } - .nav-button:active { - transform: scale(0.95); - } #section-counter { font-family: system-ui, sans-serif; font-size: 0.9rem; @@ -126,14 +119,21 @@ fn global_styles() -> Markup { margin: 0 1rem; padding: 0; line-height: 1; + } + .nav-button:hover { + background: #e0e0e0; + transform: scale(1.1); + } + .nav-button:active { + transform: scale(0.95); }"; - let container_styles = r" + const CONTAINER_STYLES: &str = r" .textbox-container { width: 75%; margin: 0 auto; position: relative; - padding-top: 42.1875%; /* 16:9 Aspect Ratio */ + padding-top: 42.1875%; background: #f8f8f8; border-radius: 8px; overflow: hidden; @@ -147,7 +147,7 @@ fn global_styles() -> Markup { z-index: 1; }"; - let scene_styles = r" + const SCENE_STYLES: &str = r" .scene-section { position: absolute; top: 0; @@ -178,7 +178,7 @@ fn global_styles() -> Markup { transform: translateX(-50%); }"; - let textbox_styles = r" + const TEXTBOX_STYLES: &str = r" .textbox-content { position: absolute; bottom: 0; @@ -213,7 +213,7 @@ fn global_styles() -> Markup { opacity: 0.5; }"; - let character_styles = r" + const CHARACTER_STYLES: &str = r" .character-name, .choice-name { font-family: 'Georgia', serif; font-size: 1.8vw; @@ -239,7 +239,7 @@ fn global_styles() -> Markup { padding: 1vh 0.5vw; }"; - let choice_styles = r" + const CHOICE_STYLES: &str = r" .choices-section { position: absolute; top: 0; @@ -293,7 +293,7 @@ fn global_styles() -> Markup { z-index: 1; }"; - let responsive = r" + const RESPONSIVE: &str = r" @media (max-width: 768px) { .choice-name { font-size: 1.2rem; @@ -315,16 +315,11 @@ fn global_styles() -> Markup { html! { style { - (maud::PreEscaped([ - base_styles, - navigation, - container_styles, - scene_styles, - textbox_styles, - character_styles, - choice_styles, - responsive - ].join(""))) + (maud::PreEscaped( + [BASE_STYLES, NAVIGATION, CONTAINER_STYLES, SCENE_STYLES, + TEXTBOX_STYLES, CHARACTER_STYLES, CHOICE_STYLES, RESPONSIVE] + .join("") + )) } } }