diff --git a/static/css/components/card.css b/static/css/components/card.css index 84801ef3..e1d77d50 100644 --- a/static/css/components/card.css +++ b/static/css/components/card.css @@ -20,6 +20,9 @@ aspect-ratio: 896/1152; max-width: 260px; /* Adjusted from 320px to fit 5 cards */ margin: 0 auto; + cursor: pointer; /* Added from recipe-card */ + display: flex; /* Added from recipe-card */ + flex-direction: column; /* Added from recipe-card */ } .lora-card:hover { @@ -274,4 +277,55 @@ border-radius: var(--border-radius-xs); backdrop-filter: blur(2px); font-size: 0.85em; +} + +/* Recipe specific elements - migrated from recipe-card.css */ +.recipe-indicator { + position: absolute; + top: 6px; + left: 8px; + width: 24px; + height: 24px; + background: var(--lora-primary); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-weight: bold; + z-index: 2; +} + +.base-model-wrapper { + display: flex; + align-items: center; + gap: 8px; + margin-left: 32px; /* For accommodating the recipe indicator */ +} + +.lora-count { + display: flex; + align-items: center; + gap: 4px; + background: rgba(255, 255, 255, 0.2); + padding: 2px 8px; + border-radius: var(--border-radius-xs); + font-size: 0.85em; + position: relative; +} + +.lora-count.ready { + background: rgba(46, 204, 113, 0.3); +} + +.lora-count.missing { + background: rgba(231, 76, 60, 0.3); +} + +.placeholder-message { + grid-column: 1 / -1; + text-align: center; + padding: 2rem; + background: var(--lora-surface-alt); + border-radius: var(--border-radius-base); } \ No newline at end of file diff --git a/static/css/components/recipe-card.css b/static/css/components/recipe-card.css index 7e359bc8..f61f6bb1 100644 --- a/static/css/components/recipe-card.css +++ b/static/css/components/recipe-card.css @@ -27,6 +27,7 @@ overflow: hidden; box-shadow: var(--shadow-sm); transition: all 0.2s ease; + aspect-ratio: 896/1152; cursor: pointer; display: flex; flex-direction: column; diff --git a/static/js/components/RecipeCard.js b/static/js/components/RecipeCard.js index 91d3f745..d281e461 100644 --- a/static/js/components/RecipeCard.js +++ b/static/js/components/RecipeCard.js @@ -11,7 +11,7 @@ class RecipeCard { createCardElement() { const card = document.createElement('div'); - card.className = 'recipe-card'; + card.className = 'lora-card'; card.dataset.filePath = this.recipe.file_path; card.dataset.title = this.recipe.title; card.dataset.created = this.recipe.created_date; diff --git a/static/js/utils/infiniteScroll.js b/static/js/utils/infiniteScroll.js index c1eefe2e..ddb0e341 100644 --- a/static/js/utils/infiniteScroll.js +++ b/static/js/utils/infiniteScroll.js @@ -43,7 +43,7 @@ export function initializeInfiniteScroll(pageType = 'loras') { break; } - const debouncedLoadMore = debounce(loadMoreFunction, 200); + const debouncedLoadMore = debounce(loadMoreFunction, 100); state.observer = new IntersectionObserver( (entries) => { diff --git a/templates/recipes.html b/templates/recipes.html index 07d9360f..c32a3f35 100644 --- a/templates/recipes.html +++ b/templates/recipes.html @@ -4,7 +4,7 @@ {% block page_id %}recipes{% endblock %} {% block page_css %} - + {% endblock %} @@ -33,10 +33,10 @@ -
+
{% if recipes and recipes|length > 0 %} {% for recipe in recipes %} -
+
R
{{ recipe.title }}