From 616bbaf30d971b8f67627efdfd71afe4cf014792 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Sun, 3 Mar 2024 08:30:52 -0500 Subject: [PATCH] Fixed css and sort when number contains -2 or -X --- templates/frontpage.html | 41 +++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/templates/frontpage.html b/templates/frontpage.html index 5e6e4a8..0f94f2a 100644 --- a/templates/frontpage.html +++ b/templates/frontpage.html @@ -4,6 +4,12 @@ Responsive Grid + + + + + +
- - - - - +
+ + + + +
@@ -130,10 +150,9 @@ function dynamicSort(className) { var textA = a.getElementsByClassName(className)[0].textContent.trim(); var textB = b.getElementsByClassName(className)[0].textContent.trim(); - // Remove "-1" suffix if present - textA = textA.replace(/-1$/, '').trim(); - textB = textB.replace(/-1$/, '').trim(); - + // Remove digits after hyphen if present + textA = textA.replace(/-\d+$/, '').trim(); + textB = textB.replace(/-\d+$/, '').trim(); // If text1 is an integer, parse it as a number if (!isNaN(textA) && !isNaN(textB)) { var result = parseInt(textA) - parseInt(textB);