css+div实现精灵飞舞动画效果代码
代码语言:html
所属分类:动画
代码描述:css+div实现精灵飞舞动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background: #1e3242; } .frame { position: absolute; width: 350px; height: 350px; left: calc(50% - 175px); top: calc(50% - 175px); border-radius: 2px; box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.4); overflow: hidden; background: linear-gradient(to bottom, #0a2342 0%, #283e51 100%); } .frame .star { position: absolute; width: 1px; height: 1px; border-radius: 1px; background: #fff; } .frame .star:nth-child(1) { left: 65%; bottom: 85%; opacity: 0.69; animation: 2s flickr -1s infinite; } .frame .star:nth-child(2) { left: 98%; bottom: 4%; opacity: -0.37; animation: 3s flickr -1s infinite; } .frame .star:nth-child(3) { left: 63%; bottom: 66%; opacity: 0.33; animation: 4s flickr -1s infinite; } .frame .star:nth-child(4) { left: 15%; bottom: 4%; opacity: -0.4; animation: 3s flickr -1s infinite; } .frame .star:nth-child(5) { left: 7%; bottom: 92%; opacity: 0.47; animation: 4s flickr -1s infinite; } .frame .star:nth-child(6) { left: 72%; bottom: 93%; opacity: 0.77; animation: 4s flickr -1s infinite; } .frame .star:nth-child(7) { left: 86%; bottom: 54%; opacity: 0.11; animation: 3s flickr -1s infinite; } .frame .star:nth-child(8) { left: 57%; bottom: 29%; opacity: 0.13; animation: 4s flickr -1s infinite; } .frame .star:nth-child(9) { left: 84%; bottom: 50%; opacity: 0.31; animation: 2s flickr -1s infinite; } .frame .star:nth-child(10) { left: 7%; bottom: 45%; opacity: 0.32; animation: 3s flickr -1s infinite; } .frame .star:nth-child(11) { left: 69%; bottom: 20%; opacity: 0.11; animation: 4s flickr -1s infinite; } .frame .star:nth-child(12) { left: 24%; bottom: 59%; opacity: 0.24; animation: 4s flickr -1s infinite; } .frame .star:nth-child(13) { left: 85%; bottom: 5%; opacity: -0.12; animation: 4s flickr -1s infinite; } .frame .star:nth-child(14) { left: 31%; bottom: 72%; opacity: 0.72; animation: 2s flickr -1s infinite; } .frame .star:nth-child(15) { left: 9%; bottom: 66%; opacity: 0.18; animation: 4s flickr -1s infinite; } .frame .star:nth-child(16) { left: 40%; bottom: 52%; opacity: 0.48; animation: 3s flickr -1s infinite; } .frame .star:nth-child(17) { left: 67%; bottom: 53%; opacity: 0.43; animation: 2s flickr -1s infinite; } .frame .star:nth-child(18) { left: 97%; bottom: 78%; opacity: 0.4; animation: 4s flickr -1s infinite; } .frame .star:nth-child(19) { left: 72%; bottom: 13%; opacity: -0.09; animation: 4s flickr -1s infinite; } .frame .star:nth-child(20) { left: 81%; bottom: 79%; opacity: 0.52; animation: 2s flickr -1s infinite; } .frame .star:nth-child(21) { left: 26%; bottom: 41%; opacity: 0.38; animation: 4s flickr -1s infinite; } .frame .star:nth-child(22) { left: 16%; bottom: 23%; opacity: 0.16; animation: 3s flickr -1s infinite; } .frame .star:nth-child(23) { left: 54%; bottom: 97%; opacity: 0.83; animation: 3s flickr -1s infinite; } .frame .star:nth-child(24) { left: 64%; bottom: 61%; opacity: 0.4; animation: 3s flickr -1s infinite; } .frame .star:nth-child(25) { left: 20%; bottom: 28%; opacity: -0.13; animation: 3s flickr -1s infinite; } .frame .star:nth-child(26) { left: 25%; bottom: 24%; opacity: 0.2; animation: 3s flickr -1s infinite; } .frame .star:nth-child(27) { left: 85%; bottom: 76%; opacity: 0.43; animation: 4s flickr -1s infinite; } .frame .star:nth-child(28) { left: 69%; bottom: 64%; opacity: 0.28; animation: 4s flickr -1s infinite; } .frame .star:nth-child(29) { left: 89%; bottom: 96%; opacity: 0.53; animation: 2s flickr -1s infinite; } .frame .star:nth-child(30) { left: 1%; bottom: 35%; opacity: 0.05; animation: 4s flickr -1s infinite; } .frame .star:nth-child(31) { left: 25%; bottom: 32%; opacity: -0.14; animation: 3s flickr -1s infinite; } .frame .star:nth-child(32) { left: 20%; bottom: 54%; opacity: 0.11; animation: 2s flickr -1s infinite; } .frame .star:nth-child(33) { left: 19%; bottom: 62%; opacity: 0.54; animation: 3s flickr -1s infinite; } .frame .star:nth-child(34) { left: 42%; bottom: 63%; opacity: 0.42; animation: 4s flickr -1s infinite; } .frame .star:nth-child(35) { left: 78%; bottom: 21%; opacity: -0.26; animation: 4s flickr -1s infinite; } .frame .star:nth-child(36) { left: 5%; bottom: 38%; opacity: 0.11; animation: 2s flickr -1s infinite; } .frame .star:nth-child(37) { left: 27%; bottom: 23%; opacity: 0.14; animation: 4s flickr -1s infinite; } .frame .star:nth-child(38) { left: 58%; bottom: 94%; opacity: 0.74; animation: 4s flickr -1s infinite; } .frame .star:nth-child(39) { left: 85%; bottom: 86%; opacity: 0.38; animation: 4s flickr -1s infinite; } .frame .star:nth-child(40) { left: 90%; bottom: 4%; opacity: -0.39; animation: 4s flickr -1s infinite; } .frame .star:nth-child(41) { left: 55%; bottom: 46%; opacity: 0.08; animation: 3s flickr -1s infinite; } .frame .star:nth-child(42) { left: 90%; bottom: 10%; opacity: -0.19; animation: 4s flickr -1s infinite; } .frame .star:nth-child(43) { left: 79%; bottom: 92%; opacity: 0.67; animation: 3s flickr -1s infinite; } .frame .star:nth-child(44) { left: 46%; bottom: 71%; opacity: 0.31; animation: 2s flickr -1s infinite; } .frame .star:nth-child(45) { left: 42%; bottom: 90%; opacity: 0.57; animation: 2s flickr -1s infinite; } .frame .star:nth-child(46) { left: 63%; bottom: 75%; opacity: 0.42; animation: 2s flickr -1s infinite; } .frame .star:nth-child(47) { left: 96%; bottom: 68%; opacity: 0.5; animation: 3s flickr -1s infinite; } .frame .star:nth-child(48) { left: 41%; bottom: 20%; opacity: -0.25; animation: 2s flickr -1s infinite; } .frame .star:nth-child(49) { left: 50%; bottom: 31%; opacity: 0.18; animation: 4s flickr -1s infinite; } .frame .star:nth-child(50) { left: 32%; bottom: 55%; opacity: 0.38; animation: 2s flickr -1s infinite; } .frame .star:nth-child(51) { left: 76%; bottom: 32%; opacity: -0.15; animation: 2s flickr -1s infinite; } .frame .star:nth-child(52) { left: 33%; bottom: 81%; opacity: 0.69; animation: 3s flickr -1s infinite; } .frame .star:nth-child(53) { left: 72%; bottom: 14%; opacity: -0.16; animation: 3s flickr -1s infinite; } .frame .star:nth-child(54) { left: 53%; bottom: 57%; opacity: 0.34; animation: 3s flickr -1s infinite; } .frame .star:nth-child(55) { left: 96%; bottom: 83%; opacity: 0.41; animation: 3s flickr -1s infinite; } .frame .star:nth-child(56) { left: 76%; bottom: 57%; opacity: 0.36; animation: 3s flickr -1s infinite; } .frame .star:nth-child(57) { left: 48%; bottom: 43%; opacity: 0.01; animation: 4s flickr -1s infinite; } .frame .star:nth-child(58) { left: 15%; bottom: 62%; opacity: 0.18; animation: 4s flickr -1s infinite; } .frame .star:nth-child(59) { left: 85%; bottom: 47%; opacity: 0.03; animation: 3s flickr -1s infinite; } .frame .star:nth-child(60) { left: 60%; bottom: 75%; opacity: 0.28; animation: 2s flickr -1s infinite; } .frame .star:nth-child(61) { left: 26%; bottom: 94%; opacity: 0.8; animation: 3s flickr -1s infinite; } .frame .star:nth-child(62) { left: 17%; bottom: 9%; opacity: -0.17; animation: 3s flickr -1s infinite; } .frame .star:nth-child(63) { left: 76%; bottom: 79%; opacity: 0.37; animation: 3s flickr -1s infinite; } .frame .star:nth-child(64) { left: 47%; bottom: 98%; opacity: 0.52; animation: 2s flickr -1s infinite; } .frame .star:nth-child(65) { left: 68%; bottom: 86%; opacity: 0.54; animation: 2s flickr -1s infinite; } .frame .star:nth-child(66) { left: 31%; bottom: 74%; opacity: 0.33; animation: 3s flickr -1s infinite; } .frame .star:nth-child(67) { left: 58%; bottom: 56%; opacity: 0.38; animation: 2s flickr -1s infinite; } .frame .star:nth-child(68) { left: 99%; bottom: 39%; opacity: -0.07; animation: 3s flickr -1s infinite; } .frame .star:nth-child(69) { left: 20%; bottom: 39%; opacity: 0.08; animation: 4s flickr -1s infinite; } .frame .star:nth-child(70) { left: 35%; bottom: 90%; opacity: 0.43; animation: 4s flickr -1s infinite; } .frame .star:nth-child(71) { left: 57%; bottom: 22%; opacity: 0.15; animation: 3s flickr -1s infinite; } .frame .star:nth-child(72) { left: 10%; bottom: 49%; opacity: 0.1; animation: 2s flickr -1s infinite; } .frame .star:nth-child(73) { left: 96%; bottom: 23%; opacity: -0.24; animation: 4s flickr -1s infinite; } .frame .star:nth-child(74) { left: 26%; bottom: 18%; opacity: -0.19; animation: 2s flickr -1s infinite; } .frame .star:nth-child(75) { left: 68%; bottom: 76%; opacity: 0.4; animation: 3s flickr -1s infinite; } .frame .star:nth-child(76) { left: 77%; bottom: 83%; opacity: 0.7; animation: 3s flickr -1s infinite; } .frame .star:nth-child(77) { left: 96%; bottom: 73%;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0