Skip to content

Commit d965924

Browse files
committed
fix: content wider than the screen
1 parent f36b5b5 commit d965924

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

assets/script/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var body = document.querySelector('body > main > section#body');
55
var footer = document.querySelector('body > main > section#footer');
66
var significantChange = document.querySelector('body > main > section#significantChange');
77
var result = document.querySelector('body > main > section#result');
8+
let sections = Array.from(document.querySelectorAll('main > section'));
89

910

1011
var currentTarget = type;
@@ -23,6 +24,8 @@ function waitTransition(section) {
2324

2425
try {
2526

27+
sections.forEach(element => element.classList.add('visible'));
28+
2629
let loop = setInterval(() => {
2730

2831
if (
@@ -31,6 +34,9 @@ function waitTransition(section) {
3134
) {
3235

3336
clearInterval(loop);
37+
38+
sections.forEach(element => (element.id != section.id) && element.classList.remove('visible'));
39+
3440
resolve();
3541

3642
}

assets/style/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ main {
2828

2929
display: flex;
3030
flex-flow: column;
31+
32+
visibility: hidden;
33+
}
34+
main > section.visible {
35+
visibility: visible;
3136
}
3237
main > section > details {
3338
flex: 0;

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<!-- <header></header> -->
3434

3535
<main>
36-
<section id="type">
36+
<section id="type" class="visible">
3737

3838
<details>
3939
<summary>Type</summary>

0 commit comments

Comments
 (0)