Fixed Animation and presentation class
This commit is contained in:
parent
ad16090dea
commit
023b9606b5
3 changed files with 39 additions and 12 deletions
|
@ -6,16 +6,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.presentation {
|
.presentation {
|
||||||
overflow: visible;
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
height: 30rem;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.presentation-text {
|
||||||
|
margin: 14rem 2rem;
|
||||||
|
padding: 0 0 0 2rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.presentation-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.photosaoul {
|
.photosaoul {
|
||||||
width: 30%;
|
max-width: inherit;
|
||||||
height: 30%;
|
height: inherit;
|
||||||
float: right;
|
float: right;
|
||||||
z-index:10;
|
z-index:10;
|
||||||
rotate: 0deg;
|
display: none;
|
||||||
margin-right: -30rem;
|
margin-top: auto;
|
||||||
}
|
}
|
10
index.html
10
index.html
|
@ -16,9 +16,13 @@
|
||||||
<body>
|
<body>
|
||||||
<Navbar></Navbar>
|
<Navbar></Navbar>
|
||||||
<div class="presentation">
|
<div class="presentation">
|
||||||
<h1>Saoul Bonmonsieur</h1>
|
<div class="presentation-text">
|
||||||
<img class="photosaoul" src="assets/saoul.png"></img>
|
<h1>Saoul Bonmonsieur</h1>
|
||||||
<button onclick="superAnim()">Animate !</button>
|
<button onclick="superAnim()">Animate !</button>
|
||||||
|
</div>
|
||||||
|
<div class="presentation-img">
|
||||||
|
<img class="photosaoul" src="assets/saoul.png"></img>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
19
js/index.js
19
js/index.js
|
@ -1,10 +1,21 @@
|
||||||
var saoulAnimation = anime({
|
var saoulAnimation = anime({
|
||||||
targets: '.photosaoul',
|
targets: '.photosaoul',
|
||||||
autoplay: false,
|
easing: 'easeOutQuint',
|
||||||
rotate: -30,
|
translateX: [
|
||||||
translateX: -380,
|
{value: 0, duration: 100, delay: 0 },
|
||||||
|
{value: "100%", duration: 600, delay: 100 }
|
||||||
|
],
|
||||||
|
rotate : [
|
||||||
|
{value: 0, duration: 100, delay: 0 },
|
||||||
|
{value: 30, duration: 600, delay: 100 }
|
||||||
|
],
|
||||||
|
begin: function () {
|
||||||
|
document.getElementsByClassName("photosaoul")[0].style.display = "flex";
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
saoulAnimation.reverse()
|
||||||
|
|
||||||
function superAnim() {
|
function superAnim() {
|
||||||
saoulAnimation.restart();
|
saoulAnimation.restart()
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue