html5 - 花瓣散落效果怎么寫(xiě) 怎么生成好多花瓣
問(wèn)題描述
.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)在是一個(gè)一個(gè)寫(xiě)的 很挫啊而且不能有很多花瓣 很多花瓣是怎么在只有幾個(gè)的情況下無(wú)限生成 不用canvas能實(shí)現(xiàn)么或者 用canvas怎么實(shí)現(xiàn)呢
問(wèn)題解答
回答1:找?guī)讖埢ò甑膱D片,js控制旋轉(zhuǎn)不同的角度不就好了
回答2:layabox,phaser,粒子效果
回答3:多張花瓣的圖片,用js隨機(jī)生成花瓣的位置和花瓣的旋轉(zhuǎn)和選擇花瓣的圖片。
相關(guān)文章:
1. Python2中code.co_kwonlyargcount的等效寫(xiě)法2. 求救一下,用新版的phpstudy,數(shù)據(jù)庫(kù)過(guò)段時(shí)間會(huì)消失是什么情況?3. [python2]local variable referenced before assignment問(wèn)題4. mysql - 如何在有自增id的情況下,讓其他某些字段能不重復(fù)插入5. javascript - 我的站點(diǎn)貌似被別人克隆了, google 搜索特定文章,除了域名不一樣,其他的都一樣,如何解決?6. mysql - 請(qǐng)問(wèn)數(shù)據(jù)庫(kù)字段為年月日,傳進(jìn)的參數(shù)為月,怎么查詢那個(gè)月所對(duì)應(yīng)的數(shù)據(jù)7. javascript - 求幫助 , ATOM不顯示界面!!!!8. html - 移動(dòng)端radio無(wú)法選中9. javascript - vue+iview upload傳參失敗 跨域問(wèn)題后臺(tái)已經(jīng)解決 仍然報(bào)403,這是怎么回事啊?10. php - 微信開(kāi)發(fā)驗(yàn)證服務(wù)器有效性
