-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update demo to make it more responsible for mobile devices;
- Loading branch information
1 parent
7c1e9d8
commit ea5d79c
Showing
4 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import './mobile.init'; | ||
import '../../src'; | ||
import './style.css'; | ||
import './assets/fonts/helvetica-neue.css'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import MobileDetect from 'mobile-detect'; | ||
|
||
|
||
const md = new MobileDetect(window.navigator.userAgent); | ||
const isMobile = md.mobile(); | ||
|
||
if (isMobile) { | ||
const elementsToHide = document.querySelectorAll('.no-mobile'); | ||
const mercedes360View = document.getElementById('mercedes-360-view'); | ||
|
||
for (let i = 0; elementsToHide.length > i; i++ ) { | ||
const elem = elementsToHide[i]; | ||
elem.parentNode.removeChild(elem); | ||
} | ||
|
||
mercedes360View.setAttribute( | ||
'data-folder', | ||
'https://scaleflex.cloudimg.io/crop/600x400/n/https://scaleflex.airstore.io/demo/360-car/' | ||
); | ||
mercedes360View.setAttribute('data-ratio', '0.666'); | ||
mercedes360View.setAttribute('data-bottom-circle-offset', '22'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters