js+css的运用

B站视频:https://www.bilibili.com/video/BV1Kp4y167iX
十分钟实现炫酷透明计算器,CSS3+JavaScript实现3D炫酷计算器

今天带大家实现了一个炫酷的透明计算器,实现的过程中需要用到vanillatiltjs,一个平滑的3D倾斜javascript库,具体的使用和下载地址如下:https://micku7zu.github.io/vanilla-tilt.js/

实现代码如下:

HTML:

炫酷透明计算器:公众号AlbertYang
C / * 7 8 9 - 4 5 6 + 1 2 3 0 00 . =

css:

  • {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    }

body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: darkslateblue;
}

body::before {
content: ‘’;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(#e91e63, #ffc107);
clip-path: circle(22% at 30% 20%);

}

body::after {
content: ‘’;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(#ffffff, #da00ff);
clip-path: circle(20% at 70% 90%);

}

.container {
position: relative;
background: rgba(255, 255, 255, 0.05);
border-radius: 6px;
overflow: hidden;
z-index: 100;
border-top: 1px solid rgba(255, 255, 255, 0.2);
border-left: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 5px 5px 30px rgba(0, 0, 0, 0.3);
}

.container .calculator {
position: relative;
display: grid;
}

.container .calculator .value {
grid-column: span 4;
height: 150px;
width: 320px;
text-align: right;
border: none;
outline: none;
padding: 10px;
font-size: 30px;
background-color: transparent;
color: #FFFFFF;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.container .calculator span {
display: grid;
place-items: center;
height: 80px;
width: 80px;
color: #fff;
font-weight: 500;
font-size: 20px;
cursor: pointer;
user-select: none;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
border-right: 1px solid rgba(255, 255, 255, 0.05);
transition: 0.5s;
}

.container .calculator span:hover {
transition: 0s;
background: rgba(255, 255, 255, 0.05);
}

.container .calculator span:active {
background: #00BCD4;
color: black;
font-size: 24px;
font-weight: 600;
}

.container .calculator .equal,
.container .calculator .clear {
grid-column: span 2;
width: 160px;
background: rgba(255, 255, 255, 0.05);
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值