From 8fbe7682e7202bd6188e843f210417bd75ab87bf Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Wed, 23 Feb 2022 10:53:49 +0100 Subject: [PATCH] Improve card layout --- src/assets/css/default.css | 31 ++++++++++- src/classes/wishlist.php | 108 ++++++++++++++++++------------------ src/pages/wishlist-view.php | 4 +- 3 files changed, 85 insertions(+), 58 deletions(-) diff --git a/src/assets/css/default.css b/src/assets/css/default.css index ced40ee4..f55a82e3 100644 --- a/src/assets/css/default.css +++ b/src/assets/css/default.css @@ -1,3 +1,7 @@ +:root { + --lineHeight: 1.4285; +} + /** * Footer */ @@ -23,16 +27,37 @@ /** * Card */ -.ui.card .header > img { - height: 1.25em; - vertical-align: text-bottom; +.ui.fluid.card.stretch { + height: 100%; } + +/** Image */ .ui.card > .image > img, .ui.cards > .card > .image > img { height: 30vh; object-fit: cover; + background-color: #fff; } +/** Content */ +.ui.card > .content > .header + .description, +.ui.card > .content > .meta + .description, +.ui.cards > .card > .content > .header + .description, +.ui.cards > .card > .content > .meta + .description { + max-height: calc(2em * var(--lineHeight)); + + overflow: hidden; +} + +/** Icon */ +.ui.card .header > img { + position: absolute; + top: 1em; + height: 1.25em; + vertical-align: text-bottom; +} + + /** * Label */ diff --git a/src/classes/wishlist.php b/src/classes/wishlist.php index 4b2fc560..3b0b41a3 100644 --- a/src/classes/wishlist.php +++ b/src/classes/wishlist.php @@ -78,67 +78,69 @@ class Wishlist * Cards */ if (!empty($products)) { ?> -
+
get($product['url']); ?> -
+
+
- image) { ?> -
- + image) { ?> +
+ +
+ + +
+ title) { ?> +
+ favicon) { ?> + + + + url) { ?> + title ?> + + title ?> + +
+ + + keywords) { ?> +
+ keywords) ?> +
+ + + description) { ?> +
+ description ?> +
+ +
+
+ publishedTime) { ?> + + publishedTime ?> + + + providerName) { ?> + providerName ?> + +
+
+ url) { ?> + View + + data['user'] === $_SESSION['user']['id']) { ?> + Delete + + Commit +
- -
- title) { ?> -
- favicon) { ?> - - - - url) { ?> - title ?> - - title ?> - -
- - - keywords) { ?> -
- keywords) ?> -
- - - description) { ?> -
- description ?> -
-
-
- publishedTime) { ?> - - publishedTime ?> - - - providerName) { ?> - providerName ?> - -
-
- url) { ?> - View - - data['user'] === $_SESSION['user']['id']) { ?> - Delete - - Commit - -
-
diff --git a/src/pages/wishlist-view.php b/src/pages/wishlist-view.php index ce2b43ed..39ec61e3 100644 --- a/src/pages/wishlist-view.php +++ b/src/pages/wishlist-view.php @@ -56,9 +56,9 @@ if (isset($_POST['wishlist_delete_id'])) {
- -
+ +