How to use the modernizr.webgl function in modernizr

To help you get started, we’ve selected a few modernizr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nasa / common-mapping-client / src / _core / utils / MapWrapperCesium.js View on Github external
createMap(container, options) {
        try {
            // Check for webgl support
            if (!Modernizr.webgl) {
                throw "WebGL not available in this browser but is required by CesiumJS";
            }
            let map = new this.cesium.Viewer(container, {
                animation: false,
                baseLayerPicker: false,
                fullscreenButton: false,
                geocoder: false,
                homeButton: false,
                infoBox: false,
                sceneModePicker: false,
                selectionIndicator: false,
                timeline: false,
                navigationHelpButton: false,
                vrButton: false,
                contextOptions: {
                    alpha: true
github nasa / common-mapping-client / src / _core / reducers / reducerFunctions / ViewReducer.js View on Github external
if (!Modernizr.fullscreen) {
            alerts = alerts.push(
                alert.merge({
                    title: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.title,
                    body: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.formatString
                        .replace("{FUNCTIONALITY}", "Fullscreen")
                        .replace(
                            "{SYMPTOM}",
                            "This application will not be able to enter fullscreen mode"
                        ),
                    severity: 2,
                    time: new Date()
                })
            );
        }
        if (!Modernizr.webgl) {
            alerts = alerts.push(
                alert.merge({
                    title: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.title,
                    body: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.formatString
                        .replace("{FUNCTIONALITY}", "WebGL")
                        .replace(
                            "{SYMPTOM}",
                            "This application will not be able to use the 3D map"
                        ),
                    severity: 3,
                    time: new Date()
                })
            );
        }
        return state.set("alerts", alerts);
    }
github SeedVault / Hadron / src / hadron.js View on Github external
checkDeviceCapabilites() {
      this.hasWebGL              = Modernizr.webgl;
      this.hasWebGLExtensions    = Modernizr.webglextensions;
      this.hasSpeechSynthesis    = Modernizr.speechsynthesis;
      this.hasSpeechRecognition  = Modernizr.speechrecognition;
      this.hasBatteryAPI         = Modernizr.batteryapi;
      this.hasLowBattery         = Modernizr.lowbattery;
      this.hasLowBandwidth       = Modernizr.lowbandwidth;
    }
github nasa / common-mapping-client / src / _core / components / Map / MapControlsContainer.js View on Github external
[this.props.className]: typeof this.props.className !== "undefined",
            [styles.mapControlsContainer]: true
        });
        return (
            <div> this.onMapControlsMouseLeave()}
                onMouseEnter={() =&gt; this.onMapControlsMouseEnter()}
            &gt;
                
                    
                         this.setViewMode()}
                            aria-label={
                                this.props.in3DMode ? "Switch to 2D map" : "Switch to 3D map"
                            }
                            className={styles.singleButton}
                        &gt;
                            
                        
                    
                
                
                    </div>