Loading...
(function(){<br />
let canvas = document.createElement('canvas'),<br />
ctx = canvas.getContext('2d'),<br />
w = canvas.width = innerWidth,<br />
h = canvas.height = innerHeight,<br />
particles = [],<br />
properties = {<br />
bgColor : 'rgba(17, 17, 19, 1)',<br />
particleColor : 'rgba(255, 40, 40, 1)',<br />
particleRadius : 3,<br />
particleCount : 60,<br />
particleMaxVelocity : 0.5,<br />
lineLength : 150,<br />
particleLife : 6,<br />
};<br />
<br />
document.querySelector('body').appendChild(canvas);<br />
<br />
window.onresize = function() {<br />
w = canvas.width = innerWidth;<br />
h = canvas.height = innerHeight;<br />
}<br />
<br />
class Particle {<br />
constructor() {<br />
this.x = Math.random()*w;<br />Loading...
Opera 8.0+
1const isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
Firefox 1.0+
1const isFirefox = typeof InstallTrigger !== 'undefined';
Safari 3.0+ "[object HTMLElementConstructor]"
1const isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification));
Internet Explorer 6-11
1const isIE = /*@cc_on!@*/false || !!document.documentMode;
Edge 20+
1const isEdge = !isIE && !!window.StyleMedia;
Chrome 1 - 71
1const isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
Blink engine detection
1const isBlink = (isChrome || isOpera) && !!window.CSS;
Source: https://stackoverflow.com/questions/49328382/browser-detection-in-reactjs