1CSS
2<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
3
4JS
5<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
6
7INITIALIZE AOS:
8<script>
9 AOS.init();
10</script>
1//install
2npm install aos --save
3
4
5//initialize in react
6
7import AOS from 'aos'
8import 'aos/dist/aos.css';
9AOS.init();
10
11
12
1// In your terminal
2yarn add aos@next or npm install --save aos@next
3
4// In your JS file
5import AOS from 'aos';
6import 'aos/dist/aos.css';
7
8AOS.init();
9
10// then, you can add data-aos attributes in your html
1[data-aos="new-animation"] {
2 opacity: 0;
3 transition-property: transform, opacity;
4
5 &.aos-animate {
6 opacity: 1;
7 }
8
9 @media screen and (min-width: 768px) {
10 transform: translateX(100px);
11
12 &.aos-animate {
13 transform: translateX(0);
14 }
15 }
16}
1/*Add styles in <head>: */
2
3 <link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
4
5/*Add script right before closing </body> tag, and initialize AOS:*/
6 <script src="https://unpkg.com/aos@next/dist/aos.js"></script>
7 <script>
8 AOS.init();
9 </script>