I'm trying to use animate.css in my vue project. I've imported the library in the main.js file
import { createApp } from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
//bootstrap
import 'bootstrap/dist/css/bootstrap.min.css';
//font-awesome
import '@fortawesome/fontawesome-free/css/all.min.css';
//animate.css
import 'animate.css';
createApp(App)
.use(router)
.mount('#app');
And In my view I'm assigning the classes from the library to the elements I want to animate but without success, nothing happen.
<template>
<div class="container-fluid p-0" id="content-wrapper">
<!-- copertina pagina -->
<div class="row m-0" id="cover-row">
<div class="col-sm-12 col-md-12 col-lg-12 vh-100 p-0">
<img class="img-fluid w-100 h-100" src="@/assets/cover.jpeg" id="cover-image">
<span class="text-center position-absolute" id="cover-scroll">
<a href="#travels" class="animate__slideOutDown animate__slower animate__delay-3s animate__repeat-3">
<i class="fas fa-chevron-down"></i>
</a>
</span>
<div class="overlay position-absolute"></div>
</div>
</div>
<!-- descrizione progetto -->
<div class="row m-0 mb-3 pt-5 pb-5 px-md-5" id="travels">
<div class="col-sm-12 col-md-6 col-lg-6 text-center" id="">
<img class="img-fluid w-75" src="@/assets/peoples.jpg">
</div>
<div class="col-sm-12 col-md-6 col-lg-6" id="">
<h1 class="fw-bold mt-5 animate__fadeInDown">Escursioni in programma</h1>
<h4 class="mb-5 animate__fadeInDown">
...
</h4>
<div class="d-grid gap-2">
<button class="btn btn-primary btn-lg btn-block" @click.prevent="showIframe()">OPEN</button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Home',
methods: {
showIframe() {
this.$router.push({path: '/events'});
}
}
}
</script>
<style lang="scss" scoped>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
#content-wrapper {
font-family: 'Montserrat', sans-serif;
background: white;
#cover-row {
#cover-image {
object-fit: cover;
}
.overlay {
height: 100vh;
background: rgba(0,0,0,0.5);
top: 0;
left: 0;
right: 0;
}
#cover-scroll {
a {
color: white !important;
}
z-index: 1;
top: 85%;
left: 0;
right: 0;
}
}
}
</style>
The arrow on the cover will not be animated. For the text the same problem occur. Any suggestion to fix the code?Maybe I've made a mistake?