-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from scriptex/feature/typescript-support
Migrate to TypeScript
- Loading branch information
Showing
13 changed files
with
554 additions
and
3,243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
||
<title>Animate Me Demo</title> | ||
<title>Animate Me Demo</title> | ||
|
||
<link rel="stylesheet" href="../dist/animate.me.css" /> | ||
<link rel="stylesheet" href="../dist/animate.me.css" /> | ||
|
||
<style type="text/css" media="screen"> | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
<style type="text/css" media="screen"> | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
} | ||
body { | ||
margin: 0; | ||
} | ||
|
||
.animate-me { | ||
font-family: sans-serif; | ||
font-size: 2vw; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 75vh; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="animate-me" style="background-color: red;">1st section</div> | ||
.animate-me { | ||
font-family: sans-serif; | ||
font-size: 2vw; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 75vh; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="animate-me" style="background-color: red;">1st section</div> | ||
|
||
<div class="animate-me" style="background-color: blue;">2nd section</div> | ||
<div class="animate-me" style="background-color: blue;">2nd section</div> | ||
|
||
<div class="animate-me" style="background-color: green;">3rd section</div> | ||
<div class="animate-me" style="background-color: green;">3rd section</div> | ||
|
||
<div class="animate-me" style="background-color: yellow;">4th section</div> | ||
<div class="animate-me" style="background-color: yellow;">4th section</div> | ||
|
||
<div class="animate-me" style="background-color: lavender;">5th section</div> | ||
<div class="animate-me" style="background-color: lavender;">5th section</div> | ||
|
||
<script type="module"> | ||
import AnimateMe from '../src/animate.me.js'; | ||
<script src="../dist/animate.me.js"></script> | ||
|
||
new AnimateMe(); | ||
</script> | ||
</body> | ||
<script> | ||
new AnimateMe(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
interface AnimateMeOptions { | ||
offset?: number; | ||
readonly reverse?: boolean; | ||
readonly animatedIn?: string; | ||
readonly offsetAttr?: string; | ||
readonly animationAttr?: string; | ||
readonly touchDisabled?: boolean; | ||
} | ||
declare class AnimateMe { | ||
private win; | ||
private winO; | ||
private winH; | ||
private winW; | ||
private offsets; | ||
private options; | ||
private animated; | ||
private isTouchDevice; | ||
constructor(selector?: string, options?: AnimateMeOptions); | ||
private start; | ||
private listen; | ||
private getCurrentScroll; | ||
private getWindowDimensions; | ||
private scrollListener; | ||
private resizeListener; | ||
private bind; | ||
private unbind; | ||
private cleanup; | ||
private destroy; | ||
private animate; | ||
private updateOffsets; | ||
} |
Oops, something went wrong.