Mode of Operation
To get Grade.js working, you just need to download the repo from GitHub.
Alternatively, you can choose to install it via npm:
npm install grade-js
If installing via npm, the usage is fairly straightforward:
import Grade from 'grade-js'
<!--the gradients will be applied to these outer divs, as background-images--> <div class="gradient-wrap"> <img src="./samples/sample-image.jpg" alt="Alt Text" /> </div> <div class="gradient-wrap"> <img src="./samples/another-image.jpg" alt="Alt Text" /> </div>
Once you include Grade.js in your project, you can include it within a script tag as well:
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%20src%3D%22path%2Fto%2Fgrade.js%22%3E%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="<script>" title="<script>" />