Skip to content

Commit

Permalink
Set the bar higher for high-quality mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Apr 28, 2019
1 parent 4672a4d commit a7e0b35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ for (let family in familiesSpeciesData) {
}

const isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
const smallScreen = screen.width <= 600 || screen.height <= 600;
const hqHash = /#hq/.test(location.hash);
const renderingMode = !hqHash && (isTouch && smallScreen) ? 'low' : 'high';
const renderingMode = !hqHash && isTouch ? 'low' : 'high';

if (renderingMode === 'low') document.getElementById('rendering-mode').hidden = false;

Expand Down
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ <h1>Explore Trees in Singapore <button class="close">×</button></h1>
}

const _isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
const _smallScreen = screen.width <= 600 || screen.height <= 600;
const _hqHash = /#hq/.test(location.hash);
const _renderingMode = !_hqHash && (_isTouch && _smallScreen) ? 'low' : 'high';
const _renderingMode = !_hqHash && _isTouch ? 'low' : 'high';
if (_renderingMode === 'high') {
document.getElementById('dummy-fetch').rel = 'preload';
}
Expand Down

0 comments on commit a7e0b35

Please sign in to comment.