canvas实现可调节温度风力湿度云层密度的下雨天气动画效果代码
代码语言:html
所属分类:动画
代码描述:canvas实现可调节温度风力湿度云层密度的下雨天气动画效果代码
代码标签: canvas 调节 温度 风力 湿度 云层 密度 下雨 天气 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.7.0.css"> <style> body { margin: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; background-color: #1e1e2f; color: #fff; font-family: "Poppins", Arial, sans-serif; } canvas { display: block; background: linear-gradient(to bottom, #4a90e2, #1e1e2f); } .controls { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 20px; align-items: center; background: rgba(30, 30, 30, 0.8); padding: 10px 20px; border-radius: 10px; /* Rounded corners */ } .slider-group { display: flex; flex-direction: column; align-items: center; } .slider-group label { color: #fff; /* White text */ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Add text shadow for contrast */ font-size: 1rem; /* Slightly increase label size */ margin-bottom: 5px; } .temperature-display { font-size: 1.2em; padding: 10px; background: rgba(30, 30, 30, 0.8); border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #fff; /* Ensure text is white for visibility */ } .weather-icon { font-size: 2em; transition: opacity 0.5s ease-in-out; } .weather-icon.hidden { opacity: 0; } .additional-info { font-size: 1em; margin-top: 5px; } .temperature-display, .slider-group label, .additional-info { font-family: "Poppins", Arial, sans-serif; font-weight: 500; /* Medium weight for better readability */ } input[type="range"] { appearance: none; width: 100px; height: 6px; background: #ddd; border-radius: 5px; outline: none; transition: background 0.3s ease; } input[type="range"]::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; background: #4a90e2; /* Blue handle */ border: 2px solid #fff; border-radius: 50%; /* Circular handle */ cursor: pointer; transition: transform 0.2s ease; } input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); /* Slightly enlarge on hover */ } </style> </head> <body> <div class="controls"> <div class="slider-group"> <label for.........完整代码请登录后点击上方下载按钮下载查看
网友评论0