hrenpack-theme-style 3.0.1 → 3.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrenpack-theme-style",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/MagIlyasDOMA/hrenpack-theme-style.git"
@@ -12,7 +12,7 @@
12
12
  "bootstrap",
13
13
  "dark-theme"
14
14
  ],
15
- "author": "MagIlyasDOMA",
15
+ "author": "Маг Ильяс DOMA (MagIlyasDOMA)",
16
16
  "license": "MIT",
17
17
  "bugs": {
18
18
  "url": "https://github.com/MagIlyasDOMA/hrenpack-theme-style/issues"
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "bootstrap": "^5.3.8",
27
- "hrenpack_js": "^3.1.0"
27
+ "hrenpack_js": "^3.1.0",
28
+ "magic-snowflakes": "^7.0.2"
28
29
  }
29
30
  }
package/snow.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ declare function SnowProperty(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor;
2
+ declare class SnowManager {
3
+ snow?: Snowflakes | null;
4
+ isActive?: boolean;
5
+ constructor(options?: SnowOptions);
6
+ protected initConfig(config: SnowOptions): SnowConfig;
7
+ protected setupVisibility(): void;
8
+ pause(): void;
9
+ play(): void;
10
+ toggle(): void;
11
+ destroy(): void;
12
+ get container(): Optional<HTMLElement>;
13
+ set container(container: HTMLElement);
14
+ get count(): Optional<number>;
15
+ set count(value: Optional<number>);
16
+ get color(): string;
17
+ set color(value: string);
18
+ get minOpacity(): Optional<number>;
19
+ set minOpacity(value: Optional<number>);
20
+ get maxOpacity(): Optional<number>;
21
+ set maxOpacity(value: Optional<number>);
22
+ get minSize(): Optional<number>;
23
+ set minSize(value: Optional<number>);
24
+ get maxSize(): Optional<number>;
25
+ set maxSize(value: Optional<number>);
26
+ get rotation(): Optional<boolean>;
27
+ set rotation(value: Optional<boolean>);
28
+ get speed(): Optional<number>;
29
+ set speed(value: Optional<number>);
30
+ get stop(): Optional<boolean>;
31
+ set stop(value: Optional<boolean>);
32
+ get types(): Optional<number>;
33
+ set types(value: Optional<number>);
34
+ get width(): Nullable<number>;
35
+ set width(value: Nullable<number>);
36
+ get height(): Nullable<number>;
37
+ set height(value: Nullable<number>);
38
+ get wind(): Optional<boolean>;
39
+ set wind(value: Optional<boolean>);
40
+ get zIndex(): Optional<number>;
41
+ set zIndex(value: Optional<number>);
42
+ get autoResize(): Optional<boolean>;
43
+ set autoResize(value: Optional<boolean>);
44
+ }
45
+ declare let snowManager: SnowManager;
46
+ //# sourceMappingURL=snow.d.ts.map
package/snow.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snow.d.ts","sourceRoot":"","sources":["snow.ts"],"names":[],"mappings":"AAAA,iBAAS,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,sBAuB9F;AAGD,cAAM,WAAW;IACb,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;gBAEP,OAAO,GAAE,WAAgB;IAMrC,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU;IAmBrD,SAAS,CAAC,eAAe;IAUzB,KAAK;IAOL,IAAI;IAOJ,MAAM;IAIN,OAAO;IAOP,IAAI,SAAS,IAAI,QAAQ,CAAC,WAAW,CAAC,CAErC;IAED,IAAI,SAAS,CAAC,SAAS,EAAE,WAAW,EAMnC;IAGD,IACI,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAe;IAC5C,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAI;IAGrC,IACI,KAAK,IAAI,MAAM,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AAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAI;IAGtC,IACI,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAe;IAC5C,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAI;IAGrC,IACI,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAe;IAC7C,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAI;IAGtC,IACI,UAAU,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAe;IAClD,IAAI,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAI;CAC9C;AAED,QAAA,IAAI,WAAW,EAAE,WAAW,CAAC"}
package/snow.js ADDED
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ function SnowProperty(target, propertyKey, descriptor) {
9
+ if (descriptor.get) {
10
+ descriptor.get = function () {
11
+ const instance = this;
12
+ if (instance.snow) {
13
+ return instance.snow.params[propertyKey];
14
+ }
15
+ return null;
16
+ };
17
+ }
18
+ if (descriptor.get) {
19
+ descriptor.set = function (value) {
20
+ const instance = this;
21
+ if (instance.snow) {
22
+ instance.snow.params[propertyKey] = value;
23
+ return;
24
+ }
25
+ throw new Error(`Cannot set ${String(propertyKey)} - snow instance destroyed`);
26
+ };
27
+ }
28
+ return descriptor;
29
+ }
30
+ class SnowManager {
31
+ constructor(options = {}) {
32
+ Object.defineProperty(this, "snow", {
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true,
36
+ value: void 0
37
+ });
38
+ Object.defineProperty(this, "isActive", {
39
+ enumerable: true,
40
+ configurable: true,
41
+ writable: true,
42
+ value: void 0
43
+ });
44
+ this.isActive = true;
45
+ this.snow = new Snowflakes(this.initConfig(options));
46
+ this.setupVisibility();
47
+ }
48
+ initConfig(config) {
49
+ return {
50
+ container: config.container ?? document.body,
51
+ count: config.count ?? 50,
52
+ color: config.color ?? '#5ecdef',
53
+ minOpacity: config.minOpacity ?? 0.6,
54
+ maxOpacity: config.maxOpacity ?? 1,
55
+ minSize: config.minSize ?? 10,
56
+ maxSize: config.maxSize ?? 25,
57
+ rotation: config.rotation ?? false,
58
+ speed: config.speed ?? 1,
59
+ stop: config.stop ?? false,
60
+ types: config.types ?? 6,
61
+ wind: config.wind ?? true,
62
+ zIndex: config.zIndex ?? 9999,
63
+ autoResize: config.autoResize ?? true,
64
+ };
65
+ }
66
+ setupVisibility() {
67
+ const handleVisibility = () => {
68
+ document.hidden ? this.pause() : this.play();
69
+ };
70
+ document.addEventListener('visibilitychange', handleVisibility);
71
+ window.addEventListener('blur', () => this.pause());
72
+ window.addEventListener('focus', () => this.play());
73
+ }
74
+ pause() {
75
+ if (this.snow && this.isActive) {
76
+ this.snow.pause();
77
+ this.isActive = false;
78
+ }
79
+ }
80
+ play() {
81
+ if (this.snow && !this.isActive) {
82
+ this.snow.play();
83
+ this.isActive = true;
84
+ }
85
+ }
86
+ toggle() {
87
+ this.isActive ? this.pause() : this.play();
88
+ }
89
+ destroy() {
90
+ if (this.snow) {
91
+ this.snow.destroy();
92
+ this.snow = null;
93
+ }
94
+ }
95
+ get container() {
96
+ return this.snow?.container ?? null;
97
+ }
98
+ set container(container) {
99
+ if (this.snow) {
100
+ this.snow.container = container;
101
+ return;
102
+ }
103
+ throw new Error("Unable to set container - SnowManager is destroyed");
104
+ }
105
+ get count() { return null; }
106
+ set count(value) { }
107
+ get color() { return ''; }
108
+ set color(value) { }
109
+ get minOpacity() { return null; }
110
+ set minOpacity(value) { }
111
+ get maxOpacity() { return null; }
112
+ set maxOpacity(value) { }
113
+ get minSize() { return null; }
114
+ set minSize(value) { }
115
+ get maxSize() { return null; }
116
+ set maxSize(value) { }
117
+ get rotation() { return null; }
118
+ set rotation(value) { }
119
+ get speed() { return null; }
120
+ set speed(value) { }
121
+ get stop() { return null; }
122
+ set stop(value) { }
123
+ get types() { return null; }
124
+ set types(value) { }
125
+ get width() { return null; }
126
+ set width(value) { }
127
+ get height() { return null; }
128
+ set height(value) { }
129
+ get wind() { return null; }
130
+ set wind(value) { }
131
+ get zIndex() { return null; }
132
+ set zIndex(value) { }
133
+ get autoResize() { return null; }
134
+ set autoResize(value) { }
135
+ }
136
+ __decorate([
137
+ SnowProperty
138
+ ], SnowManager.prototype, "count", null);
139
+ __decorate([
140
+ SnowProperty
141
+ ], SnowManager.prototype, "color", null);
142
+ __decorate([
143
+ SnowProperty
144
+ ], SnowManager.prototype, "minOpacity", null);
145
+ __decorate([
146
+ SnowProperty
147
+ ], SnowManager.prototype, "maxOpacity", null);
148
+ __decorate([
149
+ SnowProperty
150
+ ], SnowManager.prototype, "minSize", null);
151
+ __decorate([
152
+ SnowProperty
153
+ ], SnowManager.prototype, "maxSize", null);
154
+ __decorate([
155
+ SnowProperty
156
+ ], SnowManager.prototype, "rotation", null);
157
+ __decorate([
158
+ SnowProperty
159
+ ], SnowManager.prototype, "speed", null);
160
+ __decorate([
161
+ SnowProperty
162
+ ], SnowManager.prototype, "stop", null);
163
+ __decorate([
164
+ SnowProperty
165
+ ], SnowManager.prototype, "types", null);
166
+ __decorate([
167
+ SnowProperty
168
+ ], SnowManager.prototype, "width", null);
169
+ __decorate([
170
+ SnowProperty
171
+ ], SnowManager.prototype, "height", null);
172
+ __decorate([
173
+ SnowProperty
174
+ ], SnowManager.prototype, "wind", null);
175
+ __decorate([
176
+ SnowProperty
177
+ ], SnowManager.prototype, "zIndex", null);
178
+ __decorate([
179
+ SnowProperty
180
+ ], SnowManager.prototype, "autoResize", null);
181
+ let snowManager;
182
+ document.addEventListener('DOMContentLoaded', () => {
183
+ snowManager = new SnowManager({
184
+ color: '#abcdef',
185
+ zIndex: 50,
186
+ count: 400,
187
+ minOpacity: 0.4,
188
+ maxOpacity: 0.7,
189
+ speed: 3
190
+ });
191
+ setTimeout(() => { snowManager.speed = 1; }, 3000);
192
+ });
193
+ //# sourceMappingURL=snow.js.map
package/snow.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snow.js","sourceRoot":"","sources":["snow.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAS,YAAY,CAAC,MAAW,EAAE,WAA4B,EAAE,UAA8B;IAC3F,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;QACjB,UAAU,CAAC,GAAG,GAAG;YACb,MAAM,QAAQ,GAAG,IAAW,CAAC;YAC7B,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAChB,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAA+B,CAAC,CAAC;YAClE,CAAC;YACA,OAAO,IAAI,CAAC;QACjB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;QACjB,UAAU,CAAC,GAAG,GAAG,UAAS,KAAU;YAChC,MAAM,QAAQ,GAAG,IAAW,CAAC;YAC7B,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAChB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAA+B,CAAC,GAAG,KAAK,CAAC;gBAC9D,OAAO;YACZ,CAAC;YACA,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;QACpF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAGD,MAAM,WAAW;IAIb,YAAY,UAAuB,EAAE;QAHrC;;;;;WAAyB;QACzB;;;;;WAAmB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B,IAAG,CAAC;IAIrC,IAAI,MAAM,KAAsB,OAAO,IAAI,CAAC,CAAA,CAAC;IAC7C,IAAI,MAAM,CAAC,KAAuB,IAAG,CAAC;IAItC,IAAI,UAAU,KAAuB,OAAO,IAAI,CAAC,CAAA,CAAC;IAClD,IAAI,UAAU,CAAC,KAAwB,IAAG,CAAC;CAC9C;AAxEG;IADC,YAAY;wCAC+B;AAK5C;IADC,YAAY;wCACmB;AAKhC;IADC,YAAY;6CACoC;AAKjD;IADC,YAAY;6CACoC;AAKjD;IADC,YAAY;0CACiC;AAK9C;IADC,YAAY;0CACiC;AAK9C;IADC,YAAY;2CACmC;AAKhD;IADC,YAAY;wCAC+B;AAK5C;IADC,YAAY;uCAC+B;AAK5C;IADC,YAAY;wCAC+B;AAK5C;IADC,YAAY;wCAC+B;AAK5C;IADC,YAAY;yCACgC;AAK7C;IADC,YAAY;uCAC+B;AAK5C;IADC,YAAY;yCACgC;AAK7C;IADC,YAAY;6CACqC;AAItD,IAAI,WAAwB,CAAC;AAE7B,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC/C,WAAW,GAAG,IAAI,WAAW,CAAC;QAC1B,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,GAAG;QACf,KAAK,EAAE,CAAC;KACX,CAAC,CAAC;IACH,UAAU,CAAC,GAAG,EAAE,GAAE,WAAW,CAAC,KAAK,GAAG,CAAC,CAAA,CAAA,CAAC,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
package/types.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ declare class Snowflakes {
2
+ constructor(options: any);
3
+ pause(): void;
4
+ play(): void;
5
+ destroy(): void;
6
+ container: HTMLElement;
7
+ params: SnowConfig;
8
+ }
9
+
10
+ interface SnowConfig {
11
+ container: HTMLElement; // Default: document.body
12
+ count: number; // Default: 50
13
+ color: string; // Default: "#5ecdef"
14
+ minOpacity: number; // Default: 0.6
15
+ maxOpacity: number; // Default: 1
16
+ minSize: number; // Default: 10
17
+ maxSize: number; // Default: 25
18
+ rotation: boolean; // Default: true
19
+ speed: number; // Default: 1
20
+ stop: boolean; // Default: false
21
+ types: number; // Default: 6
22
+ width?: number; // Default: width of container
23
+ height?: number; // Default: height of container
24
+ wind: boolean; // Default: true
25
+ zIndex: number; // Default: 9999
26
+ autoResize: boolean; // Default: true
27
+ }
28
+
29
+ type Optional<T> = T | null
30
+ type Nullable<T> = T | null | undefined
31
+ type SnowOptions = Partial<SnowConfig>