-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit and correct readme for better readability #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this update. I found a few issues. Nevertheless, great work!
README.md
Outdated
|
||
**Sal** (_Scroll Animation Library_) is written with aim to provide performant and lightweight solution for animating elements on scroll. It's based on the [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API), which gives amazing performance in terms of checking the element's presence in viewport. | ||
**Sal** (_Scroll Animation Library_) was created to provide a performant and lightweight solution for animating elements on scroll. It's based on the [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API), which gives amazing performance in terms of checking the element's presence in the viewport. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
README.md
Outdated
@@ -1,8 +1,10 @@ | |||
# Sal [![npm version](https://badge.fury.io/js/sal.js.svg)](https://www.npmjs.com/package/sal.js) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/mciastek/sal/blob/master/LICENSE) [![Build Status](https://travis-ci.org/mciastek/sal.svg?branch=master)](https://travis-ci.org/mciastek/sal) | |||
|
|||
Performance focused, lightweight (less than **2.5 kb**) scroll animation library, written in vanilla JavaScript. No dependencies! | |||
Performance focused, lightweight (less than **2.5 kb** without Gzip) scroll animation library, written in vanilla JavaScript. No dependencies! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, I looked only at the JS file and forgot about counting CSS as well!
README.md
Outdated
@@ -22,7 +24,7 @@ $ npm install --save sal.js | |||
$ yarn add sal.js | |||
``` | |||
|
|||
Then load it with your favorite module loader or use as global, when no modules | |||
Load it with your favorite module loader or use as a global |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe as a global variable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I actually thought of explicitely documenting the "as a global" use-case. It could look like this (along with importing styles):
Load it with your favorite module loader:
// ES6 modules
import sal from 'sal.js'
// CommonJS modules
var sal = require('sal.js')
or use as a global variable:
<script src="sal.js"></script>
Import the styles in your preprocessor:
// Webpack
@import '~sal.js/sal.css';
// Other
@import './node_modules/sal.js/dist/sal.css';
or in your document's head
:
<link rel="stylesheet" type="text/css" href="sal.css" />
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to emphasise on using sal.js
with Webpack, rather than as a global script. I'm planning to make a Wiki docs for that kind of tips and tricks. For now you can skip it.
**Sal** (_Scroll Animation Library_) is written with aim to provide performant and lightweight solution for animating elements on scroll. It's based on the [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API), which gives amazing performance in terms of checking the element's presence in viewport. | ||
**Sal** (_Scroll Animation Library_) was created to provide a performant and lightweight solution for animating elements on scroll. It's based on the [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API), which gives amazing performance in terms of checking the element's presence in the viewport. | ||
|
||
**Note:** Intersection Observer API is an experimental technology so be sure to consult the [browser compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#Browser_compatibility) and consider using a [polyfill](https://github.com/w3c/IntersectionObserver/tree/master/polyfill). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this note 👍 It's really important!
Please add the required changes and PR is ready to merge 🎉 |
Please see 7267211 for the fixes. Cheers. |
Looks good to me. Thanks! |
Hey, I've found your library through the Codrops Collective, it looks neat.
Thought I'd contribute by correcting the readme a little. Added a browser compatibilty note with a link to the polyfill also.
Tell me what you think.
Keep up the good work.