From 3f3532fd14285dd9eeccac88edeaebbb4a06cd13 Mon Sep 17 00:00:00 2001 From: chenyongjia Date: Thu, 19 Nov 2015 13:08:17 +0800 Subject: [PATCH] change to use css3 animation hearts, circles, oval --- index.html | 99 +++++++++++++++++++++++++++++++++++++++-- svg-loaders/circles.svg | 20 --------- svg-loaders/hearts.svg | 18 -------- svg-loaders/oval.svg | 17 ------- 4 files changed, 96 insertions(+), 58 deletions(-) delete mode 100644 svg-loaders/circles.svg delete mode 100644 svg-loaders/hearts.svg delete mode 100644 svg-loaders/oval.svg diff --git a/index.html b/index.html index f95a5b4..442f1cf 100644 --- a/index.html +++ b/index.html @@ -112,6 +112,89 @@ margin-top: 20px; } + svg { + vertical-align: middle; + } + + svg#oval { + width: 50px; + height: 50px; + stroke-width: 2px; + fill: none; + stroke: #fff; + } + + svg#oval > circle { + stroke-opacity: 0.5 + } + + @-webkit-keyframes ovalRoll { to { transform: rotate(360deg) } } + @-moz-keyframes ovalRoll { to { transform: rotate(360deg) } } + @-o-keyframes ovalRoll { to { transform: rotate(360deg) } } + @keyframes ovalRoll { to { transform: rotate(360deg) } } + + svg#oval > path { + -webkit-animation: ovalRoll 1s infinite linear; + -moz-animation: ovalRoll 1s infinite linear; + -o-animation: ovalRoll 1s infinite linear; + animation: ovalRoll 1s infinite linear; + transform-origin: left bottom; + } + + svg#circles { + fill: #fff; + width: 50px; + height: 50px; + } + + svg#circles > path { + transform-origin: center; + } + + @-webkit-keyframes dotRoll1 { to { transform: rotate(-360deg) } } + @-moz-keyframes dotRoll1 { to { transform: rotate(-360deg) } } + @-o-keyframes dotRoll1 { to { transform: rotate(-360deg) } } + @keyframes dotRoll1 { to { transform: rotate(-360deg) } } + + @-webkit-keyframes dotRoll2 { to { transform: rotate(360deg) } } + @-moz-keyframes dotRoll2 { to { transform: rotate(360deg) } } + @-o-keyframes dotRoll2 { to { transform: rotate(360deg) } } + @keyframes dotRoll2 { to { transform: rotate(360deg) } } + + svg#circles > path:first-child { + -webkit-animation: dotRoll1 2.5s linear infinite; + -moz-animation: dotRoll1 2.5s linear infinite; + -o-animation: dotRoll1 2.5s linear infinite; + animation: dotRoll1 2.5s linear infinite; + } + svg#circles > path:last-child { + -webkit-animation: dotRoll2 8s linear infinite; + -moz-animation: dotRoll2 8s linear infinite; + -o-animation: dotRoll2 8s linear infinite; + animation: dotRoll2 8s linear infinite; + } + + + @-webkit-keyframes heartFlash { 0%, 100% { opacity: 0.5 } 50% { opacity: 1 } } + @-moz-keyframes heartFlash { 0%, 100% { opacity: 0.5 } 50% { opacity: 1 } } + @-o-keyframes heartFlash { 0%, 100% { opacity: 0.5 } 50% { opacity: 1 } } + @keyframes heartFlash { 0%, 100% { opacity: 0.5 } 50% { opacity: 1 } } + + svg#hearts { + width: 80px; + fill: #fff; + } + svg#hearts > path:first-child, + svg#hearts > path:last-child { + opacity: 0.5; + -webkit-animation: heartFlash 1.4s linear infinite; + -moz-animation: heartFlash 1.4s linear infinite; + -o-animation: heartFlash 1.4s linear infinite; + animation: heartFlash 1.4s linear infinite; + } + svg#hearts > path:last-child { + animation-delay: 0.7s; + } @@ -127,10 +210,17 @@
  • - + + + + +
  • - + + + +
  • @@ -142,7 +232,10 @@
  • - + + + +
  • diff --git a/svg-loaders/circles.svg b/svg-loaders/circles.svg deleted file mode 100644 index de8e4de..0000000 --- a/svg-loaders/circles.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - diff --git a/svg-loaders/hearts.svg b/svg-loaders/hearts.svg deleted file mode 100644 index 2f63c4c..0000000 --- a/svg-loaders/hearts.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/svg-loaders/oval.svg b/svg-loaders/oval.svg deleted file mode 100644 index 004a356..0000000 --- a/svg-loaders/oval.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - \ No newline at end of file