<div class="container">
<div class="t-shirt__container">
<svg class="t-shirt" viewBox="0 0 440 360" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.6545 116.193L111.549 4H162.242C163.583 13.6241 170.379 21.7997 179.708 27.5871C190.208 34.1014 204.464 38 220 38C235.536 38 249.792 34.1014 260.292 27.5871C269.621 21.7997 276.417 13.6241 277.758 4H327.998L433.892 116.193L366.987 179.341L332.909 143.236C331.784 142.044 330.046 141.659 328.523 142.265C327 142.87 326 144.343 326 145.982V356H114V145.501C114 143.862 113 142.389 111.477 141.784C109.954 141.179 108.216 141.564 107.091 142.756L72.5592 179.341L5.6545 116.193Z" fill="#C4C4C4" stroke="black" stroke-width="8" stroke-linejoin="round"></path>
</svg>
<div class="t-shirt__badge"></div>
</div>
<div class="arrow"></div>
</div>
<div class="tutorials">
<a href="https://s.juejin.cn/ds/idkRes2Y/" target="_blank">
<svg t="1696988571607" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4422" width="200" height="200"><path d="M924.8 576.64v-115.2c12.8-13.44 13.44-26.88 12.8-34.56-3.2-30.08-36.48-42.24-47.36-46.72-79.36-30.08-226.56-89.6-307.84-122.88-49.28-24.32-65.28-19.84-113.28-0.64-12.8 5.12-224.64 83.84-306.56 117.76-44.8 18.56-51.2 46.08-51.2 61.44 0 25.6 17.92 48.64 50.56 62.08L259.84 537.6v257.28l8.32 8.32c3.84 3.84 91.52 92.16 252.16 92.16 150.4 0 236.16-88.96 240-92.8l7.68-8.32V540.16l36.48-15.36-1.28 52.48-29.44 49.28 88.96 84.48 98.56-85.76-36.48-48.64zM710.4 771.2c-22.4 18.56-88.96 67.2-190.08 67.2-111.36 0-179.84-48.64-202.88-67.2V561.28l144.64 58.88h0.64c46.08 17.28 81.28 16 125.44-3.2l122.24-51.84v206.08z m154.24-138.24l-17.92-16.64 13.44-22.4 2.56-102.4c4.48-14.08-0.64-25.6-8.32-32-7.68-7.04-21.76-11.52-36.48-2.56L565.12 563.84c-30.08 13.44-49.92 14.08-81.92 2.56l-298.88-121.6c-7.68-3.2-12.16-6.4-14.08-8.96 1.92-1.92 6.4-5.12 14.72-8.96 81.92-33.92 302.72-116.48 305.28-117.12h0.64c38.4-15.36 38.4-15.36 67.2-0.64l1.92 0.64c80.64 32.64 226.56 92.16 307.2 122.88v163.2l16 21.12-18.56 16z" p-id="4423"></path></svg>
</a>
</div>
@layer reset, base, components, variant, layout;
@layer reset {
*,
*:after,
*:before {
box-sizing: border-box;
}
}
@layer base {
body {
min-height: 100vh;
display: grid;
place-items: center;
overflow: hidden;
background: #405a6d;
}
.container {
resize: both;
overflow: hidden;
position: relative;
min-height: 200px;
min-width: 200px;
max-height: 500px;
max-width: 500px;
}
.container:active .arrow {
display: none;
}
.arrow {
height: 30px;
width: 20px;
background: #fff;
position: absolute;
bottom: 15px;
right: 0;
transform-origin: 50% 100%;
transform: rotate(-15deg);
clip-path: polygon(
50% 100%,
100% 60%,
60% 60%,
65% 0,
35% 0,
35% 60%,
0 60%
);
animation: bounce 0.5s infinite linear;
}
@keyframes bounce {
0,
100% {
transform: rotate(-15deg) translate(0, 0) scale(1);
}
50% {
transform: rotate(-15deg) translate(0, -15%) scale(1.15);
}
}
.tutorials {
position: fixed;
bottom: 1rem;
right: 1rem;
z-index: 9999;
width: 64px;
aspect-ratio: 1;
border-radius: 50%;
background: #3f517e;
padding: .5rem;
display: grid;
place-content: center;
transition: all .28s linear;
&:hover {
background:#4161b2;
}
& svg {
display: block;
width: 100%;
height: 100%;
filter: invert(1);
}
}
}
@layer components {
.container {
container-type: size;
}
.t-shirt {
height: 100%;
width: 100%;
}
.t-shirt path {
fill: hsl(var(--hue, 10), 60%, 65%);
stroke: #333;
transform: scaleX(var(--width, 1)) scaleY(var(--length, 1));
transform-origin: 50% 0%;
transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.8, 1.7),
fill 0.2s cubic-bezier(0.2, 0.7, 0.8, 1.7);
}
.t-shirt__badge {
height: 15%;
width: 15%;
background: #fff;
border-radius: 5%;
border: 2px solid #333;
position: absolute;
top: 30%;
left: 55%;
transform: translate(-50%, 0%);
}
.t-shirt__badge:before {
content: "";
position: absolute;
z-index: -1;
height: 110%;
width: 10%;
background: #bf9540;
bottom: 95%;
left: 50%;
transform: translate(-50%, 0);
}
.t-shirt__badge:after {
content: var(--size, "S");
font-family: sans-serif;
font-weight: bold;
color: hsl(0, 0%, 20%);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.t-shirt__container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(var(--scale, 1)) scaleX(1);
width: 200px;
height: 200px;
transition: transform 0.1s, background 0.1s;
}
}
@layer variant {
@container (width >= 300px) and (height >= 300px) {
.t-shirt__container {
--scale: 1.5;
--size: "M";
--hue: 210;
}
}
@container ( width >= 400px) and (height >= 400px) {
.t-shirt__container {
--scale: 2;
--size: "L";
--hue: 104;
}
}
@container (width >= 500px) and (height >= 500px) {
.t-shirt__container {
--scale: 2.5;
--size: "XL";
--hue: 280;
}
}
}
This Pen doesn't use any external CSS resources.