Put the text box and the scene into the same selection parent
This commit is contained in:
parent
631812abdf
commit
485609a3e4
13
src/vn.rs
13
src/vn.rs
@ -41,15 +41,13 @@ fn generate_html(scenes: Vec<Markup>, sections: Vec<Markup>) -> Markup {
|
|||||||
div #story-container {
|
div #story-container {
|
||||||
div .scene-viewport {
|
div .scene-viewport {
|
||||||
@for (index, (scene, section)) in (scenes.iter().zip(sections)).enumerate() {
|
@for (index, (scene, section)) in (scenes.iter().zip(sections)).enumerate() {
|
||||||
article .scene-section
|
section .selection-section
|
||||||
data-section-index=(index)
|
data-section-index=(index)
|
||||||
style=(format!("display: {};", if index == 0 { "block" } else { "none" })) {
|
style=(format!("display: {};", if index == 0 { "block" } else { "none" })) {
|
||||||
|
article .scene-section {
|
||||||
(scene)
|
(scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
section .text-section
|
|
||||||
data-section-index=(index)
|
|
||||||
style=(format!("display: {};", if index == 0 { "block" } else { "none" })) {
|
|
||||||
(section)
|
(section)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,8 +127,6 @@ fn global_styles() -> Markup {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
display: none;
|
display: none;
|
||||||
aspect-ratio: 16/9;
|
aspect-ratio: 16/9;
|
||||||
}
|
|
||||||
.scene-section[style*='block'] {
|
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -261,10 +257,7 @@ fn interactive_script(total_scenes: usize) -> Markup {
|
|||||||
const totalScenes = {total_scenes};
|
const totalScenes = {total_scenes};
|
||||||
|
|
||||||
function updateSection() {{
|
function updateSection() {{
|
||||||
document.querySelectorAll('.text-section').forEach((el, index) => {{
|
document.querySelectorAll('.selection-section').forEach((el, index) => {{
|
||||||
el.style.display = index === currentScene ? 'block' : 'none';
|
|
||||||
}});
|
|
||||||
document.querySelectorAll('.scene-section').forEach((el, index) => {{
|
|
||||||
el.style.display = index === currentScene ? 'block' : 'none';
|
el.style.display = index === currentScene ? 'block' : 'none';
|
||||||
}});
|
}});
|
||||||
document.getElementById('section-counter').textContent =
|
document.getElementById('section-counter').textContent =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user