@get-set/gs-zoom 0.0.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 (35) hide show
  1. package/README.md +46 -0
  2. package/dist/GSZoom.css +235 -0
  3. package/dist/actions/general.js +30 -0
  4. package/dist/actions/getAdjustTransform.js +43 -0
  5. package/dist/actions/getCurrentParams.js +42 -0
  6. package/dist/actions/getTranslateCoordToPoint.js +41 -0
  7. package/dist/actions/init.js +21 -0
  8. package/dist/actions/initActionEvents.js +93 -0
  9. package/dist/actions/initAdditionals.js +118 -0
  10. package/dist/actions/initAdjust.js +107 -0
  11. package/dist/actions/initAdjustAdditionalActive.js +33 -0
  12. package/dist/actions/initArrows.js +44 -0
  13. package/dist/actions/initAutoplay.js +81 -0
  14. package/dist/actions/initChange.js +73 -0
  15. package/dist/actions/initClose.js +28 -0
  16. package/dist/actions/initDraggle.js +303 -0
  17. package/dist/actions/initDraw.js +79 -0
  18. package/dist/actions/initDrawItem.js +83 -0
  19. package/dist/actions/initFullScreen.js +32 -0
  20. package/dist/actions/initLightBox.js +33 -0
  21. package/dist/actions/initMagnifier.js +54 -0
  22. package/dist/actions/initNavigateWithKeys.js +27 -0
  23. package/dist/actions/initWheel.js +51 -0
  24. package/dist/actions/setStyles.js +24 -0
  25. package/dist/components/GSZoom.js +115 -0
  26. package/dist/components/styles/GSZoom.css +235 -0
  27. package/dist/components/styles/GSZoom.css.map +1 -0
  28. package/dist/components/styles/GSZoom.scss +254 -0
  29. package/dist/constants/defaultParams.js +20 -0
  30. package/dist/constants/icons.js +23 -0
  31. package/dist/constants/magnifierDefaultProps.js +7 -0
  32. package/dist/constants/types.js +6 -0
  33. package/dist/helpers/uihelpers.js +9 -0
  34. package/index.js +3 -0
  35. package/package.json +43 -0
@@ -0,0 +1,235 @@
1
+ html.gs-zoom-opened {
2
+ overflow: hidden !important;
3
+ touch-action: pan-x pan-y;
4
+ }
5
+ html.gs-zoom-opened body {
6
+ touch-action: pan-x pan-y;
7
+ }
8
+
9
+ .gs-zoom-magnifier-instance:hover {
10
+ cursor: none;
11
+ }
12
+
13
+ .gs-zoom-magnifier {
14
+ pointer-events: none;
15
+ position: fixed;
16
+ z-index: 9999;
17
+ border: 4px solid #fff;
18
+ aspect-ratio: 1;
19
+ overflow: hidden;
20
+ }
21
+ .gs-zoom-magnifier[data-type=circle] {
22
+ border-radius: 50%;
23
+ }
24
+ .gs-zoom-magnifier img {
25
+ position: absolute;
26
+ transform-origin: top left;
27
+ max-width: unset !important;
28
+ }
29
+
30
+ .gs-zoom-container {
31
+ position: fixed;
32
+ z-index: 9999999999;
33
+ width: 100vw;
34
+ height: 100dvh;
35
+ top: 0;
36
+ left: 0;
37
+ overflow: hidden;
38
+ -webkit-backdrop-filter: blur(50px);
39
+ backdrop-filter: blur(50px);
40
+ }
41
+ .gs-zoom-container .gs-zoom-autoplayline {
42
+ position: fixed;
43
+ height: 4px;
44
+ top: 0;
45
+ left: 0;
46
+ z-index: 999;
47
+ background-color: red;
48
+ }
49
+ .gs-zoom-container button {
50
+ cursor: pointer;
51
+ outline: none !important;
52
+ }
53
+ .gs-zoom-container * {
54
+ -webkit-user-drag: none;
55
+ -moz-user-select: none;
56
+ -webkit-user-select: none;
57
+ user-select: none;
58
+ }
59
+ .gs-zoom-container .gs-zoom-header {
60
+ position: fixed;
61
+ right: 10px;
62
+ top: 10px;
63
+ display: flex;
64
+ justify-content: flex-end;
65
+ align-items: center;
66
+ z-index: 99;
67
+ }
68
+ .gs-zoom-container .gs-zoom-header .gs-zoom-actions {
69
+ display: flex;
70
+ align-items: center;
71
+ }
72
+ .gs-zoom-container .gs-zoom-header .gs-zoom-actions .gs-zoom-action {
73
+ width: 40px;
74
+ height: 40px;
75
+ background-color: rgba(35, 35, 35, 0.65);
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ border: none;
80
+ }
81
+ .gs-zoom-container .gs-zoom-header .gs-zoom-actions .gs-zoom-action svg {
82
+ fill: #fff;
83
+ width: 18px;
84
+ }
85
+ .gs-zoom-container .gs-zoom-img-list {
86
+ position: relative;
87
+ z-index: 2;
88
+ display: flex;
89
+ width: -moz-max-content;
90
+ width: max-content;
91
+ }
92
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img {
93
+ width: 100vw;
94
+ height: 100dvh;
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: center;
98
+ position: relative;
99
+ overflow: hidden;
100
+ }
101
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img .gs-zoom-img-touch {
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ right: 0;
106
+ bottom: 0;
107
+ z-index: 2;
108
+ }
109
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img .gz-zoom-loading-container {
110
+ display: none;
111
+ position: absolute;
112
+ top: 50%;
113
+ left: 50%;
114
+ transform: translate(-50%, -50%);
115
+ }
116
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img .gs-zoom-img {
117
+ max-width: 100%;
118
+ max-height: 100%;
119
+ }
120
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img .gs-zoom-img.gs-zoom-is-adjusting {
121
+ transition: 0.4s ease-in-out !important;
122
+ }
123
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img.gz-zoom-is-loading .gz-zoom-loading-container {
124
+ display: block;
125
+ }
126
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img.gz-zoom-is-loading .gs-zoom-img {
127
+ visibility: hidden;
128
+ }
129
+ .gs-zoom-container .gs-zoom-img-list .gs-zoom-main-img .gs-zoom-info-data {
130
+ position: absolute;
131
+ left: 0;
132
+ bottom: 0;
133
+ right: 0;
134
+ padding: 20px 20px 90px;
135
+ display: flex;
136
+ flex-direction: column;
137
+ align-items: center;
138
+ color: #fff;
139
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
140
+ }
141
+ .gs-zoom-container .gs-zoom-additionals {
142
+ position: fixed;
143
+ bottom: 0;
144
+ left: 0;
145
+ width: 100%;
146
+ overflow-x: hidden;
147
+ padding: 5px 0;
148
+ display: flex;
149
+ justify-content: center;
150
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
151
+ transform-origin: bottom;
152
+ }
153
+ .gs-zoom-container .gs-zoom-additionals .gs-add-list-container {
154
+ overflow-x: hidden;
155
+ max-width: 100%;
156
+ }
157
+ .gs-zoom-container .gs-zoom-additionals .gs-add-list-container .gs-add-list {
158
+ display: flex;
159
+ gap: 5px;
160
+ width: -moz-max-content;
161
+ width: max-content;
162
+ justify-content: center;
163
+ flex-wrap: nowrap;
164
+ }
165
+ .gs-zoom-container .gs-zoom-additionals .gs-add-list-container .gs-add-list .gs-add-item {
166
+ width: 80px;
167
+ aspect-ratio: 1;
168
+ display: flex;
169
+ align-items: center;
170
+ justify-content: center;
171
+ border: 1px solid #000;
172
+ opacity: 0.5;
173
+ transition: 0.2s ease-out;
174
+ transform: scale(0.8);
175
+ cursor: pointer;
176
+ }
177
+ .gs-zoom-container .gs-zoom-additionals .gs-add-list-container .gs-add-list .gs-add-item:hover, .gs-zoom-container .gs-zoom-additionals .gs-add-list-container .gs-add-list .gs-add-item.active {
178
+ transform: scale(1);
179
+ opacity: 1;
180
+ }
181
+ .gs-zoom-container .gs-zoom-additionals .gs-add-list-container .gs-add-list .gs-add-item img {
182
+ max-width: 100%;
183
+ max-height: 100%;
184
+ }
185
+ .gs-zoom-container .gs-zoom-additionals.gs-zoom-hidden {
186
+ z-index: 1;
187
+ opacity: 0;
188
+ }
189
+ .gs-zoom-container .gs-zoom-additionals.gs-zoom-hidden .gs-add-list {
190
+ transform: scale(0.9);
191
+ }
192
+ .gs-zoom-container:not(.gs-additional-isdragging) .gs-zoom-additionals .gs-add-list-container .gs-add-list {
193
+ transition: 0.3s transform ease-in-out;
194
+ }
195
+ .gs-zoom-container .gs-zoom-navigations button {
196
+ border: none;
197
+ position: fixed;
198
+ top: 50%;
199
+ width: 50px;
200
+ background-color: rgba(35, 35, 35, 0.65);
201
+ aspect-ratio: 1;
202
+ display: inline-flex;
203
+ align-items: center;
204
+ justify-content: center;
205
+ font-size: 28px;
206
+ color: #fff;
207
+ transform: translateY(-50%);
208
+ }
209
+ .gs-zoom-container .gs-zoom-navigations button svg {
210
+ fill: #fff;
211
+ width: 18px;
212
+ }
213
+ .gs-zoom-container .gs-zoom-navigations .gs-zoom-next {
214
+ right: 10px;
215
+ }
216
+ .gs-zoom-container .gs-zoom-navigations .gs-zoom-prev {
217
+ left: 10px;
218
+ }
219
+ .gs-zoom-container .gs-zoom-hide-inzoomed {
220
+ z-index: 3;
221
+ opacity: 1;
222
+ transform: scale(1);
223
+ transition: 0.3s ease-in-out;
224
+ }
225
+ .gs-zoom-container.gs-zoom-is-zoomed .gs-zoom-hide-inzoomed {
226
+ z-index: 1;
227
+ opacity: 0;
228
+ transform: scale(0.9);
229
+ }
230
+ .gs-zoom-container.gs-zoom-is-zoomed .gs-zoom-hide-inzoomed.gs-zoom-additionals {
231
+ transform: scale(1);
232
+ }
233
+ .gs-zoom-container.gs-zoom-is-zoomed .gs-zoom-hide-inzoomed.gs-zoom-additionals .gs-add-list {
234
+ transform: scale(0.9);
235
+ }/*# sourceMappingURL=GSZoom.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GSZoom.scss","GSZoom.css"],"names":[],"mappings":"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","file":"GSZoom.css"}
@@ -0,0 +1,254 @@
1
+ html.gs-zoom-opened {
2
+ overflow: hidden !important;
3
+ touch-action: pan-x pan-y;
4
+ body {
5
+ touch-action: pan-x pan-y;
6
+ }
7
+ }
8
+ .gs-zoom-magnifier-instance {
9
+ &:hover {
10
+ cursor: none;
11
+ }
12
+ }
13
+ .gs-zoom-magnifier {
14
+ pointer-events: none;
15
+ position: fixed;
16
+ z-index: 9999;
17
+ border: 4px solid #fff;
18
+ aspect-ratio: 1;
19
+ overflow: hidden;
20
+ &[data-type="circle"] {
21
+ border-radius: 50%;
22
+ }
23
+ img {
24
+ position: absolute;
25
+ transform-origin: top left;
26
+ max-width: unset !important;
27
+ }
28
+ }
29
+ .gs-zoom-container {
30
+ position: fixed;
31
+ z-index: 9999999999;
32
+ width: 100vw;
33
+ height: 100dvh;
34
+ top: 0;
35
+ left: 0;
36
+ overflow: hidden;
37
+ backdrop-filter: blur(50px);
38
+
39
+ .gs-zoom-autoplayline {
40
+ position: fixed;
41
+ height: 4px;
42
+ top: 0;
43
+ left: 0;
44
+ z-index: 999;
45
+ background-color: red;
46
+ }
47
+ button {
48
+ cursor: pointer;
49
+ outline: none !important;
50
+ }
51
+ * {
52
+ -webkit-user-drag: none;
53
+ -moz-user-select: none;
54
+ -webkit-user-select: none;
55
+ -ms-user-select: none;
56
+ user-select: none;
57
+ }
58
+ .gs-zoom-header {
59
+ position: fixed;
60
+ right: 10px;
61
+ top: 10px;
62
+ //width: 100%;
63
+ display: flex;
64
+ justify-content: flex-end;
65
+ align-items: center;
66
+ z-index: 99;
67
+
68
+ .gs-zoom-actions {
69
+ display: flex;
70
+ align-items: center;
71
+ .gs-zoom-action {
72
+ width: 40px;
73
+ height: 40px;
74
+ background-color: rgba(35, 35, 35, 0.65);
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ border: none;
79
+
80
+ svg {
81
+ fill: #fff;
82
+ width: 18px;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ .gs-zoom-img-list {
88
+ position: relative;
89
+ z-index: 2;
90
+ display: flex;
91
+ width: max-content;
92
+ .gs-zoom-main-img {
93
+ width: 100vw;
94
+ height: 100dvh;
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: center;
98
+ position: relative;
99
+ overflow: hidden;
100
+
101
+ .gs-zoom-img-touch {
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ right: 0;
106
+ bottom: 0;
107
+ z-index: 2;
108
+ }
109
+
110
+ .gz-zoom-loading-container {
111
+ display: none;
112
+ position: absolute;
113
+ top: 50%;
114
+ left: 50%;
115
+ transform: translate(-50%, -50%);
116
+ }
117
+ .gs-zoom-img {
118
+ max-width: 100%;
119
+ max-height: 100%;
120
+ //transition: 0.15s;
121
+ &.gs-zoom-is-adjusting {
122
+ transition: 0.4s ease-in-out !important;
123
+ }
124
+ }
125
+ &.gz-zoom-is-loading {
126
+ .gz-zoom-loading-container {
127
+ display: block;
128
+ }
129
+ .gs-zoom-img {
130
+ visibility: hidden;
131
+ }
132
+ }
133
+ .gs-zoom-info-data {
134
+ position: absolute;
135
+ left: 0;
136
+ bottom: 0;
137
+ right: 0;
138
+ padding: 20px 20px 90px;
139
+ display: flex;
140
+ flex-direction: column;
141
+ align-items: center;
142
+ color: #fff;
143
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
144
+ }
145
+ }
146
+ }
147
+ .gs-zoom-additionals {
148
+ position: fixed;
149
+ bottom: 0;
150
+ left: 0;
151
+ width: 100%;
152
+ overflow-x: hidden;
153
+ padding: 5px 0;
154
+ display: flex;
155
+ justify-content: center;
156
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
157
+ transform-origin: bottom;
158
+ .gs-add-list-container {
159
+ overflow-x: hidden;
160
+ max-width: 100%;
161
+ .gs-add-list {
162
+ display: flex;
163
+ gap: 5px;
164
+ width: max-content;
165
+ justify-content: center;
166
+ flex-wrap: nowrap;
167
+
168
+ .gs-add-item {
169
+ width: 80px;
170
+ aspect-ratio: 1;
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ border: 1px solid #000;
175
+ opacity: 0.5;
176
+ transition: 0.2s ease-out;
177
+ transform: scale(0.8);
178
+ cursor: pointer;
179
+ &:hover,
180
+ &.active {
181
+ transform: scale(1);
182
+ opacity: 1;
183
+ }
184
+ img {
185
+ max-width: 100%;
186
+ max-height: 100%;
187
+ }
188
+ }
189
+ }
190
+ }
191
+ &.gs-zoom-hidden {
192
+ z-index: 1;
193
+ opacity: 0;
194
+ .gs-add-list {
195
+ transform: scale(0.9);
196
+ }
197
+ }
198
+ }
199
+ &:not(.gs-additional-isdragging) {
200
+ .gs-zoom-additionals {
201
+ .gs-add-list-container {
202
+ .gs-add-list {
203
+ transition: 0.3s transform ease-in-out;
204
+ }
205
+ }
206
+ }
207
+ }
208
+ .gs-zoom-navigations {
209
+ button {
210
+ border: none;
211
+ position: fixed;
212
+ top: 50%;
213
+ width: 50px;
214
+ background-color: rgba(35, 35, 35, 0.65);
215
+ aspect-ratio: 1;
216
+ display: inline-flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ font-size: 28px;
220
+ color: #fff;
221
+ transform: translateY(-50%);
222
+
223
+ svg {
224
+ fill: #fff;
225
+ width: 18px;
226
+ }
227
+ }
228
+ .gs-zoom-next {
229
+ right: 10px;
230
+ }
231
+ .gs-zoom-prev {
232
+ left: 10px;
233
+ }
234
+ }
235
+ .gs-zoom-hide-inzoomed {
236
+ z-index: 3;
237
+ opacity: 1;
238
+ transform: scale(1);
239
+ transition: 0.3s ease-in-out;
240
+ }
241
+ &.gs-zoom-is-zoomed {
242
+ .gs-zoom-hide-inzoomed {
243
+ z-index: 1;
244
+ opacity: 0;
245
+ transform: scale(0.9);
246
+ &.gs-zoom-additionals {
247
+ transform: scale(1);
248
+ .gs-add-list {
249
+ transform: scale(0.9);
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
@@ -0,0 +1,20 @@
1
+ import types from "./types";
2
+
3
+ const defaultParams = {
4
+ reference: "",
5
+ arrows: true,
6
+ navigateWithKeys: true,
7
+ allowArrowNavigation: true,
8
+ showAdditionals: true,
9
+ zoomOnWheel: true,
10
+ maxZoom: 5,
11
+ type: types.lightbox,
12
+ mainImageQueryParameters: "",
13
+ additionalImageQueryParameters: "",
14
+ disableFullScreen: false,
15
+ imgLoading: "",
16
+ autoplaySpeed: 5000,
17
+ responsive: [],
18
+ };
19
+
20
+ export default Object.freeze(defaultParams);
@@ -0,0 +1,23 @@
1
+ const icons = {
2
+ // zoomIn: '<svg width="20px" height="20px" viewBox="0 -0.5 21 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Dribbble-Light-Preview" class="btn-icon btn-icon-plus" transform="translate(-379.000000, -240.000000)" fill="none"><g id="icons" transform="translate(56.000000, 160.000000)"><polygon id="plus-[#1512]" points="344 89 344 91 334.55 91 334.55 100 332.45 100 332.45 91 323 91 323 89 332.45 89 332.45 80 334.55 80 334.55 89"></polygon></g></g></g></svg>',
3
+ zoomIn:
4
+ '<svg width="20px" height="20px" viewBox="0 0 30 30"><path class="fslightbox-svg-path" d="M 13 3 C 7.4889971 3 3 7.4889971 3 13 C 3 18.511003 7.4889971 23 13 23 C 15.396508 23 17.597385 22.148986 19.322266 20.736328 L 25.292969 26.707031 A 1.0001 1.0001 0 1 0 26.707031 25.292969 L 20.736328 19.322266 C 22.148986 17.597385 23 15.396508 23 13 C 23 7.4889971 18.511003 3 13 3 z M 13 5 C 17.430123 5 21 8.5698774 21 13 C 21 17.430123 17.430123 21 13 21 C 8.5698774 21 5 17.430123 5 13 C 5 8.5698774 8.5698774 5 13 5 z M 12.984375 7.9863281 A 1.0001 1.0001 0 0 0 12 9 L 12 12 L 9 12 A 1.0001 1.0001 0 1 0 9 14 L 12 14 L 12 17 A 1.0001 1.0001 0 1 0 14 17 L 14 14 L 17 14 A 1.0001 1.0001 0 1 0 17 12 L 14 12 L 14 9 A 1.0001 1.0001 0 0 0 12.984375 7.9863281 z"></path></svg>',
5
+ //zoomOut: '<svg width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path class="btn-icon btn-icon-minus" d="M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z" fill="none"></path></svg>',
6
+ zoomOut:
7
+ '<svg width="20px" height="20px" viewBox="0 0 30 30"><path class="fslightbox-svg-path" d="M 13 3 C 7.4889971 3 3 7.4889971 3 13 C 3 18.511003 7.4889971 23 13 23 C 15.396508 23 17.597385 22.148986 19.322266 20.736328 L 25.292969 26.707031 A 1.0001 1.0001 0 1 0 26.707031 25.292969 L 20.736328 19.322266 C 22.148986 17.597385 23 15.396508 23 13 C 23 7.4889971 18.511003 3 13 3 z M 13 5 C 17.430123 5 21 8.5698774 21 13 C 21 17.430123 17.430123 21 13 21 C 8.5698774 21 5 17.430123 5 13 C 5 8.5698774 8.5698774 5 13 5 z M 9 12 A 1.0001 1.0001 0 1 0 9 14 L 17 14 A 1.0001 1.0001 0 1 0 17 12 L 9 12 z"></path></svg>',
8
+ //close: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" viewBox="0 -0.5 21 21" version="1.1"><g fill="none" fill-rule="evenodd"><g transform="translate(-419.000000, -240.000000)" class="btn-icon btn-icon-close"><g transform="translate(56.000000, 160.000000)"><polygon points="375.0183 90 384 98.554 382.48065 100 373.5 91.446 364.5183 100 363 98.554 371.98065 90 363 81.446 364.5183 80 373.5 88.554 382.48065 80 384 81.446"></polygon></g></g></g></svg>',
9
+ close:
10
+ '<svg width="20px" height="20px" viewBox="0 0 24 24"><path class="fslightbox-svg-path" d="M 4.7070312 3.2929688 L 3.2929688 4.7070312 L 10.585938 12 L 3.2929688 19.292969 L 4.7070312 20.707031 L 12 13.414062 L 19.292969 20.707031 L 20.707031 19.292969 L 13.414062 12 L 20.707031 4.7070312 L 19.292969 3.2929688 L 12 10.585938 L 4.7070312 3.2929688 z"></path></svg>',
11
+ autoplay:
12
+ '<svg width="16px" height="16px" viewBox="0 0 30 30"><path class="fslightbox-svg-path" d="M 6 3 A 1 1 0 0 0 5 4 A 1 1 0 0 0 5 4.0039062 L 5 15 L 5 25.996094 A 1 1 0 0 0 5 26 A 1 1 0 0 0 6 27 A 1 1 0 0 0 6.5800781 26.8125 L 6.5820312 26.814453 L 26.416016 15.908203 A 1 1 0 0 0 27 15 A 1 1 0 0 0 26.388672 14.078125 L 6.5820312 3.1855469 L 6.5800781 3.1855469 A 1 1 0 0 0 6 3 z"></path></svg>',
13
+ autoplayPause:
14
+ '<svg width="14px" height="14px" viewBox="0 0 356.19 356.19"><path class="fslightbox-svg-path" d="M121,0c18,0,33,15,33,33v372c0,18-15,33-33,33s-32-15-32-33V33C89,15,103,0,121,0zM317,0c18,0,32,15,32,33v372c0,18-14,33-32,33s-33-15-33-33V33C284,15,299,0,317,0z"></path></svg>',
15
+ arrPrev:
16
+ '<svg width="20px" height="20px" viewBox="0 0 20 20"><path class="fslightbox-svg-path" d="M18.271,9.212H3.615l4.184-4.184c0.306-0.306,0.306-0.801,0-1.107c-0.306-0.306-0.801-0.306-1.107,0L1.21,9.403C1.194,9.417,1.174,9.421,1.158,9.437c-0.181,0.181-0.242,0.425-0.209,0.66c0.005,0.038,0.012,0.071,0.022,0.109c0.028,0.098,0.075,0.188,0.142,0.271c0.021,0.026,0.021,0.061,0.045,0.085c0.015,0.016,0.034,0.02,0.05,0.033l5.484,5.483c0.306,0.307,0.801,0.307,1.107,0c0.306-0.305,0.306-0.801,0-1.105l-4.184-4.185h14.656c0.436,0,0.788-0.353,0.788-0.788S18.707,9.212,18.271,9.212z"></path></svg>',
17
+ arrNext:
18
+ '<svg width="20px" height="20px" viewBox="0 0 20 20"><path class="fslightbox-svg-path" d="M1.729,9.212h14.656l-4.184-4.184c-0.307-0.306-0.307-0.801,0-1.107c0.305-0.306,0.801-0.306,1.106,0l5.481,5.482c0.018,0.014,0.037,0.019,0.053,0.034c0.181,0.181,0.242,0.425,0.209,0.66c-0.004,0.038-0.012,0.071-0.021,0.109c-0.028,0.098-0.075,0.188-0.143,0.271c-0.021,0.026-0.021,0.061-0.045,0.085c-0.015,0.016-0.034,0.02-0.051,0.033l-5.483,5.483c-0.306,0.307-0.802,0.307-1.106,0c-0.307-0.305-0.307-0.801,0-1.105l4.184-4.185H1.729c-0.436,0-0.788-0.353-0.788-0.788S1.293,9.212,1.729,9.212z"></path></svg>',
19
+ toggleadditionals:
20
+ '<svg width="17px" height="17px" viewBox="0 0 22 22"><path class="fslightbox-svg-path" d="M 3 2 C 2.448 2 2 2.448 2 3 L 2 6 C 2 6.552 2.448 7 3 7 L 6 7 C 6.552 7 7 6.552 7 6 L 7 3 C 7 2.448 6.552 2 6 2 L 3 2 z M 10 2 C 9.448 2 9 2.448 9 3 L 9 6 C 9 6.552 9.448 7 10 7 L 13 7 C 13.552 7 14 6.552 14 6 L 14 3 C 14 2.448 13.552 2 13 2 L 10 2 z M 17 2 C 16.448 2 16 2.448 16 3 L 16 6 C 16 6.552 16.448 7 17 7 L 20 7 C 20.552 7 21 6.552 21 6 L 21 3 C 21 2.448 20.552 2 20 2 L 17 2 z M 3 9 C 2.448 9 2 9.448 2 10 L 2 13 C 2 13.552 2.448 14 3 14 L 6 14 C 6.552 14 7 13.552 7 13 L 7 10 C 7 9.448 6.552 9 6 9 L 3 9 z M 10 9 C 9.448 9 9 9.448 9 10 L 9 13 C 9 13.552 9.448 14 10 14 L 13 14 C 13.552 14 14 13.552 14 13 L 14 10 C 14 9.448 13.552 9 13 9 L 10 9 z M 17 9 C 16.448 9 16 9.448 16 10 L 16 13 C 16 13.552 16.448 14 17 14 L 20 14 C 20.552 14 21 13.552 21 13 L 21 10 C 21 9.448 20.552 9 20 9 L 17 9 z M 3 16 C 2.448 16 2 16.448 2 17 L 2 20 C 2 20.552 2.448 21 3 21 L 6 21 C 6.552 21 7 20.552 7 20 L 7 17 C 7 16.448 6.552 16 6 16 L 3 16 z M 10 16 C 9.448 16 9 16.448 9 17 L 9 20 C 9 20.552 9.448 21 10 21 L 13 21 C 13.552 21 14 20.552 14 20 L 14 17 C 14 16.448 13.552 16 13 16 L 10 16 z M 17 16 C 16.448 16 16 16.448 16 17 L 16 20 C 16 20.552 16.448 21 17 21 L 20 21 C 20.552 21 21 20.552 21 20 L 21 17 C 21 16.448 20.552 16 20 16 L 17 16 z"></path></svg>',
21
+ };
22
+
23
+ export default Object.freeze(icons);
@@ -0,0 +1,7 @@
1
+ const magnifierDefaultProps = {
2
+ zoom: 3,
3
+ form: 'circle',
4
+ size: 150,
5
+ };
6
+
7
+ export default Object.freeze(magnifierDefaultProps);
@@ -0,0 +1,6 @@
1
+ const types = {
2
+ lightbox: 'lightbox',
3
+ magnifier: 'magnifier',
4
+ };
5
+
6
+ export default Object.freeze(types);
@@ -0,0 +1,9 @@
1
+ const NewGuid = () => {
2
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3
+ const r = (Math.random() * 16) | 0,
4
+ v = c == 'x' ? r : (r & 0x3) | 0x8;
5
+ return v.toString(16);
6
+ });
7
+ };
8
+
9
+ export default NewGuid;
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import GSZoom from './dist/components/GSZoom';
2
+
3
+ export default GSZoom;
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@get-set/gs-zoom",
3
+ "version": "0.0.1",
4
+ "description": "Get-Set Zoom",
5
+ "main": "index.js",
6
+ "author": "Get-Set",
7
+ "license": "ISC",
8
+ "files": [
9
+ "index.js",
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "cp -r src/* dist/",
14
+ "build:styles": "node-sass src/components/styles/GSZoom.scss -o dist"
15
+ },
16
+ "peerDependencies": {
17
+ "react": "^18.2.0"
18
+ },
19
+ "keywords": [
20
+ "zoom",
21
+ "plugin",
22
+ "images",
23
+ "slider",
24
+ "slideshow",
25
+ "magnifier",
26
+ "fullscreen",
27
+ "gallery",
28
+ "react",
29
+ "react-component"
30
+ ],
31
+ "devDependencies": {
32
+ "@babel/cli": "^7.24.1",
33
+ "@babel/core": "^7.24.4",
34
+ "@babel/preset-env": "^7.24.4",
35
+ "@babel/preset-react": "^7.24.1",
36
+ "prettier": "2.7.1"
37
+ },
38
+ "dependencies": {
39
+ "@types/prop-types": "^15.7.13",
40
+ "jsdoc": "^4.0.3",
41
+ "prop-types": "^15.8.1"
42
+ }
43
+ }