console
// 借鉴地址:https://www.jianshu.com/p/43ce4591c621
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Display a map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js'>
</script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css' rel='stylesheet' />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoidGlhbnBpZ3BpZyIsImEiOiJja2NrNXMzOWgwdjB2MnJwNXZucThxcTMwIn0.KbXLRcg296lMYM2D45jgzQ';
var map = new mapboxgl.Map({
container: 'map',
style:{
"version": 8,
"name": "Mapbox Streets",
"sprite": "mapbox://sprites/mapbox/streets-v8",
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"sources": {
"osm-tiles": {
"type": "raster",
"tiles": [
"http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{x}/{y}"
],
"tileSize": 256,
}
},
"layers":[{
"id": "123",
"type": "raster",
"source": "osm-tiles",
"source-layer": "osmtiles"
}]
},
center: [-74.50, 40],
zoom: 12
});
</script>
</body>
</html>
.container {
padding: 50px;
text-align: center;
}
.timer {
padding: 10px;
background: -webkit-linear-gradient(top, #222, #444);
background: -moz-linear-gradient(top, #222, #444);
background: -ms-linear-gradient(top, #222, #444);
background: -o-linear-gradient(top, #222, #444);
background: linear-gradient(top, #222, #444);
overflow: hidden;
display: inline-block;
border: 7px solid #efefef;
border-radius: 5px;
position: relative;
box-shadow: inset 0 -2px 10px 1px rgba(0, 0, 0, 0.75), 0 5px 20px -10px rgba(0, 0, 0, 1);
}
.cell {
width: 0.60em;
height: 40px;
font-size: 50px;
overflow: hidden;
position: relative;
float: left;
}
.numbers {
width: 0.6em;
line-height: 40px;
font-family: digital, arial, verdana;
text-align: center;
color: #fff;
position: absolute;
top: 0;
left: 0;
text-shadow: 0 0 5px rgba(255, 255, 255, 1);
}
#timer_controls {
margin-top: -5px;
}
#timer_controls label {
cursor: pointer;
padding: 5px 10px;
background: #efefef;
font-family: arial, verdana, tahoma;
font-size: 11px;
border-radius: 0 0 3px 3px;
}
input[name="controls"] {display: none;}
#stop:checked~.timer .numbers {
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
-ms-animation-play-state: paused;
animation-play-state: paused;
}
#start:checked~.timer .numbers {
-webkit-animation-play-state: running;
-moz-animation-play-state: running;
-o-animation-play-state: running;
-ms-animation-play-state: running;
animation-play-state: running;
}
#reset:checked~.timer .numbers {
-webkit-animation: none;
-moz-animation: none;
-o-animation: none;
-ms-animation: none;
animation: none;
}
.moveten {
-webkit-animation: moveten 1s steps(10, end) infinite;
-moz-animation: moveten 1s steps(10, end) infinite;
-o-animation: moveten 1s steps(10, end) infinite;
-ms-animation: moveten 1s steps(10, end) infinite;
animation: moveten 1s steps(10, end) infinite;
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
-ms-animation-play-state: paused;
animation-play-state: paused;
}
.movesix {
-webkit-animation: movesix 1s steps(6, end) infinite;
-moz-animation: movesix 1s steps(6, end) infinite;
-o-animation: movesix 1s steps(6, end) infinite;
-ms-animation: movesix 1s steps(6, end) infinite;
animation: movesix 1s steps(6, end) infinite;
}
.second {
-webkit-animation-duration: 10s;
-moz-animation-duration: 10s;
-o-animation-duration: 10s;
-ms-animation-duration: 10s;
animation-duration: 10s;
}
.tensecond {
-webkit-animation-duration: 60s;
-moz-animation-duration: 60s;
-o-animation-duration: 60s;
-ms-animation-duration: 60s;
animation-duration: 60s;
}
.milisecond {
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-o-animation-duration: 1s;
-ms-animation-duration: 1s;
animation-duration: 1s;
}
.tenmilisecond {
-webkit-animation-duration: 0.1s;
-moz-animation-duration: 0.1s;
-ms-animation-duration: 0.1s;
-o-animation-duration: 0.1s;
animation-duration: 0.1s;
}
.hundredmilisecond {
-webkit-animation-duration: 0.01s;
-moz-animation-duration: 0.01s;
-o-animation-duration: 0.01s;
-ms-animation-duration: 0.01s;
animation-duration: 0.01s;
}
.minute {
-webkit-animation-duration: 600s;
-moz-animation-duration: 600s;
-o-animation-duration: 600s;
-ms-animation-duration: 600s;
animation-duration: 600s;
}
.tenminute {
-webkit-animation-duration: 3600s;
-moz-animation-duration: 3600s;
-ms-animation-duration: 3600s;
-o-animation-duration: 3600s;
animation-duration: 3600s;
}
.hour {
-webkit-animation-duration: 36000s;
-moz-animation-duration: 36000s;
-ms-animation-duration: 36000s;
-o-animation-duration: 36000s;
animation-duration: 36000s;
}
.tenhour {
-webkit-animation-duration: 360000s;
-moz-animation-duration: 360000s;
-o-animation-duration: 360000s;
-ms-animation-duration: 360000s;
animation-duration: 360000s;
}
@-webkit-keyframes moveten {
0% {top: 0;}
100% {top: -400px;}
}
@-webkit-keyframes movesix {
0% {top: 0;}
100% {top: -240px;}
}
@-moz-keyframes moveten {
0% {top: 0;}
100% {top: -400px;}
}
@-moz-keyframes movesix {
0% {top: 0;}
100% {top: -240px;}
}
@-o-keyframes moveten {
0% {top: 0;}
100% {top: -400px;}
}
@-o-keyframes movesix {
0% {top: 0;}
100% {top: -240px;}
}
@-ms-keyframes moveten {
0% {top: 0;}
100% {top: -400px;}
}
@-ms-keyframes movesix {
0% {top: 0;}
100% {top: -240px;}
}
@keyframes moveten {
0% {top: 0;}
100% {top: -400px;}
}
@keyframes movesix {
0% {top: 0;}
100% {top: -240px;}
}
@font-face {
font-family: 'digital';
src: url('http://thecodeplayer.com/uploads/fonts/DS-DIGI.TTF');
}