پیشنمایش زنده
کد HTML
<div class="flex w-full h-screen items-center justify-center bg-gray-600">
<label
title="Tap to light"
class="relative flex flex-col items-center justify-center"
>
<input type="checkbox" class="peer hidden" />
<div
class="absolute bottom-[55px] mx-auto mt-10 h-[0px] w-[60px] overflow-hidden rounded-2xl bg-gradient-to-t from-[#ffff] duration-500 peer-checked:h-[100px] before:absolute before:h-full before:w-[15px] before:origin-bottom-right before:-rotate-[12deg] before:bg-gray-600 after:absolute after:right-0 after:h-full after:w-[15px] after:origin-bottom-left after:rotate-[12deg] after:bg-gray-600"
></div>
<svg
height="50"
width="50"
class="-rotate-45 cursor-pointer"
viewBox="0 0 50 50"
>
<path
fill="#00000"
d="M31.925 27.325q-.54-.26-.985-.671-3.875-3.596-7.785-7.81-1.215-1.315-1.01-3.079.11-.985 1.125-2.829 4.806-8.74 6.26-11.156.765-1.265 2.385-.575 1.95.829 3.64 2.071.871.635 3.2 2.654 5.8 5.029 9.715 11.1 1.575 2.446-.85 3.835-5.735 3.29-11.54 6.454-1.96 1.065-4.154.004M7.015 33.146q6.685-7.317 13.271-14.481a.27.27 52.1 0 1 .435.054q.904 1.64 2.071 2.8 1.04 1.035 1.065 1.065 3.479 3.704 7.446 6.879a.221.215 43 0 1 .015.329q-9.881 9.144-19.931 18.098-1.01.9-1.785 1.075-1.24.279-2.196-.496-3.965-3.235-6-6-.671-.915-.39-2.05.171-.704 1.004-1.665 2.465-2.835 4.996-5.61m14.448-4.556a1.875 1.875 0 0 0-2.658-.042l-2.219 2.15a1.875 1.875 0 0 0-.042 2.658l.131.135a1.875 1.875 0 0 0 2.658.042l2.219-2.15a1.875 1.875 0 0 0 .042-2.658z"
></path>
</svg>
</label>
</div>
کد CSS
/* ! tailwindcss v3.4.16 | MIT License | s://tailwindcss.com */
*,
::after,
::before {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: #e5e7eb;
}
::after,
::before {
--tw-content: "";
}
:host,
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-feature-settings: normal;
font-variation-settings: normal;
-webkit-tap-highlight-color: transparent;
}
body {
margin: 0;
line-height: inherit;
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
a {
color: inherit;
text-decoration: inherit;
}
b,
strong {
font-weight: bolder;
}
code,
kbd,
pre,
samp {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace;
font-feature-settings: normal;
font-variation-settings: normal;
font-size: 1em;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
font-size: 100%;
font-weight: inherit;
line-height: inherit;
letter-spacing: inherit;
color: inherit;
margin: 0;
padding: 0;
}
button,
select {
text-transform: none;
}
button,
input:where([type="button"]),
input:where([type="reset"]),
input:where([type="submit"]) {
-webkit-appearance: button;
background-color: transparent;
background-image: none;
}
:-moz-focusring {
outline: auto;
}
:-moz-ui-invalid {
box-shadow: none;
}
progress {
vertical-align: baseline;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
summary {
display: list-item;
}
blockquote,
dd,
dl,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
menu,
ol,
ul {
list-style: none;
margin: 0;
padding: 0;
}
dialog {
padding: 0;
}
textarea {
resize: vertical;
}
input::placeholder,
textarea::placeholder {
opacity: 1;
color: #9ca3af;
}
[role="button"],
button {
cursor: pointer;
}
:disabled {
cursor: default;
}
audio,
canvas,
embed,
iframe,
img,
object,
svg,
video {
display: block;
vertical-align: middle;
}
img,
video {
max-width: 100%;
height: auto;
}
[hidden]:where(:not([hidden="until-found"])) {
display: none;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.bottom-\[55px\] {
bottom: 55px;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
}
.mt-10 {
margin-top: 2.5rem;
}
.flex {
display: flex;
}
.hidden {
display: none;
}
.h-\[0px\] {
height: 0px;
}
.h-screen {
height: 100vh;
}
.w-\[60px\] {
width: 60px;
}
.w-full {
width: 100%;
}
.-rotate-45 {
--tw-rotate: -45deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y))
rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y))
scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.cursor-pointer {
cursor: pointer;
}
.flex-col {
flex-direction: column;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.overflow-hidden {
overflow: hidden;
}
.rounded-2xl {
border-radius: 1rem;
}
.bg-gray-600 {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));
}
.bg-gradient-to-t {
background-image: linear-gradient(to top, var(--tw-gradient-stops));
}
.from-\[\#ffff\] {
--tw-gradient-from: #ffff var(--tw-gradient-from-position);
--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.duration-500 {
transition-duration: 500ms;
}
.before\:absolute::before {
content: var(--tw-content);
position: absolute;
}
.before\:h-full::before {
content: var(--tw-content);
height: 100%;
}
.before\:w-\[15px\]::before {
content: var(--tw-content);
width: 15px;
}
.before\:origin-bottom-right::before {
content: var(--tw-content);
transform-origin: bottom right;
}
.before\:-rotate-\[12deg\]::before {
content: var(--tw-content);
--tw-rotate: -12deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y))
rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y))
scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.before\:bg-gray-600::before {
content: var(--tw-content);
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));
}
.after\:absolute::after {
content: var(--tw-content);
position: absolute;
}
.after\:right-0::after {
content: var(--tw-content);
right: 0px;
}
.after\:h-full::after {
content: var(--tw-content);
height: 100%;
}
.after\:w-\[15px\]::after {
content: var(--tw-content);
width: 15px;
}
.after\:origin-bottom-left::after {
content: var(--tw-content);
transform-origin: bottom left;
}
.after\:rotate-\[12deg\]::after {
content: var(--tw-content);
--tw-rotate: 12deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y))
rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y))
scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.after\:bg-gray-600::after {
content: var(--tw-content);
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));
}
.peer:checked ~ .peer-checked\:h-\[100px\] {
height: 100px;
}