monster.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <view>
  3. <button open-type="contact">
  4. <view class="dong">
  5. <view class="monster">
  6. <view class="monster__face">
  7. <view class="monster__eye avatar-eye avatar-eye--green eye--left">
  8. <view class="avatar-eye-pupil pupil--green"><span class="avatar-eye-pupil-blackThing"><span
  9. class="avatar-eye-pupil-lightReflection"></span></span></view>
  10. </view>
  11. <view class="monster__eye avatar-eye avatar-eye--violet eye--right">
  12. <view class="avatar-eye-pupil pupil--pink"><span class="avatar-eye-pupil-blackThing"><span
  13. class="avatar-eye-pupil-lightReflection"></span></span></view>
  14. </view>
  15. <view class="monster__noses">
  16. <view class="monster__nose"></view>
  17. <view class="monster__nose"></view>
  18. </view>
  19. <view class="monster__mouth">
  20. <view class="monster__top"></view>
  21. <view class="monster__bottom"></view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </button>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: "monster",
  32. props: {
  33. // 跳转地址
  34. pageUrl: {
  35. type: String,
  36. default: ''
  37. },
  38. },
  39. data() {
  40. return {
  41. };
  42. },
  43. methods: {
  44. goTo() {
  45. if (this.pageUrl) {
  46. this.utils.goto(this.pageUrl)
  47. }
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. /* 大嘴鸟*/
  54. .dong {
  55. z-index: 9999;
  56. position: fixed;
  57. top: 60px;
  58. right: -80px;
  59. transform: scale(0.24);
  60. -webkit-transform: scale(0.24);
  61. -moz-transform: scale(0.24);
  62. }
  63. .monster {
  64. transform: rotate(-50deg);
  65. -ms-transform: rotate(-50deg);
  66. /* IE 9 */
  67. -moz-transform: rotate(-50deg);
  68. /* Firefox */
  69. -webkit-transform: rotate(-50deg);
  70. /* Safari 和 Chrome */
  71. -o-transform: rotate(-50deg);
  72. /* Opera */
  73. display: flex;
  74. justify-content: center;
  75. position: relative;
  76. width: 170px;
  77. height: 400px;
  78. border-top-left-radius: 200px;
  79. border-top-right-radius: 200px;
  80. background-color: #3C47D7;
  81. box-shadow: 20px 20px 60px #4650E5;
  82. }
  83. .monster__face {
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. flex-direction: column;
  88. position: absolute;
  89. top: 14%;
  90. width: 75%;
  91. height: 160px;
  92. }
  93. .monster__noses {
  94. top: 50%;
  95. display: flex;
  96. justify-content: space-between;
  97. width: 28%;
  98. height: auto;
  99. margin-bottom: 10px;
  100. }
  101. .monster__nose {
  102. width: 8px;
  103. height: 12px;
  104. border-radius: 20px;
  105. background: rgba(0, 0, 0, 0.5);
  106. box-shadow: 4px 8px 5px rgba(0, 0, 0, 0.1);
  107. }
  108. .monster__mouth {
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. position: relative;
  113. width: 100%;
  114. height: 0%;
  115. overflow: hidden;
  116. border: 25px solid #FFC333;
  117. border-radius: 100px;
  118. background-color: #810332;
  119. animation: mouth 1.75s infinite;
  120. box-shadow: 4px 8px 5px rgba(0, 0, 0, 0.2);
  121. box-sizing: border-box;
  122. }
  123. .monster__mouth::before {
  124. content: '';
  125. position: absolute;
  126. width: 150px;
  127. height: 80px;
  128. border-radius: 100px;
  129. background-color: #400018;
  130. }
  131. .monster__mouth::after {
  132. content: '';
  133. position: absolute;
  134. bottom: -80px;
  135. width: 160px;
  136. height: 80px;
  137. border-top-left-radius: 50%;
  138. border-top-right-radius: 50%;
  139. background-color: #DC1B50;
  140. animation: tongue 1.75s infinite;
  141. }
  142. .monster__top {
  143. position: absolute;
  144. top: -30px;
  145. width: 170px;
  146. height: 30px;
  147. border-bottom-left-radius: 10px;
  148. border-bottom-right-radius: 10px;
  149. background-color: #ffffff;
  150. z-index: 100;
  151. animation: t 1.75s infinite;
  152. }
  153. .monster__bottom {
  154. position: absolute;
  155. bottom: 0;
  156. width: 100px;
  157. height: 30px;
  158. border-top-left-radius: 10px;
  159. border-top-right-radius: 10px;
  160. background-color: #ffffff;
  161. z-index: 100;
  162. animation: b 1.75s infinite;
  163. }
  164. .avatar-eye {
  165. position: absolute;
  166. top: -10%;
  167. width: 65px;
  168. height: 65px;
  169. background: linear-gradient(105deg, white, #cb87f4);
  170. border-radius: 100%;
  171. box-shadow: 4px 8px 5px rgba(0, 0, 0, 0.2);
  172. margin: 3px;
  173. -webkit-transform: translateX(-50%);
  174. transform: translateX(-50%);
  175. }
  176. .avatar-eye--green {
  177. background: linear-gradient(to bottom, #fdfdfd, #c3efea);
  178. }
  179. .avatar-eye--violet {
  180. background: linear-gradient(to bottom, #fdfdfd, #e6d6f6);
  181. }
  182. .eye--left {
  183. left: 10%;
  184. }
  185. .eye--right {
  186. left: 85%;
  187. }
  188. .eye--center {
  189. left: 45%;
  190. top: 10%;
  191. }
  192. .avatar-eye-pupil {
  193. position: absolute;
  194. width: 55%;
  195. height: 55%;
  196. left: 50%;
  197. top: 25%;
  198. -webkit-transform: translate(-50%);
  199. transform: translate(-50%);
  200. z-index: 100;
  201. border-radius: 100%;
  202. }
  203. .pupil--green {
  204. background: linear-gradient(135deg, rgba(188, 248, 177, 0.7), #2fa38c 75%);
  205. }
  206. .pupil--pink {
  207. background: linear-gradient(135deg, #f1a183, #8535cd);
  208. }
  209. .avatar-eye-pupil-blackThing {
  210. position: absolute;
  211. width: 55%;
  212. height: 55%;
  213. left: 50%;
  214. top: 25%;
  215. background: #2c2f32;
  216. -webkit-transform: translate(-50%);
  217. transform: translate(-50%);
  218. border-radius: 100%;
  219. box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
  220. }
  221. .avatar-eye-pupil-lightReflection {
  222. position: absolute;
  223. width: 7px;
  224. height: 7px;
  225. left: 25%;
  226. top: 10%;
  227. background: #ebebeb;
  228. -webkit-transform: translate(-50%);
  229. transform: translate(-50%);
  230. border-radius: 100%;
  231. box-shadow: 10px 10px 10px rgba(255, 255, 255, 0.2);
  232. }
  233. /*大嘴动起来*/
  234. @keyframes t {
  235. 0%,
  236. 10%,
  237. 80%,
  238. 100% {
  239. top: -30px;
  240. }
  241. 20% {
  242. top: 0px;
  243. }
  244. 30% {
  245. top: -20px;
  246. }
  247. 40% {
  248. top: -0px;
  249. }
  250. 50% {
  251. top: -25px;
  252. }
  253. 70% {
  254. top: 0px;
  255. }
  256. }
  257. @keyframes b {
  258. 0%,
  259. 10%,
  260. 80%,
  261. 100% {
  262. bottom: -30px;
  263. }
  264. 20% {
  265. bottom: 0px;
  266. }
  267. 30% {
  268. bottom: -20px;
  269. }
  270. 40% {
  271. bottom: -0px;
  272. }
  273. 50% {
  274. bottom: -25px;
  275. }
  276. 70% {
  277. bottom: 0px;
  278. }
  279. }
  280. @keyframes mouth {
  281. 0%,
  282. 10%,
  283. 100% {
  284. width: 100%;
  285. height: 0%;
  286. }
  287. 15% {
  288. width: 90%;
  289. height: 30%;
  290. }
  291. 20% {
  292. width: 50%;
  293. height: 70%;
  294. }
  295. 25% {
  296. width: 70%;
  297. height: 70%;
  298. }
  299. 30% {
  300. width: 80%;
  301. height: 60%;
  302. }
  303. 35% {
  304. width: 60%;
  305. height: 70%;
  306. }
  307. 40% {
  308. width: 55%;
  309. height: 75%;
  310. }
  311. 45% {
  312. width: 50%;
  313. height: 90%;
  314. }
  315. 50% {
  316. width: 40%;
  317. height: 70%;
  318. }
  319. 55% {
  320. width: 70%;
  321. height: 95%;
  322. }
  323. 60% {
  324. width: 40%;
  325. height: 50%;
  326. }
  327. 65% {
  328. width: 100%;
  329. height: 60%;
  330. }
  331. 70% {
  332. width: 100%;
  333. height: 70%;
  334. }
  335. 75% {
  336. width: 90%;
  337. height: 70%;
  338. }
  339. 80% {
  340. width: 50%;
  341. height: 70%;
  342. }
  343. 85% {
  344. width: 90%;
  345. height: 50%;
  346. }
  347. 85% {
  348. width: 40%;
  349. height: 70%;
  350. }
  351. 90% {
  352. width: 90%;
  353. height: 30%;
  354. }
  355. 95% {
  356. width: 100%;
  357. height: 10%;
  358. }
  359. }
  360. @keyframes tongue {
  361. 0%,
  362. 20%,
  363. 100% {
  364. bottom: -80px;
  365. }
  366. 30%,
  367. 90% {
  368. bottom: -40px;
  369. }
  370. 40% {
  371. bottom: -45px;
  372. }
  373. 50% {
  374. bottom: -50px;
  375. }
  376. 70% {
  377. bottom: -80px;
  378. }
  379. 90% {
  380. bottom: -40px;
  381. }
  382. }
  383. </style>