minor fixes

This commit is contained in:
Ilya Kantor 2021-11-01 23:15:10 +03:00
parent 9fcffe1692
commit 15f7acfc2a
15 changed files with 17 additions and 17 deletions

View file

@ -73,7 +73,7 @@ Script files are attached to HTML with the `src` attribute:
<script src="/path/to/script.js"></script> <script src="/path/to/script.js"></script>
``` ```
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder. Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder.
We can give a full URL as well. For instance: We can give a full URL as well. For instance:

View file

@ -10,7 +10,7 @@
text-align: center; text-align: center;
} }
.circle { .circle {
transition-property: width, height, margin-left, margin-top; transition-property: width, height;
transition-duration: 2s; transition-duration: 2s;
position: fixed; position: fixed;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);

View file

@ -10,7 +10,7 @@
<div id="carousel" class="carousel"> <div id="carousel" class="carousel">
<button class="arrow prev"></button> <button class="arrow prev"></button>
<div class="gallery"> <div class="gallery">
<ul class="images"> <ul>
<li><img src="https://en.js.cx/carousel/1.png"></li> <li><img src="https://en.js.cx/carousel/1.png"></li>
<li><img src="https://en.js.cx/carousel/2.png"></li> <li><img src="https://en.js.cx/carousel/2.png"></li>
<li><img src="https://en.js.cx/carousel/3.png"></li> <li><img src="https://en.js.cx/carousel/3.png"></li>

View file

@ -88,7 +88,7 @@ class HoverIntent {
if (speed < this.sensitivity) { if (speed < this.sensitivity) {
clearInterval(this.checkSpeedInterval); clearInterval(this.checkSpeedInterval);
this.isHover = true; this.isHover = true;
this.over.call(this.elem, event); this.over.call(this.elem);
} else { } else {
// speed fast, remember new coordinates as the previous ones // speed fast, remember new coordinates as the previous ones
this.prevX = this.lastX; this.prevX = this.lastX;

View file

@ -126,9 +126,9 @@ new TypedArray();
We can create a `TypedArray` directly, without mentioning `ArrayBuffer`. But a view cannot exist without an underlying `ArrayBuffer`, so gets created automatically in all these cases except the first one (when provided). We can create a `TypedArray` directly, without mentioning `ArrayBuffer`. But a view cannot exist without an underlying `ArrayBuffer`, so gets created automatically in all these cases except the first one (when provided).
To access the `ArrayBuffer`, there are properties: To access the underlying `ArrayBuffer`, there are following properties in `TypedArray`:
- `arr.buffer` -- references the `ArrayBuffer`. - `buffer` -- references the `ArrayBuffer`.
- `arr.byteLength` -- the length of the `ArrayBuffer`. - `byteLength` -- the length of the `ArrayBuffer`.
So, we can always move from one view to another: So, we can always move from one view to another:
```js ```js

View file

@ -5,7 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
.circle { .circle {
transition-property: width, height, margin-left, margin-top; transition-property: width, height;
transition-duration: 2s; transition-duration: 2s;
position: fixed; position: fixed;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);

View file

@ -5,7 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
.circle { .circle {
transition-property: width, height, margin-left, margin-top; transition-property: width, height;
transition-duration: 2s; transition-duration: 2s;
position: fixed; position: fixed;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);

View file

@ -10,7 +10,7 @@
text-align: center; text-align: center;
} }
.circle { .circle {
transition-property: width, height, margin-left, margin-top; transition-property: width, height;
transition-duration: 2s; transition-duration: 2s;
position: fixed; position: fixed;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);

View file

@ -21,7 +21,7 @@
} }
function bounce(timeFraction) { function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }

View file

@ -21,7 +21,7 @@
} }
function bounce(timeFraction) { function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }

View file

@ -283,7 +283,7 @@ The `bounce` function does the same, but in the reverse order: "bouncing" starts
```js ```js
function bounce(timeFraction) { function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }

View file

@ -26,7 +26,7 @@
function bounce(timeFraction) { function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }

View file

@ -22,7 +22,7 @@
} }
function bounce(timeFraction) { function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }

View file

@ -19,7 +19,7 @@
animate({ animate({
duration: 3000, duration: 3000,
timing: function bounce(timeFraction) { timing: function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }

View file

@ -36,7 +36,7 @@ And stood awhile in thought.
function bounce(timeFraction) { function bounce(timeFraction) {
for (let a = 0, b = 1, result; 1; a += b, b /= 2) { for (let a = 0, b = 1; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) { if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2) return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
} }