@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.
Files changed (65) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/README.md +1 -1
  3. package/assets/css/app.css +1 -0
  4. package/assets/img/github-mark-white.png +0 -0
  5. package/assets/img/github-mark.png +0 -0
  6. package/assets/js/app.js +1 -0
  7. package/cheatsheet.html +427 -0
  8. package/dist/x.css +1 -1
  9. package/dist/x.js +1 -3
  10. package/index.html +34 -38
  11. package/package.json +52 -47
  12. package/postcss.config.cjs +0 -2
  13. package/src/components/x/animate.js +39 -45
  14. package/src/components/x/appear.js +19 -26
  15. package/src/components/x/autocomplete.js +22 -10
  16. package/src/components/x/buttons.css +38 -16
  17. package/src/components/x/colors.css +47 -41
  18. package/src/components/x/debug.css +2 -2
  19. package/src/components/x/device.js +39 -33
  20. package/src/components/x/dropdown.css +2 -3
  21. package/src/components/x/dropdown.js +16 -9
  22. package/src/components/x/flex.css +146 -109
  23. package/src/components/x/flow.css +12 -6
  24. package/src/components/x/form.css +3 -3
  25. package/src/components/x/form.js +12 -9
  26. package/src/components/x/grid.css +78 -42
  27. package/src/components/x/helpers.css +601 -438
  28. package/src/components/x/hover.js +20 -9
  29. package/src/components/x/icons.css +12 -12
  30. package/src/components/x/lazyload.js +17 -8
  31. package/src/components/x/lib.js +15 -1
  32. package/src/components/x/links.css +2 -6
  33. package/src/components/x/loadmore.js +17 -5
  34. package/src/components/x/modal.css +4 -22
  35. package/src/components/x/modal.js +14 -5
  36. package/src/components/x/reset.css +1 -15
  37. package/src/components/x/scroll.css +4 -9
  38. package/src/components/x/scroll.js +14 -1
  39. package/src/components/x/sheets.css +0 -3
  40. package/src/components/x/sheets.js +157 -37
  41. package/src/components/x/slider.css +10 -1
  42. package/src/components/x/slider.js +15 -0
  43. package/src/components/x/space.css +22 -2
  44. package/src/components/x/sticky.css +10 -15
  45. package/src/components/x/sticky.js +21 -4
  46. package/src/components/x/typo.css +14 -40
  47. package/src/css/app.css +92 -93
  48. package/src/css/x.css +191 -213
  49. package/src/js/app.js +9 -9
  50. package/src/js/x.js +37 -41
  51. package/assets/github-mark-white.png +0 -0
  52. package/assets/github-mark.png +0 -0
  53. package/assets/logo-inverse.png +0 -0
  54. package/babel.config.cjs +0 -4
  55. package/dist/app.css +0 -1
  56. package/dist/app.js +0 -1
  57. package/dist/index.html +0 -2182
  58. package/dist/logo.png +0 -0
  59. package/jest.config.mjs +0 -7
  60. package/jsdoc.json +0 -11
  61. package/vite.config.js +0 -31
  62. /package/assets/{alpha.png → img/alpha.png} +0 -0
  63. /package/assets/{apple-touch-icon.png → img/apple-touch-icon.png} +0 -0
  64. /package/assets/{logo.png → img/logo.png} +0 -0
  65. /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 + 'deg)';
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 + 'deg)';
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 + 'deg)';
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 = x.device.size.s ? 100 : 120;
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 } 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";
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 = 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;
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 = 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
-
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
- // Query selectors shorthands
75
- window.qs = x.lib.qs;
76
- window.qsa = x.lib.qsa;
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
Binary file
Binary file
package/babel.config.cjs DELETED
@@ -1,4 +0,0 @@
1
- // babel.config.cjs — used by Jest (babel-jest)
2
- module.exports = {
3
- presets: ['@babel/preset-env'],
4
- };