From e19594f50097159c56df0a80fc5650116e9a0a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Wed, 27 May 2020 22:51:43 +0200 Subject: [PATCH] Show additional infos about the part picture, when hovering it. --- assets/css/app.css | 37 +++++++++++++++++++++++++ src/Twig/TypeLabelExtension.php | 27 ++++++++++++++++++ templates/Parts/info/_picture.html.twig | 17 ++++++++++-- 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 src/Twig/TypeLabelExtension.php diff --git a/assets/css/app.css b/assets/css/app.css index 595dca29..16bb8591 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -837,4 +837,41 @@ div.dataTables_wrapper div.dataTables_info { .scanner-video { max-width: 500px; max-height: 250px; +} + +/******************************************* + * Hovering carousel gallery + *******************************************/ +.carousel-caption-hover { + display: none; +} + +.carousel .mask { + display: none; +} + +.carousel:hover .mask { + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + transition: .5s ease; + background-color: #0a0909; + opacity: 0.7; + border: 1px solid #dee2e6; + border-radius: .25rem; +} + +.carousel-control { + display: none; +} + +.carousel:hover .carousel-caption-hover { + display: block; +} + +.carousel:hover .carousel-control { + display: flex; } \ No newline at end of file diff --git a/src/Twig/TypeLabelExtension.php b/src/Twig/TypeLabelExtension.php new file mode 100644 index 00000000..1b398dda --- /dev/null +++ b/src/Twig/TypeLabelExtension.php @@ -0,0 +1,27 @@ +nameGenerator = $elementTypeNameGenerator; + } + + public function getFunctions() + { + return [ + new TwigFunction('elementType', [$this->nameGenerator, 'getLocalizedTypeLabel']), + new TwigFunction('elementTypeName', [$this->nameGenerator, 'getTypeNameCombination']), + ]; + } +} \ No newline at end of file diff --git a/templates/Parts/info/_picture.html.twig b/templates/Parts/info/_picture.html.twig index 5290cd1b..3977845b 100644 --- a/templates/Parts/info/_picture.html.twig +++ b/templates/Parts/info/_picture.html.twig @@ -4,17 +4,28 @@