From 3e9c5d59969de9e22691a9446a81d18911442cf7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 17 Jun 2021 13:26:28 +0200 Subject: tripoli: Workaround Safari SVG bugs by avoiding SVG features. --- play.html | 210 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 104 insertions(+), 106 deletions(-) (limited to 'play.html') diff --git a/play.html b/play.html index 61ad59b..439d942 100644 --- a/play.html +++ b/play.html @@ -73,55 +73,60 @@ /* MAP */ +.mapwrap.fit { + box-shadow: 0px 0px 15px rgba(0,0,0,0.8); +} + #map { + position: relative; display: block; width: 2476px; height: 801px; background-color: black; - box-shadow: 0 0 15px rgba(0,0,0,0.8); + box-shadow: 0px 0px 15px rgba(0,0,0,0.8); } -#map.fit { - width: 100%; - height: auto; +svg { + position: absolute; } -#map image { +svg image { pointer-events: none; } -#map use, #map circle { - transition-property: x, y, cx, cy; +svg circle, .piece { + transition-property: x, y, cx, cy, top, left; transition-duration: 700ms; transition-timing-function: ease; } -#map use { +.piece { + position: absolute; pointer-events: none; + background-size: cover; + background-repeat: none; + filter: drop-shadow(1px 1px 4px rgba(0,0,0,0.5)); } -#map use.highlight { +.piece.highlight { pointer-events: all; cursor: pointer; - stroke: white; + filter: brightness(150%) drop-shadow(0 0 3px white); } -#map use.highlight.damaged { - stroke: lightgray; +.piece.damaged { + filter: brightness(60%) drop-shadow(1px 1px 4px rgba(0,0,0,0.5)); } -.us_frigate { fill: #0977bd; } -.us_gunboat { fill: #0977bd; } -.se_frigate { fill: #fdd527; } -.tr_frigate { fill: #de333e; } -.tr_corsair { fill: #de333e; } -.al_corsair { fill: #f39331; } -.us_marine { fill: #0977bd; } -.ar_infantry { fill: #e0e0e0; } -.tr_infantry { fill: #de333e; } - -.us_frigate.damaged { fill: #005577; } -.tr_frigate.damaged { fill: #881111; } +.piece.us_frigate { width: 42px; height: 29px; background-image: url("icons/us_frigate.svg"); } +.piece.se_frigate { width: 42px; height: 29px; background-image: url("icons/se_frigate.svg"); } +.piece.tr_frigate { width: 42px; height: 29px; background-image: url("icons/tr_frigate.svg"); } +.piece.us_gunboat { width: 33px; height: 27px; background-image: url("icons/us_gunboat.svg"); } +.piece.tr_corsair { width: 33px; height: 27px; background-image: url("icons/tr_corsair.svg"); } +.piece.al_corsair { width: 33px; height: 27px; background-image: url("icons/al_corsair.svg"); } +.piece.us_marine { width: 21px; height: 21px; background-image: url("icons/us_marine.svg"); } +.piece.ar_infantry { width: 21px; height: 21px; background-image: url("icons/ar_infantry.svg"); } +.piece.tr_infantry { width: 21px; height: 21px; background-image: url("icons/tr_infantry.svg"); } .harbor { fill-opacity: 0; @@ -275,7 +280,7 @@ -
+
@@ -308,18 +313,9 @@
- - - - - - - - - - - - +
+
+ @@ -339,76 +335,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-- cgit v1.2.3