Script yang digunakan adalah sebagai berikut:
<script>
const ob = document.querySelector('.ob');
ob.classList.remove('st');
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
ob.classList.add('st');
return;
}
ob.classList.remove('st');
});
});
observer.observe(document.querySelector('.ani'));
</script>
const ob = document.querySelector('.ob');
ob.classList.remove('st');
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
ob.classList.add('st');
return;
}
ob.classList.remove('st');
});
});
observer.observe(document.querySelector('.ani'));
</script>
CSS yang digunakan adalah sebagai berikut:
<style>
.st{animation: bin 2s ease}
@keyframes bin{
0%{opacity: 0.1;transform: scale(.3)}
50%{opacity: 1;transform: scale(1.05)}
70%{transform:scale(.9)}
100%{transform:scale(1)}}
</style>
.st{animation: bin 2s ease}
@keyframes bin{
0%{opacity: 0.1;transform: scale(.3)}
50%{opacity: 1;transform: scale(1.05)}
70%{transform:scale(.9)}
100%{transform:scale(1)}}
</style>
0
..
..
..
.. 1
!
..
..
..!
..
.
0 comments:
Posting Komentar