Skip to content

Commit 211383b

Browse files
authored
3164 bug issue on UI pdf multi tool (#3289)
# Description of Changes * Added spacing between pages on multi-tool * pages now have square area so all dimensions of page can be previewed * Removed excessive CSS * Tidied up left hand page buttons. Closes #(3164) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details.
1 parent 6887e15 commit 211383b

File tree

4 files changed

+56
-85
lines changed

4 files changed

+56
-85
lines changed

Diff for: src/main/resources/static/css/dragdrop.css

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,21 @@ html[dir="rtl"] .drag-manager_draghover img {
5959
background-color: #ffffff10;
6060
transition: width 0.1s;
6161
animation: end-drop-expand 0.3s ease;
62-
display: flex;
6362
align-items: center;
6463
justify-content: center;
6564
margin-left:16px;
6665
border-radius: 8px;
67-
6866
}
6967

7068
.drag-manager_endpoint svg {
7169
width: 50px;
7270
height: 50px;
71+
72+
display: block;
73+
position: absolute;
74+
left: 50%;
75+
top: 50%;
76+
translate: -50% -50%;
7377
}
7478

7579
.drag-manager_endpoint.drag-manager_draghover {

Diff for: src/main/resources/static/css/multi-tool.css

+20-15
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,14 @@ label {
8585
flex-direction: column;
8686
padding: 1rem;
8787
border-radius: 25px;
88-
overflow-y: clip;
89-
overflow-x: auto;
9088
min-height: 275px;
9189
margin: 0 0 30px 0;
9290
}
9391

9492
#pages-container {
95-
gap: 0px;
96-
display: flex;
97-
flex-wrap: wrap;
98-
margin-left: -15px;
99-
margin-right: -15px;
93+
margin: 0 auto;
94+
width: 95%;
95+
font-size: 0;
10096
}
10197

10298
/* width */
@@ -121,18 +117,20 @@ label {
121117
background: var(--scroll-bar-thumb-hover);
122118
}
123119

120+
124121
.page-container {
122+
display: inline-block;
123+
list-style-type: none;
124+
width: 250px;
125125
height: 250px;
126-
display: flex;
127-
align-items: center;
128-
flex-direction: column-reverse;
129-
aspect-ratio: 1;
126+
line-height: 50px;
127+
margin: 15px 25px;
128+
box-sizing: border-box;
130129
text-align: center;
130+
aspect-ratio: 1;
131131
position: relative;
132132
user-select: none;
133133
transition: width 1s linear;
134-
margin-top: 16px;
135-
margin-bottom: 16px;
136134
}
137135

138136
.page-container.split-before {
@@ -196,9 +194,8 @@ label {
196194
}
197195

198196
.page-container img {
199-
/* max-width: calc(100% - 15px); */
197+
max-width: calc(100% - 15px);
200198
max-height: calc(100% - 15px);
201-
max-width: 237px;
202199
display: block;
203200
position: absolute;
204201
left: 50%;
@@ -217,6 +214,7 @@ label {
217214
position: absolute;
218215
top: 5px;
219216
left: 5px;
217+
line-height: normal;
220218
color: var(--md-sys-color-on-secondary);
221219
background-color: rgba(162, 201, 255, 0.8);
222220
padding: 6px 8px;
@@ -294,6 +292,13 @@ label {
294292
.checkbox-label {
295293
font-size: medium;
296294
}
295+
297296
.btn {
298297
position: relative;
299298
}
299+
300+
@media only screen and (max-width: 767px) { #pages-container { width:300px; } }
301+
@media only screen and (min-width: 768px) and (max-width: 991px) { #pages-container { width: 600px; } }
302+
@media only screen and (min-width: 992px) and (max-width: 1199px) { #pages-container { width: 900px; } }
303+
@media only screen and (min-width: 1200px) and (max-width: 1399px) { #pages-container { width: 900px; } }
304+
@media only screen and (min-width: 1399px) { #pages-container { width: 1200px; } }

Diff for: src/main/resources/static/css/pdfActions.css

+26-64
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
.pdf-actions_button-container {
22
z-index: 4;
3-
display: flex;
43
opacity: 0;
54
transition: opacity 0.1s linear;
5+
6+
position: absolute !important;
7+
bottom: 0px;
8+
left: 50%;
9+
transform: translate(-50%, 0%);
610
}
711

812
.pdf-actions_container:hover .pdf-actions_button-container {
@@ -42,40 +46,27 @@
4246

4347
/* "insert pdf" buttons that appear on the right when hover */
4448
.pdf-actions_insert-file-button-container {
49+
display:flex;
50+
flex-direction: column;
51+
gap: 10px;
4552
translate: 0 -50%;
46-
width: 80px;
4753
height: 100%;
48-
54+
width: 100px;
55+
padding-left: 30px;
56+
padding-right:30px;
57+
justify-content: center;
4958
z-index: 3;
5059
opacity: 0;
51-
transition: opacity 0.2s;
52-
}
53-
54-
.pdf-actions_insert-file-button-container button .material-symbols-rounded {
55-
vertical-align: top;
56-
}
60+
transition: opacity 0.4s;
5761

58-
.pdf-actions_insert-file-button-container.left button,
59-
.pdf-actions_insert-file-button-container.right button {
60-
padding: 0.45rem;
61-
}
62-
63-
.pdf-actions_button-container button .material-symbols-rounded {
64-
font-size: 1.25rem;
65-
vertical-align: sub;
66-
}
67-
68-
.pdf-actions_insert-file-button {
69-
padding: 0;
70-
vertical-align: sub;
7162
}
7263

7364
.pdf-actions_insert-file-button-container.left {
74-
left: -20px;
65+
left: -50px;
7566
}
7667

7768
.pdf-actions_insert-file-button-container.right {
78-
right: -20px;
69+
right: -50px;
7970
}
8071

8172
html[dir="ltr"] .pdf-actions_insert-file-button-container.right {
@@ -86,49 +77,29 @@ html[dir="rtl"] .pdf-actions_insert-file-button-container.left {
8677
display: none;
8778
}
8879

89-
.pdf-actions_insert-file-button-container.left .pdf-actions_insert-file-button {
90-
left: 0;
91-
translate: 0 -50%;
80+
html[dir="ltr"] .pdf-actions_container:last-child>.pdf-actions_insert-file-button-container.right {
81+
display: flex;
9282
}
9383

94-
.pdf-actions_insert-file-button-container.right .pdf-actions_insert-file-button {
95-
right: 0;
96-
translate: 0 -50%;
84+
html[dir="rtl"] .pdf-actions_container:last-child>.pdf-actions_insert-file-button-container.left {
85+
display: flex;
9786
}
9887

99-
html[dir="ltr"] .pdf-actions_container:last-child>.pdf-actions_insert-file-button-container.right {
100-
display: block;
88+
.pdf-actions_insert-file-button-container.left button,
89+
.pdf-actions_insert-file-button-container.right button {
90+
padding: 0.45rem;
10191
}
10292

103-
html[dir="rtl"] .pdf-actions_container:last-child>.pdf-actions_insert-file-button-container.left {
104-
display: block;
93+
.pdf-actions_button-container button .material-symbols-rounded {
94+
font-size: 1.25rem;
95+
vertical-align: sub;
10596
}
10697

10798
.pdf-actions_insert-file-button-container:hover {
10899
opacity: 1;
109100
transition: opacity 0.05s;
110101
}
111102

112-
.pdf-actions_insert-file-button {
113-
position: absolute;
114-
top: 50%;
115-
right: 50%;
116-
translate: 50% -50%;
117-
aspect-ratio: 1;
118-
border-radius: 100px;
119-
z-index: 4;
120-
}
121-
122-
.pdf-actions_split-file-button {
123-
position: absolute;
124-
top: 25%;
125-
right: 50%;
126-
translate: 0 -50%;
127-
aspect-ratio: 1;
128-
border-radius: 100px;
129-
z-index: 3;
130-
}
131-
132103
.pdf-actions_checkbox {
133104
position: absolute;
134105
top: 5px;
@@ -143,13 +114,4 @@ html[dir="rtl"] .pdf-actions_container:last-child>.pdf-actions_insert-file-butto
143114

144115
.hidden {
145116
display: none;
146-
}
147-
.pdf-actions_insert-file-blank-button {
148-
position: absolute;
149-
top: 75%;
150-
right: 50%;
151-
translate: 0% -50%;
152-
aspect-ratio: 1;
153-
border-radius: 100px;
154-
z-index: 5;
155-
}
117+
}

Diff for: src/main/resources/static/js/multitool/PdfActionsManager.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,21 +194,21 @@ class PdfActionsManager {
194194
);
195195

196196
const insertFileButton = document.createElement("button");
197-
insertFileButton.classList.add("btn", "btn-primary", "pdf-actions_insert-file-button");
197+
insertFileButton.classList.add("btn", "btn-primary");
198198
moveUp.setAttribute('title', window.translations.addFile);
199199
insertFileButton.innerHTML = `<span class="material-symbols-rounded">add</span>`;
200200
insertFileButton.onclick = this.insertFileButtonCallback;
201201
insertFileButtonContainer.appendChild(insertFileButton);
202202

203203
const splitFileButton = document.createElement("button");
204-
splitFileButton.classList.add("btn", "btn-primary", "pdf-actions_split-file-button");
204+
splitFileButton.classList.add("btn", "btn-primary");
205205
splitFileButton.setAttribute('title', window.translations.split);
206206
splitFileButton.innerHTML = `<span class="material-symbols-rounded">cut</span>`;
207207
splitFileButton.onclick = this.splitFileButtonCallback;
208208
insertFileButtonContainer.appendChild(splitFileButton);
209209

210210
const insertFileBlankButton = document.createElement("button");
211-
insertFileBlankButton.classList.add("btn", "btn-primary", "pdf-actions_insert-file-blank-button");
211+
insertFileBlankButton.classList.add("btn", "btn-primary");
212212
insertFileBlankButton.setAttribute('title', window.translations.insertPageBreak);
213213
insertFileBlankButton.innerHTML = `<span class="material-symbols-rounded">insert_page_break</span>`;
214214
insertFileBlankButton.onclick = this.insertFileBlankButtonCallback;
@@ -225,7 +225,7 @@ class PdfActionsManager {
225225
);
226226

227227
const insertFileButtonRight = document.createElement("button");
228-
insertFileButtonRight.classList.add("btn", "btn-primary", "pdf-actions_insert-file-button");
228+
insertFileButtonRight.classList.add("btn", "btn-primary");
229229
insertFileButtonRight.innerHTML = `<span class="material-symbols-rounded">add</span>`;
230230
insertFileButtonRight.onclick = () => addFiles();
231231
insertFileButtonRightContainer.appendChild(insertFileButtonRight);

0 commit comments

Comments
 (0)