From 9dcb2c3b4e272323bc2769373a14ec4db27393b5 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 21 Feb 2022 17:53:43 +0100 Subject: [PATCH] wip #5087 @1.5 --- js/libs/fluidbook/fluidbook.links.js | 7 +++- style/fluidbook.less | 57 +++++++++++++++++++++++++--- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 170181f9..0bbc6619 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -10,7 +10,7 @@ __('click to play the audio') __('add to cart') __('click to open the file') - + __('click to flip') */ function FluidbookLinks(fluidbook) { @@ -92,6 +92,11 @@ FluidbookLinks.prototype = { }); + $(document).on(this.fluidbook.input.clickEvent, '[data-flipcard] > a', function () { + $(this).closest('[data-flipcard]').find('.flipcard').toggleClass('flipped'); + return false; + }); + new ClipboardJS('[data-clipboard-text]'); $(document).on(this.fluidbook.input.clickEvent, '[data-clipboard-text]', function () { $this.fluidbook.tooltip.displayTooltip($this.fluidbook.l10n.__('copied!')); diff --git a/style/fluidbook.less b/style/fluidbook.less index 86e72fcc..622a3beb 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1438,14 +1438,61 @@ html.ios body.portrait #interface { opacity: 1; } } + + &[data-flipcard] { + background-image: none !important; + perspective: 2000px; + position: relative; + + > a { + position: absolute; + display: block; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + } + + .flipcard { + width: 100%; + height: 100%; + position: absolute; + transition: transform 0.8s; + transform-style: preserve-3d; + + &.flipped { + transform: rotateY(180deg); + } + + > div { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + backface-visibility: hidden; + + &.back { + transform: rotateY(180deg); + } + + img { + width: 100%; + height: 100% + } + } + } + } } + .link.contentLink { z-index: 500; position: absolute; pointer-events: none; - &.interactive{ + &.interactive { pointer-events: auto; } @@ -1750,11 +1797,11 @@ html.ios body.portrait #interface { text-align: center; position: relative; - .svg-icon{ + .svg-icon { width: 20px; position: absolute; - top:11px; - left:-11px; + top: 11px; + left: -11px; } &.noborder { @@ -1774,7 +1821,7 @@ html.ios body.portrait #interface { display: block; margin: 0 0 10px 0; - .svg-icon{ + .svg-icon { width: 20px; margin-right: 12px; vertical-align: text-bottom; -- 2.39.5