MEDIA / 105

Waveform graphic

波形のグラフィック
縦棒の高さを変え、音の波形を思わせる図形をつくります。

実際のHTML・CSSで描かれた見本です。

ラボで詳しく試す ↗

ひとつ試すなら

どこが変わるかを観察して、似た表現と見比べてみよう。

こんなときに

音声コンテンツの見た目を検討するとき。

仕組みと使い方

これは静的な図形です。音声の解析や再生は行いません。

波形waveform音グラフィック
実装コードを見る
<style>
.sample{width:100%;height:100%;min-height:190px;display:grid;place-items:center;position:relative;overflow:hidden;box-sizing:border-box;font-family:Arial,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;color:#20211d;background:#f1f0e9;padding:22px}.sample *{box-sizing:border-box}.sample button,.sample input,.sample summary{font:inherit}.sample button,.sample summary,.sample label{touch-action:manipulation}.sample :focus-visible{outline:3px solid #6050bf;outline-offset:5px}.sample small{font-size:10px;line-height:1.5}.sample .editable{margin:0}.sample svg{max-width:100%;height:auto}
.sample .wave{display:flex;align-items:center;gap:5px;height:125px}.sample i{width:7px;background:#9980cb;border-radius:20px}
</style>
<div class="sample">
<div class="wave" aria-label="波形を模した静的な図形"><i style="height:20px"></i><i style="height:35px"></i><i style="height:52px"></i><i style="height:31px"></i><i style="height:70px"></i><i style="height:92px"></i><i style="height:55px"></i><i style="height:110px"></i><i style="height:79px"></i><i style="height:46px"></i><i style="height:96px"></i><i style="height:63px"></i><i style="height:36px"></i><i style="height:72px"></i><i style="height:45px"></i><i style="height:24px"></i><i style="height:39px"></i></div>
</div>