parent
1673ccd8f9
commit
8eaa279a07
10 changed files with 166 additions and 47 deletions
After Width: | Height: | Size: 195 B |
@ -0,0 +1,15 @@ |
||||
import React from "react"; |
||||
|
||||
import "./index.scss"; |
||||
|
||||
const CssCountdown = () => { |
||||
return ( |
||||
<div className="wrapper"> |
||||
<span className="box third-number"></span> |
||||
<span className="box second-number"></span> |
||||
<span className="box first-number"></span> |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default CssCountdown; |
@ -0,0 +1,32 @@ |
||||
body { |
||||
background: #262626; |
||||
} |
||||
|
||||
.wrapper { |
||||
position: absolute; |
||||
top: 50%; |
||||
left: 50%; |
||||
transform: translate(-50%, -50%); |
||||
} |
||||
|
||||
.wrapper span { |
||||
color: #fff; |
||||
border: 5px solid #ddd; |
||||
padding: 0 30px; |
||||
border-radius: 25px; |
||||
margin: 0 10px; |
||||
} |
||||
|
||||
.box { |
||||
display: inline-block; |
||||
overflow: hidden; |
||||
height: 1em; |
||||
font-weight: bold; |
||||
font-size: 16em; |
||||
} |
||||
|
||||
.box::after { |
||||
position: relative; |
||||
white-space: pre; |
||||
content: ""; |
||||
} |
@ -0,0 +1,31 @@ |
||||
import L from "leaflet"; |
||||
import { GridLayer, withLeaflet } from "react-leaflet"; |
||||
|
||||
class Grid extends GridLayer { |
||||
createLeafletElement() { |
||||
const Grid = L.GridLayer.extend({ |
||||
createTile: () => { |
||||
const tile = document.createElement("div"); |
||||
tile.style.outline = "1px solid black"; |
||||
return tile; |
||||
}, |
||||
}); |
||||
return new Grid({ tileSize: 100 }); |
||||
} |
||||
|
||||
componentDidMount() { |
||||
const { map } = this.props.leaflet; |
||||
if (this.props.showGrid) this.leafletElement.addTo(map); |
||||
} |
||||
|
||||
updateLeafletElement(fromProps, toProps) { |
||||
const { map } = this.props.leaflet; |
||||
if (toProps.showGrid !== fromProps.showGrid) { |
||||
toProps.showGrid |
||||
? this.leafletElement.addTo(map) |
||||
: this.leafletElement.removeFrom(map); |
||||
} |
||||
} |
||||
} |
||||
|
||||
export default withLeaflet(Grid); |
Loading…
Reference in new issue