From a1f867025b3cf3059fb594e42175c1ebed578380 Mon Sep 17 00:00:00 2001 From: p11 Date: Mon, 21 Apr 2025 10:15:14 +0200 Subject: [PATCH] Use .class instead of class="class" --- src/vn.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/vn.rs b/src/vn.rs index 8b40477..2a11d53 100644 --- a/src/vn.rs +++ b/src/vn.rs @@ -28,10 +28,10 @@ fn render_scene(settings: &PlayerSettings, name: &str) -> Markup { fn navigation_controls(total_scenes: usize) -> Markup { html! { - div class="nav-controls" { - button class="nav-button" onclick="prev()" { "←" } + div .nav-controls { + button .nav-button onclick="prev()" { "←" } span id="section-counter" { "1/" (total_scenes) } - button class="nav-button" onclick="next()" { "→" } + button .nav-button onclick="next()" { "→" } } } } @@ -41,22 +41,22 @@ fn generate_html(scenes: Vec, sections: Vec) -> Markup { html! { div id="story-container" { - div class="textbox-container" { - div class="scene-container" { + div .textbox-container { + div .scene-container { @for (index, scene) in scenes.iter().enumerate() { - div class="scene-section" + div .scene-section data-section-index=(index) style=(format!("display: {};", if index == 0 { "block" } else { "none" })) { - div class="scene-content" { + div .scene-content { (scene) } } } } - div class="textbox-content" { + div .textbox-content { @for (index, section) in sections.into_iter().enumerate() { - div class="story-section" + div .story-section data-section-index=(index) style=(format!("display: {};", if index == 0 { "block" } else { "none" })) { (section) @@ -358,16 +358,16 @@ pub fn render_novel( if let Some(_named_multilinear_info) = named_multilinear_info { let choices_html = html! { - div class="choices-section" { + div .choices-section { @for (i, dialog_sequence) in dialogs.iter().enumerate() { @if let Some(block) = dialog_sequence.blocks.first() { form method="POST" { input type="hidden" name="progress" value=(progress); input type="hidden" name="choice" value=(i); - button type="submit" class="choice-button" { - fieldset class="choice-box" { + button type="submit" .choice-button { + fieldset .choice-box { @if !block.name.is_empty() { - legend class="choice-name" { (block.name) } + legend .choice-name { (block.name) } } (block.lines[0].text) } @@ -454,11 +454,11 @@ fn render_dialog_block(block: &dialogi::DialogBlock, start_level: usi ); html! { - fieldset class="visual-novel-box" { + fieldset .visual-novel-box { @if !block.name.is_empty() { - legend class="character-name" { (block.name) } + legend .character-name { (block.name) } } - div class="dialog-content" { + div .dialog-content { @match String::from_utf8(content) { Ok(text) => (maud::PreEscaped(text)), Err(e) => (maud::PreEscaped(format!("Error: {}", e))),