]> _ Git - fluidbook-html5.git/commitdiff
wip #5087 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Feb 2022 16:53:43 +0000 (17:53 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Feb 2022 16:53:43 +0000 (17:53 +0100)
js/libs/fluidbook/fluidbook.links.js
style/fluidbook.less

index 170181f9a2fcc08dfa35d2af9e04162367ff94bc..0bbc661923fa3d75aa207f260314f9bc547375ee 100644 (file)
@@ -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!'));
index 86e72fcce3dbff1d86ba39634d72efcd69edfc82..622a3bebebb7c8b40f6e29572acd556683e3493b 100644 (file)
@@ -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;