پیشنمایش زنده
کد HTML
<label class="container">
<input type="checkbox" />
<div class="checkmark">NOUVEAU</div>
<span class="sticker">
<span class="front">
<span class="content">NOUVEAU</span>
</span>
<span class="back"></span>
</span>
</label>
کد CSS
/* Cacher la case à cocher */
.container input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.container {
display: block;
position: relative;
cursor: pointer;
font-size: 20px;
user-select: none;
transition: all 0.3s ease;
}
/* Style de départ pour le bouton rond */
.checkmark {
position: relative;
font-size: 10px;
font-weight: 800;
display: flex;
align-items: center;
justify-content: center;
border-radius: 100%;
top: 0;
left: 0;
height: 70px;
width: 70px;
background-color: #ffffff00;
color: #000000;
border: solid 3px #000000;
transition: all 0.3s ease;
}
/* Effet hover sur le bouton */
.container:hover {
transform: rotate(-20deg) scale(1.03);
}
/* Styles pour le sticker */
.sticker {
font-family: inherit;
font-weight: 800;
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
z-index: 5;
width: 70px;
height: 70px;
border-radius: 50%;
transition: 0.2s 0.2s;
transform: translate3d(5px, 10px, 0) scale(1.3) rotate(-45deg);
opacity: 0;
pointer-events: none; /* Désactive les interactions */
}
.sticker .back,
.sticker .front {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
transition: 0.5s;
}
.sticker .back:before,
.sticker .front:before {
content: " ";
position: absolute;
bottom: 0;
left: 0;
width: 70px;
height: 70px;
border-radius: 50%;
transition: 0.5s;
}
.sticker .front {
height: 0;
}
.sticker .front .content {
position: absolute;
bottom: -0.5px;
left: -0.5px;
font-size: 10px;
font-weight: 800;
display: flex;
align-items: center;
justify-content: center;
width: 71px;
height: 71px;
transform: rotate(25deg);
border: solid 3px rgb(255, 255, 255);
background: linear-gradient(
234deg,
rgba(255, 64, 129, 1) 1%,
rgba(123, 170, 247, 1) 98%
);
color: #fff;
text-align: center;
border-radius: 50%;
}
.sticker .back {
top: 70px;
overflow: hidden;
}
.sticker .back:before {
background-color: #ffffff;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.4);
top: 0;
}
/* Lorsque le bouton est coché, activer le sticker */
.container input:checked ~ .sticker {
transform: translate3d(0, 0, 0) scale(1) rotate(-45deg);
transition-delay: 0s;
opacity: 1;
pointer-events: all;
}
.container input:checked ~ .sticker .front {
height: 130px;
}
.container input:checked ~ .sticker .back {
top: 0;
}
.container input:checked ~ .sticker .back:before {
top: -134px;
}