Improved image display
This commit is contained in:
parent
995b946dcb
commit
8d9da220d5
51
src/vn.rs
51
src/vn.rs
@ -141,12 +141,16 @@ pub fn render_novel(
|
||||
let html = html! {
|
||||
div id="story-container" {
|
||||
div class="textbox-container" {
|
||||
div class="scene-container" {
|
||||
@for (index, scene) in scenes.iter().enumerate() {
|
||||
div class="scene-section" data-section-index=(index)
|
||||
style=(format!("display: {};", if index == 0 { "block" } else { "none" })) {
|
||||
div class="scene-content" {
|
||||
(maud::PreEscaped(scene))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div class="textbox-content" {
|
||||
@for (index, section) in sections.iter().enumerate() {
|
||||
@ -219,16 +223,53 @@ pub fn render_novel(
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.textbox-content {
|
||||
.scene-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 1rem;
|
||||
justify-content: flex-end;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.scene-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.scene-section {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.scene-section[style*='block'] {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.scene-section img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.textbox-content {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 30%);
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.visual-novel-box {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user