|
71 | 71 | align-items: center; |
72 | 72 | justify-content: space-between; |
73 | 73 | font-size: 14pt; |
| 74 | + gap: 0.5em; |
| 75 | + min-height: 2.5em; |
74 | 76 | } |
75 | 77 | .modAuthor { |
76 | 78 | font-size: 0.7em; |
77 | 79 | white-space: nowrap; |
78 | 80 | overflow: hidden; |
79 | 81 | text-overflow: ellipsis; |
80 | | - max-width: 60%; |
| 82 | + max-width: calc(100% - 3em); |
81 | 83 | } |
82 | 84 | .modIcon { |
83 | 85 | width: 2.5em; |
84 | 86 | height: 2.5em; |
85 | 87 | flex-shrink: 0; |
| 88 | + object-fit: contain; |
86 | 89 | box-shadow: 0 2px 5px black; |
87 | 90 | border: 2px solid white; |
88 | 91 | filter: brightness(1.1); |
89 | | - object-fit: contain; |
90 | | - align-self: center; |
| 92 | + } |
| 93 | + .webkit-mobile-fix { |
| 94 | + transform: translateY(-20px); |
91 | 95 | } |
92 | 96 | @media (max-width: 513px) { |
93 | 97 | .modDescription { |
|
1203 | 1207 | <script src="/scripts/main/nodetails.js"></script> |
1204 | 1208 | <script src="/scripts/main/vines.js"></script> |
1205 | 1209 | <script> |
1206 | | - // Select all checkboxes |
1207 | 1210 | const filters = document.querySelectorAll('.modFilter'); |
1208 | 1211 |
|
1209 | | - // Listen for changes to the filters |
1210 | 1212 | filters.forEach(filter => { |
1211 | 1213 | filter.addEventListener('change', filterMods); |
1212 | 1214 | }); |
1213 | 1215 |
|
1214 | 1216 | function filterMods() { |
1215 | | - // Get all mod items |
1216 | 1217 | const mods = document.querySelectorAll('.modItem'); |
1217 | 1218 |
|
1218 | | - // Get the checked filter values |
1219 | 1219 | const activeFilters = Array.from(filters) |
1220 | 1220 | .filter(filter => filter.checked) |
1221 | 1221 | .map(filter => ({ filter: filter.dataset.filter, value: filter.value })); |
1222 | 1222 |
|
1223 | 1223 | mods.forEach(mod => { |
1224 | 1224 | let showMod = true; |
1225 | 1225 |
|
1226 | | - // Loop through all the active filters |
1227 | 1226 | activeFilters.forEach(activeFilter => { |
1228 | | - const modAttr = mod.dataset[activeFilter.filter]; // e.g. "entity,enemy" |
| 1227 | + const modAttr = mod.dataset[activeFilter.filter]; |
1229 | 1228 |
|
1230 | | - // If the attribute exists, split it by comma into an array |
1231 | 1229 | const modValues = modAttr ? modAttr.split(',') : []; |
1232 | 1230 |
|
1233 | | - // Check if the mod includes the active filter value |
1234 | 1231 | if (!modValues.includes(activeFilter.value)) { |
1235 | 1232 | showMod = false; |
1236 | 1233 | } |
1237 | 1234 | }); |
1238 | 1235 |
|
1239 | | - // Show or hide the mod based on the filter matching |
1240 | 1236 | mod.style.display = showMod ? '' : 'none'; |
1241 | 1237 | }); |
1242 | 1238 | } |
1243 | 1239 | </script> |
1244 | 1240 |
|
1245 | 1241 | <script> |
1246 | 1242 | window.addEventListener('DOMContentLoaded', () => { |
1247 | | - // Get all the mod items |
1248 | 1243 | const modItems = document.querySelectorAll('.modItem'); |
1249 | 1244 |
|
1250 | | - // Convert NodeList to array for sorting |
1251 | 1245 | const modItemsArray = Array.from(modItems); |
1252 | 1246 |
|
1253 | | - // Sort the mod items based on modHeader, ignoring 'The' |
1254 | 1247 | modItemsArray.sort((a, b) => { |
1255 | 1248 | const headerA = a.querySelector('.modHeader').textContent.replace(/^The\s+/i, ''); |
1256 | 1249 | const headerB = b.querySelector('.modHeader').textContent.replace(/^The\s+/i, ''); |
1257 | 1250 |
|
1258 | 1251 | return headerA.localeCompare(headerB); |
1259 | 1252 | }); |
1260 | 1253 |
|
1261 | | - // Append the sorted mod items back into the container |
1262 | 1254 | const container = modItems[0].parentElement; |
1263 | 1255 | modItemsArray.forEach(modItem => container.appendChild(modItem)); |
1264 | 1256 | }); |
1265 | 1257 |
|
1266 | 1258 | </script> |
| 1259 | + <script> |
| 1260 | + document.addEventListener("DOMContentLoaded", function () { |
| 1261 | + const isWebkitMobile = /AppleWebKit/.test(navigator.userAgent) && /Mobile|iPhone|iPad|Android/.test(navigator.userAgent); |
| 1262 | + |
| 1263 | + if (isWebkitMobile) { |
| 1264 | + document.querySelectorAll('.modIcon').forEach(icon => { |
| 1265 | + icon.classList.add('webkit-mobile-fix'); |
| 1266 | + }); |
| 1267 | + } |
| 1268 | +}); |
| 1269 | + |
| 1270 | + </script> |
1267 | 1271 |
|
1268 | 1272 |
|
1269 | 1273 |
|
|
0 commit comments