aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-10-23 17:45:07 +0100
committerMatthew Lemon <y@yulqen.org>2024-10-23 17:45:07 +0100
commit412936bd395b8a9b853a197b434548605dd00d51 (patch)
treed466afc6f2ff4676c5330866f15438c8f17c2884
parenta09bf4044e3fdeba7275e57153c14698ba848183 (diff)
wip: working on feature card styling
-rw-r--r--alphabetlearning/static/css/project.css51
-rw-r--r--alphabetlearning/templates/resources/resource_card_featured.html11
2 files changed, 54 insertions, 8 deletions
diff --git a/alphabetlearning/static/css/project.css b/alphabetlearning/static/css/project.css
index 7fff081..43dde1d 100644
--- a/alphabetlearning/static/css/project.css
+++ b/alphabetlearning/static/css/project.css
@@ -1,5 +1,6 @@
:root {
--link-colour: rgb(64, 21, 92);
+ --dark-gray: #4c4c4c;
}
* {
@@ -111,17 +112,47 @@ nav > div > ul > li {
border-width: 2px;
border-radius: 5px;
padding: 10px;
- /*height: 560px;*/
+ /* height: 560px; */
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: stretch;
}
+.card-title-link {
+ text-decoration: none;
+ font-weight: bold;
+ font-size: 1.3em;
+}
+
+.card-metadata-row {
+ display: flex;
+ justify-content: space-between;
+ font-size: 0.8em;
+ margin: 10px auto;
+ font-weight: bold;
+ color: var(--dark-gray)
+ position: relative;
+}
+
+.card-category-badge {
+ padding: 2px 10px;
+ font-size: 1.0em;
+ color: white;
+ border: 1px;
+ border-radius: 4px;
+}
+
+.card-metadata-row ~ hr {
+ border: 1px solid lightgray;
+}
+
+
.featured-img {
display: block;
margin-left: auto;
margin-right: auto;
+ margin-bottom: 8px;
border: 1px solid #ddd;
border-radius: 4px;
padding: 3px;
@@ -213,10 +244,22 @@ nav > div > ul > li {
.add-to-basket-button {
background-color: green;
+ border: none;
+ text-decoration: none;
+ text-align: center;
+ border-radius: 5px;
color: white;
- padding: 5px;
+ display: inline-block;
+ padding: 7px;
+ transition: background-color 0.5s;
}
+.add-to-basket-button:hover {
+ background-color: darkgreen;
+ color: white;
+}
+
+
.add-to-basket-button-disabled {
background-color: lightgray;
color: black;
@@ -249,6 +292,7 @@ nav > div > ul > li {
font-size: 1.2rem;
}
+
.new-carousel-wrapper {
display: flex;
margin-left: auto;
@@ -269,3 +313,6 @@ nav > div > ul > li {
border-radius: 14px;
text-align: center;
}
+
+
+
diff --git a/alphabetlearning/templates/resources/resource_card_featured.html b/alphabetlearning/templates/resources/resource_card_featured.html
index 2145eb4..bca4f53 100644
--- a/alphabetlearning/templates/resources/resource_card_featured.html
+++ b/alphabetlearning/templates/resources/resource_card_featured.html
@@ -4,20 +4,19 @@
<div class="featured-card" style="border-color: {{ resource.main_resource_category_colour_css_class }};">
<img class="featured-img" src="{{ resource.thumbnail_urls|first }}" alt="{{ resource.thumbnail_filename }}">
<div>
- <div>
- <h5><a href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a></h5>
- </div>
- <div>
+ <a class="card-title-link" href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a>
+ <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="featured-card-description">{{ resource.card_description }}</p>
</div>