Share a pure HTML5-made clock source example

Source: Internet
Author: User

Today to share a very beautiful pure HTML5 implementation of the clock. The entire interface is drawn from HTML5. Take a look at the effect chart:

The code that is implemented.

HTML code:

The code is as follows Copy Code
<div class= "Container" >


<svg width= "height=" class= ' svg-element ' >





<filter id= "F4" x= " -50%" y= " -20%" width= "200%" height= "140%" >


<feoffset result= "Offout" in= "Sourcealpha" dx= "0" dy= "/>"


<fegaussianblur result= "Blurout" in= "Offout" stddeviation= "ten"/>


<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= "a"/> <!--Shadow Offset-->


<fegaussianblur stddeviation= "result=" Offset-blur "/> <!--Shadow Blur-->


<fecomposite operator= "Out" in= "sourcegraphic" in2= "Offset-blur" result= "inverse"/> <!--Invert the drop Shadow to create a inner shadow-->


<feflood flood-color= "Black" flood-opacity= "1" result= "Color"/> <!--color & opacity--&G T


<fecomposite operator= "in" in= "color" in2= "inverse" result= "shadow"/> <!--Clip color inside shadow -->


<fecomponenttransfer in= "Shadow" result= "Shadow" > <!--shadow Opacity-->


<fefunca type= "Linear" slope= "1"/>


</feComponentTransfer>


<fecomposite operator= "Over" in= "Shadow" in2= "Sourcegraphic"/> <!--put shadow over original O Bject-->


</filter>





<filter id= "Inset-shadow-big" >


<feoffset dx= "0" dy= "4"/> <!--Shadow Offset-->


<fegaussianblur stddeviation= "2" result= "Offset-blur"/> <!--Shadow Blur-->


<fecomposite operator= "Out" in= "sourcegraphic" in2= "Offset-blur" result= "inverse"/> <!--Invert the drop Shadow to create a inner shadow-->


<feflood flood-color= "White" flood-opacity= "1" result= "Color"/> <!--color & opacity--&G T


<fecomposite operator= "in" in= "color" in2= "inverse" result= "shadow"/> <!--Clip color inside shadow -->


<fecomponenttransfer in= "Shadow" result= "Shadow" > <!--shadow Opacity-->


<fefunca type= "linear" slope= "0.5"/>


</feComponentTransfer>


<fecomposite operator= "Over" in= "Shadow" in2= "Sourcegraphic"/> <!--put shadow over original O Bject-->


</filter>





<filter id= "Inset-shadow-big-bottom" >


<feoffset dx= "0" dy= "a"/> <!--Shadow Offset-->


<fegaussianblur stddeviation= "2" result= "Offset-blur"/> <!--Shadow Blur-->


<fecomposite operator= "Out" in= "sourcegraphic" in2= "Offset-blur" result= "inverse"/> <!--Invert the drop Shadow to create a inner shadow-->


<feflood flood-color= "#FFF" flood-opacity= "1" result= "Color"/> <!--color & opacity ;


<fecomposite operator= "in" in= "color" in2= "inverse" result= "shadow"/> <!--Clip color inside shadow -->


<fecomponenttransfer in= "Shadow" result= "Shadow" > <!--shadow Opacity-->


<fefunca type= "linear" slope= "0.5"/>


</feComponentTransfer>


<fecomposite operator= "Over" in= "Shadow" in2= "Sourcegraphic" result= ' final-shadow-1 '/> <!--Pu T shadow over original object-->





<feoffset dx= "0" dy= " -12"/> <!--Shadow Offset-->


<fegaussianblur stddeviation= "2" result= "Offset-blur"/> <!--Shadow Blur-->


<fecomposite operator= "Out" in= "final-shadow-1" in2= "Offset-blur" result= "inverse"/> <!--Invert the drop Shadow to create a inner shadow-->


<feflood flood-color= "#69c39b" flood-opacity= "1" result= "Color"/> <!--color & opacity-- >


<fecomposite operator= "in" in= "color" in2= "inverse" result= "shadow"/> <!--Clip color inside shadow -->


<fecomponenttransfer in= "Shadow" result= "Shadow" > <!--shadow Opacity-->


<fefunca type= "linear" slope= "0.5"/>


</feComponentTransfer>


<fecomposite operator= "Over" in= "Shadow" in2= "Final-shadow-1" result= ' final-shadow-2 '/> <!--P UT shadow over original object-->





</filter>





<lineargradient id= "LG"


gradienttransform= "Rotate (5.5)" >


<stop id= "S0" offset= "0" stop-color= "#d6f8e9"/>


<stop id= "S2" offset= "1" stop-color= "#9ee1c4"/>


</linearGradient>





<lineargradient id= "LG2"


gradienttransform= "Rotate ( -90.5.5)" >


<stop id= "S0" offset= "0.07" stop-color= "#fdfefe"/>


<stop id= "S1" offset= "0.5" stop-color= "#98e2c2"/>


<stop id= "S2" offset= "0.8" stop-color= "#79c9a7"/>


<stop id= "S3" offset= "1" stop-color= "#5fbc95"/>


</linearGradient>





<lineargradient id= "Arrow1"


gradienttransform= "Rotate ( -90.5.5)" >


<stop id= "S0" offset= "0" stop-color= "#07594f"/>


<stop id= "S2" offset= "1" stop-color= "#01443c"/>


</linearGradient>





<lineargradient id= "Arrowred"


gradienttransform= "Rotate ( -90.5.5)" >


<stop id= "S0" offset= "0" stop-color= "#fd5959"/>


<stop id= "S2" offset= "1" stop-color= "#fe7c7c"/>


</linearGradient>





<lineargradient id= "Center-knob-outter"


gradienttransform= "Rotate (5.5)" >


<stop id= "S0" offset= "0" stop-color= "#fffefe"/>


<stop id= "S2" offset= "1" stop-color= "#86ecdb"/>


</linearGradient>





<lineargradient id= "Center-knob-inner"


gradienttransform= "Rotate (5.5)" >


<stop id= "S0" offset= "0" stop-color= "#a0dcd2"/>


<stop id= "S2" offset= "1" stop-color= "#dff9ef"/>


</linearGradient>





<g transform= "Translate" >





<rect x= "0" y= "0"


Width= "382" height= "382"


Fill= "url (#LG)"


filter= "url (#inset-shadow-big-bottom)"


rx= "ry="/>





<circle cx= "191" cy= "191" r= "fill=" url (#LG2) "/>


<circle cx= "191" cy= "191" r= "130" fill= "#53d2c5"/>


<circle cx= "191" cy= 191 "r=" 130 "fill=" #53d2c5 "filter=" url (#inset-shadow) "/>





<g width= "200" height= "


transform= "Translate" >


<animatetransform attributename= "transform" type= "translate" dur= "4s"


Values= "191,191;191,191" repeatcount= "indefinite"/>


<animatetransform attributename= "transform" additive= "sum" type= "rotate"


Dur= "86400s" values= "0 0;550 0 0" repeatcount= "indefinite"/>





<rect x= "0" y= "0"


Width= "height=" "70"


Fill= "url (#arrow1)"


fill-opacity= "0.5"


filter= "url (#blurred-source)"


Rx= "Ten" ry= "10"


transform= "Translate ( -11, -15)"/>


</g>





<g width= "200" height= "


transform= "Translate" >


<animatetransform attributename= "transform" type= "translate" dur= "4s"


Values= "191,191;191,191" repeatcount= "indefinite"/>


<animatetransform attributename= "transform" additive= "sum" type= "rotate"


Dur= "86400s" values= "0 0;550 0 0" repeatcount= "indefinite"/>





<rect x= "0" y= "0"


Width= "height=" "70"


Fill= "url (#arrow1)"


Rx= "Ten" ry= "10"


transform= "Translate ( -10, -10)"/>


</g>





<g width= "200" height= "


transform= "Translate" >


<animatetransform attributename= "transform" type= "translate" dur= "4s"


Values= "191,191;191,191" repeatcount= "indefinite"/>


<animatetransform attributename= "transform" additive= "sum" type= "rotate"


Dur= "3600s" values= "90,0 0;450 0 0" repeatcount= "indefinite"/>





<rect x= "0" y= "0"


Width= "height=" "104"


Fill= "url (#arrow1)"


fill-opacity= "0.8"


filter= "url (#blurred-source)"


rx= "8" ry= "8"


transform= "Translate ( -9, -15)" >/>


</g>





<g width= "200" height= "


transform= "Translate" >


<animatetransform attributename= "transform" type= "translate" dur= "4s"


Values= "191,191;191,191" repeatcount= "indefinite"/>


<animatetransform attributename= "transform" additive= "sum" type= "rotate"


Dur= "3600s" values= "90,0 0;450 0 0" repeatcount= "indefinite"/>





<rect x= "0" y= "0"


Width= "height=" "104"


Fill= "url (#arrow1)"


rx= "8" ry= "8"


transform= "Translate ( -8, -8)" >/>


</g>





<g width= "height=" >


<animatetransform attributename= "transform" type= "translate" dur= "4s"


Values= "195,195;190,195" repeatcount= "indefinite"/>


<animatetransform attributename= "transform" additive= "sum" type= "rotate"


Dur= "60s" values= "0,0 0;360 0 0" repeatcount= "indefinite"/>





<rect class= "Arrowred"


x= "0" y= "0"


Width= "8" height= "120"


Fill= "url (#arrowRed)"


filter= "url (#blurred-source)"


fill-opacity= "0.5"


rx= "3" ry= "3"


transform= "Translate ( -3, -20)"/>


</g>








<g width= "200" height= "


transform= "Translate" >


<animatetransform attributename= "transform" type= "translate" dur= "4s"


Values= "191,191;191,191" repeatcount= "indefinite"/>


<animatetransform attributename= "transform" additive= "sum" type= "rotate"


Dur= "60s" values= "0,0 0;360 0 0" repeatcount= "indefinite"/>





<rect class= "Arrowred"


x= "0" y= "0"


Width= "6" height= "134"


Fill= "url (#arrowRed)"


rx= "3" ry= "3"


transform= "Translate ( -3, -20)"/>


</g>











<g width= "200" height= "


transform= "Translate (191, 191)" >





<circle cx= "0" cy= "0" r= "fill=" url (#center-knob-outter) "/>


<circle cx= "0" cy= "0" r= "fill=" url (#center-knob-inner) "/>


</g>





<!--<path d= "M 200 20


40


Z ">-->





</g>


</div>

CSS code:

The code is as follows Copy Code
. container
{
Text-align:center;
width:100%;
margin-top:20px;
padding:20px;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.