wagtail-cjkcms 24.2.7__py2.py3-none-any.whl → 25.1.6__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- cjkcms/.DS_Store +0 -0
- cjkcms/__init__.py +1 -1
- cjkcms/blocks/__init__.py +4 -0
- cjkcms/blocks/content/countdown.py +116 -0
- cjkcms/blocks/content_blocks.py +46 -9
- cjkcms/migrations/0018_layoutsettings_search_format.py +10 -5
- cjkcms/migrations/0019_layoutsettings_searchbox_input_class_and_more.py +28 -11
- cjkcms/migrations/0020_socialmediasettings_github_and_more.py +35 -0
- cjkcms/migrations/0021_remove_layoutsettings_navbar_color_scheme_and_more.py +85 -0
- cjkcms/migrations/0022_cjkcmspage_breadcrumb_label_and_more.py +23 -0
- cjkcms/migrations/0023_alter_navbar_language.py +18 -0
- cjkcms/models/admin_sidebar.py +0 -28
- cjkcms/models/page_models.py +33 -0
- cjkcms/models/snippet_models.py +22 -7
- cjkcms/models/wagtailsettings_models.py +61 -22
- cjkcms/settings.py +96 -64
- cjkcms/static/.DS_Store +0 -0
- cjkcms/static/cjkcms/css/cjkcms-custom-theme-disabled.css +73 -0
- cjkcms/static/cjkcms/css/cjkcms-front.css +41 -5
- cjkcms/static/cjkcms/js/cjkcms-front.js +2 -2
- cjkcms/static/vendor/.DS_Store +0 -0
- cjkcms/static/vendor/mdb/.DS_Store +0 -0
- cjkcms/static/vendor/mdb/css/.DS_Store +0 -0
- cjkcms/static/vendor/mdb/css/mdb.min.css +18 -0
- cjkcms/static/vendor/mdb/css/mdb.min.css.map +1 -0
- cjkcms/static/vendor/mdb/js/.DS_Store +0 -0
- cjkcms/static/vendor/mdb/js/mdb.umd.min.js +21 -0
- cjkcms/static/vendor/mdb/js/mdb.umd.min.js.map +1 -0
- cjkcms/static/vendor/simplycountdown/css/circle.css +73 -0
- cjkcms/static/vendor/simplycountdown/css/cyber.css +155 -0
- cjkcms/static/vendor/simplycountdown/css/dark.css +85 -0
- cjkcms/static/vendor/simplycountdown/css/light.css +85 -0
- cjkcms/static/vendor/simplycountdown/css/losange.css +83 -0
- cjkcms/static/vendor/simplycountdown/js/simplyCountdown.umd.js +2 -0
- cjkcms/static/vendor/simplycountdown/js/simplyCountdown.umd.js.map +1 -0
- cjkcms/templates/.DS_Store +0 -0
- cjkcms/templates/404.html +72 -104
- cjkcms/templates/cjkcms/.DS_Store +0 -0
- cjkcms/templates/cjkcms/blocks/base_link_block.html +48 -51
- cjkcms/templates/cjkcms/blocks/button_block.html +2 -2
- cjkcms/templates/cjkcms/blocks/card_landing1.html +2 -2
- cjkcms/templates/cjkcms/blocks/card_landing2.html +3 -3
- cjkcms/templates/cjkcms/blocks/countdown.html +24 -0
- cjkcms/templates/cjkcms/blocks/highlight_block.html +21 -0
- cjkcms/templates/cjkcms/blocks/pricelistitem_block.html +9 -5
- cjkcms/templates/cjkcms/pages/base.html +3 -3
- cjkcms/templates/cjkcms/pages/page.mini.html +1 -1
- cjkcms/templates/cjkcms/pages/search.html +10 -1
- cjkcms/templates/cjkcms/robots.txt +0 -4
- cjkcms/templates/cjkcms/snippets/breadcrumbs.html +2 -2
- cjkcms/templates/cjkcms/snippets/frontend_assets.html +9 -1
- cjkcms/templates/cjkcms/snippets/navbar.html +12 -9
- cjkcms/templates/cjkcms/snippets/navbar_search.html +6 -35
- cjkcms/templates/cjkcms/snippets/navbar_search_modal.html +34 -0
- cjkcms/templates/cjkcms/snippets/social_media_icons.html +20 -6
- cjkcms/templatetags/cjkcms_tags.py +80 -17
- cjkcms/tests/media/images/test_O3GLriA.original.png +0 -0
- cjkcms/tests/media/original_images/test_O3GLriA.png +0 -0
- cjkcms/tests/test_countdown_block.py +100 -0
- cjkcms/tests/test_search_blocks.py +10 -10
- cjkcms/tests/test_templatetags.py +19 -1
- cjkcms/tests/test_urls.py +8 -6
- cjkcms/urls.py +3 -0
- cjkcms/views.py +80 -78
- cjkcms/wagtail_hooks.py +37 -5
- {wagtail_cjkcms-24.2.7.dist-info → wagtail_cjkcms-25.1.6.dist-info}/METADATA +6 -6
- {wagtail_cjkcms-24.2.7.dist-info → wagtail_cjkcms-25.1.6.dist-info}/RECORD +71 -40
- {wagtail_cjkcms-24.2.7.dist-info → wagtail_cjkcms-25.1.6.dist-info}/WHEEL +1 -1
- {wagtail_cjkcms-24.2.7.dist-info → wagtail_cjkcms-25.1.6.dist-info}/LICENSE +0 -0
- {wagtail_cjkcms-24.2.7.dist-info → wagtail_cjkcms-25.1.6.dist-info}/entry_points.txt +0 -0
- {wagtail_cjkcms-24.2.7.dist-info → wagtail_cjkcms-25.1.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
.simply-countdown-circle {
|
2
|
+
--sc-circle-primary: #6366f1;
|
3
|
+
--sc-circle-secondary: #818cf8;
|
4
|
+
--sc-circle-bg: #1e1b4b;
|
5
|
+
--sc-circle-text: #fff;
|
6
|
+
|
7
|
+
display: flex;
|
8
|
+
flex-wrap: wrap;
|
9
|
+
justify-content: center;
|
10
|
+
gap: 1.5rem;
|
11
|
+
font-family: "Inter", sans-serif;
|
12
|
+
}
|
13
|
+
|
14
|
+
.simply-countdown-circle > .simply-section {
|
15
|
+
position: relative;
|
16
|
+
width: 100px;
|
17
|
+
height: 100px;
|
18
|
+
padding: 1rem;
|
19
|
+
display: flex;
|
20
|
+
align-items: center;
|
21
|
+
justify-content: center;
|
22
|
+
flex-direction: column;
|
23
|
+
border-radius: 50%;
|
24
|
+
background: linear-gradient(45deg, var(--sc-circle-primary), var(--sc-circle-secondary));
|
25
|
+
box-shadow: 0 0 25px -5px var(--sc-circle-primary);
|
26
|
+
animation: pulse-circle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
27
|
+
}
|
28
|
+
|
29
|
+
.simply-countdown-circle > .simply-section::before {
|
30
|
+
content: "";
|
31
|
+
position: absolute;
|
32
|
+
inset: 6px;
|
33
|
+
border-radius: 50%;
|
34
|
+
background: var(--sc-circle-bg);
|
35
|
+
z-index: 0;
|
36
|
+
}
|
37
|
+
|
38
|
+
.simply-countdown-circle > .simply-section > div {
|
39
|
+
position: relative;
|
40
|
+
z-index: 1;
|
41
|
+
color: var(--sc-circle-text);
|
42
|
+
text-align: center;
|
43
|
+
}
|
44
|
+
|
45
|
+
.simply-countdown-circle .simply-amount {
|
46
|
+
display: block;
|
47
|
+
font-size: 1.75rem;
|
48
|
+
font-weight: 700;
|
49
|
+
line-height: 1;
|
50
|
+
background: linear-gradient(to right, var(--sc-circle-primary), var(--sc-circle-secondary));
|
51
|
+
-webkit-background-clip: text;
|
52
|
+
background-clip: text;
|
53
|
+
-webkit-text-fill-color: transparent;
|
54
|
+
}
|
55
|
+
|
56
|
+
.simply-countdown-circle .simply-word {
|
57
|
+
font-size: 0.7rem;
|
58
|
+
text-transform: uppercase;
|
59
|
+
letter-spacing: 0.05em;
|
60
|
+
opacity: 0.8;
|
61
|
+
}
|
62
|
+
|
63
|
+
@keyframes pulse-circle {
|
64
|
+
0%,
|
65
|
+
100% {
|
66
|
+
transform: scale(1);
|
67
|
+
opacity: 1;
|
68
|
+
}
|
69
|
+
50% {
|
70
|
+
transform: scale(0.98);
|
71
|
+
opacity: 0.9;
|
72
|
+
}
|
73
|
+
}
|
@@ -0,0 +1,155 @@
|
|
1
|
+
/**
|
2
|
+
* Project : simply-countdown
|
3
|
+
* File : simplyCountdown.theme.cyberpunk
|
4
|
+
* Author : Vincent Loy <vincent.loy1@gmail.com>
|
5
|
+
* Theme : Modern Cyberpunk
|
6
|
+
*/
|
7
|
+
|
8
|
+
.simply-countdown-cyber {
|
9
|
+
overflow: visible;
|
10
|
+
display: flex;
|
11
|
+
flex-wrap: wrap;
|
12
|
+
justify-content: center;
|
13
|
+
gap: 1.75rem;
|
14
|
+
font-family: "Inter", system-ui, -apple-system, sans-serif;
|
15
|
+
perspective: 1000px;
|
16
|
+
}
|
17
|
+
|
18
|
+
.simply-countdown-cyber > .simply-section {
|
19
|
+
width: 70px;
|
20
|
+
height: 70px;
|
21
|
+
padding: 1.5rem;
|
22
|
+
position: relative;
|
23
|
+
display: flex;
|
24
|
+
align-items: center;
|
25
|
+
justify-content: center;
|
26
|
+
background: linear-gradient(135deg, rgba(23, 25, 35, 0.9), rgba(15, 17, 25, 0.95));
|
27
|
+
border-radius: 0.5rem;
|
28
|
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
29
|
+
backdrop-filter: blur(12px);
|
30
|
+
transform-style: preserve-3d;
|
31
|
+
}
|
32
|
+
|
33
|
+
.simply-countdown-cyber > .simply-section::before {
|
34
|
+
content: "";
|
35
|
+
position: absolute;
|
36
|
+
inset: -1px;
|
37
|
+
background: linear-gradient(135deg, rgba(120, 240, 255, 0.2), rgba(255, 90, 220, 0.2));
|
38
|
+
border-radius: 0.5rem;
|
39
|
+
z-index: -1;
|
40
|
+
opacity: 0;
|
41
|
+
transition: opacity 0.3s ease;
|
42
|
+
}
|
43
|
+
|
44
|
+
.simply-countdown-cyber > .simply-section::after {
|
45
|
+
content: "";
|
46
|
+
position: absolute;
|
47
|
+
inset: -2px;
|
48
|
+
background: linear-gradient(135deg, #78f0ff, #ff5adc);
|
49
|
+
border-radius: 0.5rem;
|
50
|
+
z-index: -2;
|
51
|
+
opacity: 0.15;
|
52
|
+
filter: blur(4px);
|
53
|
+
animation: pulse 4s ease-in-out infinite;
|
54
|
+
}
|
55
|
+
|
56
|
+
.simply-countdown-cyber > .simply-section .glass-overlay {
|
57
|
+
position: absolute;
|
58
|
+
inset: 0;
|
59
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
|
60
|
+
border-radius: 0.5rem;
|
61
|
+
}
|
62
|
+
|
63
|
+
.simply-countdown-cyber > .simply-section:hover {
|
64
|
+
transform: translateY(-4px) translateZ(10px) rotateX(5deg);
|
65
|
+
box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(120, 240, 255, 0.2), 0 0 0 1px rgba(120, 240, 255, 0.1);
|
66
|
+
}
|
67
|
+
|
68
|
+
.simply-countdown-cyber > .simply-section:hover::before {
|
69
|
+
opacity: 1;
|
70
|
+
}
|
71
|
+
|
72
|
+
.simply-countdown-cyber > .simply-section > div {
|
73
|
+
display: flex;
|
74
|
+
flex-direction: column;
|
75
|
+
gap: 0.4rem;
|
76
|
+
align-items: center;
|
77
|
+
transform-style: preserve-3d;
|
78
|
+
}
|
79
|
+
|
80
|
+
.simply-countdown-cyber > .simply-section .simply-amount {
|
81
|
+
font-size: 1.75rem;
|
82
|
+
font-weight: 700;
|
83
|
+
background: linear-gradient(to bottom right, #78f0ff, #ff5adc);
|
84
|
+
-webkit-background-clip: text;
|
85
|
+
background-clip: text;
|
86
|
+
color: transparent;
|
87
|
+
text-shadow: 0 0 20px rgba(120, 240, 255, 0.3), 0 0 40px rgba(120, 240, 255, 0.2);
|
88
|
+
letter-spacing: -0.02em;
|
89
|
+
transform: translateZ(10px);
|
90
|
+
}
|
91
|
+
|
92
|
+
.simply-countdown-cyber > .simply-section .simply-word {
|
93
|
+
font-size: 0.6rem;
|
94
|
+
font-weight: 500;
|
95
|
+
text-transform: uppercase;
|
96
|
+
letter-spacing: 0.2em;
|
97
|
+
color: rgba(255, 255, 255, 0.7);
|
98
|
+
transform: translateZ(5px);
|
99
|
+
position: relative;
|
100
|
+
}
|
101
|
+
|
102
|
+
.simply-countdown-cyber > .simply-section .simply-word::after {
|
103
|
+
content: "";
|
104
|
+
position: absolute;
|
105
|
+
left: -10%;
|
106
|
+
bottom: -4px;
|
107
|
+
width: 120%;
|
108
|
+
height: 1px;
|
109
|
+
background: linear-gradient(to right, rgba(120, 240, 255, 0), rgba(120, 240, 255, 0.5), rgba(255, 90, 220, 0.5), rgba(255, 90, 220, 0));
|
110
|
+
}
|
111
|
+
|
112
|
+
@media (min-width: 640px) {
|
113
|
+
.simply-countdown-cyber > .simply-section {
|
114
|
+
width: 80px;
|
115
|
+
height: 80px;
|
116
|
+
padding: 1.75rem;
|
117
|
+
}
|
118
|
+
|
119
|
+
.simply-countdown-cyber > .simply-section .simply-amount {
|
120
|
+
font-size: 2rem;
|
121
|
+
}
|
122
|
+
|
123
|
+
.simply-countdown-cyber > .simply-section .simply-word {
|
124
|
+
font-size: 0.75rem;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
@media (min-width: 1024px) {
|
129
|
+
.simply-countdown-cyber > .simply-section {
|
130
|
+
width: 100px;
|
131
|
+
height: 100px;
|
132
|
+
padding: 2rem;
|
133
|
+
}
|
134
|
+
|
135
|
+
.simply-countdown-cyber > .simply-section .simply-amount {
|
136
|
+
font-size: 2.5rem;
|
137
|
+
}
|
138
|
+
|
139
|
+
.simply-countdown-cyber > .simply-section .simply-word {
|
140
|
+
font-size: 0.8rem;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
/* Add subtle animation for extra futuristic feel */
|
145
|
+
@keyframes pulse {
|
146
|
+
0%,
|
147
|
+
100% {
|
148
|
+
opacity: 0.15;
|
149
|
+
transform: scale(1);
|
150
|
+
}
|
151
|
+
50% {
|
152
|
+
opacity: 0.25;
|
153
|
+
transform: scale(1.05);
|
154
|
+
}
|
155
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/**
|
2
|
+
* Project : simply-countdown
|
3
|
+
* File : simplyCountdown.theme.dark
|
4
|
+
* Author : Vincent Loy <vincent.loy1@gmail.com>
|
5
|
+
* Theme : Dark Modern
|
6
|
+
*/
|
7
|
+
|
8
|
+
.simply-countdown-dark {
|
9
|
+
overflow: hidden;
|
10
|
+
display: flex;
|
11
|
+
flex-wrap: wrap;
|
12
|
+
justify-content: center;
|
13
|
+
gap: 1.25rem;
|
14
|
+
font-family: "Inter", system-ui, -apple-system, sans-serif;
|
15
|
+
}
|
16
|
+
|
17
|
+
.simply-countdown-dark > .simply-section {
|
18
|
+
width: 65px;
|
19
|
+
height: 65px;
|
20
|
+
padding: 1.5rem;
|
21
|
+
display: flex;
|
22
|
+
align-items: center;
|
23
|
+
justify-content: center;
|
24
|
+
background: rgba(15, 23, 42, 0.75);
|
25
|
+
border: 1px solid rgba(51, 65, 85, 0.6);
|
26
|
+
border-radius: 1rem;
|
27
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05);
|
28
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
29
|
+
backdrop-filter: blur(10px);
|
30
|
+
}
|
31
|
+
|
32
|
+
.simply-countdown-dark > .simply-section > div {
|
33
|
+
display: flex;
|
34
|
+
flex-direction: column;
|
35
|
+
line-height: 1;
|
36
|
+
align-items: center;
|
37
|
+
}
|
38
|
+
|
39
|
+
.simply-countdown-dark > .simply-section .simply-amount {
|
40
|
+
font-size: 1.5rem;
|
41
|
+
font-weight: 700;
|
42
|
+
color: #f1f5f9;
|
43
|
+
line-height: 1.2;
|
44
|
+
letter-spacing: -0.025em;
|
45
|
+
}
|
46
|
+
|
47
|
+
.simply-countdown-dark > .simply-section .simply-word {
|
48
|
+
font-size: 0.6rem;
|
49
|
+
font-weight: 500;
|
50
|
+
color: #94a3b8;
|
51
|
+
text-transform: uppercase;
|
52
|
+
letter-spacing: 0.1em;
|
53
|
+
}
|
54
|
+
|
55
|
+
@media (min-width: 640px) {
|
56
|
+
.simply-countdown-dark > .simply-section {
|
57
|
+
width: 75px;
|
58
|
+
height: 75px;
|
59
|
+
padding: 1.75rem;
|
60
|
+
}
|
61
|
+
|
62
|
+
.simply-countdown-dark > .simply-section .simply-amount {
|
63
|
+
font-size: 1.75rem;
|
64
|
+
}
|
65
|
+
|
66
|
+
.simply-countdown-dark > .simply-section .simply-word {
|
67
|
+
font-size: 0.75rem;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
@media (min-width: 1024px) {
|
72
|
+
.simply-countdown-dark > .simply-section {
|
73
|
+
width: 90px;
|
74
|
+
height: 90px;
|
75
|
+
padding: 2rem;
|
76
|
+
}
|
77
|
+
|
78
|
+
.simply-countdown-dark > .simply-section .simply-amount {
|
79
|
+
font-size: 2rem;
|
80
|
+
}
|
81
|
+
|
82
|
+
.simply-countdown-dark > .simply-section .simply-word {
|
83
|
+
font-size: 0.8rem;
|
84
|
+
}
|
85
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/**
|
2
|
+
* Project : simply-countdown
|
3
|
+
* File : simplyCountdown.theme.default
|
4
|
+
* Author : Vincent Loy <vincent.loy1@gmail.com>
|
5
|
+
* Theme : Light Modern
|
6
|
+
*/
|
7
|
+
|
8
|
+
.simply-countdown-light {
|
9
|
+
overflow: hidden;
|
10
|
+
display: flex;
|
11
|
+
flex-wrap: wrap;
|
12
|
+
justify-content: center;
|
13
|
+
gap: 1.25rem;
|
14
|
+
font-family: "Inter", system-ui, -apple-system, sans-serif;
|
15
|
+
}
|
16
|
+
|
17
|
+
.simply-countdown-light > .simply-section {
|
18
|
+
width: 65px;
|
19
|
+
height: 65px;
|
20
|
+
padding: 1.5rem;
|
21
|
+
display: flex;
|
22
|
+
align-items: center;
|
23
|
+
justify-content: center;
|
24
|
+
background: rgba(255, 255, 255, 0.9);
|
25
|
+
border: 1px solid rgba(226, 232, 240, 0.8);
|
26
|
+
border-radius: 1rem;
|
27
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03), 0 0 0 1px rgba(0, 0, 0, 0.02);
|
28
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
29
|
+
backdrop-filter: blur(10px);
|
30
|
+
}
|
31
|
+
|
32
|
+
.simply-countdown-light > .simply-section > div {
|
33
|
+
display: flex;
|
34
|
+
flex-direction: column;
|
35
|
+
line-height: 1;
|
36
|
+
align-items: center;
|
37
|
+
}
|
38
|
+
|
39
|
+
.simply-countdown-light > .simply-section .simply-amount {
|
40
|
+
font-size: 1.5rem;
|
41
|
+
font-weight: 700;
|
42
|
+
color: #1e293b;
|
43
|
+
line-height: 1.2;
|
44
|
+
letter-spacing: -0.025em;
|
45
|
+
}
|
46
|
+
|
47
|
+
.simply-countdown-light > .simply-section .simply-word {
|
48
|
+
font-size: 0.6rem;
|
49
|
+
font-weight: 500;
|
50
|
+
color: #64748b;
|
51
|
+
text-transform: uppercase;
|
52
|
+
letter-spacing: 0.1em;
|
53
|
+
}
|
54
|
+
|
55
|
+
@media (min-width: 640px) {
|
56
|
+
.simply-countdown-light > .simply-section {
|
57
|
+
width: 75px;
|
58
|
+
height: 75px;
|
59
|
+
padding: 1.75rem;
|
60
|
+
}
|
61
|
+
|
62
|
+
.simply-countdown-light > .simply-section .simply-amount {
|
63
|
+
font-size: 1.75rem;
|
64
|
+
}
|
65
|
+
|
66
|
+
.simply-countdown-light > .simply-section .simply-word {
|
67
|
+
font-size: 0.75rem;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
@media (min-width: 1024px) {
|
72
|
+
.simply-countdown-light > .simply-section {
|
73
|
+
width: 90px;
|
74
|
+
height: 90px;
|
75
|
+
padding: 2rem;
|
76
|
+
}
|
77
|
+
|
78
|
+
.simply-countdown-light > .simply-section .simply-amount {
|
79
|
+
font-size: 2rem;
|
80
|
+
}
|
81
|
+
|
82
|
+
.simply-countdown-light > .simply-section .simply-word {
|
83
|
+
font-size: 0.8rem;
|
84
|
+
}
|
85
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* Project : simply-countdown
|
3
|
+
* File : simplyCountdown.theme.losange
|
4
|
+
* Author : Vincent Loy <vincent.loy1@gmail.com>
|
5
|
+
*/
|
6
|
+
|
7
|
+
.simply-countdown-losange {
|
8
|
+
overflow: visible;
|
9
|
+
display: flex;
|
10
|
+
flex-wrap: wrap;
|
11
|
+
justify-content: center;
|
12
|
+
gap: 3rem;
|
13
|
+
font-family: "Inter", sans-serif;
|
14
|
+
}
|
15
|
+
|
16
|
+
.simply-countdown-losange > .simply-section {
|
17
|
+
width: 70px;
|
18
|
+
height: 70px;
|
19
|
+
display: flex;
|
20
|
+
justify-content: center;
|
21
|
+
align-items: center;
|
22
|
+
transform: rotate(-45deg);
|
23
|
+
background: linear-gradient(135deg, #4f46e5, #7c3aed);
|
24
|
+
border-radius: 0.5rem;
|
25
|
+
transition: all 0.2s ease-in-out;
|
26
|
+
}
|
27
|
+
|
28
|
+
.simply-countdown-losange > .simply-section > div {
|
29
|
+
transform: rotate(45deg);
|
30
|
+
display: flex;
|
31
|
+
flex-direction: column;
|
32
|
+
line-height: 1.2;
|
33
|
+
}
|
34
|
+
|
35
|
+
.simply-countdown-losange > .simply-section .simply-amount,
|
36
|
+
.simply-countdown-losange > .simply-section .simply-word {
|
37
|
+
display: block;
|
38
|
+
text-align: center;
|
39
|
+
}
|
40
|
+
|
41
|
+
.simply-countdown-losange > .simply-section .simply-amount {
|
42
|
+
font-size: 1.25rem;
|
43
|
+
font-weight: 700;
|
44
|
+
color: #fff;
|
45
|
+
}
|
46
|
+
|
47
|
+
.simply-countdown-losange > .simply-section .simply-word {
|
48
|
+
font-size: 0.65rem;
|
49
|
+
font-weight: 500;
|
50
|
+
color: rgba(255, 255, 255, 0.9);
|
51
|
+
text-transform: uppercase;
|
52
|
+
letter-spacing: 0.05em;
|
53
|
+
}
|
54
|
+
|
55
|
+
@media (min-width: 640px) {
|
56
|
+
.simply-countdown-losange > .simply-section {
|
57
|
+
width: 80px;
|
58
|
+
height: 80px;
|
59
|
+
}
|
60
|
+
|
61
|
+
.simply-countdown-losange > .simply-section .simply-amount {
|
62
|
+
font-size: 1.5rem;
|
63
|
+
}
|
64
|
+
|
65
|
+
.simply-countdown-losange > .simply-section .simply-word {
|
66
|
+
font-size: 0.7rem;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
@media (min-width: 1024px) {
|
71
|
+
.simply-countdown-losange > .simply-section {
|
72
|
+
width: 90px;
|
73
|
+
height: 90px;
|
74
|
+
}
|
75
|
+
|
76
|
+
.simply-countdown-losange > .simply-section .simply-amount {
|
77
|
+
font-size: 1.75rem;
|
78
|
+
}
|
79
|
+
|
80
|
+
.simply-countdown-losange > .simply-section .simply-word {
|
81
|
+
font-size: 0.75rem;
|
82
|
+
}
|
83
|
+
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define("simplyCountdown",n):(e="undefined"!=typeof globalThis?globalThis:e||self).simplyCountdown=n()}(this,(function(){"use strict";const e=(e,n,t,o,s,a)=>{const l=document.createElement("div");l.className=`${e} ${a.sectionClass}`;const r=document.createElement("div"),d=document.createElement("span"),i=document.createElement("span");return d.className=`${n} ${a.amountClass}`,i.className=`${t} ${a.wordClass}`,d.textContent=String(o),i.textContent=s,r.appendChild(d),r.appendChild(i),l.appendChild(r),l},n={year:2024,month:12,day:25,hours:0,minutes:0,seconds:0,words:{days:{lambda:(e,n)=>n>1?e+"s":e,root:"day"},hours:{lambda:(e,n)=>n>1?e+"s":e,root:"hour"},minutes:{lambda:(e,n)=>n>1?e+"s":e,root:"minute"},seconds:{lambda:(e,n)=>n>1?e+"s":e,root:"second"}},plural:!0,inline:!1,inlineSeparator:", ",enableUtc:!1,onEnd:()=>{},refresh:1e3,inlineClass:"simply-countdown-inline",sectionClass:"simply-section",amountClass:"simply-amount",wordClass:"simply-word",zeroPad:!1,countUp:!1,removeZeroUnits:!1,onStop:()=>{},onResume:()=>{},onUpdate:()=>{}};function t(e,n,t){return!t.removeZeroUnits||(0!==e.value||n.some((e=>0!==e.value)))}function o(e,n,o){const s=e.filter(((o,s)=>t(o,e.slice(0,s),n))).map((e=>function(e,n){return`${n.zeroPad?String(e.value).padStart(2,"0"):e.value} ${n.words[e.word].lambda(n.words[e.word].root,e.value)}`}(e,n))).join(n.inlineSeparator);o.innerHTML=s}function s(e,n,o){e.forEach(((s,a)=>{"seconds"===s.word||t(s,e.slice(0,a),n)?(((e,n,t)=>{const o=e.querySelector(".simply-amount"),s=e.querySelector(".simply-word");o&&(o.textContent=String(n)),s&&(s.textContent=t)})(o[s.word],n.zeroPad?String(s.value).padStart(2,"0"):s.value,n.words[s.word].lambda(n.words[s.word].root,s.value)),o[s.word].style.display=""):o[s.word].style.display="none"}))}const a=(n,t)=>{let a={isPaused:!1,interval:null,targetDate:new Date};const l=e=>e.enableUtc?new Date(Date.UTC(e.year,e.month-1,e.day,e.hours,e.minutes,e.seconds)):new Date(e.year,e.month-1,e.day,e.hours,e.minutes,e.seconds);a.targetDate=l(t);let r=null;t.inline&&(r=document.createElement("span"),r.className=t.inlineClass,n.appendChild(r));const d=t.inline?null:((n,t)=>{const o="simply-amount",s="simply-word",a=e("simply-section simply-days-section",o,s,0,"day",t),l=e("simply-section simply-hours-section",o,s,0,"hour",t),r=e("simply-section simply-minutes-section",o,s,0,"minute",t),d=e("simply-section simply-seconds-section",o,s,0,"second",t);return n.appendChild(a),n.appendChild(l),n.appendChild(r),n.appendChild(d),{days:a,hours:l,minutes:r,seconds:d}})(n,{sectionClass:t.sectionClass,amountClass:t.amountClass,wordClass:t.wordClass}),i=()=>{const e=t.enableUtc?new Date(Date.UTC((new Date).getUTCFullYear(),(new Date).getUTCMonth(),(new Date).getUTCDate(),(new Date).getUTCHours(),(new Date).getUTCMinutes(),(new Date).getUTCSeconds())):new Date;let n=t.countUp?e.getTime()-a.targetDate.getTime():a.targetDate.getTime()-e.getTime();n<=0&&!t.countUp&&(n=0,null!==a.interval&&clearInterval(a.interval),t.onEnd&&t.onEnd());const l=Math.floor(n/864e5);n-=1e3*l*60*60*24;const i=Math.floor(n/36e5);n-=1e3*i*60*60;const u=Math.floor(n/6e4);n-=1e3*u*60;const c=Math.floor(n/1e3);if(t.inline&&r){o([{value:l,word:"days"},{value:i,word:"hours"},{value:u,word:"minutes"},{value:c,word:"seconds"}],t,r)}else if(d){s([{value:l,word:"days"},{value:i,word:"hours"},{value:u,word:"minutes"},{value:c,word:"seconds"}],t,d)}},u=()=>{a.interval=setInterval(i,t.refresh),i()};u();const c=new MutationObserver((e=>{e.forEach((e=>{e.removedNodes.forEach((e=>{e===n&&(null!==a.interval&&clearInterval(a.interval),c.disconnect())}))}))}));return n.parentNode&&c.observe(n.parentNode,{childList:!0}),{stopCountdown:()=>{var e;null!==a.interval&&(clearInterval(a.interval),a.interval=null),a.isPaused=!0,null==(e=t.onStop)||e.call(t)},resumeCountdown:()=>{var e;a.isPaused&&(u(),a.isPaused=!1,null==(e=t.onResume)||e.call(t))},updateCountdown:e=>{var n;Object.assign(t,e),void 0===e.year&&void 0===e.month&&void 0===e.day&&void 0===e.hours&&void 0===e.minutes&&void 0===e.seconds||(a.targetDate=l(t)),null==(n=t.onUpdate)||n.call(t,e),a.isPaused||(a.interval&&clearInterval(a.interval),u())},getState:()=>({...a})}},l=e=>{const n=e;return n.stopCountdown=()=>e.forEach((e=>e.stopCountdown())),n.resumeCountdown=()=>e.forEach((e=>e.resumeCountdown())),n.updateCountdown=n=>e.forEach((e=>e.updateCountdown(n))),n.getState=()=>e.map((e=>e.getState())),n},r=(e,t=n)=>{const o={...n,...t};if("string"==typeof e){const n=document.querySelectorAll(e),t=Array.from(n).map((e=>a(e,o)));return 1===t.length?t[0]:l(t)}if((e=>e instanceof NodeList)(e)){const n=Array.from(e).map((e=>a(e,o)));return 1===n.length?n[0]:l(n)}return a(e,o)};return"function"==typeof define&&define.amd?define((function(){return r})):"object"==typeof module&&module.exports?module.exports=r:window.simplyCountdown=r,r}));
|
2
|
+
//# sourceMappingURL=simplyCountdown.umd.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"simplyCountdown.umd.js","sources":["../src/core/dom.ts","../src/core/simplyCountdown.ts","../src/core/simplyCountdown.umd.ts"],"sourcesContent":["/**\n * Creates a countdown section element\n */\nexport const createCountdownSection = (\n sectionClass: string,\n amountClass: string,\n wordClass: string,\n amount: number,\n word: string,\n params: {\n sectionClass: string;\n amountClass: string;\n wordClass: string;\n }\n): HTMLElement => {\n const section = document.createElement(\"div\");\n section.className = `${sectionClass} ${params.sectionClass}`;\n\n const wrap = document.createElement(\"div\");\n const amount_elem = document.createElement(\"span\");\n const word_elem = document.createElement(\"span\");\n\n amount_elem.className = `${amountClass} ${params.amountClass}`;\n word_elem.className = `${wordClass} ${params.wordClass}`;\n\n amount_elem.textContent = String(amount);\n word_elem.textContent = word;\n\n wrap.appendChild(amount_elem);\n wrap.appendChild(word_elem);\n section.appendChild(wrap);\n\n return section;\n};\n\n/**\n * Retrieves a countdown section element from a container\n */\nexport const getCountdownSection = (sectionClass: string, container: HTMLElement): HTMLElement | null => {\n return container.querySelector(`.simply-section.${sectionClass}`);\n};\n\n/**\n * Updates a countdown section element\n */\nexport const updateCountdownSection = (section: HTMLElement, amount: number | string, word: string): void => {\n const amountElement = section.querySelector(\".simply-amount\");\n const wordElement = section.querySelector(\".simply-word\");\n\n if (amountElement) {\n amountElement.textContent = String(amount);\n }\n if (wordElement) {\n wordElement.textContent = word;\n }\n};\n\n/**\n * Creates all countdown elements\n */\nexport const createCountdown = (\n container: HTMLElement,\n params: {\n sectionClass: string;\n amountClass: string;\n wordClass: string;\n }\n): {\n days: HTMLElement;\n hours: HTMLElement;\n minutes: HTMLElement;\n seconds: HTMLElement;\n} => {\n const amountCls = \"simply-amount\";\n const wordCls = \"simply-word\";\n\n const days = createCountdownSection(\"simply-section simply-days-section\", amountCls, wordCls, 0, \"day\", params);\n const hours = createCountdownSection(\"simply-section simply-hours-section\", amountCls, wordCls, 0, \"hour\", params);\n const minutes = createCountdownSection(\"simply-section simply-minutes-section\", amountCls, wordCls, 0, \"minute\", params);\n const seconds = createCountdownSection(\"simply-section simply-seconds-section\", amountCls, wordCls, 0, \"second\", params);\n\n container.appendChild(days);\n container.appendChild(hours);\n container.appendChild(minutes);\n container.appendChild(seconds);\n\n return {\n days,\n hours,\n minutes,\n seconds,\n };\n};\n","/*!\n * Project : simplyCountdown.js\n * Date : __SCD_BUILD_DATE__\n * License : MIT\n * Version : __SCD_VERSION__\n * Author : Vincent Loy-Serre\n * Contributors :\n * - Justin Beasley\n * - Nathan Smith\n * - Mehdi Rezaei\n * - mira01\n */\n\nimport type { CountdownParameters, CountdownSelector, CountdownState, CountdownController, CountdownControllerArray } from \"../types\";\nimport { createCountdown, updateCountdownSection } from \"./dom\";\n\nconst defaultParams: CountdownParameters = {\n year: 2024,\n month: 12,\n day: 25,\n hours: 0,\n minutes: 0,\n seconds: 0,\n words: {\n days: { lambda: (root, n) => (n > 1 ? root + \"s\" : root), root: \"day\" },\n hours: { lambda: (root, n) => (n > 1 ? root + \"s\" : root), root: \"hour\" },\n minutes: { lambda: (root, n) => (n > 1 ? root + \"s\" : root), root: \"minute\" },\n seconds: { lambda: (root, n) => (n > 1 ? root + \"s\" : root), root: \"second\" },\n },\n plural: true,\n inline: false,\n inlineSeparator: \", \",\n enableUtc: false,\n onEnd: () => {},\n refresh: 1000,\n inlineClass: \"simply-countdown-inline\",\n sectionClass: \"simply-section\",\n amountClass: \"simply-amount\",\n wordClass: \"simply-word\",\n zeroPad: false,\n countUp: false,\n removeZeroUnits: false,\n onStop: () => {},\n onResume: () => {},\n onUpdate: () => {},\n};\n\nconst isNodeList = (element: CountdownSelector): element is NodeListOf<HTMLElement> => {\n return element instanceof NodeList;\n};\n\ninterface TimeUnit {\n value: number;\n word: keyof CountdownParameters[\"words\"];\n element?: HTMLElement;\n}\n\n/**\n * Formats a time unit with optional zero padding and pluralization\n * @param unit - The time unit object containing value and word properties\n * @param params - The countdown parameters containing formatting options and word definitions\n * @returns A formatted string containing the value and pluralized word for the time unit\n * @example\n * // With zeroPad: true\n * formatTimeUnit({value: 5, word: 'days'}, params) // returns \"05 days\"\n * // With zeroPad: false\n * formatTimeUnit({value: 5, word: 'days'}, params) // returns \"5 days\"\n */\nfunction formatTimeUnit(unit: TimeUnit, params: CountdownParameters): string {\n const value = params.zeroPad ? String(unit.value).padStart(2, \"0\") : unit.value;\n return `${value} ${params.words[unit.word].lambda(params.words[unit.word].root, unit.value)}`;\n}\n\n/**\n * Determines whether a time unit should be displayed based on its value and the values of previous units\n * @param unit - The current time unit to evaluate\n * @param previousUnits - Array of time units that come before the current unit\n * @param params - Configuration parameters for the countdown\n * @returns True if the unit should be displayed, false otherwise\n *\n * If removeZeroUnits is false in params, always returns true.\n * Otherwise, returns true if either:\n * - The current unit value is not zero\n * - Any previous unit has a non-zero value\n */\nfunction shouldDisplay(unit: TimeUnit, previousUnits: TimeUnit[], params: CountdownParameters): boolean {\n if (!params.removeZeroUnits) return true;\n return unit.value !== 0 || previousUnits.some((u) => u.value !== 0);\n}\n\n/**\n * Displays the countdown timer inline within the specified HTML element.\n *\n * @param timeUnits - Array of time units containing values and labels for display\n * @param params - Configuration parameters for the countdown display\n * @param element - The HTML element where the countdown will be rendered\n *\n * @remarks\n * The function filters and formats time units based on display rules, then joins them with\n * the specified separator from params.inlineSeparator before setting the element's innerHTML.\n */\nfunction displayInline(timeUnits: TimeUnit[], params: CountdownParameters, element: HTMLElement): void {\n const displayStr = timeUnits\n .filter((unit, index) => shouldDisplay(unit, timeUnits.slice(0, index), params))\n .map((unit) => formatTimeUnit(unit as { value: number; word: keyof typeof params.words }, params))\n .join(params.inlineSeparator);\n\n element.innerHTML = displayStr;\n}\n\n/**\n * Updates the display of time units in the countdown based on their values and display conditions\n * @param timeUnits - Array of TimeUnit objects containing the time values and their corresponding words\n * @param params - Configuration parameters for the countdown display\n * @param countdown - DOM elements representing the countdown display sections\n * @returns void\n *\n * @remarks\n * This function iterates through each time unit and determines whether it should be shown based on:\n * - If it's the seconds unit (always shown)\n * - If it meets display criteria based on previous units\n *\n * For units that should be shown, it:\n * - Updates the display value (with optional zero padding)\n * - Updates the word label using the configured lambda function\n * - Shows the unit's DOM element\n *\n * For units that shouldn't be shown, it hides their DOM elements\n */\nfunction displayBlocks(timeUnits: TimeUnit[], params: CountdownParameters, countdown: any): void {\n timeUnits.forEach((unit, index) => {\n const shouldShow = unit.word === \"seconds\" || shouldDisplay(unit, timeUnits.slice(0, index), params);\n\n if (shouldShow) {\n updateCountdownSection(\n countdown[unit.word],\n params.zeroPad ? String(unit.value).padStart(2, \"0\") : unit.value,\n params.words[unit.word].lambda(params.words[unit.word].root, unit.value)\n );\n countdown[unit.word].style.display = \"\";\n } else {\n countdown[unit.word].style.display = \"none\";\n }\n });\n}\n\n/**\n * Creates a countdown instance that manages the countdown timer functionality.\n *\n * @param targetElement - The HTML element where the countdown will be rendered\n * @param parameters - Configuration parameters for the countdown\n *\n * @returns A controller object with methods to control the countdown:\n * - stopCountdown: Pauses the countdown and triggers onStop callback\n * - resumeCountdown: Resumes a paused countdown and triggers onResume callback\n * - updateCountdown: Updates countdown parameters and triggers onUpdate callback\n * - getState: Returns current state of the countdown\n */\nconst createCountdownInstance = (targetElement: HTMLElement, parameters: CountdownParameters): CountdownController => {\n let state: CountdownState = {\n isPaused: false,\n interval: null,\n targetDate: new Date(),\n };\n\n const getTargetDate = (params: CountdownParameters): Date => {\n return params.enableUtc\n ? new Date(Date.UTC(params.year, params.month - 1, params.day, params.hours, params.minutes, params.seconds))\n : new Date(params.year, params.month - 1, params.day, params.hours, params.minutes, params.seconds);\n };\n\n state.targetDate = getTargetDate(parameters);\n\n // Create span element for inline mode\n let inlineElement: HTMLElement | null = null;\n if (parameters.inline) {\n inlineElement = document.createElement(\"span\");\n inlineElement.className = parameters.inlineClass;\n targetElement.appendChild(inlineElement);\n }\n\n const countdown = parameters.inline\n ? null\n : createCountdown(targetElement, {\n sectionClass: parameters.sectionClass,\n amountClass: parameters.amountClass,\n wordClass: parameters.wordClass,\n });\n\n const refresh = () => {\n // Fix UTC current date handling\n const currentDate = parameters.enableUtc\n ? new Date(\n Date.UTC(\n new Date().getUTCFullYear(),\n new Date().getUTCMonth(),\n new Date().getUTCDate(),\n new Date().getUTCHours(),\n new Date().getUTCMinutes(),\n new Date().getUTCSeconds()\n )\n )\n : new Date();\n\n let diff = parameters.countUp ? currentDate.getTime() - state.targetDate.getTime() : state.targetDate.getTime() - currentDate.getTime();\n\n if (diff <= 0 && !parameters.countUp) {\n diff = 0;\n // Clear interval before calling onEnd to prevent multiple calls\n if (state.interval !== null) {\n clearInterval(state.interval);\n }\n\n if (parameters.onEnd) {\n parameters.onEnd();\n }\n }\n\n const days = Math.floor(diff / (1000 * 60 * 60 * 24));\n diff -= days * 1000 * 60 * 60 * 24;\n\n const hours = Math.floor(diff / (1000 * 60 * 60));\n diff -= hours * 1000 * 60 * 60;\n\n const minutes = Math.floor(diff / (1000 * 60));\n diff -= minutes * 1000 * 60;\n\n const seconds = Math.floor(diff / 1000);\n\n if (parameters.inline && inlineElement) {\n const timeUnits: TimeUnit[] = [\n { value: days, word: \"days\" as keyof CountdownParameters[\"words\"] },\n {\n value: hours,\n word: \"hours\" as keyof CountdownParameters[\"words\"],\n },\n {\n value: minutes,\n word: \"minutes\" as keyof CountdownParameters[\"words\"],\n },\n {\n value: seconds,\n word: \"seconds\" as keyof CountdownParameters[\"words\"],\n },\n ];\n displayInline(timeUnits, parameters, inlineElement);\n } else if (countdown) {\n const timeUnits: TimeUnit[] = [\n { value: days, word: \"days\" as keyof CountdownParameters[\"words\"] },\n {\n value: hours,\n word: \"hours\" as keyof CountdownParameters[\"words\"],\n },\n {\n value: minutes,\n word: \"minutes\" as keyof CountdownParameters[\"words\"],\n },\n {\n value: seconds,\n word: \"seconds\" as keyof CountdownParameters[\"words\"],\n },\n ];\n displayBlocks(timeUnits, parameters, countdown);\n }\n };\n\n const startInterval = () => {\n state.interval = setInterval(refresh, parameters.refresh);\n refresh();\n };\n\n const stopCountdown = () => {\n if (state.interval !== null) {\n clearInterval(state.interval);\n state.interval = null;\n }\n state.isPaused = true;\n parameters.onStop?.();\n };\n\n const resumeCountdown = () => {\n if (state.isPaused) {\n startInterval();\n state.isPaused = false;\n parameters.onResume?.();\n }\n };\n\n const updateCountdown = (newParams: Partial<CountdownParameters>) => {\n Object.assign(parameters, newParams);\n if (\n newParams.year !== undefined ||\n newParams.month !== undefined ||\n newParams.day !== undefined ||\n newParams.hours !== undefined ||\n newParams.minutes !== undefined ||\n newParams.seconds !== undefined\n ) {\n state.targetDate = getTargetDate(parameters);\n }\n\n parameters.onUpdate?.(newParams);\n\n if (!state.isPaused) {\n if (state.interval) {\n clearInterval(state.interval);\n }\n startInterval();\n }\n };\n\n const getState = () => ({ ...state });\n\n // Start the countdown\n startInterval();\n\n // Cleanup on element removal\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node === targetElement) {\n if (state.interval !== null) {\n clearInterval(state.interval);\n }\n observer.disconnect();\n }\n });\n });\n });\n\n if (targetElement.parentNode) {\n observer.observe(targetElement.parentNode, { childList: true });\n }\n\n // Return controller object\n return {\n stopCountdown,\n resumeCountdown,\n updateCountdown,\n getState,\n };\n};\n\n/**\n * Creates an enhanced array of countdown controllers with additional control methods.\n *\n * @param controllers - Array of individual countdown controllers to be combined\n * @returns An array of controllers enhanced with collective control methods:\n * - `stopCountdown()`: Stops all countdowns in the array\n * - `resumeCountdown()`: Resumes all countdowns in the array\n * - `updateCountdown(newParams)`: Updates all countdowns with new parameters\n * - `getState()`: Returns an array of states from all countdowns\n */\nconst createControllerArray = (controllers: CountdownController[]): CountdownControllerArray => {\n const array = controllers as CountdownControllerArray;\n\n array.stopCountdown = () => controllers.forEach((c) => c.stopCountdown());\n array.resumeCountdown = () => controllers.forEach((c) => c.resumeCountdown());\n array.updateCountdown = (newParams) => controllers.forEach((c) => c.updateCountdown(newParams));\n array.getState = () => controllers.map((c) => c.getState());\n\n return array;\n};\n\n/**\n * Creates a countdown timer on specified HTML elements\n * @param element - A CSS selector string, HTMLElement, or NodeList targeting the countdown container(s)\n * @param args - Optional configuration parameters for the countdown\n * @returns A CountdownController for single element or CountdownControllerArray for multiple elements\n */\nconst simplyCountdown = (\n element: CountdownSelector,\n args: Partial<CountdownParameters> = defaultParams\n): CountdownController | CountdownControllerArray => {\n const parameters: CountdownParameters = { ...defaultParams, ...args };\n\n if (typeof element === \"string\") {\n const elements = document.querySelectorAll<HTMLElement>(element);\n const controllers = Array.from(elements).map((el) => createCountdownInstance(el, parameters));\n return controllers.length === 1 ? controllers[0] : createControllerArray(controllers);\n }\n\n if (isNodeList(element)) {\n const controllers = Array.from(element).map((el) => createCountdownInstance(el, parameters));\n return controllers.length === 1 ? controllers[0] : createControllerArray(controllers);\n }\n\n return createCountdownInstance(element, parameters);\n};\n\nexport default simplyCountdown;\n","import simplyCountdownCore from \"./simplyCountdown\";\n\ndeclare const define: {\n (factory: () => any): void;\n amd: boolean;\n};\n\nif (typeof define === \"function\" && define.amd) {\n // AMD\n define(function () {\n return simplyCountdownCore;\n });\n} else if (typeof module === \"object\" && module.exports) {\n // Node\n module.exports = simplyCountdownCore;\n} else {\n // Browser\n (window as any).simplyCountdown = simplyCountdownCore;\n}\n\n// Export for Vite/Rollup\nexport default simplyCountdownCore;\n"],"names":["createCountdownSection","sectionClass","amountClass","wordClass","amount","word","params","section","document","createElement","className","wrap","amount_elem","word_elem","textContent","String","appendChild","defaultParams","year","month","day","hours","minutes","seconds","words","days","lambda","root","n","plural","inline","inlineSeparator","enableUtc","onEnd","refresh","inlineClass","zeroPad","countUp","removeZeroUnits","onStop","onResume","onUpdate","shouldDisplay","unit","previousUnits","value","some","u","displayInline","timeUnits","element","displayStr","filter","index","slice","map","padStart","formatTimeUnit","join","innerHTML","displayBlocks","countdown","forEach","amountElement","querySelector","wordElement","updateCountdownSection","style","display","createCountdownInstance","targetElement","parameters","state","isPaused","interval","targetDate","Date","getTargetDate","UTC","inlineElement","container","amountCls","wordCls","createCountdown","currentDate","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","diff","getTime","clearInterval","Math","floor","startInterval","setInterval","observer","MutationObserver","mutations","mutation","removedNodes","node","disconnect","parentNode","observe","childList","stopCountdown","_a","call","resumeCountdown","updateCountdown","newParams","Object","assign","getState","createControllerArray","controllers","array","c","simplyCountdown","args","elements","querySelectorAll","Array","from","el","length","NodeList","isNod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