Added sort by date Added
| @@ -2273,6 +2273,8 @@ | ||
| 2273 | 2273 | <option value="search" data-i18n="Search" hidden>A-Z</option> |
| 2274 | 2274 | <option value="asc">A-Z</option> |
| 2275 | 2275 | <option value="desc">Z-A</option> |
| 2276 | + <option value="date_asc">Date Asc</option> | |
| 2277 | + <option value="date_desc">Date Desc</option> | |
| 2276 | 2278 | </select> |
| 2277 | 2279 | <select id="category_selection"> |
| 2278 | 2280 | <option value="" disabled selected data-i18n="category">category</option> |
| @@ -293,7 +293,7 @@ export async function loadFeatherlessModels(data) { | ||
| 293 | 293 | populateClassSelection(data); |
| 294 | 294 | |
| 295 | 295 | // Retrieve the stored number of items per page or default to 5 |
| 296 | 296 | const perPage = Number(localStorage.getItem(storageKey)) || 56; |
| 297 | 297 | |
| 298 | 298 | // Initialize pagination with the full set of models |
| 299 | 299 | setupPagination(originalModels, perPage); |
| @@ -303,7 +303,7 @@ export async function loadFeatherlessModels(data) { | ||
| 303 | 303 | paginationContainer.pagination({ |
| 304 | 304 | dataSource: models, |
| 305 | 305 | pageSize: perPage, |
| 306 | 306 | sizeChangerOptions: [56, 10, 2526, 50, 100, 250, 500, 1000], |
| 307 | 307 | pageRange: 1, |
| 308 | 308 | pageNumber: 1, |
| 309 | 309 | showPageNumbers: true, |
| @@ -450,6 +450,10 @@ export async function loadFeatherlessModels(data) { | ||
| 450 | 450 | filteredModels.sort((a, b) => a.id.localeCompare(b.id)); |
| 451 | 451 | } else if (selectedSortOrder === 'desc') { |
| 452 | 452 | filteredModels.sort((a, b) => b.id.localeCompare(a.id)); |
| 453 | + } else if (selectedSortOrder === 'date_asc') { | |
| 454 | + filteredModels.sort((a, b) => a.updated_at.localeCompare(b.updated_at)); | |
| 455 | + } else if (selectedSortOrder === 'date_desc') { | |
| 456 | + filteredModels.sort((a, b) => b.updated_at.localeCompare(a.updated_at)); | |
| 453 | 457 | } |
| 454 | 458 | |
| 455 | 459 | // Reinitialize pagination with the filtered and sorted models |
| @@ -5495,22 +5495,22 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5495 | 5495 | border-radius: 8px; /* Rounded corners for the card */ |
| 5496 | 5496 | background-color: #222; /* Card background color */ |
| 5497 | 5497 | color: #fff; /* Text color */ |
| 5498 | 5498 | margin: 10px7px; /* Space between cards */ |
| 5499 | 5499 | width: calc(100% - 20px7px); /* Full width minus margin */ |
| 5500 | 5500 | box-sizing: border-box; /* Include padding and border in the width */ |
| 5501 | 5501 | transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, border 0.2s ease-in-out; |
| 5502 | 5502 | } |
| 5503 | 5503 | |
| 5504 | 5504 | .model-card:hover { |
| 5505 | 5505 | transform: scale(1.02502); /* Grow the card slightly on hover */ |
| 5506 | 5506 | background-color: #444; /* Highlight background on hover */ |
| 5507 | 5507 | transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out; /* Smooth transition */ |
| 5508 | 5508 | } |
| 5509 | 5509 | |
| 5510 | 5510 | /* Highlight the selected model card */ |
| 5511 | 5511 | .model-card.selected { |
| 5512 | 5512 | border: 2px solid #00fvar(--okGreen70a); /* Add a blue border to indicate selection */ |
| 5513 | 5513 | background-color: #333var(--okGreen70a); /* Slightly darker background for selected state */ |
| 5514 | 5514 | } |
| 5515 | 5515 | |
| 5516 | 5516 | /* Model title information */ |
| @@ -5550,7 +5550,7 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5550 | 5550 | grid-template-columns: repeat(2, 1fr); |
| 5551 | 5551 | display: flex; |
| 5552 | 5552 | flex-wrap: wrap; /* Cards wrap onto new lines when necessary */ |
| 5553 | 5553 | gap: 15px5px; /* Space between grid items */ |
| 5554 | 5554 | justify-content: flex-start; /* Align cards to the left */ |
| 5555 | 5555 | } |
| 5556 | 5556 | |
| @@ -5558,7 +5558,7 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5558 | 5558 | #model_card_block.grid-view .model-card { |
| 5559 | 5559 | flex-direction: column; /* Stack title, class, and context length vertically for grid */ |
| 5560 | 5560 | flex: 1 1 calc(50% - 30px); /* 3 cards per row with spacing */ |
| 5561 | 5561 | /* margin-bottom: 10px; */ |
| 5562 | 5562 | } |
| 5563 | 5563 | |
| 5564 | 5564 | /* Ensure the search bar takes most of the width */ |