今天给大家分享一款非常漂亮的纯html5实现的时钟。整个界面都由html5绘制而成。下面我们来看看具体实现的代码,需要的朋友可以参考下
今天给大家分享一款非常漂亮的纯html5实现的时钟。整个界面都由html5绘制而成。一起看下效果图:
实现的代码。
htm代码:
XML/HTML Code复制内容到剪贴板
- <div class="container">
- <svg width="600" height="600" class='svg-element'>
-
- <filter id="f4" x="-50%" y="-20%" width="200%" height="140%">
- <feOffset result="offOut" in="SourceAlpha" dx="0" dy="25" />
- <feGaussianBlur result="blurOut" in="offOut" stdDeviation="10" />
- <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
- </filter>
-
- <filter id="blurred-source" x="-50%" y="-20%" width="200%" height="140%">
- <feGaussianBlur in="color" stdDeviation="5" result="blurOut"/>
- </filter>
-
- <filter id="inset-shadow">
- <feOffset dx="0" dy="10"/>
- <feGaussianBlur stdDeviation="15" result="offset-blur"/>
- <feComposite operator="out" in="SourceGraphic" in2="offset-blur" result="inverse"/>
- <feFlood flood-color="black" flood-opacity="1" result="color"/>
- <feComposite operator="in" in="color" in2="inverse" result="shadow"/>
- <feComponentTransfer in="shadow" result="shadow">
- <feFuncA type="linear" slope="1"/>
- </feComponentTransfer>
- <feComposite operator="over" in="shadow" in2="SourceGraphic"/>
- </filter>
-
- <filter id="inset-shadow-big">
- <feOffset dx="0" dy="4"/>
- <feGaussianBlur stdDeviation="2" result="offset-blur"/>
- <feComposite operator="out" in="SourceGraphic" in2="offset-blur" result="inverse"/>
- <feFlood flood-color="white" flood-opacity="1" result="color"/>
- <feComposite operator="in" in="color" in2="inverse" result="shadow"/>
- <feComponentTransfer in="shadow" result="shadow">
- <feFuncA type="linear" slope="0.5"/>
- </feComponentTransfer>
- <feComposite operator="over" in="shadow" in2="SourceGraphic"/>
- </filter>
-
- <filter id="inset-shadow-big-bottom">
- <feOffset dx="0" dy="10"/> &nbs