Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style>
- .svg-item {
- width: 100%;
- font-size: 16px;
- margin: 0 auto;
- animation: donutfade 1s;
- }
- @keyframes donutfade {
- /* this applies to the whole svg item wrapper */
- 0% {
- opacity: .2;
- }
- 100% {
- opacity: 1;
- }
- }
- @media (min-width: 992px) {
- .svg-item {
- width: 80%;
- }
- }
- .d-ring {
- stroke: #EBEBEB;
- }
- .d-seg {
- stroke: #ed1e79;
- animation: donut3 3s;
- }
- .d-percent {
- animation: donutfadelong 1s;
- }
- @keyframes donutfadelong {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
- }
- .donut-text {
- font-family: Arial, Helvetica, sans-serif;
- fill: #FF6200;
- }
- .donut-text-3 {
- fill: #ed1e79;
- }
- .d-percent {
- font-size: 0.5em;
- line-height: 1;
- transform: translateY(0.5em);
- font-weight: bold;
- }
- .donut-data {
- font-size: 0.12em;
- line-height: 1;
- transform: translateY(0.5em);
- text-align: center;
- text-anchor: middle;
- color:#666;
- fill: #666;
- animation: donutfadelong 1s;
- }
- @keyframes donut3{
- 0% {
- stroke-dasharray: 0, 100;
- }
- 100% {
- stroke-dasharray: 80, 20;
- }
- }
- /* ---------- */
- /* just for this presentation */
- html { text-align:center; }
- .svg-item {
- max-width:30%;
- display:inline-block;
- }
- </style>
- </head>
- <body>
- <div class="svg-item">
- <svg width="100%" height="100%" viewBox="0 0 40 40" class="donut">
- <circle class="donut-hole" cx="20" cy="20" r="15.91549430918954" fill="#fff"></circle>
- <circle class="d-ring" cx="20" cy="20" r="15.91549430918954" fill="transparent" stroke-width="3.5"></circle>
- <circle class="dd-seg d-seg" cx="20" cy="20" r="15.91549430918954" fill="transparent" stroke-width="3.5" stroke-dasharray="80 20" stroke-dashoffset="25"></circle>
- <g class="donut-text donut-text-3">
- <text y="50%" transform="translate(0, 2)">
- <tspan x="50%" text-anchor="middle" class="d-percent">1%</tspan>
- </text>
- <text y="60%" transform="translate(0, 2)">
- <tspan x="50%" text-anchor="middle" class="donut-data">50 widgets</tspan>
- </text>
- </g>
- </svg>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement