jquery+css实现万圣节南瓜灯笼开灯关灯效果代码
代码语言:html
所属分类:其他
代码描述:jquery+css实现万圣节南瓜灯笼开灯关灯效果代码,可在灯笼上鼠标涂抹书写文字图形,这样灯光会透出来。
代码标签: jquery css 万圣节 南瓜 灯笼 开灯 关灯
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css"> <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Major+Mono+Display&display=swap'> <style> html, body { height: 100%; } body { background: url(//repo.bfw.wiki/bfwrepo/image/634361e104a2c.png); position: relative; overflow: hidden; } body::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(34, 34, 34, 0.75); } body.dark::after { background: rgba(0, 0, 0, 0.9); } body.dark .wrap::after { background: radial-gradient(circle at center, transparent, #160000); } body.dark .light { background: #333; } body.dark .light__bulb { background: transparent; border-color: #333; background: rgba(17, 17, 17, 0.5); } body.dark .light__bulb::before { background: #222; } body.dark .light__bulb::after { content: none; } body.dark .table { border-bottom-color: rgba(0, 0, 0, 0.85); } body.dark .table::after { background: #130602; opacity: 0.85; } body.dark .pumpkin__back { position: relative; } body.dark .pumpkin__back::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(circle at center, yellow, transparent 50%); } body.dark .pumpkin__flame { position: absolute; width: 10px; height: 15px; background: red; top: 163px; left: 149px; background: radial-gradient(circle farthest-corner at bottom, rgba(255, 165, 0, 0) 0%, #ff0c00 100%); opacity: 0.6; transform: translate(-50%, 0.3vw) rotate(45deg); border-radius: 0 50px 30px 50px; transition: bottom 1500ms ease-out; animation: flamebreath2 2s ease-in-out infinite; box-shadow: -5px -5px 10px 2.5px rgba(255, 165, 0, 0.5); } body.dark .pumpkin__flame::before { content: ""; position: absolute; background: radial-gradient(40px, rgba(255, 255, 0, 0.25) 0%, #ff7300 100%); box-shadow: -10px -10px 20px 5px rgba(255, 255, 0, 0.5); left: 50%; width: 180%; bottom: -5px; height: 180%; opacity: 0.9; border-radius: 0 50px 30px 50px; transition: 200ms; animation: flamebreath1 1.5s ease-in-out infinite; } * { user-select: none; } .wrap { display: flex; height: 100%; align-items: center; justify-content: center; position: relative; z-index: 1; } .wrap::after { content: ""; position: absolute; z-index: 99; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(circle at 15% 30%, transparent, #140000); pointer-events: none; } .table { background: url(//repo.bfw.wiki/bfwrepo/image/634361f30f92e.png); width: 100vw; height: 200px; margin-top: 250px; border-bottom: 20px solid rgba(41, 15, 5, 0.85); position: relative; box-shadow: 0 20px 20px rgba(0, 0, 0, 0.75); } .table::after { content: ""; background: #571f0a; opacity: 0.75; position: absolute; top: 0; left: 0; bottom: 0; right: 0; } .light { position: absolute; top: 0; left: 15%; width: 10px; height: 30%; background: #888; } .light__bulb { width: 46px; height: 46px; border-radius: 100%; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: #f9f968; border: 2px solid white; } .light__bulb::before { content: ""; background: #666; width: 30px; height: 20px; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); } .light__bulb::after { content: ""; position: absolute; top: 50%; left: 50%; width: 300px; height: 300px; transform: translate(-50%, -50%); background: radial-gradient(circle at center, rgba(249, 249, 104, 0.75), transparent 50%); border-radius: 100%; } .pumpkin { width: 300px; height: 300px; position: absolute; left: calc(50% - 150px); } .pumpkin::before { content: ""; position: absolute; bottom: -2%; left: 10%; width: 150%; height: 100px; border-radius: 100%; background: rgba(0, 0, 0, 0.35); box-shadow: 0px 0px 30px 5px rgba(0, 0, 0, 0.35); transform: skewY(-4deg); } .pumpkin__back { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .pumpkin__back img { width: 100%; } .pumpkin__front { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .title { user-select: none; position: absolute; z-index: 20; font.........完整代码请登录后点击上方下载按钮下载查看
网友评论0