div+js实现一个计算器代码

代码语言:html

所属分类:其他

代码描述:div+js实现一个计算器代码

代码标签: div js 计算器 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

    <link href="https://fonts.googleapis.com/css2?family=PT+Mono&family=Rubik&display=swap" rel="stylesheet">
  
  
  
<style>
* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  background: #232323;
}
@media (max-width: 576px) {
  body {
    height: 100h;
  }
}

.calc {
  width: 50em;
  aspect-ratio: 1/1.5;
  margin: 2em;
  background: #232323;
  background: #CED4CA;
  background: #EBECE9;
  padding: 4em;
  border-radius: 1em;
  display: flex;
  flex-direction: column;
  gap: 2em;
  box-shadow: rgba(0, 0, 0, 0.15) 0.3em 0.3em 0.8em 0px inset, rgba(0, 0, 0, 0.15) -0.3em 0em 0.8em 0em inset, rgba(0, 0, 0, 0.25) 0.3em 0.3em 0.8em 0px;
}
@media (max-width: 576px) {
  .calc {
    padding: 2.5em;
  }
}
.calc .result {
  height: 12em;
  background: pink;
  width: 100%;
  background: linear-gradient(-30deg, rgba(34, 33, 38, 0.1), rgba(34, 33, 38, 0), rgba(34, 33, 38, 0.1)) 100% 0%/100% 100%, #DBE7E5;
  box-shadow: rgba(0, 0, 0, 0.2) 0.3em 0.3em 0.6em 0px inset, rgba(0, 0, 0, 0.25) -3px -3px 0.6em 0.1em inset, rgba(0, 0, 0, 0.25) 0px 0em 1.2em 0px inset, rgba(0, 0, 0, 0.25) 0px 0.3em 0.2em 0px inset, rgba(255, 255, 255, 0.85) 0px 0.3em 0.2em 0px;
  background-repeat: no-repeat;
  padding: 2em;
}
@media (max-width: 576px) {
  .calc .result {
    height: 10em;
  }
}
.calc .result .result__inner {
  text-shadow: 0.15em 0.15em rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  color: #2A3027;
  height: 100%;
  font-family: "PT Mono", monospace;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}
.calc .result .result__inner .prev-operand {
  font-size: 2em;
}
.calc .result .result__inner .current.........完整代码请登录后点击上方下载按钮下载查看

网友评论0