From 130e72ea6ba94efce873e5be4b0e3cbc2c3313b2 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 29 Mar 2019 14:37:06 -0600 Subject: [PATCH] Refine expanding card UX --- www/css/styles.css | 49 ++++++++++++++++++++++++++++++++++++++------- www/js/home.js | 17 ++++------------ www/js/map.js | 6 ++++-- www/pages/home.html | 34 ++++++++++++++++--------------- 4 files changed, 68 insertions(+), 38 deletions(-) diff --git a/www/css/styles.css b/www/css/styles.css index 8430a2e..f4b8978 100644 --- a/www/css/styles.css +++ b/www/css/styles.css @@ -88,16 +88,24 @@ html.md .navbar .link { display: block !important; } -#qrcode { - width: 10em; - max-width: 100%; - max-height: 12em; +.card-opened .card-header { + display: none; } -.card-expandable #qrcode { +#qrcode, .card-closing #qrcode { width: auto; + max-width: 100%; + height: 12em; + transition: height 0.3s ease-in-out; +} + +.card-opening #qrcode, .card-opened #qrcode { height: 55em; - max-height: 50vh; + max-height: 55vh; +} + +#map-card { + background-color: hsl(47, 26%, 88%); } #map { @@ -106,17 +114,44 @@ html.md .navbar .link { left: 0; height: 100%; width: 100%; + opacity: 1; + transition: opacity 0.5s linear, top 0.25s linear; + background-color: hsl(47, 26%, 88%); } .card-expandable.card-closing, .card-expandable.card-opened, .card-expandable.card-opening { z-index: 9999999; } -.card-expandable #map { +.card-opening #map, .card-closing #map { + opacity: 0; +} + +.card-opened #map { + opacity: 1; top: var(--f7-navbar-height); height: calc(100% - var(--f7-navbar-height)); } .card-backdrop { z-index: 999999; +} + +#map .leaflet-control-attribution, #map .leaflet-control-zoom { + opacity: 0; + visibility: hidden; + transition: visibility 0s, opacity 0.5s; +} + +.card-opened #map .leaflet-control-attribution, .card-opened #map .leaflet-control-zoom { + opacity: 1; + visibility: visible; +} + +.card-expandable .navbar { + display: none; +} + +.card-opened .navbar { + display: block; } \ No newline at end of file diff --git a/www/js/home.js b/www/js/home.js index 41d033a..218d261 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -12,20 +12,18 @@ $(".view-main").on("ptr:refresh", ".ptr-content", function () { }); }); + $(".view-main").on("card:open", ".card-expandable", function () { $(".ptr-preloader").addClass("display-none"); - $(".card-expandable .navbar").removeClass("display-none"); }); -$(".view-main").on("card:close", ".card-expandable", function () { - $(".card-expandable .navbar").addClass("display-none"); +$(".view-main").on("card:closed", "#map-card", function () { + leafletgllayer._glMap.setPitch(0); + leafletmap.invalidateSize(); }); $(".view-main").on("card:closed", ".card-expandable", function () { $(".ptr-preloader").removeClass("display-none"); - $(this).removeClass("card-expandable"); - leafletgllayer._glMap.setPitch(0); - leafletmap.invalidateSize(); }); function loadBalance(callback) { @@ -47,14 +45,7 @@ function loadBalance(callback) { }); } -function openReceiveCard() { - $("#receive-card").addClass("card-expandable"); - app.card.open("#receive-card"); -} - function openMapCard() { - $("#map-card").addClass("card-expandable"); - app.card.open("#map-card"); leafletgllayer._glMap.setPitch(40); leafletmap.invalidateSize(); } diff --git a/www/js/map.js b/www/js/map.js index 5f2c642..5b03078 100644 --- a/www/js/map.js +++ b/www/js/map.js @@ -6,11 +6,13 @@ var leafletmap = L.map('map', { - attributionControl: false, - minZoom: 12 + minZoom: 12, + maxZoom: 20 }); leafletmap.setView([46.595, -112.019], 13); +leafletmap.attributionControl.setPrefix(""); var leafletgllayer = L.mapboxGL({ + attribution: "© OpenMapTiles © OpenStreetMap contributors", accessToken: 'none', style: 'https://maps.netsyms.net/styles/klokantech-3d-gl/style.json', pitch: 0 diff --git a/www/pages/home.html b/www/pages/home.html index e7b5c52..e1a0020 100644 --- a/www/pages/home.html +++ b/www/pages/home.html @@ -52,17 +52,18 @@
-
+
-
- Receive Money -
- +
+ +
+ Receive Money +
+ +
-
-
-
-
- -
- Nearby -
+
-