Added speaker name for choice boxes
This commit is contained in:
parent
1ad2fcd9cb
commit
89a6dc9f1d
32
src/vn.rs
32
src/vn.rs
@ -266,6 +266,21 @@ fn global_styles() -> Markup {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.choice-name {
|
||||
font-family: 'Georgia', serif;
|
||||
font-size: 1.8vw;
|
||||
font-weight: bold;
|
||||
padding: 0 1.5vw;
|
||||
background: #4a6b8a;
|
||||
color: white;
|
||||
border-radius: 0.5vw;
|
||||
margin: -1.2vw 0 1vw 0;
|
||||
transform: translateY(-60%);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.choice-box {
|
||||
width: 90%;
|
||||
min-width: 85%;
|
||||
@ -280,6 +295,18 @@ fn global_styles() -> Markup {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.choice-name {
|
||||
font-size: 1.2rem;
|
||||
margin: -1rem 0 0.8rem 0;
|
||||
transform: translateY(-40%);
|
||||
}
|
||||
}
|
||||
|
||||
.choice-box:has(.choice-name) {
|
||||
padding-top: 2.5vw;
|
||||
}
|
||||
|
||||
.choice-button {
|
||||
width: 100%;
|
||||
background: none;
|
||||
@ -387,6 +414,11 @@ pub fn render_novel(
|
||||
@for (i, dialog_sequence) in dialogs.iter().enumerate() {
|
||||
@if let Some(block) = dialog_sequence.blocks.first() {
|
||||
div class="choice-box" {
|
||||
@if !block.name.is_empty() {
|
||||
div class="choice-name" {
|
||||
(block.name)
|
||||
}
|
||||
}
|
||||
form method="POST" {
|
||||
input type="hidden" name="progress" value=(progress);
|
||||
input type="hidden" name="choice" value=(i);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user