پیشنمایش زنده
کد HTML
<div class="results-summary-container">
<div class="confetti">
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
<div class="confetti-piece"></div>
</div>
<div class="results-summary-container__result">
<div class="heading-tertiary">Your Result</div>
<div class="result-box">
<div class="heading-primary">98</div>
<p class="result">of 100</p>
</div>
<div class="result-text-box">
<div class="heading-secondary">excellent</div>
<p class="paragraph">
You scored higher than 65% of the people who have taken these tests.
</p>
</div>
</div>
<div class="results-summary-container__options">
<div class="heading-secondary heading-secondary--blue">Summary</div>
<div class="summary-result-options">
<div class="result-option result-option-reaction">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20">
<path stroke="#F55" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M10.833 8.333V2.5l-6.666 9.167h5V17.5l6.666-9.167h-5Z"></path>
</svg>
<span class="reaction-icon-text">Reaction</span>
</div>
<div class="result-box"><span>82</span> / 100</div>
</div>
<div class="result-option result-option-memory">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20">
<path stroke="#FFB21E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M5.833 11.667a2.5 2.5 0 1 0 .834 4.858"></path>
<path stroke="#FFB21E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M3.553 13.004a3.333 3.333 0 0 1-.728-5.53m.025-.067a2.083 2.083 0 0 1 2.983-2.824m.199.054A2.083 2.083 0 1 1 10 3.75v12.917a1.667 1.667 0 0 1-3.333 0M10 5.833a2.5 2.5 0 0 0 2.5 2.5m1.667 3.334a2.5 2.5 0 1 1-.834 4.858"></path>
<path stroke="#FFB21E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M16.447 13.004a3.334 3.334 0 0 0 .728-5.53m-.025-.067a2.083 2.083 0 0 0-2.983-2.824M10 3.75a2.085 2.085 0 0 1 2.538-2.033 2.084 2.084 0 0 1 1.43 2.92m-.635 12.03a1.667 1.667 0 0 1-3.333 0"></path>
</svg>
<span class="memory-icon-text">Memory</span>
</div>
<div class="result-box"><span>94</span> / 100</div>
</div>
<div class="result-option result-option-verbal">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20">
<path stroke="#00BB8F" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M7.5 10h5M10 18.333A8.333 8.333 0 1 0 1.667 10c0 1.518.406 2.942 1.115 4.167l-.699 3.75 3.75-.699A8.295 8.295 0 0 0 10 18.333Z"></path>
</svg>
<span class="verbal-icon-text">Verbal</span>
</div>
<div class="result-box"><span>66</span> / 100</div>
</div>
<div class="result-option result-option-Visual">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20">
<path stroke="#1125D6" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M10 11.667a1.667 1.667 0 1 0 0-3.334 1.667 1.667 0 0 0 0 3.334Z"></path>
<path stroke="#1125D6" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.25" d="M17.5 10c-1.574 2.492-4.402 5-7.5 5s-5.926-2.508-7.5-5C4.416 7.632 6.66 5 10 5s5.584 2.632 7.5 5Z"></path>
</svg>
<span class="visual-icon-text">Visual</span>
</div>
<div class="result-box"><span>72</span> / 100</div>
</div>
<div class="summary__cta">
<button class="btn btn__continue">Continue</button>
</div>
</div>
</div>
</div>
کد CSS
.results-summary-container {
font-family: "Hanken Grotesk", sans-serif;
display: flex;
flex-direction: column;
width: 350px;
gap: 10px;
border-radius: 10px;
box-shadow: 10px 10px 30px rgba(120, 87, 255, 0.8);
backface-visibility: hidden;
}
.heading-primary,
.heading-secondary,
.heading-tertiary {
color: #ffffff;
text-transform: capitalize;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 1px;
}
.heading-primary {
font-size: 36px;
font-weight: 700;
background-image: linear-gradient(to right, #f7bb97, #dd5e89);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
transform: scale(1.4);
}
.heading-secondary {
font-size: 24px;
font-weight: 700;
margin-top: 15px;
letter-spacing: 1px;
}
.heading-secondary--blue {
color: hsl(224, 30%, 27%);
}
.heading-tertiary {
font-size: 20px;
font-weight: 500;
margin-bottom: 20px;
color: hsl(221, 100%, 96%);
}
.paragraph {
font-size: 17px;
line-height: 1.6;
color: hsl(221, 100%, 96%);
}
.paragraph-text-box {
width: 100%;
}
.text-center {
text-align: center;
}
.margin-1 {
margin-bottom: 10px;
}
.results-summary-container__result {
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
justify-content: center;
padding: 20px 10px;
border-radius: 10px 10px 0 0;
background-image: linear-gradient(to bottom, #aa076b, #61045f);
.result-box {
width: 150px;
height: 150px;
border-radius: 50%;
background-image: linear-gradient(-45deg, #ef629f, #42275a);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
}
.result {
margin-top: -12px;
font-size: 14px;
font-weight: 400;
color: hsl(241, 100%, 89%);
}
}
.results-summary-container__options {
padding: 0 16px;
}
.summary-result-options {
display: flex;
flex-direction: column;
gap: 10px;
}
.result-option {
width: 100%;
height: 40px;
background-color: hsl(0, 100%, 97%);
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
border-radius: 3px;
cursor: pointer;
}
.result-option-memory {
background-color: hsl(39, 100%, 97%);
}
.result-option-verbal {
background-color: hsl(166, 100%, 97%);
}
.result-option-Visual {
background-color: hsl(234, 85%, 97%);
}
.icon-box {
display: flex;
font-size: 16px;
align-items: center;
gap: 2px;
}
.reaction-icon-text {
color: hsl(0, 100%, 67%);
}
.memory-icon-text {
color: hsl(39, 100%, 56%);
}
.verbal-icon-text {
color: hsl(166, 100%, 37%);
}
.visual-icon-text {
color: hsl(234, 85%, 45%);
}
.result-box {
font-size: 14px;
color: hsl(241, 100%, 89%);
font-weight: 700;
}
.result-box span {
font-size: 14px;
color: hsl(224, 30%, 27%);
}
.btn {
width: 100%;
padding: 10px;
color: #ffffff;
background-image: linear-gradient(to right, #aa076b, #61045f);
border: none;
border-radius: 3px;
font-size: 17px;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 500;
cursor: pointer;
margin: 15px 0 30px 0;
transition: all 0.3s;
}
.btn:hover {
transform: translateY(5px);
background-image: linear-gradient(to left, #aa076b, #61045f);
}
.icon {
cursor: pointer;
filter: grayscale(1);
transition: 0.3s linear;
}
.icon:hover {
filter: grayscale(0);
}
@keyframes background {
0% {
background-image: linear-gradient(to right, #aa076b, #61045f);
}
50% {
background-image: linear-gradient(to right, #aa076b, #61045f);
}
100% {
background-image: linear-gradient(to right, #ef629f, #42275a);
}
}
@keyframes gradient {
0% {
background-position: 0% 50%;
background-image: linear-gradient(-45deg, #ef629f, #42275a);
}
50% {
background-position: 100% 50%;
background-image: linear-gradient(to bottom, #aa076b, #61045f);
}
100% {
background-position: 0% 50%;
background-image: linear-gradient(to top, #ef629f, #42275a);
}
}
.confetti {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
width: 360px;
height: 50%;
overflow: hidden;
z-index: 1000;
}
.confetti-piece {
position: absolute;
width: 10px;
height: 20px;
background-color: hsl(39, 100%, 56%);
top: 0;
opacity: 0;
animation: makeItRain 3000ms infinite ease-in-out;
}
.confetti-piece:nth-child(1) {
left: 7%;
transform: rotate(-10deg);
animation-delay: 182ms;
animation-duration: 2000ms;
}
.confetti-piece:nth-child(2) {
left: 14%;
transform: rotate(20deg);
animation-delay: 161ms;
animation-duration: 2076ms;
}
.confetti-piece:nth-child(3) {
left: 21%;
transform: rotate(-51deg);
animation-delay: 481ms;
animation-duration: 2103ms;
}
.confetti-piece:nth-child(4) {
left: 28%;
transform: rotate(61deg);
animation-delay: 334ms;
animation-duration: 1008ms;
}
.confetti-piece:nth-child(5) {
left: 35%;
transform: rotate(-52deg);
animation-delay: 302ms;
animation-duration: 1776ms;
}
.confetti-piece:nth-child(6) {
left: 42%;
transform: rotate(38deg);
animation-delay: 180ms;
animation-duration: 1168ms;
}
.confetti-piece:nth-child(7) {
left: 49%;
transform: rotate(11deg);
animation-delay: 395ms;
animation-duration: 1200ms;
}
.confetti-piece:nth-child(8) {
left: 56%;
transform: rotate(49deg);
animation-delay: 14ms;
animation-duration: 1887ms;
}
.confetti-piece:nth-child(9) {
left: 63%;
transform: rotate(-72deg);
animation-delay: 149ms;
animation-duration: 1805ms;
}
.confetti-piece:nth-child(10) {
left: 70%;
transform: rotate(10deg);
animation-delay: 351ms;
animation-duration: 2059ms;
}
.confetti-piece:nth-child(11) {
left: 77%;
transform: rotate(4deg);
animation-delay: 307ms;
animation-duration: 1132ms;
}
.confetti-piece:nth-child(12) {
left: 84%;
transform: rotate(42deg);
animation-delay: 464ms;
animation-duration: 1776ms;
}
.confetti-piece:nth-child(13) {
left: 91%;
transform: rotate(-72deg);
animation-delay: 429ms;
animation-duration: 1818ms;
}
.confetti-piece:nth-child(14) {
left: 94%;
transform: rotate(-72deg);
animation-delay: 429ms;
animation-duration: 818ms;
}
.confetti-piece:nth-child(15) {
left: 96%;
transform: rotate(-72deg);
animation-delay: 429ms;
animation-duration: 2818ms;
}
.confetti-piece:nth-child(16) {
left: 98%;
transform: rotate(-72deg);
animation-delay: 429ms;
animation-duration: 2818ms;
}
.confetti-piece:nth-child(17) {
left: 50%;
transform: rotate(-72deg);
animation-delay: 429ms;
animation-duration: 2818ms;
}
.confetti-piece:nth-child(18) {
left: 60%;
transform: rotate(-72deg);
animation-delay: 429ms;
animation-duration: 1818ms;
}
.confetti-piece:nth-child(odd) {
background-color: hsl(0, 100%, 67%);
}
.confetti-piece:nth-child(even) {
z-index: 1;
}
.confetti-piece:nth-child(4n) {
width: 6px;
height: 14px;
animation-duration: 4000ms;
background-color: #c33764;
}
.confetti-piece:nth-child(5n) {
width: 3px;
height: 10px;
animation-duration: 4000ms;
background-color: #b06ab3;
}
.confetti-piece:nth-child(3n) {
width: 4px;
height: 12px;
animation-duration: 2500ms;
animation-delay: 3000ms;
background-color: #dd2476;
}
.confetti-piece:nth-child(3n-7) {
background-color: hsl(166, 100%, 37%);
}
@keyframes makeItRain {
from {
opacity: 0;
}
50% {
opacity: 1;
}
to {
transform: translateY(200px);
}
}