diff options
author | Matthew Lemon <y@yulqen.org> | 2024-10-24 16:25:58 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-10-24 16:25:58 +0100 |
commit | 573721751cb669907c8ffb3d287d73bc3350519a (patch) | |
tree | c3a932400f468ad38519364c40a771d527905921 | |
parent | 412936bd395b8a9b853a197b434548605dd00d51 (diff) |
wip: improved standard resource cards
- matches the featured card apart from the borders
- TODO still needs to fix the badge which is not good with long text
content
-rw-r--r-- | alphabetlearning/static/css/project.css | 27 | ||||
-rw-r--r-- | alphabetlearning/templates/resources/resource_card_standard.html | 16 |
2 files changed, 23 insertions, 20 deletions
diff --git a/alphabetlearning/static/css/project.css b/alphabetlearning/static/css/project.css index 43dde1d..ad1d465 100644 --- a/alphabetlearning/static/css/project.css +++ b/alphabetlearning/static/css/project.css @@ -176,13 +176,14 @@ nav > div > ul > li { } .standard-card { - padding: 1.1em; - border: 1px solid rgb(199, 200, 201); - border-radius: 10px; - /*background-color: #f0f2f7;*/ - background-color: white; - text-align: left; - position: relative; + border: 1px solid lightgray; + border-radius: 5px; + padding: 10px; + /* height: 560px; */ + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: stretch; } /* for animated borders, check https://www.youtube.com/watch?v=ezP4kbOvs_E */ @@ -231,10 +232,9 @@ nav > div > ul > li { } .standard-card-description { - margin: 20px 0px 16px; - line-height: 1.6; + margin: 10px 0px; + line-height: 1.1; font-size: 0.9em; - text-align: left; } .card-credit { @@ -244,19 +244,22 @@ nav > div > ul > li { .add-to-basket-button { background-color: green; - border: none; + border: 5px solid transparent; + margin: 10px 0px; text-decoration: none; text-align: center; border-radius: 5px; color: white; display: inline-block; - padding: 7px; + padding: 5px; transition: background-color 0.5s; } .add-to-basket-button:hover { background-color: darkgreen; color: white; + /* border: 5px solid yellow; */ + box-shadow: 0.2em 0.2em 1em rgb(109 109 109 / 60%); } diff --git a/alphabetlearning/templates/resources/resource_card_standard.html b/alphabetlearning/templates/resources/resource_card_standard.html index 4cfa929..42bba72 100644 --- a/alphabetlearning/templates/resources/resource_card_standard.html +++ b/alphabetlearning/templates/resources/resource_card_standard.html @@ -9,35 +9,35 @@ </div> <div> <div> - <h5><a href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a> - </h5> + <a class="card-title-link" href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a> </div> - <div> + <div class="card-metadata-row"> <span>{{ resource.age_range }}</span> {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %} - <span style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span> + <span class="card-category-badge" style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span> {% else %} - <span style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span> + <span class="card-category-badge" style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span> {% endif %} {% if request.user.is_authenticated and request.user.is_staff %} <span>Feature slot: {{ resource.feature_slot }}</span> {% endif %} </div> + <hr> <div> <p class="standard-card-description">{{ resource.card_description }}</p> </div> <div> - <p><small class="text-muted">1 credit</small></p> + <p><small class="card-credit">1 credit</small></p> {% if resource.in_cart %} <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST"> {% csrf_token %} - <button type="submit">In basket</button> + <button type="submit" class="add-to-basket-button-disabled">In basket</button> </form> {% else %} <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST"> {% csrf_token %} - <button type="submit">Add to basket</button> + <button type="submit" class="add-to-basket-button">Add to basket</button> </form> {% endif %} </div> |