How would the css be adjusted here where the play buttons are separated into their own container?
I am up to that part in the javascript. https://jsfiddle.net/gqv5btr1/
In there I put the play buttons into their own container, as the code is now not working, which is fine.
I wanted to get the css ready first, and wanted to know what adjustments would need to be made in there.
Here is a working code if you would need to be able to see that.
Working code: https://jsfiddle.net/2md1ge8c/
When the play buttons are moved out, .outer
will not be needed in the html, right, that can be removed?
I added .playButtonContainer
Replacing .outer
in the css
What else in the css needs to be changed to get it ready.
.isOpen
is staying I think, right?
What adjustments would need to be made in the css to prepare?
I’m not really sure what happens to this:
Would .outer
become .playButtonContainer
?
Assuming, .outer
will not be needed in the html, which it won’t be now, right?
.outer.isOpen {
/*display: flex;*/
width: auto;
/*align-content: stretch;*/
}
.fadingOut .isOpen {
animation: fadingOut 1s;
animation-delay: 11.3s;
}
Also, I’m not implementing the crossfade effect on this one, all I’m doing is, separating the play buttons into a separate container, having it work like that.
I’m not sure what needs to be changed in here to get it ready.
In the css here I replaced .outer
with .playButtonContainer
.
CSS
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background: #353198;
/* animation: fadeInBody1 0s ease forwards;*/
}
/*@keyframes fadeInBody1 {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}*/
/*body.*/
.initial-fade {
animation: initial-fade 500ms ease forwards;
}
@keyframes initial-fade {
to {
opacity: 0;
}
}
.initial-fade,
.fadingOut {
cursor: default;
}
.initial-fade .cover,
.initial-fade .cover * {
pointer-events: none !important;
}
.container {
display: flex;
justify-content: center;
position: relative;
/*z-index: 2;*/
}
.container.active {
flex: 1 0 0;
}
/*body.*/
.bg1 {
animation: fadeInBody 5s ease 0s forwards;
animation-delay: 0s;
opacity: 0;
}
@keyframes fadeInBody {
100% {
opacity: 1;
}
}
/*body.*/
.bg1 .with-curtain:before {
content: "";
position: fixed;
/*z-index: 1;*/
top: 0;
left: 0;
right: 0;
bottom: 0;
background-size: 165px 165px;
}
.playButtonContainer {
display: flex;
flex-wrap: wrap;
min-height: 100%;
margin: auto;
justify-content: center;
align-content: center;
width: 290px;
gap: 10px;
animation: fadeInButtons 3s ease 0s forwards;
}
@keyframes fadeInButtons {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/*.outer {
display: flex;
flex-wrap: wrap;
min-height: 100%;
margin: auto;
justify-content: center;
align-content: center;
width: 290px;
gap: 10px;
animation: fadeInButtons 3s ease 0s forwards;
}
@keyframes fadeInButtons {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}*/
.outer.isOpen {
/*display: flex;*/
width: auto;
/*align-content: stretch;*/
}
.fadingOut .isOpen {
animation: fadingOut 1s;
animation-delay: 11.3s;
}
@keyframes fadingOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
.inner-container {
display: none;
}
/* when container is active hide the cssPlay and show the inner container*/
.container.active .cover {
display: none;
}
.container.active .inner-container {
display: flex;
}
.container.active .inner-container.curtain {
display: block;
}
Also, what would .outer
on here be changed to, .playButtonContainer
?
I’m assuming .isOpen will still be needed, right?
function resetButtons(buttonSelector) {
const allButtons = document.querySelectorAll(buttonSelector);
function hideButton(button) {
button.classList.add("isOpen");
}
allButtons.forEach(hideButton);
}
resetButtons(".outer");
What I am trying to figure out is,
What gets removed, what stays in the code, and what gets changed to prepare for the play buttons to be put into their own container?
I think I make it seem more complicated than it is.