Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="wrapper">
    <svg version="1.1" id="logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="100%" y="100%" viewBox="0 0 283.8 60.2" enable-background="new 0 0 283.8 60.2" xml:space="preserve">
        <g>
            <path fill="#200706" d="M0,56.5V3.3c0-1.7,1.4-3.1,3-3.1h4.6c1.5,0,2.7,1.2,2.7,2.8v44.9c0,1.7,1.3,3.1,3,3.1h20.5
                                    c1.3,0,2.4,1.1,2.4,2.5v3.9c0,1.6-1.3,2.9-2.9,2.9H3.6C1.6,60.2,0,58.6,0,56.5z"></path>
            <path fill="#200706" d="M61.8,57.3V2.6c0-1.3,1.1-2.4,2.4-2.4h5c1.7,0,3,1.4,3,3.1v54.4c0,1.4-1.1,2.6-2.5,2.6h-5
                                    C63,60.2,61.8,58.9,61.8,57.3z"></path>
            <path fill="#200706" d="M177.8,59V32.3c0-1.1,0.9-1.9,1.9-1.9h3.2c0.7,0,1.2,0.5,1.2,1.2v26.6c0,1.1-0.9,1.9-1.9,1.9H179
                                    C178.4,60.2,177.8,59.7,177.8,59z"></path>
            <path fill="#200706" d="M219.9,58.6l-11.1-15.2c-0.6-0.8-1.9-0.4-1.9,0.6v14.3c0,1.1-0.9,2-2,2h-1.6c-1.6,0-2.8-1.3-2.8-2.8V33.2
                                    c0-1.5,1.3-2.8,2.8-2.8h1.9c1.2,0,2.3,0.6,3,1.5l10.8,14.7c0.6,0.8,1.9,0.4,1.9-0.6V32.3c0-1.1,0.9-2,2-2h1.7
                                    c1.5,0,2.7,1.2,2.7,2.7v24.4c0,1.5-1.2,2.7-2.7,2.7h-1.4C221.8,60.2,220.6,59.6,219.9,58.6z"></path>
            <path fill="#200706" d="M256,60.2c-2.2,0-4.3-0.4-6.3-1.1c-1.9-0.7-3.6-1.7-5-3c-1.4-1.3-2.5-2.9-3.4-4.7c-0.8-1.8-1.2-3.8-1.2-6.1
                                    s0.4-4.2,1.2-6.1c0.8-1.8,1.9-3.4,3.4-4.7c1.4-1.3,3.1-2.3,5-3c1.9-0.7,4-1.1,6.3-1.1c1.6,0,3.1,0.2,4.4,0.6
                                    c1.3,0.4,2.5,0.9,3.5,1.6c1,0.6,1.9,1.4,2.6,2.2c0.2,0.2,0.3,0.4,0.5,0.6c0.8,1,0.5,2.5-0.7,3.1l-1.6,0.8c-0.9,0.4-1.9,0.2-2.5-0.5
                                    c-0.5-0.6-1.2-1.2-1.9-1.7c-1.3-0.8-2.7-1.2-4.2-1.2c-1.3,0-2.6,0.2-3.7,0.7c-1.2,0.5-2.1,1.1-3,2c-0.8,0.8-1.5,1.8-2,3
                                    c-0.5,1.2-0.7,2.4-0.7,3.8s0.2,2.6,0.7,3.8c0.5,1.2,1.1,2.2,2,3c0.8,0.8,1.8,1.5,3,2c1.2,0.5,2.4,0.7,3.7,0.7c1.6,0,3-0.4,4.2-1.2
                                    c0.8-0.5,1.4-1,2-1.7c0.6-0.7,1.7-0.9,2.5-0.5l1.6,0.8c1.2,0.6,1.6,2,0.7,3.1c-0.2,0.2-0.3,0.4-0.5,0.6c-0.7,0.8-1.6,1.6-2.6,2.3
                                    c-1,0.7-2.2,1.2-3.5,1.6C259.2,60,257.7,60.2,256,60.2z"></path>
            <path fill="#200706" d="M280.3,60.1c-1,0-1.8-0.3-2.5-1c-0.7-0.7-1-1.5-1-2.5s0.3-1.8,1-2.5c0.7-0.7,1.5-1,2.5-1c1,0,1.8,0.3,2.5,1
                                    c0.7,0.7,1,1.5,1,2.5s-0.3,1.8-1,2.5C282.1,59.8,281.2,60.1,280.3,60.1z"></path>
            <path fill="#200706" d="M148.2,30.4h-12.8c-2.3,0-4.8,2.1-4.9,4.3c0.1,2.3,2.7,3.7,5.1,3.7h5.6c1.5,0,2.8,1.5,2.8,3l0,2
                                    c0,0.9-0.3,1.8-1,2.4c-1.1,1.2-3.3,2.6-5.9,3.7c-2.5,1-5.6,1.7-8.6,1.7c-2.9,0-5.7-0.5-8.1-1.6c-2.5-1-4.6-2.5-6.4-4.4
                                    c-1.8-1.9-3.2-4.1-4.2-6.7c-1-2.6-1.5-5.4-1.5-8.4c0-3,0.5-5.8,1.5-8.4c1-2.6,2.4-4.8,4.2-6.7c1.8-1.9,3.9-3.3,6.4-4.4
                                    c2.5-1,5.2-1.6,8.1-1.6c3.4,0,6.4,0.7,9,2.2c0.1,0.1,0.2,0.1,0.3,0.2c1.4,0.8,2.6,1.7,3.7,2.8c1.5,1.4,3.7,1.7,5.5,0.7l0.8-0.4
                                    l0.7-0.4c2-1.1,2.5-3.8,0.9-5.5c-0.4-0.4-0.9-0.9-1.3-1.3c-1.6-1.5-3.3-2.8-5.3-3.8c-1.9-1.1-4.1-1.9-6.5-2.6c-2.4-0.6-5-1-7.9-1
                                    c-4.2,0-8.2,0.7-12,2.1c-3.8,1.4-7.1,3.4-9.9,6.1c-2.8,2.6-5,5.8-6.6,9.5c-1.6,3.7-2.4,7.8-2.4,12.4c0,4.5,0.8,8.7,2.4,12.4
                                    c1.6,3.7,3.8,6.9,6.6,9.5c2.8,2.6,6.1,4.7,9.9,6.1c3.8,1.4,7.8,2.1,12,2.1c5.2,0,9.7-1,13.7-2.9c1.9-0.9,3.5-1.9,5.2-3.1
                                    c3.3-2.4,5-6.2,5-10.2v-8.8C152.4,32.7,150.7,30.4,148.2,30.4z"></path>
        </g>
</svg>
</div>
              
            
!

CSS

              
                html, body {
    width: 100%;
    height: 100%;
}
body {
    margin: 0;
}
.wrapper {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 40px;
    position: relative;
}
svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}
              
            
!

JS

              
                // あらかじめgetUserMediaのポリフィルが読み込まれています
// https://github.com/lig-dsktschy/ligfes20160426/blob/gh-pages/01/js/getusermedia-commented.js

'use strict';

var ctx, analyser, frequencies, getByteFrequencyDataAverage, elLogo, draw;

window.AudioContext = window.AudioContext || window.webkitAudioContext;
ctx = new AudioContext();

analyser = ctx.createAnalyser();
frequencies = new Uint8Array(analyser.frequencyBinCount);

getByteFrequencyDataAverage = function() {
    analyser.getByteFrequencyData(frequencies);
    return frequencies.reduce(function(previous, current) {
        return previous + current;
    }) / analyser.frequencyBinCount;
};

navigator.mediaDevices.getUserMedia({audio: true})
    .then(function(stream) {
        window.hackForMozzila = stream;
        ctx.createMediaStreamSource(stream)
          // AnalyserNodeに接続
          .connect(analyser);
    })
    .catch(function(err) {
        console.log(err.message);
    });

// 透明度を変更する要素
elLogo = document.getElementById('logo');
// 可能な限り高いフレームレートで音量を取得し、透明度に反映する
(draw = function() {
    // opacityの範囲である0〜1に変換
    elLogo.style.opacity = getByteFrequencyDataAverage() / 255;
    requestAnimationFrame(draw);
})();
              
            
!
999px

Console