پیش‌نمایش زنده
کد HTML
<div class="card">
  <div class="card__body">
    <input id="checkbox" type="checkbox" />
    <label class="switch" for="checkbox">
      <div class="mute-speaker">
        <svg
          viewBox="0 0 75 75"
          version="1.0"
          xmlns="http://www.w3.org/2000/svg"
        >
          <path
            style="stroke:#fff;stroke-width:5;stroke-linejoin:round;fill:#fff;"
            d="M39.389,13.769 L22.235,28.606 L6,28.606 L6,47.699 L21.989,47.699 L39.389,62.75 L39.389,13.769z"
          ></path>
          <path
            style="fill:none;stroke:#fff;stroke-width:5;stroke-linecap:round"
            d="M48,27.6a19.5,19.5 0 0 1 0,21.4M55.1,20.5a30,30 0 0 1 0,35.6M61.6,14a38.8,38.8 0 0 1 0,48.6"
          ></path>
        </svg>
      </div>

      <div class="speaker">
        <svg stroke-width="5" stroke="#fff" viewBox="0 0 75 75" version="1.0">
          <path
            stroke-linejoin="round"
            fill="#fff"
            d="m39,14-17,15H6V48H22l17,15z"
          ></path>
          <path
            stroke-linecap="round"
            fill="#fff"
            d="m49,26 20,24m0-24-20,24"
          ></path>
        </svg>
      </div>
    </label>
  </div>
  <div class="card__ribbon">
    <label class="card__ribbon-label">
      <div class="container">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
      </div>
    </label>
  </div>
</div>
کد CSS
#checkbox {
  display: none;
}

.switch {
  position: relative;
  width: 70px;
  height: 70px;
  background-color: rgb(99, 99, 99);
  border-radius: 50%;
  z-index: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgb(126, 126, 126);
  box-shadow: 0px 0px 3px rgb(2, 2, 2) inset;
}
.switch svg {
  width: 1.2em;
}
.switch svg path {
  fill: rgb(48, 48, 48);
}
#checkbox:checked + .switch {
  box-shadow:
    0px 0px 1px rgb(151, 243, 255) inset,
    0px 0px 2px rgb(151, 243, 255) inset,
    0px 0px 10px rgb(151, 243, 255) inset,
    0px 0px 40px rgb(151, 243, 255),
    0px 0px 100px rgb(151, 243, 255),
    0px 0px 5px rgb(151, 243, 255);
  border: 2px solid rgb(255, 255, 255);
  background-color: rgb(146, 180, 184);
}
#checkbox:checked + .switch svg {
  filter: drop-shadow(0px 0px 5px rgb(151, 243, 255));
}
#checkbox:checked + .switch svg path {
  fill: rgb(255, 255, 255);
}

/* The switch - the box around the speaker*/
.switch {
  width: 50px;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(39, 39, 39);
  border-radius: 50%;
  cursor: pointer;
  transition-duration: 0.3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.13);
  overflow: hidden;
}

/* Hide default HTML checkbox */
#checkbox {
  display: none;
}

.bell {
  width: 18px;
}

.bell path {
  fill: white;
}

.speaker {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition-duration: 0.3s;
}

.speaker svg {
  width: 18px;
}

.mute-speaker {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 3;
  transition-duration: 0.3s;
}

.mute-speaker svg {
  width: 18px;
}

#checkbox:checked + .switch .speaker {
  opacity: 0;
  transition-duration: 0.3s;
}

#checkbox:checked + .switch .mute-speaker {
  opacity: 1;
  transition-duration: 0.3s;
}

#checkbox:active + .switch {
  transform: scale(0.7);
}

.card {
  width: min(300px, 100%);
  margin: auto;
  background-color: #ffffff;
  text-align: center;
  border-top-left-radius: 4rem;
  border-top-right-radius: 4rem;
  border: 2px solid #fff;
  position: relative;
}

.card__body {
  padding: 2rem 1.5rem;
  max-width: 25ch;
  margin: auto;
}

.card__title {
  font-weight: 800;
  color: #121513;
  font-size: 1.25rem;
  margin-block: 1.5rem 0.75rem;
}

.card__paragraph {
  color: #303830;
  font-size: 0.875rem;
}

.card__ribbon {
  margin-top: 1.5rem;
  display: grid;
  place-items: center;
  height: 50px;
  background-color: #393e7f;
  position: relative;
  width: 110%;
  left: -5%;
  top: 10px;
  position: relative;
  border-radius: 0 0 2rem 2rem;
}

.card__ribbon::after,
.card__ribbon::before {
  content: "";
  position: absolute;
  width: 20px;
  aspect-ratio: 1/1;
  bottom: 100%;
  z-index: -2;
  background-color: #191c39;
}

.card__ribbon::before {
  left: 0;
  transform-origin: left bottom;
  transform: rotate(45deg);
}

.card__ribbon::after {
  right: 0;
  transform-origin: right bottom;
  transform: rotate(-45deg);
}

.card__ribbon-label {
  display: block;
  width: 84px;
  aspect-ratio: 1/1;
  background-color: #fff;
  position: relative;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 8px solid #393e7f;
  display: grid;
  place-items: center;
  font-weight: 900;
  line-height: 1;
  font-size: 1.5rem;
}

.card__ribbon-label::before,
.card__ribbon-label::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 25px;
  bottom: 50%;
}

.card__ribbon-label::before {
  right: calc(100% + 4px);
  border-bottom-right-radius: 20px;
  box-shadow: 5px 5px 0 #393e7f;
}

.card__ribbon-label::after {
  left: calc(100% + 4px);
  border-bottom-left-radius: 20px;
  box-shadow: -5px 5px 0 #393e7f;
}

.container {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  height: 70px;
  width: 70px;
  animation: rotate_3922 1.2s linear infinite;
  background-color: #9b59b6;
  background-image: linear-gradient(#9b59b6, #84cdfa, #5ad1cd);
}

.container span {
  position: absolute;
  border-radius: 50%;
  background-color: #9b59b6;
  background-image: linear-gradient(#9b59b6, #84cdfa, #5ad1cd);
}
.container span:nth-of-type(1) {
  filter: blur(5px);
}
.container span:nth-of-type(2) {
  filter: blur(10px);
}
.container span:nth-of-type(3) {
  filter: blur(25px);
}
.container span:nth-of-type(4) {
  filter: blur(50px);
}
.container::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background-color: #fff;
  border: solid 5px #ffffff;
  border-radius: 50%;
}

@keyframes rotate_3922 {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
نوع: card
تاریخ ایجاد: 2026/06/06
آخرین بروزرسانی: 2026/06/06