html5 - 花瓣散落效果怎么寫 怎么生成好多花瓣
問題描述
.swiper-wrapper .swiper-slide:nth-of-type(1) { background: url('../img/p1_bg.jpg'); background-size: 100% 100%;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(1){ position: absolute; top: 35%; left: 4%; animation: rotate_flower1 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(2){ position: absolute; top: 23%; left: 45%; animation: rotate_flower2 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(3){ position: absolute; top: 32%; left: 33%; animation: rotate_flower2 4s linear infinite; }.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(4){ position: absolute; top: 46%; left: 43%; animation: rotate_flower3 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(5){ position: absolute; top: 38%; left: 77%; animation: rotate_flower2 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(6){ position: absolute; top: 31%; left: 48%; animation: rotate_flower1 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(7){ position: absolute; top: 26%; left: 28%; animation: rotate_flower3 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(8){ position: absolute; top: 35%; left: 67%; animation: rotate_flower3 4s linear infinite;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(9){ position: absolute; top: 25%; left: 89%; animation: rotate_flower2 4s cubic-bezier(.2,0,.1,0) infinite; }.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(10){ position: absolute; top: 33%; left: 75%; animation: rotate_flower1 4s linear infinite;}@keyframes rotate_flower1{ to{ transform: rotate(359deg); top: 78%; } }@keyframes rotate_flower2{ to{transform: rotate(359deg);top: 92%; }}@keyframes rotate_flower3{ to{transform: rotate(359deg);top: 86%;opacity: 0; }}
我現(xiàn)在是一個一個寫的 很挫啊而且不能有很多花瓣 很多花瓣是怎么在只有幾個的情況下無限生成 不用canvas能實現(xiàn)么或者 用canvas怎么實現(xiàn)呢
問題解答
回答1:找?guī)讖埢ò甑膱D片,js控制旋轉(zhuǎn)不同的角度不就好了
回答2:layabox,phaser,粒子效果
回答3:多張花瓣的圖片,用js隨機生成花瓣的位置和花瓣的旋轉(zhuǎn)和選擇花瓣的圖片。
相關(guān)文章:
1. html5 - datatables 加載不出來數(shù)據(jù)。2. node.js - mongodb查找子對象的名稱為某個值的對象的方法3. 測試自動化html元素選擇器元素ID或DataAttribute [關(guān)閉]4. html5和Flash對抗是什么情況?5. 利用IPMI遠程安裝centos報錯!6. javascript - QQ第三方登錄的問題7. 在mac下出現(xiàn)了兩個docker環(huán)境8. 運行python程序時出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯誤?9. spring-mvc - spring-session-redis HttpSessionListener失效10. 正在使用electron和node.js做桌面應(yīng)用,需要實時監(jiān)聽是否有網(wǎng)絡(luò)連接,node或者electron是否可以做到

網(wǎng)公網(wǎng)安備