]> _ Git - fluidbook-html5.git/commitdiff
wip #7459 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Apr 2025 14:55:26 +0000 (16:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Apr 2025 14:55:26 +0000 (16:55 +0200)
js/libs/modernizr/tests.js
style/fluidbook.less
style/links.less [new file with mode: 0644]

index 78b9ddc94bc7023e380c8a03f1bc0f81b00d739f..298b0ab729813d7edb6291920e0bd593682b7c79 100644 (file)
@@ -22,8 +22,12 @@ Modernizr.addTest('android', function () {
     return !!(navigator.userAgent.match(/android/i) || navigator.userAgent.search(/galaxy/i) > -1);
 });
 
+Modernizr.addTest('chromeos', function () {
+    return !!(navigator.userAgent.match(/cros/i));
+})
+
 Modernizr.addTest('ios', function () {
-    return (Modernizr.ipad || Modernizr.ipod || Modernizr.iphone);
+    return (Modernizr.ipad || Modernizr.ipod || Modernizr.iphone || Modernizr.chromeos);
 });
 
 Modernizr.addTest('mobile', function () {
index ba0e98c8034d35133a70142d4865bce238380e20..7c761cdf8e19063c5237792bbdfb97e4ba069a1a 100644 (file)
@@ -1406,287 +1406,7 @@ html.ios body.portrait #interface {
   transition: none;
 }
 
-/* Links */
-
-#links {
-  position: absolute;
-  top: 0px;
-  left: 0px;
-  z-index: 4;
-  background-color: rgba(0, 0, 0, 0.001);
-}
-
-#links, #links .container, .clinks, .ctlinks, #searchHighlights {
-  transform-origin: 0 0 0;
-}
-
-.rtl .portrait #links {
-  .leftContainer {
-    left: 0;
-  }
-}
-
-.rtl #links {
-  .leftContainer {
-    left: 50%;
-  }
-
-  .rightContainer {
-    left: 0;
-  }
-}
-
-#links .link {
-  position: absolute;
-  cursor: auto;
-}
-
-.linkshowclose {
-  position: absolute;
-  display: block;
-  top: 0;
-  left: 0;
-
-  &.topleft, &.topright {
-    width: 200px;
-    height: 200px;
-  }
-
-  &.topleft {
-    left: 0;
-  }
-
-  &.topright {
-    left: auto;
-    right: 0;
-  }
-
-  &.none {
-    display: none;
-  }
-}
-
-.link.multimedia {
-  position: absolute;
-  -ms-touch-action: manipulation;
-  touch-action: manipulation;
-
-  // Fix #2551
-  overflow: hidden;
-
-  // Fix #2556
-  &.tabslink {
-    overflow: visible;
-  }
-
-  .lottie {
-    width: 100%;
-    height: 100%;
-  }
-
-  &.notinteractive {
-    pointer-events: none;
-
-    .mask {
-      position: absolute;
-      z-index: 2;
-      top: 0;
-      left: 0;
-      width: 100%;
-      height: 100%;
-      display: block;
-
-      .ios & {
-        pointer-events: all;
-      }
-    }
-
-    iframe {
-      position: relative;
-      z-index: 1;
-      pointer-events: none;
-
-      * {
-        pointer-events: none;
-      }
-    }
-  }
-
-  // Force images to take space provided (see: https://team.cubedesigners.com/redmine/issues/1457)
-  > img.multimediaimage {
-    width: 100%;
-    height: 100%;
-  }
-}
-
-.link {
-  &[data-hidden="1"] {
-    transition: opacity 500ms, visibility 500ms;
-    visibility: hidden;
-    opacity: 0;
-
-    &.show {
-      visibility: visible;
-      opacity: 1;
-    }
-
-    &[data-animation-hide] {
-      transition: none;
-
-      &.show {
-        transition: none;
-      }
-    }
-  }
-
-  &.contentLink[data-flipcard] {
-    background-image: none !important;
-    perspective: 2000px;
-    position: relative;
-    overflow: visible;
-
-    > a {
-      position: absolute;
-      display: block;
-      top: 0;
-      left: 0;
-      width: 100%;
-      height: 100%;
-      z-index: 1;
-    }
-
-    &[data-flipcard="axis-y"] {
-      .flipcard {
-        &.flipped {
-          transform: rotateY(180deg);
-        }
-
-        > div.back {
-          transform: rotateY(180deg);
-        }
-      }
-    }
-
-    &[data-flipcard="axis-x"] {
-      .flipcard {
-        &.flipped {
-          transform: rotateX(180deg);
-        }
-
-        > div.back {
-          transform: rotateX(180deg);
-        }
-      }
-    }
-
-    .flipcard {
-      width: 100%;
-      height: 100%;
-      position: absolute;
-      transition: transform 0.8s;
-      transform-style: preserve-3d;
-
-      > div {
-        position: absolute;
-        top: 0;
-        left: 0;
-        width: 100%;
-        height: 100%;
-        backface-visibility: hidden;
-
-        img {
-          width: 100%;
-          height: 100%
-        }
-      }
-    }
-  }
-}
-
-
-.link.contentLink {
-  z-index: 500;
-  position: absolute;
-  pointer-events: none;
-  overflow: hidden;
-
-  &.interactive {
-    pointer-events: auto;
-  }
-
-  &.textLink {
-    white-space: nowrap;
-    overflow: visible;
-
-    &[data-animations] {
-      transform-origin: 0 100%;
-      opacity: 0;
-    }
-  }
-
-  &[data-layer="bothsvg"] {
-    background-color: #fff;
-  }
-
-  &[data-animation-hide] {
-    display: none;
-  }
-
-  img, div.img {
-    width: 100%;
-    height: 100%;
-    display: block;
-    background-size: 100% 100%;
-    background-position: 0 0;
-  }
-}
-
-@links-area-color: fadeout(@links-color, 100% - @links-opacity);
-
-.link a {
-  width: 100%;
-  height: 100%;
-  display: block;
-  background-color: transparent;
-
-  &.displayArea {
-    -webkit-tap-highlight-color: @links-area-color;
-    background-color: fadeout(@links-color, 99.999%);
-    border-radius: unit(@links-rounded-corners*2, px);
-
-    &.animating {
-      background-color: @links-area-color;
-    }
-
-    &:hover, &.hover {
-      .using-mouse & {
-        opacity: 1 !important;
-        background-color: @links-area-color;
-      }
-    }
-
-    &:focus {
-      .keyboard-navigating & {
-        opacity: 1 !important;
-        background-color: @links-area-color;
-      }
-    }
-  }
-}
-
-#links .nonlinkarea {
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  top: 0px;
-  left: 0px;
-  display: block;
-
-  .zoom-disabled & {
-    cursor: auto !important;
-    pointer-events: none;
-  }
-}
+@import "links";
 
 @import "bookmarks";
 
diff --git a/style/links.less b/style/links.less
new file mode 100644 (file)
index 0000000..e76a2db
--- /dev/null
@@ -0,0 +1,285 @@
+/* Links */
+
+#links {
+  position: absolute;
+  top: 0px;
+  left: 0px;
+  z-index: 4;
+  background-color: rgba(0, 0, 0, 0.001);
+}
+
+#links, #links .container, .clinks, .ctlinks, #searchHighlights {
+  transform-origin: 0 0 0;
+}
+
+.rtl .portrait #links {
+  .leftContainer {
+    left: 0;
+  }
+}
+
+.rtl #links {
+  .leftContainer {
+    left: 50%;
+  }
+
+  .rightContainer {
+    left: 0;
+  }
+}
+
+#links .link {
+  position: absolute;
+  cursor: auto;
+}
+
+.linkshowclose {
+  position: absolute;
+  display: block;
+  top: 0;
+  left: 0;
+
+  &.topleft, &.topright {
+    width: 200px;
+    height: 200px;
+  }
+
+  &.topleft {
+    left: 0;
+  }
+
+  &.topright {
+    left: auto;
+    right: 0;
+  }
+
+  &.none {
+    display: none;
+  }
+}
+
+.link.multimedia {
+  position: absolute;
+  -ms-touch-action: manipulation;
+  touch-action: manipulation;
+
+  // Fix #2551
+  overflow: hidden;
+
+  // Fix #2556
+  &.tabslink {
+    overflow: visible;
+  }
+
+  .lottie {
+    width: 100%;
+    height: 100%;
+  }
+
+  &.notinteractive {
+    pointer-events: none;
+
+    .mask {
+      position: absolute;
+      z-index: 2;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      display: block;
+
+      .ios & {
+        pointer-events: all;
+      }
+    }
+
+    iframe {
+      position: relative;
+      z-index: 1;
+      pointer-events: none;
+
+      * {
+        pointer-events: none;
+      }
+    }
+  }
+
+  // Force images to take space provided (see: https://team.cubedesigners.com/redmine/issues/1457)
+  > img.multimediaimage {
+    width: 100%;
+    height: 100%;
+  }
+}
+
+.link {
+  &[data-hidden="1"] {
+    transition: opacity 500ms, visibility 500ms;
+    visibility: hidden;
+    opacity: 0;
+
+    &.show {
+      visibility: visible;
+      opacity: 1;
+    }
+
+    &[data-animation-hide] {
+      transition: none;
+
+      &.show {
+        transition: none;
+      }
+    }
+  }
+
+  &.contentLink[data-flipcard] {
+    background-image: none !important;
+    perspective: 2000px;
+    position: relative;
+    overflow: visible;
+
+    > a {
+      position: absolute;
+      display: block;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      z-index: 1;
+    }
+
+    &[data-flipcard="axis-y"] {
+      .flipcard {
+        &.flipped {
+          transform: rotateY(180deg);
+        }
+
+        > div.back {
+          transform: rotateY(180deg);
+        }
+      }
+    }
+
+    &[data-flipcard="axis-x"] {
+      .flipcard {
+        &.flipped {
+          transform: rotateX(180deg);
+        }
+
+        > div.back {
+          transform: rotateX(180deg);
+        }
+      }
+    }
+
+    .flipcard {
+      width: 100%;
+      height: 100%;
+      position: absolute;
+      transition: transform 0.8s;
+      transform-style: preserve-3d;
+
+      > div {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        backface-visibility: hidden;
+
+        img {
+          width: 100%;
+          height: 100%
+        }
+      }
+    }
+  }
+}
+
+
+.link.contentLink {
+  z-index: 500;
+  position: absolute;
+  pointer-events: none;
+  overflow: hidden;
+
+  &.interactive {
+    pointer-events: auto;
+  }
+
+  &.textLink {
+    white-space: nowrap;
+    overflow: visible;
+
+    &[data-animations] {
+      transform-origin: 0 100%;
+      opacity: 0;
+    }
+  }
+
+  &[data-layer="bothsvg"] {
+    background-color: #fff;
+  }
+
+  &[data-animation-hide] {
+    display: none;
+  }
+
+  img, div.img {
+    width: 100%;
+    height: 100%;
+    display: block;
+    background-size: 100% 100%;
+    background-position: 0 0;
+  }
+}
+
+@links-area-color: fadeout(@links-color, 100% - @links-opacity);
+
+.link a {
+  width: 100%;
+  height: 100%;
+  display: block;
+  background-color: transparent;
+
+  &.displayArea {
+    -webkit-tap-highlight-color: @links-area-color;
+    background-color: fadeout(@links-color, 99.999%);
+    border-radius: unit(@links-rounded-corners*2, px);
+
+    &.animating {
+      background-color: @links-area-color;
+    }
+
+    &:hover, &.hover {
+      .using-mouse & {
+        opacity: 1 !important;
+        background-color: @links-area-color;
+      }
+    }
+
+    &:focus {
+      .keyboard-navigating & {
+        opacity: 1 !important;
+        background-color: @links-area-color;
+      }
+    }
+  }
+}
+
+#links .nonlinkarea {
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0px;
+  left: 0px;
+  display: block;
+
+  .zoom-disabled & {
+    cursor: auto !important;
+    pointer-events: none;
+  }
+}
+
+html.mobile [data-visibility-os="desktop"], html.desktop [data-visibility-os="mobile"] {
+  display: none !important;
+}
\ No newline at end of file