当前位置:网站首页>Canvas random bubbling background
Canvas random bubbling background
2022-06-13 00:42:00 【KatyLight】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
@font-face {
}
body{
padding: 0;
margin: 0;
background-color: black;
color: white;
}
.window{
position: fixed;
left: 0;
width: 100vw;
height:100vh;
top: 0;
z-index: 12;
}
.window>div{
width: fit-content;
height: fit-content;
position: absolute;
top:0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
input{
display: block;
background-color: rgba(0,0,0,0.5);
color: white;
border: 1px solid white;
font-size: 20px;
margin-left: 10px;
padding-inline-start: 30px;
line-height: 40px;
vertical-align: middle;
height: 40px;
width: 600px;
transition: all .5s ease-in ;
}
input:focus{
outline: none;
box-shadow: 0 0 7px 4px white, inset 0 0 5px 2px white;
transition: all .2s ease-in ;
}
input:focus+span{
text-shadow: 0 0 7px white;
font-weight: bolder;
transition: all .2s ease-in ;
}
input+span{
transition: all .2s ease-in ;
}
.search{
position: relative;
}
.search>span{
position: absolute;
top: 8px;
left: 17px;
z-index: 20;
}
</style>
</head>
<script>
var c,ctx;
window.onload=()=>{
c=document.getElementById('c')
c.width=window.screen.width;
c.height=window.screen.height;
ctx=c.getContext('2d');
ctx.strokeStyle="#FFFFFF88";
ctx.fillStyle="#FFFFFF88";
ctx.lineWidth=3;
for(let i=0;i<32;i++){
addCircles();
}
setInterval(()=>{
draw()
},1);
}
var circles=[
]
function addCircles(){
circles.push({
p:{
x:Math.floor(c.width*Math.random()),
y:Math.floor(c.height*Math.random())
},
r:1,
e:Math.floor(50+Math.random()*100)
})
}
function draw(){
ctx.clearRect(0,0,c.width,c.height)
for(let i=0;i<circles.length;i++){
ctx.beginPath();
ctx.arc(circles[i].p.x,circles[i].p.y,circles[i].r,0,Math.PI*2);
ctx.stroke();
ctx.closePath();
circles[i].r++;
if(circles[i].r>circles[i].e){
circles.splice(i,1);
addCircles();
}
}
}
</script>
<body>
<canvas id="c"></canvas>
<div class="window">
<div class="search">
<input type="search" placeholder=" Enter search content "/>
<span>◯</span>
</div>
</div>
</body>
</html>
边栏推荐
- 硬(磁)盘(一)
- [MRCTF2020]Ez_ bypass --BUUCTF
- ImportError: cannot import name &#039;get_ora_doc&#039; from partially initialized module
- [sca-cnn interpretation] spatial and channel wise attention
- Installation of IK word breaker
- [MRCTF2020]Ez_bypass --BUUCTF
- 【SCA-CNN 解读】空间与通道注意力:Spatial and Channel-wise Attention
- Solution to the problem of closing the watchdog of STM32 in the sleep mode (stop/standby)
- Context of go concurrency mode
- MySQL lpad() and rpad() concatenate string functions with specified length
猜你喜欢
Stm32f4 development of DMA transmission to GPIO port
Win10 home vs pro vs enterprise vs enterprise LTSC
Triangle wave and triangle wave convolution
【SCA-CNN 解读】空间与通道注意力:Spatial and Channel-wise Attention
Programming training 1
牌好不好无法预料
[MRCTF2020]Ez_bypass --BUUCTF
阿姨学代码续集:能力吊打大批程序员
Hard (magnetic) disk (II)
Kali system -- dnsmap for DNS collection and analysis
随机推荐
Arduino controls tb6600 driver +42 stepper motor
A simple deadlock example
How to solve the duplication problem when MySQL inserts data in batches?
What are the conditions of index invalidation?
Three kinds of thinking make me reborn
Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
6.824 Lab 3A: Fault-tolerant Key/Value Service
DNS attack surface analysis
[colorful] Net dto mapping
Easyexcel read excel simple demo
通过抓包下载钉钉直播回放
Can branches sign labor contracts with employees
[LeetCode]1. Sum of two numbers thirty-four
Zhouchuankai, Bank of Tianjin: from 0 to 1, my experience in implementing distributed databases
pytorch和tensorflow有什么区别?
(01).NET MAUI实战 建项目
【服务器数据恢复】存储服务器之间迁移数据时数据丢失恢复成功案例
Conversion of integer part and decimal part between binary / octal / decimal / hexadecimal
Map from getting started to performance optimization
Kali system -- fierce of DNS collection and analysis