Skip to content

Commit cff6b15

Browse files
committed
fix: improve close button alignment and slideshow dots appearance
- Fix close button "x" centering in round buttons using flexbox and vertical transform - Move close button inside title div for proper alignment when title is present - Add specific positioning for different close button types in title bar - Remove border from slideshow dots to prevent squashing appearance - Update webpack config to output CSS as jAlert.min.css instead of jAlert.css.min.css - Update close button markup to wrap "x" in span for better styling control
1 parent b415080 commit cff6b15

File tree

8 files changed

+113
-16
lines changed

8 files changed

+113
-16
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Ignore Mac system files
22
.DS_Store
33

4-
# Ignore build output
5-
/dist/
6-
74
# Ignore IDE files
85
.idea/
96

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,45 @@
22

33
All notable changes to jAlert will be documented in this file.
44

5+
## [5.0.2] - 2024-01-XX
6+
7+
### 🐛 Bug Fixes
8+
9+
- **Close Button Alignment**: Fixed "x" centering in round close buttons using flexbox and vertical transform
10+
- **Title Bar Positioning**: Moved close button inside title div for proper alignment when title is present
11+
- **Button Type Specifics**: Added specific positioning for different close button types (round, alt) in title bar
12+
- **Slideshow Dots**: Removed border from slideshow dots to prevent squashing appearance
13+
- **Build Output**: Updated webpack config to output CSS as `jAlert.min.css` instead of `jAlert.css.min.css`
14+
15+
### 🔧 Technical Improvements
16+
17+
- Enhanced close button markup with wrapped "x" span for better styling control
18+
- Improved visual consistency across different close button styles
19+
- Better CSS organization and specificity for button positioning
20+
21+
---
22+
23+
## [5.0.1] - 2024-01-XX
24+
25+
### ✨ New Features
26+
27+
- **Accessibility Improvements**: Added ARIA attributes and enhanced keyboard navigation
28+
- **Touch Support**: Added swipe gestures for mobile devices
29+
- **Enhanced Navigation**: Improved slideshow controls and user experience
30+
31+
### 🐛 Bug Fixes
32+
33+
- Fixed slideshow navigation controls positioning
34+
- Improved responsive design for mobile devices
35+
- Enhanced error handling and validation
36+
37+
### 📦 Dependencies
38+
39+
- Updated to latest jQuery compatibility
40+
- Improved build process and optimization
41+
42+
---
43+
544
## [5.0.0] - 2024-01-XX
645

746
### 🚀 Major Release - Complete Modernization

dist/jAlert.css.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jAlert.min.css

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jAlert.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jAlert.css

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,23 @@ body.ja_blur > *:not(.ja_wrap) {
139139
border-radius: 50%;
140140
background: #e0e0e0;
141141
color: #232323;
142-
padding: 5px 7px;
142+
padding: 0;
143143
right: 10px;
144144
top: 6px;
145145
border: 0;
146-
line-height: 13px;
146+
width: 30px;
147+
height: 30px;
147148
font-size: 18px;
149+
display: flex;
150+
align-items: center;
151+
justify-content: center;
152+
line-height: 1;
153+
}
154+
155+
.ja_close_x {
156+
display: inline-block;
157+
transform: translateY(-1px);
158+
font-weight: bold;
148159
}
149160

150161
.ja_default .ja_close_round, .ja_default .ja_close_round_white {
@@ -159,7 +170,12 @@ body.ja_blur > *:not(.ja_wrap) {
159170
top: -16px;
160171
right: -18px;
161172
border: 1px solid rgb(55, 55, 55);
162-
padding: 3px 8px 1px 7px;
173+
padding: 0;
174+
width: 25px;
175+
height: 25px;
176+
text-align: center;
177+
line-height: 23px;
178+
font-size: 14px;
163179
}
164180

165181
.ja_close:hover {
@@ -220,6 +236,19 @@ body.ja_blur > *:not(.ja_wrap) {
220236
padding: 10px 20px 10px 20px;
221237
}
222238

239+
.ja_title > .ja_close_round, .ja_title > .ja_close_round_white {
240+
top: 4px !important;
241+
}
242+
243+
.ja_title > .closejAlert {
244+
top: 10px;
245+
}
246+
247+
.ja_title > .ja_close_alt {
248+
top: -12px;
249+
right: -12px;
250+
}
251+
223252
/*
224253
THEMES
225254
*/
@@ -3565,6 +3594,7 @@ body.ja_blur > *:not(.ja_wrap) {
35653594
padding: 0;
35663595
text-align: center;
35673596
min-height: 200px;
3597+
overflow: visible;
35683598
}
35693599

35703600
.ja_slideshow_slide {
@@ -3666,6 +3696,12 @@ body.ja_blur > *:not(.ja_wrap) {
36663696
display: flex;
36673697
gap: 8px;
36683698
z-index: 10;
3699+
flex-shrink: 0;
3700+
pointer-events: auto;
3701+
width: auto;
3702+
height: auto;
3703+
min-width: 0;
3704+
min-height: 0;
36693705
}
36703706

36713707
.ja_slideshow_dot {
@@ -3675,6 +3711,13 @@ body.ja_blur > *:not(.ja_wrap) {
36753711
background: rgba(255, 255, 255, 0.5);
36763712
cursor: pointer;
36773713
transition: all 0.3s ease;
3714+
flex-shrink: 0;
3715+
flex-grow: 0;
3716+
min-width: 12px;
3717+
min-height: 12px;
3718+
max-width: 12px;
3719+
max-height: 12px;
3720+
border: none;
36783721
}
36793722

36803723
.ja_slideshow_dot:hover {

src/jAlert.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,22 @@
680680
'<div class="jAlert ' + classes.join(' ') + '" style="' + styles.join(' ') + '" id="' + alert.id + '" tabindex="-1">' +
681681
'<div>';
682682

683-
// Close button
684-
if (alert.closeBtn) {
683+
// Title and close button
684+
if (alert.title) {
685+
html += "<div class='ja_title' id='" + alert.id + "_title'>";
686+
if (alert.closeBtn) {
687+
html += "<button type='button' class='closejAlert ja_close";
688+
if (alert.closeBtnAlt) {
689+
html += ' ja_close_alt';
690+
} else if (alert.closeBtnRoundWhite) {
691+
html += ' ja_close_round_white';
692+
} else if (alert.closeBtnRound) {
693+
html += ' ja_close_round';
694+
}
695+
html += "' aria-label='Close dialog'><span class='ja_close_x'>&times;</span></button>";
696+
}
697+
html += "<div>" + alert.title + "</div></div>";
698+
} else if (alert.closeBtn) {
685699
html += "<button type='button' class='closejAlert ja_close";
686700
if (alert.closeBtnAlt) {
687701
html += ' ja_close_alt';
@@ -690,12 +704,7 @@
690704
} else if (alert.closeBtnRound) {
691705
html += ' ja_close_round';
692706
}
693-
html += "' aria-label='Close dialog'>&times;</button>";
694-
}
695-
696-
// Title
697-
if (alert.title) {
698-
html += "<div class='ja_title' id='" + alert.id + "_title'><div>" + alert.title + "</div></div>";
707+
html += "' aria-label='Close dialog'><span class='ja_close_x'>&times;</span></button>";
699708
}
700709

701710
// Body

webpack.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ export default (env, argv) => {
7575
},
7676
plugins: [
7777
new MiniCssExtractPlugin({
78-
filename: isProduction ? '[name].min.css' : '[name].css'
78+
filename: (pathData) => {
79+
if (pathData.chunk.name === 'jAlert.css') {
80+
return 'jAlert.min.css';
81+
}
82+
return isProduction ? '[name].min.css' : '[name].css';
83+
}
7984
})
8085
],
8186
optimization: {

0 commit comments

Comments
 (0)