css+js实现老式大屁股电视机屏幕无信号闪屏动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css+js实现老式大屁股电视机屏幕无信号闪屏动画效果代码

代码标签: css js 老式 大屁股 电视机 屏幕 无信号 闪屏 动画

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

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

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

  
  
  
<style>
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #1a1a1a;
  margin: 0;
  font-family: Arial, sans-serif;
}

.tv-container {
  position: relative;
  width: 600px;
  height: 350px;
  perspective: 500px;
}

.tv-body {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #8b6b3d;
  border-radius: 15px;
  display: flex;
}

.tv-screen-container {
  flex: 5;
  padding: 15px;
}

.tv-screen-outer {
  background-color: #5d4827;
  height: 100%;
  border-radius: 20px;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #5e5e5e;
  border-radius: 60px;
  overflow: hidden;
  border: 5px solid #333;
}

.tv-screen::before{
  content:"";
    position: absolute;
  top:0;
  left;0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0.8) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

.static {
  position: relative;
  width: 100%;
  height: 100%;
}

.static::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-radial-gradient(
      circle at 17% 32%,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0) 1%
    ),
    repeating-radial-gradient(
      circle at 82% 65%,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0) 1%
    );
  opacity: 0.2;
  animation: staticAnimation 0.5s infinite;
}

.vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.8);
  border-radius: 55px;
  pointer-events: none;
}

.tv-controls {
  flex: 1;
  background-color: #5f4a25;
  border-radius: 0 15px 15px 0;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.speaker {
  height: 230px;
  background-color: #5d4827;
  border-radius: 5px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(25, 1fr);
  gap: 3px;
  padding: 5px;
}

.speaker-hole {
  background-color: #3d3019;
  border-radius: 3px;
}

.knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0;
}

.knob {
  width: 40px;
  height: 40px;
  background: radial-gradient(#d0b078, #a18452);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.knob::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 45%;
  width: 40%;
  height: 5px;
  background-color: #333;
  transform: translateY(-50%);
  border-radius: 5px;
}

.knob-label {
  font-size: 10px;
  color: #d0b078;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.channel-dial {
  width: 50px;
  height: 50px;
  background: radial-gradient(#d0b078, #a18452);
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.channel-dial::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: #333;
  border-radius: 50%;
}

.channel-numbers {
  position: absolute;
  width: 100%;
  height: 100%;
}

.channel-number {
  position: absolute;
  font-size: 8px;
  color: #333;
  font-weight: bold;
}

.channel-number:nth-child(1) {
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}
.channel-number:nth-child(2) {
  top: 15%;
  right: 15%;
}
.channel-number:nth-child(3) {
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}
.channel-number:nth-child(4) {
  bottom: 15%;
  right: 15%;
}
.channel-number:nth-child(5) {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}
.channel-number:nth-child(6) {
  bottom: 15%;
  left: 15%;
}
.channel-number:nth-child(7) {
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
}
.channel-number:nth-child(8) {
  top: 15%;
  left: 15%;
}

.tv-stand {
  position: absolute;
  bottom: -12px;
  left: 50%;
  z-index: -1;
  transform: translateX(-50%);
  width: 70%;
  height: 15px;
  background-color: #5d4827;
  border-radius: 0 0 10px 10px;
}

.power-light {
  position: absolute;
  bottom: 10px;
  right: 20px;
  width: 7px;
  height: 7px;
  background-color: #ff6b4a;
  border-radius: 50%;
  margin: 10px auto;
  box-shadow: 0 0 5px #ff6b4a;
}

.control-label {
  font-size: 6px;
  color: #d0b078;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  opacity: 0.15;
}

.noise::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: noise 0.2s infinite;
}

.glitch {
  font-family: "Faustina", serif;
  font-size: 25px;
  font-weight: 600;
  margin-top: 10px;
  margin-left: 15px;
  color: white;
  filter: drop-shadow(0 1px 3px);
  text-transform: uppercase;
  position: relative;
  text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
    -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
    0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  anim.........完整代码请登录后点击上方下载按钮下载查看

网友评论0