Created
June 15, 2018 14:48
-
-
Save vinicius73/d79b7dbf62765de762f0f460c8e97d05 to your computer and use it in GitHub Desktop.
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
const appName = 'App Web' | |
const companyName = 'D6' | |
const version = '1.0.0' | |
const hasSw = (navigator.serviceWorker && navigator.serviceWorker.controller) | |
const mode = (window.matchMedia('(display-mode: standalone)').matches) | |
? 'standalone' | |
: 'web' | |
const sw = hasSw | |
? 'sw-on' | |
: 'sw-off' | |
console.log( | |
`%c ${companyName} ${appName} %c v${version} %c ${mode}/${sw} %c`, | |
'background:#000 ; padding: 3px; border-radius: 3px 0 0 3px; color: #fff', | |
'background:#0a88c2 ; padding: 3px; border-radius: 0 0 0 0; color: #fff', | |
`background:#${hasSw ? '21ba45' : 'db2828'} ; padding: 3px; border-radius: 0 3px 3px 0; color: #fff`, | |
'background:transparent' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment