From f769ac1f9206a0f3199b90bd0b36caf0d8cd3e44 Mon Sep 17 00:00:00 2001
From: Julian Lloyd
` tag. It will automatically instantiate itself ready-to-go when the event `DOMContentReady` fires.
+
+
+```
+ // Everything else
+ // ...
+
+
+
+```
+
+>**NOTE:** scrollReveal.js does not require jQuery, but *does* rely upon CSS3 transitions; it has been developed exclusively for modern browser use only.
+
+
+##2. Usage
+By adding a `data-scrollreveal` attribute to an element, it will automatically be revealed (using default values) as soon as the element is within the viewport.
**Fig 1**:
+
+```
+
+```
+However, scrollReveal.js allows you to describe custom reveal behavior, using *natural language*.
**Fig 2**:
+```
+
+
Hello
+ +``` + + + +###2.1 Keywords +Whatever string is passed to the `data-scrollreveal` attribute is parsed for specific keywords: **tokens** that expect to be followed by a **value**, and semantic **fillers** that facilitate the use of more natural language. + +####2.1.1 Tokens +These words describe the reveal behavior, using **keyword** / **value** pairs. + +--- + +- **Enter** — Controls the direction of your element transition. Whatever value is passed is considered the vector origin. For example, specifying `top` will reveal your element with a downward motion. + * Accepted value: `top`, `right`, `bottom` or `left` + +--- + +- **Move** — The distance your element will travel during transition. + * Accepted value: **[ integer ] px** →(eg. `move 33px`) + +--- + +- **Over** — The duration of your element’s transition. + * Accepted value: **[ decminal ] s** → (eg. `over 1.66s`) + +--- + +- **After/Wait** — The delay before your element beings its transition. + * Accepted value: **[ decminal ] s** → (eg. `after 0.33s` or `wait 0.33s`) + +--- + +#### 2.1.2 Fillers +While **keywords** must be followed by an appropriate accepted **value**, the use of conjoining **fillers** are permitted for more natural language. These are shown below: + +- `from` +- `the` +- `and` +- `then` +- `but` + +**Fig 3**: +``` + +
+
+ + +
+
+``` + +### 3. Contributions / Thanks! +I noticed a number of clients requesting CSS3 transitions on scroll for various site elements, so I created this little vanilla JavaScript helper plug-in to help out. Many thanks to Codrops, Mary Lou and the [cbpScroller.js](http://tympanus.net/codrops/2013/07/18/on-scroll-effect-layout/), © 2014, Codrops. + +#####**If you’d like to contribute, please feel free!** + +© 2014 Julian Lloyd +Licensed under the MIT license. +[http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) diff --git a/index.html b/index.html new file mode 100644 index 00000000..7397d6db --- /dev/null +++ b/index.html @@ -0,0 +1,52 @@ + + +
+ +
+ + +
+