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; }}
我現在是一個一個寫的 很挫啊而且不能有很多花瓣 很多花瓣是怎么在只有幾個的情況下無限生成 不用canvas能實現么或者 用canvas怎么實現呢
問題解答
回答1:找幾張花瓣的圖片,js控制旋轉不同的角度不就好了
回答2:layabox,phaser,粒子效果
回答3:多張花瓣的圖片,用js隨機生成花瓣的位置和花瓣的旋轉和選擇花瓣的圖片。
相關文章:
1. mysql多表查詢2. mysql - 千萬級數據表如何有效的變更字段?3. php mysql數據庫 產品分類與產品詳情應該怎么做?4. 下載32位vc9和11、14運行庫時解壓錯誤5. 微信掃碼跳轉頁面是怎么實現的6. 新建index文件夾,然后把controller 以及文件index.php放入index文件夾。修改htaccess文件為擴展訪問。但是訪問的時候提示頁面錯誤!請稍后再試。PHP版本正常,請老師解答7. php+mysql 高并發 根據id 循環下載數據如何避免重復 (接口)8. php - SQL 一條語句查詢出文章和對應的文章標簽9. java - 觸發器使兩張表同時更新10. 請問一下,圖片上傳成功,但是后臺對應文件夾里面卻沒有圖片,這是什么原因?(已部署到服務器)

網公網安備