纯css绘制光剑效果
代码语言:html
所属分类:布局界面
代码描述:纯css绘制光剑效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> *, *:before, *:after { position: relative; box-sizing: border-box; } :root { --lightsaber-color: #6eedb2; } html, body { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; } body { display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; background: #0f101e; } .lightsaber { -webkit-transition: -webkit-transform 0.3s ease-in-out; transition: -webkit-transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out; width: 30vw; height: 5vw; display: -webkit-box; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; flex-direction: row; -webkit-box-align: center; align-items: center; } .metal { background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #ccdbee), color-stop(35%, #607088), color-stop(70%, #ccdbee), to(#607088)); background: linear-gradient(to bottom, #ccdbee 10%, #607088 35%, #ccdbee 70%, #607088); } .black-metal { background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #767a83), color-stop(35%, #202432), color-stop(70%, #767a83), to(#202432)); background: linear-gradient(to bottom, #767a83 10%, #202432 35%, #767a83 70%, #202432); } .copper { background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #70413a), color-stop(35%, #90645a), color-stop(70%, #70413a), to(#401f21)); background: linear-gradient(to bottom, #70413a 10%, #90645a 35%, #70413a 70%, #401f21); } .pommel-cap { height: 90%; width: 10%; border-radius: 10% 0 0 10%; box-shadow: 0 0 5vw black; } .grip { height: 100%; width: 45%; border-radius: 5%; box-shadow: 0 0 5vw black; } .hilt { height: 80%; width: 35%; display: -webkit-box; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; flex-direction: row; -webkit-box-pack: start; justify-content: flex-start; } .hilt > .segment { width: 8%; height.........完整代码请登录后点击上方下载按钮下载查看
网友评论0