Skip to content

Commit e5f53c3

Browse files
committed
Update rotate instructions style.
1 parent 475c4ee commit e5f53c3

File tree

3 files changed

+103
-29
lines changed

3 files changed

+103
-29
lines changed

bower_components/webvr-polyfill/build/webvr-polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3026,7 +3026,7 @@ module.exports = THREE;
30263026
*/
30273027
var THREE = require('./three-math.js');
30283028

3029-
var ROTATE_SPEED = 0.5;
3029+
var ROTATE_SPEED = -0.5;
30303030
/**
30313031
* Provides a quaternion responsible for pre-panning the scene before further
30323032
* transformations due to device sensors.

build/webvr-manager.js

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -663,23 +663,56 @@ function RotateInstructions() {
663663
s.bottom = 0;
664664
s.left = 0;
665665
s.backgroundColor = 'gray';
666-
s.backgroundRepeat = 'no-repeat';
667-
s.backgroundPosition = '50% 20%';
668-
s.backgroundImage = 'url(' + this.icon + ')';
666+
s.fontFamily = 'sans-serif';
667+
668+
var img = document.createElement('img');
669+
img.src = this.icon;
670+
var s = img.style;
671+
s.marginLeft = '25%';
672+
s.marginTop = '25%';
673+
s.width = '50%';
674+
overlay.appendChild(img);
669675

670676
var text = document.createElement('div');
671677
var s = text.style;
672678
s.textAlign = 'center';
673-
s.fontSize = '24px';
674-
s.fontFamily = 'sans-serif';
679+
s.fontSize = '16px';
680+
s.lineHeight = '24px';
681+
s.margin = '24px 25%';
682+
s.width = '50%';
683+
text.innerHTML = 'Place your phone into your Cardboard viewer.';
684+
overlay.appendChild(text);
685+
686+
var snackbar = document.createElement('div');
687+
var s = snackbar.style;
688+
s.backgroundColor = '#CFD8DC';
675689
s.position = 'fixed';
676690
s.bottom = 0;
677-
s.marginBottom = '5%';
678-
s.marginLeft = 'auto';
679-
s.marginRight = 'auto';
680691
s.width = '100%';
681-
text.innerHTML = 'Place your phone into your Cardboard viewer.';
682-
overlay.appendChild(text);
692+
s.height = '48px';
693+
s.padding = '14px 24px';
694+
s.boxSizing = 'border-box';
695+
s.color = '#656A6B';
696+
overlay.appendChild(snackbar);
697+
698+
var snackbarText = document.createElement('div');
699+
snackbarText.style.float = 'left';
700+
snackbarText.innerHTML = 'No Cardboard viewer?';
701+
702+
var snackbarButton = document.createElement('a');
703+
snackbarButton.href = 'https://www.google.com/get/cardboard/get-cardboard/';
704+
snackbarButton.innerHTML = 'get one';
705+
var s = snackbarButton.style;
706+
s.float = 'right';
707+
s.fontWeight = 600;
708+
s.textTransform = 'uppercase';
709+
s.borderLeft = '1px solid gray';
710+
s.paddingLeft = '24px';
711+
s.textDecoration = 'none';
712+
s.color = '#656A6B';
713+
714+
snackbar.appendChild(snackbarText);
715+
snackbar.appendChild(snackbarButton);
683716

684717
this.overlay = overlay;
685718
this.text = text;
@@ -691,13 +724,17 @@ function RotateInstructions() {
691724
RotateInstructions.prototype.show = function() {
692725
this.overlay.style.display = 'block';
693726

694-
var sText = this.text.style;
695-
var s = this.overlay.style;
727+
var img = this.overlay.querySelector('img');
728+
var s = img.style;
696729

697730
if (Util.isLandscapeMode()) {
698-
s.backgroundSize = '30%';
731+
s.width = '20%';
732+
s.marginLeft = '40%';
733+
s.marginTop = '3%';
699734
} else {
700-
s.backgroundSize = '60%';
735+
s.width = '50%';
736+
s.marginLeft = '25%';
737+
s.marginTop = '25%';
701738
}
702739
};
703740

src/rotate-instructions.js

Lines changed: 51 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)