mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-10-25 11:17:28 +02:00 
			
		
		
		
	Homepage ui hotfixes (#2837)
# Description of Changes Fixed layout of homepage buttons when resizing pages Fixed bug showing/hiding favourites column toggle button --- ## Checklist ### General - [x ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [x ] 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) - [ x] I have performed a self-review of my own code - [ x] My changes generate no new warnings ### Documentation - [ x] 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) - [ x] 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) - [ x] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ x] 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.
This commit is contained in:
		
							parent
							
								
									e3adb38a06
								
							
						
					
					
						commit
						4294dc54b1
					
				| @ -95,24 +95,23 @@ function reorderCards(container) { | |||||||
| 
 | 
 | ||||||
| function initializeCards() { | function initializeCards() { | ||||||
|   updateFavoritesSection(); |   updateFavoritesSection(); | ||||||
|  |   updateFavoritesView(); | ||||||
|   updateFavoritesDropdown(); |   updateFavoritesDropdown(); | ||||||
|   filterCards(); |   filterCards(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function updateFavoritesView() { | function updateFavoritesView() { | ||||||
|   const isFavoritesView = JSON.parse(localStorage.getItem('favoritesView') || 'false'); |   const isFavoritesView = JSON.parse(localStorage.getItem('favoritesView') || 'false'); | ||||||
|   const textElement = document.getElementById('toggle-favourites-text'); |  | ||||||
|   const iconElement = document.getElementById('toggle-favourites-icon'); |   const iconElement = document.getElementById('toggle-favourites-icon'); | ||||||
|   const favoritesGroup = document.querySelector('#groupFavorites'); |   const favoritesGroup = document.querySelector('#groupFavorites'); | ||||||
|   const favoritesList = JSON.parse(localStorage.getItem('favoritesList')) || []; |   const favoritesList = JSON.parse(localStorage.getItem('favoritesList')) || []; | ||||||
|   document.getElementById('favouritesVisibility').style.display = 'flex'; |  | ||||||
| 
 | 
 | ||||||
|   if (isFavoritesView && favoritesList.length > 0) { |   if (isFavoritesView && favoritesList.length > 0) { | ||||||
|     iconElement.textContent = 'visibility_off'; |     document.getElementById('favouritesVisibility').style.display = 'flex'; | ||||||
|     favoritesGroup.style.display = 'flex'; |     favoritesGroup.style.display = 'flex'; | ||||||
|   } else { |   } else { | ||||||
|     if (favoritesList.length > 0) { |     if (favoritesList.length > 0) { | ||||||
|       iconElement.textContent = 'visibility'; |       document.getElementById('favouritesVisibility').style.display = 'flex'; | ||||||
|       favoritesGroup.style.display = 'none'; |       favoritesGroup.style.display = 'none'; | ||||||
|     } else { |     } else { | ||||||
|       document.getElementById('favouritesVisibility').style.display = 'none'; |       document.getElementById('favouritesVisibility').style.display = 'none'; | ||||||
|  | |||||||
| @ -127,14 +127,9 @@ function adjustVisibleElements() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function adjustContainerAlignment() { | function adjustContainerAlignment() { | ||||||
|   console.log('Adjusting container alignment'); |  | ||||||
| 
 |  | ||||||
|   document.querySelectorAll('.features-container').forEach((parent) => { |   document.querySelectorAll('.features-container').forEach((parent) => { | ||||||
|     parent.querySelectorAll('.feature-rows').forEach((container) => { |     parent.querySelectorAll('.feature-rows').forEach((container) => { | ||||||
|       const childElements = Array.from(container.children); |  | ||||||
| 
 |  | ||||||
|       const containerWidth = parent.offsetWidth; |       const containerWidth = parent.offsetWidth; | ||||||
|       console.log(containerWidth < 32 * parseFloat(getComputedStyle(document.documentElement).fontSize)); |  | ||||||
|       if (containerWidth < 32 * parseFloat(getComputedStyle(document.documentElement).fontSize)) { |       if (containerWidth < 32 * parseFloat(getComputedStyle(document.documentElement).fontSize)) { | ||||||
|         container.classList.add('single-column'); |         container.classList.add('single-column'); | ||||||
|       } else { |       } else { | ||||||
|  | |||||||
| @ -55,7 +55,7 @@ | |||||||
|               </span> |               </span> | ||||||
|               <input type="text" id="searchBar" onkeyup="filterCards()" th:placeholder="#{home.searchBar}" autofocus> |               <input type="text" id="searchBar" onkeyup="filterCards()" th:placeholder="#{home.searchBar}" autofocus> | ||||||
| 
 | 
 | ||||||
|               <div style="display: flex;"> |               <div style="display: flex; column-gap: 3rem; flex-wrap: wrap; margin-left:1rem"> | ||||||
|                 <div |                 <div | ||||||
|                 style="height:2.5rem;  display: flex; align-items: center; cursor: pointer; justify-content: center;"> |                 style="height:2.5rem;  display: flex; align-items: center; cursor: pointer; justify-content: center;"> | ||||||
|                 <label for="sort-options">Sort by:</label> |                 <label for="sort-options">Sort by:</label> | ||||||
| @ -66,9 +66,8 @@ | |||||||
|                   <!-- <option value="server">Popularity in organisation</option> --> |                   <!-- <option value="server">Popularity in organisation</option> --> | ||||||
|                 </select> |                 </select> | ||||||
|               </div> |               </div> | ||||||
|                 <div |                 <div style="display: flex; align-items: center; flex-wrap: wrap; align-content: flex-start; width: fit-content; max-width: 100%; gap:2rem;  justify-content: center;"> | ||||||
|                   style="display: flex; margin-left:2rem;align-items: center; flex-wrap: wrap; align-content: flex-start; width: fit-content; max-width: 100%; gap:3rem;  justify-content: center;"> |                 <div th:title="#{home.setFavorites}" style="display: flex; align-items: center; cursor: pointer;" onclick="toggleFavoritesMode()"> | ||||||
|                   <div th:title="#{home.setFavorites}" style="display: flex; align-items: center; cursor: pointer;" onclick="toggleFavoritesMode()"> |  | ||||||
|                     <span class="material-symbols-rounded toggle-favourites" |                     <span class="material-symbols-rounded toggle-favourites" | ||||||
|                       style="font-size: 2rem;  margin-left: 0.2rem;"> |                       style="font-size: 2rem;  margin-left: 0.2rem;"> | ||||||
|                       star |                       star | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user