From d80b07d43df14fc58223510d1eb32102e42d01c5 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sun, 28 Jan 2024 00:26:17 +0000 Subject: [PATCH] #6 Updated Product views to better show information --- static/css/products.css | 108 ++++++++++++++++++++++++++++++++-------- templates/content.html | 17 +++---- templates/product.html | 28 +++++++---- 3 files changed, 112 insertions(+), 41 deletions(-) diff --git a/static/css/products.css b/static/css/products.css index d5be50c..b56f0bc 100644 --- a/static/css/products.css +++ b/static/css/products.css @@ -39,51 +39,60 @@ .product { display: flex; flex-direction: column; - justify-content: space-around; - flex-wrap: wrap; + justify-content: center; + align-items: center; flex: 4 0 1rem; - max-width: 30%; - padding: .5rem .5rem .5rem .5rem; + max-width: 40%; + gap: .5em .5em; + padding: .5rem 0.2rem; background: var(--bg-secondary); border-radius: .5rem .5rem; + border: .1em solid rgba(255, 255, 255, 15%); transition: all 0.2s; } -.product-image { - width: 40%; - height: auto; - box-shadow: 0px 30px 50px 0px rgba(0, 0, 0, 0.025); -} - .product-fs { height: 80%; width: 80%; font-size: 150%; display: flex; - flex-direction: column; - justify-content: space-around; - flex-wrap: wrap; + flex-direction: row; + justify-content: space-between; + gap: 2em 2em; padding: .5rem 1rem 2rem 2rem; - background: var(--bg-secondary); + /* background: var(--bg-secondary); */ border-radius: .5rem .5rem; transition: all 0.2s; } -.product-title { - font-size: 130%; - font-weight: bold; -} - -.product-information { +.product-content-container { display: flex; flex-direction: row; - gap: 1rem 1rem; + gap: 1em 1em; + padding: 0rem 1rem; +} + +.product-image-preview { + max-height: 150px; + max-width: 150px; +} + +.product-image { + max-height: 500px; + max-width: 500px; +} + +.product-title { + font-size: 120%; + font-weight: bold; } .product-details { display: flex; flex-direction: column; - align-items: center; + padding: 5% 0; + /* justify-content: center; */ + /* align-items: center; */ gap: 1rem 1rem; } @@ -96,4 +105,59 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} + +.product-acquisition-pane { + font-size: 80%; + width: 100rem; + max-width: 20%; + background-color: var(--bg-secondary); + border: .3em solid rgba(255, 255, 255, 15%); + border-radius: .5rem; + padding: 1rem 1rem; + display: flex; + flex-direction: column; + justify-content: space-between; + gap: 1rem 1rem; +} + +.product-price { + font-weight: bold; +} + +.product-delivery { + font-size: 70%; +} + +.product-postage { + font-size: 70%; +} + +.product-stock { + display: flex; + flex-direction: row; + font-weight: bold; + justify-content: space-around; + flex-wrap: wrap; + align-items: center; +} +.product-quantity { + font-size: 50%; +} + +.product-instock { + color: var(--green); +} + +.product-nostock { + color: var(--red); +} + +.product-add-to-cart { + padding: .25rem .5rem; + margin-top: .25rem; + margin-right: .5rem; + font-size: 1rem; + border: none; + background-color: gray; } \ No newline at end of file diff --git a/templates/content.html b/templates/content.html index e28e556..89b7646 100644 --- a/templates/content.html +++ b/templates/content.html @@ -5,16 +5,15 @@ {% for product in products %}
{{product.name}}
-
-
- Brake Disks -
-
-
£{{product.cost}}
-
{{product.description}}
-
+
+ Brake Disks + +
+
£{{product.cost}}
+
{{product.description}}
-
+
+
{% endfor %} {% endif %} diff --git a/templates/product.html b/templates/product.html index bbddbd1..d628bd4 100644 --- a/templates/product.html +++ b/templates/product.html @@ -3,7 +3,7 @@
{% if product != None %} - {% if user.id == product.sellerID%} + {% if user.id == product.sellerID %}
@@ -41,17 +41,25 @@
{% else %} -
{{product.name}}
-
-
- Brake Disks -
-
-
£{{product.cost}}
-
{{product.description}}
+ Brake Disks +
+
{{product.name}}
+
{{product.description}}
+
+
+
£{{product.cost}}
+
Earliest Delivery Friday 24th December
+
+£{{product.cost}} P&P
+
+ {% if product.quantityAvailable > 0 %} +
In Stock
+
{{product.quantityAvailable}} Available
+ + {% else %} +
Out of Stock
+ {% endif %}
-
{% endif %} {% endif %}