Skip to content
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

Merged
merged 3 commits into from
Sep 13, 2018

Conversation

malydok
Copy link
Contributor

@malydok malydok commented Sep 11, 2018

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.

@mciastek mciastek self-requested a review September 11, 2018 17:41
Copy link
Owner

@mciastek mciastek left a 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.
Copy link
Owner

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!
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's with Gzip. I think it should be 2.8kb. See screenshot below (gziped compression is on):
screen shot 2018-09-11 at 19 47 15

Copy link
Contributor Author

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
Copy link
Owner

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?

Copy link
Contributor Author

@malydok malydok Sep 11, 2018

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?

Copy link
Owner

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).
Copy link
Owner

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!

@mciastek
Copy link
Owner

Please add the required changes and PR is ready to merge 🎉

@mciastek mciastek mentioned this pull request Sep 11, 2018
@malydok
Copy link
Contributor Author

malydok commented Sep 12, 2018

Please see 7267211 for the fixes. Cheers.

@mciastek mciastek merged commit f2f72b9 into mciastek:master Sep 13, 2018
@mciastek
Copy link
Owner

Looks good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants