Skip to content

Commit

Permalink
mostly .nojekyll
Browse files Browse the repository at this point in the history
One last try with GitHub Pages.
  • Loading branch information
sidewayss committed Sep 16, 2024
1 parent dcde776 commit 2393135
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 40 deletions.
Empty file added .nojekyll
Empty file.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<p> It is a solo open source project about to be released in its first public version 1.0. Hopefully others will contribute in the future.</p>
<h2>Getting started</h2>
<p>If you want to skip the formalities and jump right in, the best place to start is the <a href="/raf/apps/">Three Apps</a> (web pages) that test/demonstrate the app and generate starting-point JavaScript code for the configured animation. I am hosting them on my personal site. GitHub Pages will be up when I learn how to fully disable Jekyll...</p>
<p>There are also examples in these collections on CodePen:</p>
<p>There are also animation examples in these collections on CodePen:</p>
<p><i>...coming soon along with v1.0</i></p>

<h2>Setup</h2>
<p><span class="rAF">rAF</span> is modular. <i>There are currently no packages or minified file. Coming immediately post v1.0.</i> For most users <span>raf.js</span> provides all the exports you need. Here is a typical import statement:</p>
<p><span class="rAF">rAF</span> is modular. There are currently no packages or minified file. Coming immediately post v1.0. For most users <span>raf.js</span> provides all the exports you need. Here is a typical import statement:</p>
<p><span>import {E, Ez, F, P, PFactory, Easy, Easies, AFrame}<br>from "https://sidewayss.com/raf/src/raf.js";</span></p>
<p>To initializes constants, including the <span>F</span> and <span>P</span> objects containing all the built-in <span>Func</span> and <span>Prop</span> instances, you must run this line of code prior to using any other <span class="rAF">rAF</span> features:</p>
<p><span>PFactory.init();</span></p>
Expand Down
Binary file modified docs/raf.xlsx
Binary file not shown.
9 changes: 5 additions & 4 deletions img/rAFoffset.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ <h2>What is it?</h2>
<p> It is a solo open source project about to be released in its first public version 1.0. Hopefully others will contribute in the future.</p>
<h2>Getting started</h2>
<p>If you want to skip the formalities and jump right in, the best place to start is the <a href="/raf/apps/">Three Apps</a> (web pages) that test/demonstrate the app and generate starting-point JavaScript code for the configured animation. I am hosting them on my personal site. GitHub Pages will be up when I learn how to fully disable Jekyll...</p>
<p>There are also examples in these collections on CodePen:</p>
<p>There are also animation examples in these collections on CodePen:</p>
<p><i>...coming soon along with v1.0</i></p>

<h2>Setup</h2>
<p><span class="rAF">rAF</span> is modular. <i>There are currently no packages or minified file. Coming immediately post v1.0.</i> For most users <span>raf.js</span> provides all the exports you need. Here is a typical import statement:</p>
<p><span class="rAF">rAF</span> is modular. There are currently no packages or minified file. Coming immediately post v1.0. For most users <span>raf.js</span> provides all the exports you need. Here is a typical import statement:</p>
<p><span>import {E, Ez, F, P, PFactory, Easy, Easies, AFrame}<br>from "https://sidewayss.com/raf/src/raf.js";</span></p>
<p>To initializes constants, including the <span>F</span> and <span>P</span> objects containing all the built-in <span>Func</span> and <span>Prop</span> instances, you must run this line of code prior to using any other <span class="rAF">rAF</span> features:</p>
<p><span>PFactory.init();</span></p>
Expand Down
63 changes: 31 additions & 32 deletions src/ez.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,37 @@ export const Ez = {
newArray2D(length, ...args) {
return Array.from({length}, () => Array(...args));
},
// swapDims() swaps 2D array's inner/outer dimensions, no longer used
// internally, but 2D arrays for Easers must all be the same,
// bAbE or bEbA, so users can use this to accomplish that.
swapDims(prm, l2) {
let i, j;
const l1 = prm.length;
const twoD = Ez.newArray2D(l2);

for (i = 0; i < l1; i++) // swap sub-array elements, spread sub-value
if (Is.A(prm[i])) // swap 'em
for (j = 0; j < l2; j++) // can iterate past prm[i].length
if (Is.def(prm[i][j]))
twoD[j][i] = prm[i][j];
else if (Is.def(prm[i])) // spread it
for (j = 0; j < l2; j++)
twoD[j][i] = prm[i];

while (!twoD[--l2].length) // trim empty outer dim values
--twoD.length;

for (i = 0; i <= l2; i++) { // consolidate empty outer dim values
if (!twoD[i].length)
delete twoD[i];
}
return twoD;
},
// =============================================================================
// clamp() clamps val between min and max limits
clamp(min, val, max) {
return Math.max(min, Math.min(val, max));
},
// =============================================================================
// comp() complements a unit (number 0-1), returning the complement: 1 - unit
comp(unit) {
return 1 - unit;
Expand Down Expand Up @@ -97,10 +123,6 @@ export const Ez = {
},
// =============================================================================
// Conversion functions:
// defaultToTrue() converts undefined to true and everything else to boolean
defaultToTrue(val) {
return Is.def(val) ? Boolean(val) : true;
},
// toSum() is a callback for Array.prototype.reduce(), reduces to a sum.
toSum(sum, v) {
return sum + v;
Expand Down Expand Up @@ -212,6 +234,10 @@ export const Ez = {
v.forEach((elm, i) => v[i] = this.toElement(elm, noRules, doc));
return v;
},
// defaultToTrue() converts undefined to true and everything else to boolean
defaultToTrue(val) {
return Is.def(val) ? Boolean(val) : true;
},
// noneToZero() converts null to zero for a Color.js color coordinates array.
// null is the numeric representation of CSS "none". The CSS rules
// animating "none" are defined, but not fully implemented in the
Expand Down Expand Up @@ -337,32 +363,5 @@ export const Ez = {
// returns max 2 even if array has >2 dimensions
_dims(a) {
return Is.def(a) ? (Is.A(a) ? (a.some(v => Is.A(v)) ? 2 : 1) : 0) : -1;
},
// =============================================================================
// swapDims() swaps 2D array's inner/outer dimensions, no longer used
// internally, but 2D arrays for Easers must all be the same,
// bAbE or bEbA, so users can use this to accomplish that.
swapDims(prm, l2) {
let i, j;
const l1 = prm.length;
const twoD = Ez.newArray2D(l2);

for (i = 0; i < l1; i++) // swap sub-array elements, spread sub-value
if (Is.A(prm[i])) // swap 'em
for (j = 0; j < l2; j++) // can iterate past prm[i].length
if (Is.def(prm[i][j]))
twoD[j][i] = prm[i][j];
else if (Is.def(prm[i])) // spread it
for (j = 0; j < l2; j++)
twoD[j][i] = prm[i];

while (!twoD[--l2].length) // trim empty outer dim values
--twoD.length;

for (i = 0; i <= l2; i++) { // consolidate empty outer dim values
if (!twoD[i].length)
delete twoD[i];
}
return twoD;
}
};

0 comments on commit 2393135

Please sign in to comment.