js+css实现电影院选座效果代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现电影院选座效果代码

代码标签: js css 电影院 选座

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

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

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Lato&display=swap");

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

body {
  background-color: #242333;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: "Lato", sans-serif;
}

.movie-container {
  margin-top: 50px;
  display: flex;
}
.movie-container label {
  display: flex;
  justify-content: left;
  align-content: center;
  padding-top: 10px;
}
.movie-container select {
  background-color: #fff;
  border: 0;
  border-radius: 5px;
  font-size: 14px;
  margin-left: 10px;
  padding: 5px 15px 5px 15px;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  margin-right: 25px;
}

.container {
  perspective: 1000px;
  margin-bottom: 30px;
}

.seat {
  background-color: #ffffff;
  color: black;
  height: 28px;
  width: 35px;
  margin: 3px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 5px;
  display: flex;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.seat.selected{
  background-color: #6feaf6;
}

.seat.occupied {
  background-color: #cc0000;
}

.seat:nth-of-type(2) {
  margin-right: 18px;
}

.seat:nth-last-of-type(2) {
  margin-left: 18px;
}

.seat:not(.occupied):hover {
  cursor: pointer;
  transform: scale(1.2);
}

.showcase .seat:not(.occupied):hover {
  cursor: default;
  transform: scale(1);
}

.showcase {
  background: rgba(0, 0, 0, 0.1);
  padding: 5px 5px;
  border-radius: 5px;
  color: #ffff4d;
  list-style-type: none;
  display: flex;
  justify-content: space-between;
}

.showcase li {
  display: flex;
  align-items: center;
  justify-content: right;
  margin: 0 10px;
}

.showcase li small {
  margin-left: 2px;
}

.row {
  display: flex;
}

.screen {
  background-color: #fff;
  height: 70px;
  width: 100%;
  margin: 15px 0;
  transform: rotateX(-45deg);
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.7);
}

p.text {
  margin: 5px 0;
}

p.text span {
  color: #6feaf6;
}
</style>


  
  
</head>



<body>
  <div class="movie-container">
    <label>Movie Choices</label>
    <select id="movie">
      <option value="15">Friday ($15)</option>
      <option value="12">Boyz N Da Hood ($12)</option>
      <option value="18">Bad Boyz 4 Life ($18)</option>
      <option value="9">Set It Off ($9)</option>
    </select>
    
      <ul class="showcase">
    <li>
      <div class="seat"></div>
      <small>Available</small>
    </li>
    <li>
      <div class="seat selected"></div>
      <small>Selected</small>
    </li>
    <li>
      <div class="seat occupied"></div>
      <small>Occupied</small>
    </li>
  </ul>
  </div>



  <div class="container">
    <div class="screen"></div>

    <div class="row">
      <div class="seat">A1</div>
      <div class="seat">A2</div>
      <div class="seat">A3</div>
      <div class="seat">A4</div>
      <div class="seat">A5</div>
      <div class="seat">A6</div>
      <div class="seat">A7</div>
      <div class="seat">A8</div>
      <div class="seat">A9</div>
      <div class="seat">A10</div>
      <div class="seat">A11</div>
      <div class="seat">A12</div>
      <div class="seat">A13</div>
      <div class="seat">A14</div>
    </div>
        <div class="row">
      <div class="seat">B1</div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
    </div>
    <div class="row">
      <div class="seat occupied"></div>
      <div class="seat occupied"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
      <div class="seat"></div>
    </div>
    <div class="row">
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
      <div class="seat occupied"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
    </div>
    <div class="row">
      <div class="seat occupied"></div>
      <div class="seat"></div>
      <div class="seat occupied"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
       <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div>
      <div class="seat"></div.........完整代码请登录后点击上方下载按钮下载查看

网友评论0