Skip to content

Commit

Permalink
Importing Aos to parallex effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Anita-ihuman committed Feb 17, 2021
1 parent 457c064 commit d14dcc8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "next start"
},
"dependencies": {
"aos": "^2.3.4",
"next": "10.0.6",
"node-sass": "^5.0.0",
"react": "17.0.1",
Expand Down
13 changes: 8 additions & 5 deletions pages/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Head from "next/head";
import { useEffect, useState } from "react";
import styles from "../styles/main.module.scss";
import Aos from "aos";
import "aos/dist/aos.css";

export interface ElementProps {
headtop: string;
Expand All @@ -19,14 +21,15 @@ export function Element({
left,
image,
}: ElementProps) {

useEffect(() => {
Aos.init({ duration: 2000 });
}, []);


return (
<main className={styles.main}>
<section className={styles.main_content}>
<article
className={styles.main_content1}

>
<article data-aos="fade-left"className={styles.main_content1}>
{left && (
<figure className={styles.content_sideimg}>
<img src="01 (1).png" alt="" width="400px" />
Expand Down
24 changes: 24 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ anymatch@~3.1.1:
normalize-path "^3.0.0"
picomatch "^2.0.4"

aos@^2.3.4:
version "2.3.4"
resolved "https://registry.yarnpkg.com/aos/-/aos-2.3.4.tgz#eb1c29f5c1806a197cf6323080747547edd3db8e"
integrity sha512-zh/ahtR2yME4I51z8IttIt4lC1Nw0ktsFtmeDzID1m9naJnWXhCoARaCgNOGXb5CLy3zm+wqmRAEgMYB5E2HUw==
dependencies:
classlist-polyfill "^1.0.3"
lodash.debounce "^4.0.6"
lodash.throttle "^4.0.1"

aproba@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
Expand Down Expand Up @@ -722,6 +731,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
inherits "^2.0.1"
safe-buffer "^5.0.1"

classlist-polyfill@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz#935bc2dfd9458a876b279617514638bcaa964a2e"
integrity sha1-k1vC39lFiodrJ5YXUUY4vKqWSi4=

[email protected]:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
Expand Down Expand Up @@ -1959,11 +1973,21 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"

lodash.debounce@^4.0.6:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=

lodash.throttle@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=

lodash@^4.0.0, lodash@^4.17.13, lodash@^4.17.15, lodash@~4.17.10:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
Expand Down

0 comments on commit d14dcc8

Please sign in to comment.