From 2c85c370e606dfedb4136916e137a378d4d53ea8 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 16 Feb 2023 20:52:11 +0100 Subject: [PATCH] description fade --- vue/src/components/RecipeCard.vue | 124 +++++++++++++++++++++++------- 1 file changed, 96 insertions(+), 28 deletions(-) diff --git a/vue/src/components/RecipeCard.vue b/vue/src/components/RecipeCard.vue index cfc14f80d..260fb1ca8 100755 --- a/vue/src/components/RecipeCard.vue +++ b/vue/src/components/RecipeCard.vue @@ -22,27 +22,36 @@ - - -
- - {{ working_time }} - - - {{ waiting_time }} - +
+
+ + +
+

+ {{ recipe.description }} +

+
+ +
+ + + +
+
+ + {{ working_time }} + + + {{ waiting_time }} + +
@@ -155,13 +164,6 @@ export default { show_detail: function () { return this.recipe?.steps !== undefined && this.detailed }, - text_length: function () { - if (this.show_detail) { - return 200 - } else { - return 120 - } - }, recipe_image: function () { if (this.recipe == null || this.recipe.image === null) { return window.IMAGE_PLACEHOLDER @@ -211,4 +213,70 @@ export default { line-clamp: 2; -webkit-box-orient: vertical; } + +.content { + position: relative; + + margin: auto; + overflow: hidden; +} + +.content .content-overlay { + background: rgba(0, 0, 0, 0.7); + position: absolute; + height: 99%; + width: 100%; + left: 0; + top: 0; + bottom: 0; + right: 0; + opacity: 0; + -webkit-transition: all 0.4s ease-in-out 0s; + -moz-transition: all 0.4s ease-in-out 0s; + transition: all 0.4s ease-in-out 0s; +} + +.content:hover .content-overlay { + opacity: 1; +} + +.content-details { + position: absolute; + text-align: center; + padding-left: 1em; + padding-right: 1em; + width: 100%; + top: 50%; + left: 50%; + opacity: 0; + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + -webkit-transition: all 0.3s ease-in-out 0s; + -moz-transition: all 0.3s ease-in-out 0s; + transition: all 0.3s ease-in-out 0s; +} + +.content:hover .content-details { + top: 50%; + left: 50%; + opacity: 1; +} + +.content-details h3 { + color: #fff; + font-weight: 500; + letter-spacing: 0.15em; + margin-bottom: 0.5em; + text-transform: uppercase; +} + +.content-details p { + color: #fff; + font-size: 0.8em; +} + +.fadeIn-bottom { + top: 80%; +}