layerpro 0.0.64 → 0.0.68

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 (67) hide show
  1. package/{dist/LICENSE.txt → LICENSE.txt} +0 -0
  2. package/{dist/README.md → README.md} +0 -0
  3. package/index.js +2 -7
  4. package/package.json +142 -138
  5. package/.editorconfig +0 -13
  6. package/.env +0 -3
  7. package/.eslintignore +0 -12
  8. package/.eslintrc.json +0 -110
  9. package/.gitattributes +0 -2
  10. package/.github/FUNDING.yml +0 -12
  11. package/.github/dependabot.yml +0 -12
  12. package/.jsbeautifyrc +0 -26
  13. package/.prettierignore +0 -2
  14. package/.prettierrc +0 -7
  15. package/.vscode/launch.json +0 -22
  16. package/.vscode/settings.json +0 -84
  17. package/.vscodeignore +0 -28
  18. package/__mocks__/fileMock.js +0 -3
  19. package/__mocks__/styleMock.js +0 -3
  20. package/babel.config.js +0 -34
  21. package/backup.bat +0 -43
  22. package/coverage/coverage-final.json +0 -1
  23. package/coverage/lcov-report/base.css +0 -224
  24. package/coverage/lcov-report/block-navigation.js +0 -87
  25. package/coverage/lcov-report/favicon.png +0 -0
  26. package/coverage/lcov-report/index.html +0 -101
  27. package/coverage/lcov-report/prettify.css +0 -1
  28. package/coverage/lcov-report/prettify.js +0 -2
  29. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  30. package/coverage/lcov-report/sorter.js +0 -196
  31. package/coverage/lcov.info +0 -0
  32. package/documents/LICENSE.txt +0 -21
  33. package/documents/README.md +0 -7
  34. package/documents/SECURITY.md +0 -3
  35. package/init.js +0 -33
  36. package/jest.config.js +0 -61
  37. package/jsconfig.json +0 -10
  38. package/node/createTag.js +0 -7
  39. package/node/gitDeploy.js +0 -7
  40. package/node/goLive.js +0 -7
  41. package/scripts/genLayer.jsx +0 -234
  42. package/scripts/message.jsx +0 -280
  43. package/scripts/mouseCoords.jsx +0 -45
  44. package/scripts/popup.jsx +0 -612
  45. package/scripts/purge.jsx +0 -29
  46. package/scripts/smoothScroll.js +0 -69
  47. package/scripts/window.js +0 -28
  48. package/styles/dock.scss +0 -100
  49. package/styles/general.scss +0 -241
  50. package/styles/icons.scss +0 -33
  51. package/styles/input.scss +0 -35
  52. package/styles/messages.scss +0 -76
  53. package/styles/resize.scss +0 -99
  54. package/styles/root.scss +0 -14
  55. package/styles/scrollbar.scss +0 -24
  56. package/tests/setupJest.tsx +0 -4
  57. package/tsconfig.json +0 -69
  58. package/typings/cordova.d.ts +0 -12
  59. package/typings/dphelper.d.ts +0 -29
  60. package/typings/image.d.ts +0 -9
  61. package/typings/index.d.ts +0 -7
  62. package/typings/layerpro.d.ts +0 -23
  63. package/typings/menupro.d.ts +0 -18
  64. package/typings/namespace.d.ts +0 -7
  65. package/typings/styles.d.ts +0 -27
  66. package/typings/vscode.d.ts +0 -14724
  67. package/webpack.config.js +0 -239
package/scripts/popup.jsx DELETED
@@ -1,612 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- //import React, { useState, useEffect } from "react";
7
-
8
- import { genLayer } from "./genLayer.jsx"
9
- import { mouseCoord } from "./mouseCoords.jsx"
10
- import "./message.jsx"
11
-
12
- import "../styles/general.scss"
13
-
14
- $.ajaxSetup({
15
- async: true,
16
- cache: true,
17
- global: true
18
- })
19
-
20
- const larX = 300
21
- const larY = 150
22
- const prefs = localStorage.getItem('layerpro')
23
-
24
- let isdresizableRes
25
- let highIndex = 1
26
- let startX
27
- let startY
28
- let startWidth
29
- let startHeight
30
- let startLeft
31
- let startTop
32
- let startBottom
33
- let startRight
34
- let Win = $(window)
35
- let Body = $('body')
36
-
37
- // let oldy;
38
- // let oldx;
39
- // let oldw;
40
- // let oldh;
41
-
42
- export const popup = {
43
-
44
- open: function (p) {
45
-
46
- if (!p) return false
47
-
48
- p.id = p.id || Math.round(Math.random() * 1000)
49
- p.body = p.body
50
- p.width = p.width || 640
51
- p.height = p.height || 480
52
- p.name = p.name || 'popUp_' + p.id
53
- p.source = p.source || null
54
- p.icon = p.icon || null
55
- p.iconize = p.iconize || null
56
- p.maximize = p.maximize || null
57
- p.isMaximize = p.isMaximize || null
58
- p.dockable = p.dockable
59
- p.close = p.close || null
60
- p.raised = p.raised || null
61
- p.movable = p.movable || null
62
- p.resizable = p.resizable || null
63
- p.store = p.store || false
64
- p.top = p.top ? p.top : 'auto'
65
- p.left = p.left ? p.left : 'auto'
66
- p.right = p.right ? p.right : 'auto'
67
- p.bottom = p.bottom ? p.bottom : 'auto'
68
- p.fadeIn = p.fadeIn || 100
69
- p.fadeOut = p.fadeOut || 100
70
- p.minWidth = p.minWidth || 340
71
- p.minHeight = p.minHeight || 220
72
-
73
- /*******************************************************************/
74
-
75
- // Check if windows is too small;
76
- if (p.width < p.minWidth) p.width = p.minWidth
77
- if (p.height < p.minHeight) p.height = p.minHeight
78
-
79
- if (p.width === 'auto') p.width = '100%'
80
- if (p.height === 'auto') p.height = '100%'
81
-
82
- /*******************************************************************/
83
-
84
- // create popUp container
85
- if ($('#popup').length === 0) {
86
- $('<div id="popup">', '#popup')
87
- .appendTo('body')
88
- .css({
89
- 'pointer-events': 'none',
90
- 'z-index': popup.zIndex($('*')) + 1
91
- })
92
- }
93
-
94
- // Creation of final PopUp (avoid to recreate if same id exist)
95
- if ($('.popup_window_' + p.id, '#popup').length === 0) {
96
- genLayer(p)
97
- }
98
-
99
- /*******************************************************************/
100
-
101
- // window.onresize = function( p ){
102
- // if( Win.width() < 600 ) layerpro.popup.maximize( p );
103
- // console.log('r');
104
- // };
105
-
106
- /*******************************************************************/
107
-
108
- layerpro.purge(document)
109
- return p
110
-
111
- },
112
-
113
- show: function (item) {
114
- item.toggle()
115
- return false
116
- },
117
-
118
- vfx: function (item, vis, all = false) {
119
-
120
- setTimeout(() => {
121
-
122
- $('[class^="popup_overflow_"]', '#popup')
123
- .css('opacity', vis == true ? 1 : 0.5)
124
- .find('[class^="popup_body_"]')
125
- .css({ 'content-visibility': vis == true ? 'auto' : 'hidden' })
126
-
127
- item.css('opacity', 1)
128
-
129
- if (!all) $('[class^="popup_body_"]', item).css('content-visibility', 'visible')
130
-
131
- return false
132
-
133
- }, 0)
134
-
135
- window.dispatchEvent(new Event('resize'))
136
-
137
- },
138
-
139
- center: function (p) {
140
- let _overflow = $('.popup_overflow_' + p.id, '#popup')
141
- _overflow.css("top", Math.max(0, ((Win.height() - _overflow.outerHeight()) / 2) + Win.scrollTop()))
142
- _overflow.css("left", Math.max(0, ((Win.width() - _overflow.outerWidth()) / 2) + Win.scrollLeft()))
143
- return false
144
- },
145
-
146
- checkArea: function (e) {
147
- return [
148
- e.clientX,
149
- e.clientY,
150
- Win.scrollLeft(),
151
- Win.scrollTop(),
152
- Win.height(),
153
- Win.width()
154
- ]
155
- },
156
-
157
- close: function (p) {
158
-
159
- if (!p) {
160
-
161
- $("#popup").fadeOut(function () {
162
- $(this).remove()
163
- })
164
-
165
- } else {
166
-
167
- if (p.raised === true) {
168
-
169
- $('.popup_raised_' + p.id).fadeOut(p.fadeOut, function () {
170
- $('.popup_raised_' + p.id).remove()
171
- })
172
-
173
- } else {
174
-
175
- $('.popup_overflow_' + p.id).fadeOut(p.fadeOut, function () {
176
- $(this).remove()
177
- popup.removeDock(p)
178
- })
179
-
180
- }
181
-
182
- }
183
-
184
- layerpro.purge(document)
185
- localStorage.removeItem('popup_' + p.id)
186
- return false
187
-
188
- },
189
-
190
- removeDock: function (p) {
191
-
192
- $(".icon_" + p.id).remove()
193
-
194
- if ($('[class^="popup_overflow_"]', '#popup').length <= 0) {
195
- $('#popup_dock').remove()
196
- $('#root').css('margin', '0')
197
- }
198
-
199
- return false
200
-
201
- },
202
-
203
- iconize: function (p) {
204
-
205
- let _overflow = $('.popup_overflow_' + p.id, '#popup')
206
-
207
- // iconize only if is top layer
208
- if (_overflow.find('[class^=popup_window_]').hasClass("zHigh") === false) return false
209
-
210
- popup.vfx(_overflow, false, true)
211
-
212
- if (!_overflow.data('iconize')) {
213
-
214
- _overflow.animate({
215
- top: '100%',
216
- left: $('.icon_' + p.id, '#popup_dock').offset().left + 15,
217
- width: 0,
218
- height: 0,
219
- opacity: 0
220
- }, 200, function () {
221
-
222
- popup.vfx(_overflow, true)
223
-
224
- })
225
-
226
- _overflow.data('iconize', {
227
- y: _overflow.offset().top,
228
- x: _overflow.offset().left,
229
- w: _overflow.width(),
230
- h: _overflow.height()
231
-
232
- }, 200)
233
-
234
- } else if (_overflow.data('iconize')) {
235
-
236
- var s = _overflow.data('iconize')
237
-
238
- _overflow.animate({
239
- top: s.y,
240
- left: s.x,
241
- width: s.w,
242
- height: s.h,
243
- opacity: 1,
244
- }, function () {
245
-
246
- popup.vfx(_overflow, true)
247
-
248
- })
249
-
250
- _overflow.removeData('iconize')
251
-
252
- }
253
-
254
- return false
255
- },
256
-
257
-
258
- maximize: function (p) {
259
-
260
- let _overflow = $('.popup_overflow_' + p.id, '#popup')
261
- let gap = 6
262
-
263
- popup.vfx(_overflow, false, true)
264
-
265
- if (!_overflow.data('store')) {
266
-
267
- _overflow.data('store', {
268
- y: _overflow.offset().top,
269
- x: _overflow.offset().left,
270
- w: _overflow.width(),
271
- h: _overflow.height()
272
- })
273
-
274
- _overflow.animate({
275
- position: 'absolute',
276
- top: -gap,
277
- left: -gap,
278
- right: -gap,
279
- bottom: - gap,
280
- width: Win.width() + (gap * 2),
281
- height: Win.height() + (gap * 2) - 45,
282
- }, function () {
283
-
284
- Win.on("resize.eventItem", function () {
285
- _overflow
286
- .css({
287
- width: Win.width() + (gap * 2),
288
- height: Win.height() + (gap * 2) - 40,
289
- })
290
- })
291
-
292
- $('[class^="resize_"]', _overflow).off('mousedown')
293
- popup.vfx(_overflow, true, true)
294
-
295
- })
296
-
297
- } else if (_overflow.data('store')) {
298
-
299
- var s = _overflow.data('store')
300
-
301
- _overflow.animate({
302
- top: s.y,
303
- left: s.x,
304
- width: s.w,
305
- height: s.h,
306
- }, function () {
307
-
308
- $("[class^='resize_']",)
309
- .on('mousedown', function (e) {
310
- popup.ResizePopups(e, this)
311
- })
312
-
313
- Win.off("resize.eventItem")
314
- popup.vfx(_overflow, true)
315
-
316
- })
317
-
318
- _overflow.removeData('store')
319
-
320
- }
321
-
322
- return false
323
- },
324
-
325
- movable: function (p) {
326
-
327
- if (!p.movable) return
328
-
329
- let _overflow = $('.popup_overflow_' + p.id, '#popup')
330
- let _dragger = $('.popup_drag_' + p.id, _overflow)
331
- let _body = $('.popup_body_' + p.id, _overflow)
332
-
333
- let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0
334
-
335
- _dragger.on('mousedown', function (e) {
336
- _body.css('pointer-events', 'none')
337
-
338
- if (Win.width() > _overflow.width()) {
339
-
340
- dragMouseDown(e)
341
- popup.vfx(_overflow, false)
342
-
343
- } else {
344
-
345
- e.stopImmediatePropagation()
346
- return false
347
-
348
- }
349
- })
350
-
351
- _dragger.on('dblclick', function (e) {
352
- layerpro.popup.maximize(p)
353
- })
354
-
355
- function dragMouseDown(e) {
356
- pos3 = e.clientX
357
- pos4 = e.clientY
358
- document.onmousemove = elementDrag
359
- document.onmouseup = elementDragEnd
360
- return false
361
- }
362
-
363
- function elementDrag(e) {
364
-
365
- pos1 = pos3 - e.clientX
366
- pos2 = pos4 - e.clientY
367
- pos3 = e.clientX
368
- pos4 = e.clientY
369
-
370
- if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) _overflow.css('top', (_overflow.offset().top - pos2))
371
- if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) _overflow.css('left', (_overflow.offset().left - pos1))
372
-
373
- return false
374
-
375
- }
376
-
377
- function elementDragEnd() {
378
- document.onmouseup = null
379
- document.onmousemove = null
380
- _body.css('pointer-events', 'auto')
381
- popup.vfx(_overflow, true)
382
- return false
383
- }
384
-
385
- return false
386
-
387
- },
388
-
389
- resizable: function (p) {
390
-
391
- if (!p.resizable) return
392
-
393
- let _overflow = $('.popup_overflow_' + p.id, '#popup')
394
-
395
- // EDGE
396
- $("<div class='resize_0'>", _overflow).appendTo(_overflow)
397
- $("<div class='resize_1'>", _overflow).appendTo(_overflow)
398
- $("<div class='resize_2'>", _overflow).appendTo(_overflow)
399
- $("<div class='resize_3'>", _overflow).appendTo(_overflow)
400
-
401
- // CORNERS
402
- $("<div class='resize_corner_0'>", _overflow).appendTo(_overflow)
403
- $("<div class='resize_corner_1'>", _overflow).appendTo(_overflow)
404
- $("<div class='resize_corner_2'>", _overflow).appendTo(_overflow)
405
- $("<div class='resize_corner_3'>", _overflow).appendTo(_overflow)
406
-
407
- $("[class^='resize_']",)
408
- .on('mousedown', function (e) {
409
- popup.ResizePopups(e, this)
410
- })
411
-
412
- return false
413
-
414
- },
415
-
416
- ResizePopups: function (e, id) {
417
-
418
- let _sizer = $(id)
419
- let _parent = _sizer.parent()
420
- let cords = mouseCoord(e)
421
- Body.css('pointer-events', 'none')
422
- _parent.css('pointer-events', 'none')
423
-
424
- popup.vfx(_parent, false)
425
-
426
- document.onmousemove = (e) => { popup.doRes(e, id) }
427
- document.onmouseup = () => { popup.stopRes(id) }
428
-
429
- startX = cords[0]
430
- startY = cords[1]
431
-
432
- startWidth = _parent.width()
433
- startHeight = _parent.height()
434
- startLeft = _parent.position().left
435
- startTop = _parent.position().top
436
- startBottom = startTop + startHeight + 1
437
- startRight = startLeft + startWidth + 1
438
-
439
- isdresizableRes = id
440
-
441
- return false
442
-
443
- },
444
-
445
- doRes: function (e, id) {
446
-
447
- window.dispatchEvent(new Event('resize'))
448
-
449
- const _sizer = $(id)
450
- const _parent = _sizer.parent()
451
- const cords = mouseCoord(e)
452
-
453
- if (id === isdresizableRes) {
454
-
455
- let X = (startWidth + cords[0] - startX)
456
- let Y = (startHeight + cords[1] - startY)
457
- let X1 = (startWidth - cords[0] + startX)
458
- let Y1 = (startHeight - cords[1] + startY)
459
-
460
- if (X <= 0) { X = 0 }
461
- if (Y <= 0) { Y = 0 }
462
-
463
- /********************************************************************************************************************************************/
464
-
465
- // TOP DRAG
466
- if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) {
467
- if (_sizer.hasClass("resize_0")) {
468
- if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
469
- if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
470
- }
471
- }
472
-
473
- if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) {
474
- // RIGHT DRAG
475
- if (_sizer.hasClass("resize_1")) {
476
- if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
477
- if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
478
- }
479
- }
480
-
481
- if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) {
482
- // BOTTOM DRAG
483
- if (_sizer.hasClass("resize_2")) {
484
- if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
485
- if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
486
- }
487
- }
488
-
489
- if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) {
490
- // LEFT DRAG
491
- if (_sizer.hasClass("resize_3")) {
492
- if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
493
- if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
494
- }
495
- }
496
-
497
- /********************************************************************************************************************************************/
498
-
499
- if (
500
- popup.checkArea(e)[1] < popup.checkArea(e)[4] &&
501
- popup.checkArea(e)[0] < popup.checkArea(e)[5] &&
502
- Math.sign(popup.checkArea(e)[0]) === 1 &&
503
- Math.sign(popup.checkArea(e)[1]) === 1
504
- ) {
505
-
506
- // TOP LEFT
507
- if (_sizer.hasClass("resize_corner_0")) {
508
- if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
509
- if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
510
- if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
511
- if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
512
- }
513
-
514
- // TOP RIGHT
515
- if (_sizer.hasClass("resize_corner_1")) {
516
- if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
517
- if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
518
- if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
519
- if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
520
- }
521
-
522
- // BOTTOM RIGHT
523
- if (_sizer.hasClass("resize_corner_2")) {
524
- if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
525
- if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
526
- if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
527
- if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
528
- }
529
-
530
- // BOTTOM LEFT
531
- if (_sizer.hasClass("resize_corner_3")) {
532
- if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
533
- if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
534
- if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
535
- if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
536
- }
537
-
538
- }
539
-
540
- }
541
-
542
- return false
543
-
544
- },
545
-
546
- stopRes: function (id) {
547
-
548
- let _sizer = $(id)
549
- let _parent = _sizer.parent()
550
- Body.css('pointer-events', 'auto')
551
- _parent.css('pointer-events', 'auto')
552
-
553
- popup.vfx(_parent, true)
554
-
555
- isdresizableRes = false
556
- document.onmouseup = null
557
- document.onmousemove = null
558
-
559
- return false
560
-
561
- },
562
-
563
- index: function (p) {
564
-
565
- let _overflow = $('[class^="popup_overflow_"]', '#popup')
566
-
567
- $('[class^="popup_window_"]', '#popup').removeClass('zHigh')
568
- $('[class^="popup_bar_"]', '#popup').removeClass('pupup_bar_selected')
569
- $('[class^="icon_"]', '#popup').removeClass('pupup_bar_selected')
570
-
571
- _overflow.each(function () {
572
- $(this, '#popup')
573
- .css('zIndex', $(this, '#popup')[0].style.zIndex - 1)
574
- })
575
-
576
- $(".icon_" + p.id, '#popup')
577
- .addClass('pupup_bar_selected')
578
-
579
- $(".popup_overflow_" + p.id, '#popup')
580
- .css('zIndex', popup.zIndex(_overflow))
581
-
582
- $(".popup_bar_" + p.id, '#popup')
583
- .addClass('pupup_bar_selected')
584
-
585
- $(".popup_window_" + p.id, '#popup')
586
- .addClass('zHigh')
587
-
588
- return false
589
-
590
- },
591
-
592
- zIndex: function (els) {
593
-
594
- els.each(function () {
595
- let currentIndex = parseInt($(this, '#popup').css("zIndex"), 10)
596
-
597
- if (currentIndex > highIndex) {
598
- highIndex = currentIndex
599
- }
600
-
601
- })
602
-
603
- return highIndex + 1
604
-
605
- }
606
-
607
- }
608
-
609
- /**************************************************************************/
610
- // MAKE GLOBAL
611
-
612
- layerpro.popup = popup
package/scripts/purge.jsx DELETED
@@ -1,29 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- layerpro.purge = (d) => {
7
-
8
- var a = d.attributes, index, l, n
9
-
10
- if (a) {
11
- l = a.length
12
- for (index = 0; index < l; index += 1) {
13
- n = a[index].name
14
- if (typeof d[n] === 'function') {
15
- //d[n] = null;
16
- }
17
- }
18
- }
19
-
20
- a = d.childNodes
21
-
22
- if (a) {
23
- l = a.length
24
- for (index = 0; index < l; index += 1) {
25
- layerpro.purge(d.childNodes[index])
26
- }
27
- }
28
-
29
- }
@@ -1,69 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- //(function () {
7
- // new SmoothScroll( document, 120, 12 );
8
- //})();
9
-
10
- function SmoothScroll(target, speed, smooth) {
11
- if (target === document)
12
- target = (document.scrollingElement || document.documentElement || document.body.parentNode || document.body)
13
-
14
- var moving = false
15
- var pos = target.scrollTop
16
- var frame = target === document.body && document.documentElement ? document.documentElement : target
17
-
18
- target.addEventListener('mousewheel', scrolled, { passive: false })
19
- target.addEventListener('DOMMouseScroll', scrolled, { passive: false })
20
-
21
- function scrolled(e) {
22
- e.preventDefault() // disable default scrolling
23
-
24
- var delta = normalizeWheelDelta(e)
25
-
26
- pos += -delta * speed
27
- pos = Math.max(0, Math.min(pos, target.scrollHeight - frame.clientHeight)) // limit scrolling
28
-
29
- if (!moving) update()
30
- }
31
-
32
- function normalizeWheelDelta(e) {
33
- if (e.detail) {
34
- if (e.wheelDelta)
35
- return e.wheelDelta / e.detail / 40 * (e.detail > 0 ? 1 : -1) // Opera
36
- else
37
- return -e.detail / 3 // Firefox
38
- } else
39
- return e.wheelDelta / 120 // IE,Safari,Chrome
40
- }
41
-
42
- function update() {
43
- moving = true
44
-
45
- var delta = (pos - target.scrollTop) / smooth
46
-
47
- target.scrollTop += delta
48
-
49
- if (Math.abs(delta) > 0.5) {
50
- requestFrame(update)
51
- } else {
52
- moving = false
53
- }
54
- }
55
-
56
- var requestFrame = function () { // requestAnimationFrame cross browser
57
- return (
58
- window.requestAnimationFrame ||
59
- window.webkitRequestAnimationFrame ||
60
- window.mozRequestAnimationFrame ||
61
- window.oRequestAnimationFrame ||
62
- window.msRequestAnimationFrame ||
63
- function (function_) {
64
- window.setTimeout(function_, 1000 / 50)
65
- }
66
- )
67
- }()
68
-
69
- }