@andreyshpigunov/x 0.3.89 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +1 -1
- package/README.md +1 -1
- package/assets/css/app.css +1 -0
- package/assets/img/github-mark-white.png +0 -0
- package/assets/img/github-mark.png +0 -0
- package/assets/js/app.js +1 -0
- package/cheatsheet.html +427 -0
- package/dist/x.css +1 -1
- package/dist/x.js +1 -3
- package/index.html +34 -38
- package/package.json +52 -47
- package/postcss.config.cjs +0 -2
- package/src/components/x/animate.js +39 -45
- package/src/components/x/appear.js +19 -26
- package/src/components/x/autocomplete.js +22 -10
- package/src/components/x/buttons.css +38 -16
- package/src/components/x/colors.css +47 -41
- package/src/components/x/debug.css +2 -2
- package/src/components/x/device.js +39 -33
- package/src/components/x/dropdown.css +2 -3
- package/src/components/x/dropdown.js +16 -9
- package/src/components/x/flex.css +146 -109
- package/src/components/x/flow.css +12 -6
- package/src/components/x/form.css +3 -3
- package/src/components/x/form.js +12 -9
- package/src/components/x/grid.css +78 -42
- package/src/components/x/helpers.css +601 -438
- package/src/components/x/hover.js +20 -9
- package/src/components/x/icons.css +12 -12
- package/src/components/x/lazyload.js +17 -8
- package/src/components/x/lib.js +15 -1
- package/src/components/x/links.css +2 -6
- package/src/components/x/loadmore.js +17 -5
- package/src/components/x/modal.css +4 -22
- package/src/components/x/modal.js +14 -5
- package/src/components/x/reset.css +1 -15
- package/src/components/x/scroll.css +4 -9
- package/src/components/x/scroll.js +14 -1
- package/src/components/x/sheets.css +0 -3
- package/src/components/x/sheets.js +157 -37
- package/src/components/x/slider.css +10 -1
- package/src/components/x/slider.js +15 -0
- package/src/components/x/space.css +22 -2
- package/src/components/x/sticky.css +10 -15
- package/src/components/x/sticky.js +21 -4
- package/src/components/x/typo.css +14 -40
- package/src/css/app.css +92 -93
- package/src/css/x.css +191 -213
- package/src/js/app.js +9 -9
- package/src/js/x.js +37 -41
- package/assets/github-mark-white.png +0 -0
- package/assets/github-mark.png +0 -0
- package/assets/logo-inverse.png +0 -0
- package/babel.config.cjs +0 -4
- package/dist/app.css +0 -1
- package/dist/app.js +0 -1
- package/dist/index.html +0 -2182
- package/dist/logo.png +0 -0
- package/jest.config.mjs +0 -7
- package/jsdoc.json +0 -11
- package/vite.config.js +0 -31
- /package/assets/{alpha.png → img/alpha.png} +0 -0
- /package/assets/{apple-touch-icon.png → img/apple-touch-icon.png} +0 -0
- /package/assets/{logo.png → img/logo.png} +0 -0
- /package/assets/{logo.svg → img/logo.svg} +0 -0
package/src/js/app.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
import './x.js';
|
|
11
11
|
// import Alpine from 'alpinejs'
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
|
|
14
14
|
// window.Alpine = Alpine;
|
|
15
15
|
// Alpine.start();
|
|
16
16
|
|
|
@@ -19,26 +19,26 @@ x.init();
|
|
|
19
19
|
// Animation global functions
|
|
20
20
|
window.element1 = (params) => {
|
|
21
21
|
let rotate = params.progress * -360;
|
|
22
|
-
params.element.style.transform = 'rotate(' + rotate +
|
|
22
|
+
params.element.style.transform = 'rotate(' + rotate + 'deg)';
|
|
23
23
|
}
|
|
24
24
|
window.element2 = (params) => {
|
|
25
25
|
let rotate = params.progress * 180;
|
|
26
|
-
params.element.style.transform = 'rotate(' + rotate +
|
|
26
|
+
params.element.style.transform = 'rotate(' + rotate + 'deg)';
|
|
27
27
|
}
|
|
28
28
|
window.element3 = (params) => {
|
|
29
29
|
let rotate = params.progress * 120;
|
|
30
|
-
params.element.style.transform = 'rotate(' + rotate +
|
|
30
|
+
params.element.style.transform = 'rotate(' + rotate + 'deg)';
|
|
31
31
|
}
|
|
32
32
|
window.headerAnimation = (params) => {
|
|
33
33
|
// console.log(x.device.size.s);
|
|
34
|
-
let _height =
|
|
34
|
+
let _height = 100;
|
|
35
35
|
// console.log(_height);
|
|
36
|
-
let header = qs('.header');
|
|
37
|
-
let headerLogo = qs('.header-logo img');
|
|
36
|
+
let header = x.qs('.header');
|
|
37
|
+
let headerLogo = x.qs('.header-logo img');
|
|
38
38
|
let height = _height - params.progress * _height / 2;
|
|
39
39
|
let scale = 1 - params.progress * 0.5;
|
|
40
40
|
header.style.height = height + 'px';
|
|
41
|
-
headerLogo.style.transform = 'scale(' + scale +
|
|
41
|
+
headerLogo.style.transform = 'scale(' + scale + ')';
|
|
42
42
|
x.lib.switchClass(header, 'header_compact', params.progress == 1);
|
|
43
43
|
}
|
|
44
44
|
|
package/src/js/x.js
CHANGED
|
@@ -7,45 +7,45 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
import { modal
|
|
11
|
-
import { animate
|
|
12
|
-
import { appear
|
|
13
|
-
import { lazyload
|
|
14
|
-
import { loadmore
|
|
15
|
-
import { sheets
|
|
16
|
-
import { dropdown
|
|
17
|
-
import { autocomplete }
|
|
18
|
-
import { scroll
|
|
19
|
-
import { hover
|
|
20
|
-
import { device
|
|
21
|
-
import { lib
|
|
22
|
-
import { form
|
|
23
|
-
import { sticky
|
|
24
|
-
import { slider
|
|
10
|
+
import { modal } from "../components/x/modal";
|
|
11
|
+
import { animate } from "../components/x/animate";
|
|
12
|
+
import { appear } from "../components/x/appear";
|
|
13
|
+
import { lazyload } from "../components/x/lazyload";
|
|
14
|
+
import { loadmore } from "../components/x/loadmore";
|
|
15
|
+
import { sheets } from "../components/x/sheets";
|
|
16
|
+
import { dropdown } from "../components/x/dropdown";
|
|
17
|
+
import { autocomplete } from "../components/x/autocomplete";
|
|
18
|
+
import { scroll } from "../components/x/scroll";
|
|
19
|
+
import { hover } from "../components/x/hover";
|
|
20
|
+
import { device } from "../components/x/device";
|
|
21
|
+
import { lib } from "../components/x/lib";
|
|
22
|
+
import { form } from "../components/x/form";
|
|
23
|
+
import { sticky } from "../components/x/sticky";
|
|
24
|
+
import { slider } from "../components/x/slider";
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class X {
|
|
28
28
|
constructor() {
|
|
29
|
-
this.modal
|
|
30
|
-
this.animate
|
|
31
|
-
this.appear
|
|
32
|
-
this.lazyload
|
|
33
|
-
this.loadmore
|
|
34
|
-
this.sheets
|
|
35
|
-
this.dropdown
|
|
29
|
+
this.modal = modal;
|
|
30
|
+
this.animate = animate;
|
|
31
|
+
this.appear = appear;
|
|
32
|
+
this.lazyload = lazyload;
|
|
33
|
+
this.loadmore = loadmore;
|
|
34
|
+
this.sheets = sheets;
|
|
35
|
+
this.dropdown = dropdown;
|
|
36
36
|
this.autocomplete = autocomplete;
|
|
37
|
-
this.scroll
|
|
38
|
-
this.hover
|
|
39
|
-
this.device
|
|
40
|
-
this.lib
|
|
41
|
-
this.render
|
|
42
|
-
this.form
|
|
43
|
-
this.sticky
|
|
44
|
-
this.slider
|
|
45
|
-
|
|
37
|
+
this.scroll = scroll;
|
|
38
|
+
this.hover = hover;
|
|
39
|
+
this.device = device;
|
|
40
|
+
this.lib = lib;
|
|
41
|
+
this.render = lib.render.bind(lib);
|
|
42
|
+
this.form = form;
|
|
43
|
+
this.sticky = sticky;
|
|
44
|
+
this.slider = slider;
|
|
45
|
+
|
|
46
46
|
this.initialized = false;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
init() {
|
|
50
50
|
if (!this.initialized) {
|
|
51
51
|
this.device.init();
|
|
@@ -60,7 +60,7 @@ class X {
|
|
|
60
60
|
this.sticky.init();
|
|
61
61
|
this.slider.init();
|
|
62
62
|
hover.init();
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
this.initialized = true;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -71,11 +71,7 @@ const x = new X();
|
|
|
71
71
|
// Make 'x' as global variable
|
|
72
72
|
window.x = x;
|
|
73
73
|
|
|
74
|
-
//
|
|
75
|
-
window.
|
|
76
|
-
window.
|
|
77
|
-
|
|
78
|
-
// New shortcuts for selectors
|
|
79
|
-
window.x.id = x.lib.id;
|
|
80
|
-
window.x.qs = x.lib.qs;
|
|
81
|
-
window.x.qsa = x.lib.qsa;
|
|
74
|
+
// Shortcuts for selectors
|
|
75
|
+
window.x.id = x.lib.id;
|
|
76
|
+
window.x.qs = x.lib.qs;
|
|
77
|
+
window.x.qsa = x.lib.qsa;
|
|
Binary file
|
package/assets/github-mark.png
DELETED
|
Binary file
|
package/assets/logo-inverse.png
DELETED
|
Binary file
|
package/babel.config.cjs
DELETED