-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3D] 3d tilt #2609
[3D] 3d tilt #2609
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
goog.provide('ga_tilt3d_directive'); | ||
|
||
(function() { | ||
|
||
var module = angular.module('ga_tilt3d_directive', []); | ||
|
||
module.directive('gaTilt3d', function(gaBrowserSniffer) { | ||
return { | ||
restrict: 'A', | ||
templateUrl: 'components/tilt3d/partials/tilt3d.html', | ||
link: function(scope, element, attrs) { | ||
|
||
scope.supported = gaBrowserSniffer.webgl; | ||
|
||
// true is the selected background layer is not 3d compatible. | ||
scope.disabled = false; | ||
scope.$on('gaBgChange', function(evt, value) { | ||
scope.disabled = !!value.disable3d; | ||
}); | ||
|
||
scope.tilt = function() { | ||
if (scope.supported) { | ||
if (!scope.disabled) { | ||
scope.globals.is3dActive = !scope.globals.is3dActive; | ||
} else { | ||
// FIXME: error message "selected background not compatible" | ||
} | ||
} else { | ||
// FIXME: error message "browser not supported" | ||
} | ||
}; | ||
} | ||
}; | ||
}); | ||
})(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
goog.provide('ga_tilt3d'); | ||
|
||
goog.require('ga_tilt3d_directive'); | ||
(function() { | ||
|
||
angular.module('ga_tilt3d', [ | ||
'ga_tilt3d_directive' | ||
]); | ||
})(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<button type="button" class="ga-tilt3d" ng-click="tilt()" ng-class="{'ga-disabled': disabled, 'ga-unsupported': !supported}">3d</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.ga-tilt3d { | ||
background-color: #fff !important; | ||
&.ga-unsupported, &.ga-disabled { | ||
cursor: default; | ||
} | ||
&.ga-unsupported { | ||
|
||
} | ||
&.ga-disabled { | ||
background-color: gray !important; | ||
} | ||
} | ||
|
||
.ga-3d-active { | ||
.ga-tilt3d { | ||
background-color: green !important; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,7 @@ | |
% if device == 'mobile': | ||
<div ga-offline-bt></div> | ||
% endif | ||
<div ga-tilt3d ng-if="globals.dev3d"></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you think that using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The advantage of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, It may be quite the same here. Personally I tend to use |
||
</div> | ||
<div ga-swipe | ||
ga-swipe-map="map" | ||
|
@@ -235,7 +236,8 @@ | |
|
||
% if device != 'embed': | ||
<div ng-cloak ga-background-selector | ||
ga-background-selector-map="map" | ||
ga-background-selector-map="map", | ||
ga-background-selector-ol3d="::ol3d" | ||
ng-hide="globals.offline"> | ||
</div> | ||
<div ng-cloak translate-cloak id="footer" class="navbar navbar-fixed-bottom"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
!!
?value.disable3d
is a boolean value already, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean
orundefned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, true.