Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add padding around swipe for easier grabbing #1234

Benjamin King079b1c6b522e
diff --git a/web/css/compare.css b/web/css/compare.css
index a5cdb29bd..f94678698 100644
--- a/web/css/compare.css
+++ b/web/css/compare.css
@@ -10,14 +10,21 @@
.ab-swipe-dragger {
position: absolute;
top: 50%;
+ width: 65px;
+ height: 65px;
+ margin-top: -45px;
+ border-radius: 50%;
+ left: -30px;
+ text-align: center;
+}
+.ab-swipe-dragger .swipe-dragger-circle {
width: 45px;
height: 45px;
- margin-top: -35px;
- left: -20px;
+ left: -25px;
border-radius: 50%;
- color: #000;
background: #fff;
- text-align: center;
+ color: #000;
+ margin: 10px;
}
.ab-swipe-dragger:hover {
transform: scale(1.2);
diff --git a/web/js/map/compare/swipe.js b/web/js/map/compare/swipe.js
index 583360412..c4f5a90b6 100644
--- a/web/js/map/compare/swipe.js
+++ b/web/js/map/compare/swipe.js
@@ -128,11 +128,13 @@ export class Swipe {
var addLineOverlay = function(map) {
var lineCaseEl = document.createElement('div');
var draggerEl = document.createElement('div');
+ var draggerCircleEl = document.createElement('div');
var iconEl = document.createElement('i');
var firstLabel = document.createElement('span');
var secondLabel = document.createElement('span');
var windowWidth = util.browser.dimensions[0];
mapCase = map.getTargetElement();
+ draggerCircleEl.className = 'swipe-dragger-circle';
firstLabel.className = 'ab-swipe-span left-label';
secondLabel.className = 'ab-swipe-span right-label';
firstLabel.appendChild(document.createTextNode('A'));
@@ -143,7 +145,8 @@ var addLineOverlay = function(map) {
lineCaseEl.className = 'ab-swipe-line';
lineCaseEl.appendChild(firstLabel);
lineCaseEl.appendChild(secondLabel);
- draggerEl.appendChild(iconEl);
+ draggerEl.appendChild(draggerCircleEl);
+ draggerCircleEl.appendChild(iconEl);
lineCaseEl.appendChild(draggerEl);
mapCase.appendChild(lineCaseEl);
swipeOffset = percentSwipe