@madj2k/fe-frontend-kit 2.0.27 → 2.0.29
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
package/readme.md
CHANGED
|
@@ -402,11 +402,13 @@ A lightweight fade slider using opacity and z-index.
|
|
|
402
402
|
Init with available options:
|
|
403
403
|
```
|
|
404
404
|
import { Madj2kSimpleFadeSlider } from '@madj2k/fe-frontend-kit/tools/simple-fade-slider';
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
405
|
+
document.querySelectorAll('.js-fade-slider').forEach((el) => {
|
|
406
|
+
new Madj2kSimpleFadeSlider(el, {
|
|
407
|
+
duration: 8,
|
|
408
|
+
classSlide: 'fade-slider-item',
|
|
409
|
+
classVisible: 'is-visible',
|
|
410
|
+
debug: true
|
|
411
|
+
});
|
|
410
412
|
});
|
|
411
413
|
```
|
|
412
414
|
|
|
@@ -23,9 +23,12 @@
|
|
|
23
23
|
///
|
|
24
24
|
/// @group Layout
|
|
25
25
|
///
|
|
26
|
+
/// @param {Map} $page-padding - A map of breakpoint names to padding values for responsive control. Defaults to predefined breakpoint-based paddings.
|
|
26
27
|
/// @param {String} $page-wrap-class - The base class used to wrap the entire page (for context-aware styling). Defaults to `'.page'`.
|
|
27
28
|
/// @param {String} $wrap-class - The base utility class prefix for full-width behavior. Defaults to `'.fullwidth'`.
|
|
28
29
|
/// @param {Length} $default-padding - The default horizontal padding applied when full-width is active. Defaults to `16px`.
|
|
30
|
+
/// @param {String} $padding-class - The class prefix used for standalone padding utilities. Defaults to `$page-wrap-class`.
|
|
31
|
+
/// @param {Number} $version - Version number for compatibility handling. Defaults to `1`.
|
|
29
32
|
///
|
|
30
33
|
/// @example html
|
|
31
34
|
/// <!-- 1) Around a Bootstrap container -->
|
|
@@ -85,7 +88,9 @@
|
|
|
85
88
|
),
|
|
86
89
|
$page-wrap-class: '.page',
|
|
87
90
|
$wrap-class: '.fullwidth',
|
|
88
|
-
$default-padding: 16px
|
|
91
|
+
$default-padding: 16px,
|
|
92
|
+
$padding-class: $page-wrap-class,
|
|
93
|
+
$version: 1,
|
|
89
94
|
) {
|
|
90
95
|
|
|
91
96
|
#{$page-wrap-class} {
|
|
@@ -93,7 +98,12 @@
|
|
|
93
98
|
/** default settings without breakpoints **/
|
|
94
99
|
@include page-padding-only($default-padding);
|
|
95
100
|
|
|
96
|
-
|
|
101
|
+
/** addition class which simply contains the normal padding */
|
|
102
|
+
#{$padding-class}-padding {
|
|
103
|
+
@include page-padding-only($default-padding, 'full');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** for usage as wrap around a container */
|
|
97
107
|
#{$wrap-class}-1 {
|
|
98
108
|
@include page-padding-container($default-padding);
|
|
99
109
|
|
|
@@ -134,6 +144,11 @@
|
|
|
134
144
|
|
|
135
145
|
@include media-breakpoint-up($breakpoint) {
|
|
136
146
|
|
|
147
|
+
/** addition class which simply contains the normal padding */
|
|
148
|
+
#{$padding-class}-padding {
|
|
149
|
+
@include page-padding-only($padding-x, 'full');
|
|
150
|
+
}
|
|
151
|
+
|
|
137
152
|
/** for usage as wrap around a container */
|
|
138
153
|
#{$wrap-class}-1 {
|
|
139
154
|
@include page-padding-container($padding-x);
|
|
@@ -155,9 +170,9 @@
|
|
|
155
170
|
|
|
156
171
|
/** reset */
|
|
157
172
|
#{$wrap-class}-0,
|
|
158
|
-
|
|
173
|
+
.row #{$wrap-class}-0{
|
|
159
174
|
@include page-padding-row-reset();
|
|
160
|
-
|
|
175
|
+
}
|
|
161
176
|
|
|
162
177
|
#{$wrap-class}-0 {
|
|
163
178
|
#{$wrap-class}-inner{
|
|
@@ -179,8 +194,17 @@
|
|
|
179
194
|
|
|
180
195
|
/** ensure dominance with body-prefix */
|
|
181
196
|
body #{$page-wrap-class} {
|
|
182
|
-
|
|
183
|
-
|
|
197
|
+
|
|
198
|
+
// seems to be a bug in older version. But we keep it for compatibility
|
|
199
|
+
@if ($version < 2) {
|
|
200
|
+
padding-left: $padding-x - math.div($grid-gutter-width, 2);
|
|
201
|
+
padding-right: $padding-x - math.div($grid-gutter-width, 2);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** addition class which simply contains the normal padding */
|
|
205
|
+
#{$padding-class}-#{$breakpoint}-padding {
|
|
206
|
+
@include page-padding-only($padding-x, 'full');
|
|
207
|
+
}
|
|
184
208
|
|
|
185
209
|
/** for usage as wrap around a container */
|
|
186
210
|
#{$wrap-class}-#{$breakpoint}-1 {
|
|
@@ -212,9 +236,14 @@
|
|
|
212
236
|
}
|
|
213
237
|
}
|
|
214
238
|
|
|
215
|
-
@mixin page-padding-only ($padding-x) {
|
|
216
|
-
|
|
217
|
-
|
|
239
|
+
@mixin page-padding-only ($padding-x, $variant: 'default') {
|
|
240
|
+
@if ($variant == 'full') {
|
|
241
|
+
padding-left: $padding-x;
|
|
242
|
+
padding-right: $padding-x;
|
|
243
|
+
} @else {
|
|
244
|
+
padding-left: $padding-x - math.div($grid-gutter-width, 2);
|
|
245
|
+
padding-right: $padding-x - math.div($grid-gutter-width, 2);
|
|
246
|
+
}
|
|
218
247
|
}
|
|
219
248
|
|
|
220
249
|
@mixin page-padding-container ($padding-x) {
|
|
@@ -230,7 +259,6 @@
|
|
|
230
259
|
margin-left: $padding-x * -1 + math.div($grid-gutter-width, 2);
|
|
231
260
|
margin-right: $padding-x * -1 + math.div($grid-gutter-width, 2);
|
|
232
261
|
overflow: hidden;
|
|
233
|
-
|
|
234
262
|
/*
|
|
235
263
|
$additionalWidth: $padding-x * 2;
|
|
236
264
|
width: calc(100% + $additionalWidth);
|
|
@@ -10,17 +10,19 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @author Steffen Kroggel <developer@steffenkroggel.de>
|
|
12
12
|
* @copyright 2025 Steffen Kroggel
|
|
13
|
-
* @version 1.
|
|
13
|
+
* @version 1.1.0
|
|
14
14
|
* @license GNU General Public License v3.0
|
|
15
15
|
* @see https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
|
-
* // Initialize with
|
|
19
|
-
* const
|
|
18
|
+
* // Initialize with a single DOM element
|
|
19
|
+
* const el = document.querySelector('.js-fade-slider');
|
|
20
|
+
* const slider = new Madj2kSimpleFadeSlider(el);
|
|
20
21
|
*
|
|
21
22
|
* @example
|
|
22
23
|
* // Initialize with custom config
|
|
23
|
-
* const
|
|
24
|
+
* const el = document.querySelector('.js-fade-slider');
|
|
25
|
+
* const slider = new Madj2kSimpleFadeSlider(el, {
|
|
24
26
|
* duration: 8,
|
|
25
27
|
* classSlide: 'fade-slider-item',
|
|
26
28
|
* classVisible: 'is-visible',
|
|
@@ -28,6 +30,12 @@
|
|
|
28
30
|
* });
|
|
29
31
|
*
|
|
30
32
|
* @example
|
|
33
|
+
* // Initialize multiple sliders with forEach
|
|
34
|
+
* document.querySelectorAll('.js-fade-slider').forEach((el) => {
|
|
35
|
+
* new Madj2kSimpleFadeSlider(el, { duration: 6 });
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
31
39
|
* // Example HTML
|
|
32
40
|
* <section class="fade-slider js-fade-slider" aria-label="Image gallery">
|
|
33
41
|
* <div class="fade-slider-item"><img src="img1.jpg" alt="Description 1"></div>
|
|
@@ -66,16 +74,20 @@ class Madj2kSimpleFadeSlider {
|
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
/**
|
|
69
|
-
* @param {
|
|
77
|
+
* @param {HTMLElement} container - DOM element for the slider container
|
|
70
78
|
* @param {Object} config - configuration options
|
|
71
79
|
* @param {number} [config.duration=12] - time in seconds between slide changes
|
|
72
|
-
* @param {string} [config.classSlide='fade-
|
|
80
|
+
* @param {string} [config.classSlide='fade-slider-item'] - class for each slide
|
|
73
81
|
* @param {string} [config.classVisible='is-visible'] - class for visible slide
|
|
74
82
|
* @param {boolean} [config.debug=false] - enable debug logging
|
|
75
83
|
*/
|
|
76
|
-
constructor(
|
|
77
|
-
|
|
78
|
-
|
|
84
|
+
constructor(container, config = {}) {
|
|
85
|
+
if (!(container instanceof HTMLElement)) {
|
|
86
|
+
console.warn('[Madj2kSimpleFadeSlider] No valid container element provided.');
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.container = container;
|
|
79
91
|
|
|
80
92
|
this.config = {
|
|
81
93
|
...this.config,
|