مجموعة من الأكواد المميزة للويب مع إمكانية النسخ
زيارة القناة<input id="switch" type="checkbox"> <div class="app"> <div class="body"> <div class="phone"> <div class="menu"> <div class="time">4:20</div> <div class="icons"> <div class="network"></div> <div class="battery"></div> </div> </div> <div class="content"> <div class="circle"> <div class="crescent"></div> </div> <label for="switch"> <div class="toggle"></div> <div class="names"> <p class="light">Light</p> <p class="dark">Dark</p> </div> </label> </div> </div> </div> </div>
/* From Uiverse.io by Pradeepsaranbishnoi */ /* GENERAL */ .app { width: 100%; height: 300px; display: flex; justify-content: center; align-items: center; } .phone { position: relative; z-index: 2; width: 18rem; height: 17rem; background-color: white; box-shadow: 0 4px 35px rgba(0,0,0,.1); border-radius: 40px; display: flex; flex-direction: column; } .menu { font-size: 80%; opacity: .4; padding: .8rem 1.8rem; display: flex; justify-content: space-between; align-items: center; } .icons { display: flex; margin-top: .5rem; } .battery { width: .85rem; height: .45rem; background-color: black; } .network { width: 0; height: 0; border-style: solid; border-width: 0 6.8px 7.2px 6.8px; border-color: transparent transparent black transparent; transform: rotate(135deg); margin: .12rem .5rem; } .content { display: flex; flex-direction: column; margin: auto; text-align: center; width: 70%; transform: translateY(5%); } .circle { position: relative; border-radius: 100%; width: 8rem; height: 8rem; background: linear-gradient(40deg, #FF0080,#FF8C00 70%); margin: auto; } .crescent { position: absolute; border-radius: 100%; right: 0; width: 6rem; height: 6rem; background: white; transform: scale(0); transform-origin: top right; transition: transform .6s cubic-bezier(0.645, 0.045, 0.355, 1); } label, .toggle { height: 2.8rem; border-radius: 100px; } label { width: 100%; background-color: rgba(0,0,0,.1); border-radius: 100px; position: relative; margin: 1.8rem 0 4rem 0; cursor: pointer; } .toggle { position: absolute; width: 50%; background-color: #fff; box-shadow: 0 2px 15px rgba(0,0,0,.15); transition: transform .3s cubic-bezier(0.25, 0.46, 0.45, 0.94); } .names { font-size: 90%; font-weight: bolder; color: black; width: 65%; margin-left: 17.5%; margin-top: 6.5%; position: absolute; display: flex; justify-content: space-between; user-select: none; } .dark { opacity: .5; } [type="checkbox"] { display: none; } [type="checkbox"]:checked + .app .toggle { transform: translateX(100%); background-color: #34323D; } [type="checkbox"]:checked + .app .dark { opacity: 1; color: white; } [type="checkbox"]:checked + .app .light { opacity: 1; color: white; } [type="checkbox"]:checked + .app .body { background-color: #26242E; color: white; } [type="checkbox"]:checked + .app .crescent { transform: scale(1); background: #26242E; } [type="checkbox"]:checked + .app .circle { background: linear-gradient(40deg, #8983F7, #A3DAFB 70%); } [type="checkbox"]:checked + .app .body .phone .menu .time { color: white; } [type="checkbox"]:checked + .app .body .phone .menu .icons .network { border-color: transparent transparent white transparent; } [type="checkbox"]:checked + .app .body .phone .menu .icons .battery { background-color: white; }
<button class="button" data-text="Awesome"> <span class="actual-text"> uiverse </span> <span aria-hidden="true" class="hover-text"> uiverse </span> </button>
/* === removing default button style ===*/ .button { margin: 0; height: auto; background: transparent; padding: 0; border: none; cursor: pointer; } /* button styling */ .button { --border-right: 6px; --text-stroke-color: rgba(255,255,255,0.6); --animation-color: #37FF8B; --fs-size: 2em; letter-spacing: 3px; text-decoration: none; font-size: var(--fs-size); font-family: "Arial"; position: relative; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px var(--text-stroke-color); } /* this is the text, when you hover on button */ .hover-text { position: absolute; box-sizing: border-box; content: attr(data-text); color: var(--animation-color); width: 0%; inset: 0; border-right: var(--border-right) solid var(--animation-color); overflow: hidden; transition: 0.5s; -webkit-text-stroke: 1px var(--animation-color); } /* hover */ .button:hover .hover-text { width: 100%; filter: drop-shadow(0 0 23px var(--animation-color)) }
<button> <div class="svg-wrapper-1"> <div class="svg-wrapper"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> <path fill="none" d="M0 0h24v24H0z"></path> <path fill="currentColor" d="M1.946 9.315c-.522-.174-.527-.455.01-.634l19.087-6.362c.529-.176.832.12.684.638l-5.454 19.086c-.15.529-.455.547-.679.045L12 14l6-8-8 6-8.054-2.685z"></path> </svg> </div> </div> <span>Send</span> </button>
button { font-family: inherit; font-size: 20px; background: royalblue; color: white; padding: 0.7em 1em; padding-left: 0.9em; display: flex; align-items: center; border: none; border-radius: 16px; overflow: hidden; transition: all 0.2s; cursor: pointer; } button span { display: block; margin-left: 0.3em; transition: all 0.3s ease-in-out; } button svg { display: block; transform-origin: center center; transition: transform 0.3s ease-in-out; } button:hover .svg-wrapper { animation: fly-1 0.6s ease-in-out infinite alternate; } button:hover svg { transform: translateX(1.2em) rotate(45deg) scale(1.1); } button:hover span { transform: translateX(5em); } button:active { transform: scale(0.95); } @keyframes fly-1 { from { transform: translateY(0.1em); } to { transform: translateY(-0.1em); } }
<div aria-label="Orange and tan hamster running in a metal wheel" role="img" class="wheel-and-hamster"> <div class="wheel"></div> <div class="hamster"> <div class="hamster__body"> <div class="hamster__head"> <div class="hamster__ear"></div> <div class="hamster__eye"></div> <div class="hamster__nose"></div> </div> <div class="hamster__limb hamster__limb--fr"></div> <div class="hamster__limb hamster__limb--fl"></div> <div class="hamster__limb hamster__limb--br"></div> <div class="hamster__limb hamster__limb--bl"></div> <div class="hamster__tail"></div> </div> </div> <div class="spoke"></div> </div>
.wheel-and-hamster { --dur: 1s; position: relative; width: 12em; height: 12em; font-size: 14px; } .wheel, .hamster, .hamster div, .spoke { position: absolute; } .wheel, .spoke { border-radius: 50%; top: 0; left: 0; width: 100%; height: 100%; } .wheel { background: radial-gradient(100% 100% at center,hsla(0,0%,60%,0) 47.8%,hsl(0,0%,60%) 48%); z-index: 2; } .hamster { animation: hamster var(--dur) ease-in-out infinite; top: 50%; left: calc(50% - 3.5em); width: 7em; height: 3.75em; transform: rotate(4deg) translate(-0.8em,1.85em); transform-origin: 50% 0; z-index: 1; } .hamster__head { animation: hamsterHead var(--dur) ease-in-out infinite; background: hsl(30,90%,55%); border-radius: 70% 30% 0 100% / 40% 25% 25% 60%; box-shadow: 0 -0.25em 0 hsl(30,90%,80%) inset, 0.75em -1.55em 0 hsl(30,90%,90%) inset; top: 0; left: -2em; width: 2.75em; height: 2.5em; transform-origin: 100% 50%; } .hamster__ear { animation: hamsterEar var(--dur) ease-in-out infinite; background: hsl(0,90%,85%); border-radius: 50%; box-shadow: -0.25em 0 hsl(30,90%,55%) inset; top: -0.25em; right: -0.25em; width: 0.75em; height: 0.75em; transform-origin: 50% 75%; } .hamster__eye { animation: hamsterEye var(--dur) linear infinite; background-color: hsl(0,0%,0%); border-radius: 50%; top: 0.375em; left: 1.25em; width: 0.5em; height: 0.5em; } .hamster__nose { background: hsl(0,90%,75%); border-radius: 35% 65% 85% 15% / 70% 50% 50% 30%; top: 0.75em; left: 0; width: 0.2em; height: 0.25em; } .hamster__body { animation: hamsterBody var(--dur) ease-in-out infinite; background: hsl(30,90%,90%); border-radius: 50% 30% 50% 30% / 15% 60% 40% 40%; box-shadow: 0.1em 0.75em 0 hsl(30,90%,55%) inset, 0.15em -0.5em 0 hsl(30,90%,80%) inset; top: 0.25em; left: 2em; width: 4.5em; height: 3em; transform-origin: 17% 50%; transform-style: preserve-3d; } .hamster__limb--fr, .hamster__limb--fl { clip-path: polygon(0 0,100% 0,70% 80%,60% 100%,0% 100%,40% 80%); top: 2em; left: 0.5em; width: 1em; height: 1.5em; transform-origin: 50% 0; } .hamster__limb--fr { animation: hamsterFRLimb var(--dur) linear infinite; background: linear-gradient(hsl(30,90%,80%) 80%,hsl(0,90%,75%) 80%); transform: rotate(15deg) translateZ(-1px); } .hamster__limb--fl { animation: hamsterFLLimb var(--dur) linear infinite; background: linear-gradient(hsl(30,90%,90%) 80%,hsl(0,90%,85%) 80%); transform: rotate(15deg); } .hamster__limb--br, .hamster__limb--bl { border-radius: 0.75em 0.75em 0 0; clip-path: polygon(0 0,100% 0,100% 30%,70% 90%,70% 100%,30% 100%,40% 90%,0% 30%); top: 1em; left: 2.8em; width: 1.5em; height: 2.5em; transform-origin: 50% 30%; } .hamster__limb--br { animation: hamsterBRLimb var(--dur) linear infinite; background: linear-gradient(hsl(30,90%,80%) 90%,hsl(0,90%,75%) 90%); transform: rotate(-25deg) translateZ(-1px); } .hamster__limb--bl { animation: hamsterBLLimb var(--dur) linear infinite; background: linear-gradient(hsl(30,90%,90%) 90%,hsl(0,90%,85%) 90%); transform: rotate(-25deg); } .hamster__tail { animation: hamsterTail var(--dur) linear infinite; background: hsl(0,90%,85%); border-radius: 0.25em 50% 50% 0.25em; box-shadow: 0 -0.2em 0 hsl(0,90%,75%) inset; top: 1.5em; right: -0.5em; width: 1em; height: 0.5em; transform: rotate(30deg) translateZ(-1px); transform-origin: 0.25em 0.25em; } .spoke { animation: spoke var(--dur) linear infinite; background: radial-gradient(100% 100% at center,hsl(0,0%,60%) 4.8%,hsla(0,0%,60%,0) 5%), linear-gradient(hsla(0,0%,55%,0) 46.9%,hsl(0,0%,65%) 47% 52.9%,hsla(0,0%,65%,0) 53%) 50% 50% / 99% 99% no-repeat; } /* Animations */ @keyframes hamster { from, to { transform: rotate(4deg) translate(-0.8em,1.85em); } 50% { transform: rotate(0) translate(-0.8em,1.85em); } } @keyframes hamsterHead { from, 25%, 50%, 75%, to { transform: rotate(0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(8deg); } } @keyframes hamsterEye { from, 90%, to { transform: scaleY(1); } 95% { transform: scaleY(0); } } @keyframes hamsterEar { from, 25%, 50%, 75%, to { transform: rotate(0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(12deg); } } @keyframes hamsterBody { from, 25%, 50%, 75%, to { transform: rotate(0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-2deg); } } @keyframes hamsterFRLimb { from, 25%, 50%, 75%, to { transform: rotate(50deg) translateZ(-1px); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-30deg) translateZ(-1px); } } @keyframes hamsterFLLimb { from, 25%, 50%, 75%, to { transform: rotate(-30deg); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(50deg); } } @keyframes hamsterBRLimb { from, 25%, 50%, 75%, to { transform: rotate(-60deg) translateZ(-1px); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(20deg) translateZ(-1px); } } @keyframes hamsterBLLimb { from, 25%, 50%, 75%, to { transform: rotate(20deg); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-60deg); } } @keyframes hamsterTail { from, 25%, 50%, 75%, to { transform: rotate(30deg) translateZ(-1px); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(10deg) translateZ(-1px); } } @keyframes spoke { from { transform: rotate(0); } to { transform: rotate(-1turn); } }
<button class="learn-more"> <span class="circle" aria-hidden="true"> <span class="icon arrow"></span> </span> <span class="button-text">Learn More</span> </button>
button { position: relative; display: inline-block; cursor: pointer; outline: none; border: 0; vertical-align: middle; text-decoration: none; background: transparent; padding: 0; font-size: inherit; font-family: inherit; } button.learn-more { width: 12rem; height: auto; } button.learn-more .circle { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); position: relative; display: block; margin: 0; width: 3rem; height: 3rem; background: #282936; border-radius: 1.625rem; } button.learn-more .circle .icon { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); position: absolute; top: 0; bottom: 0; margin: auto; background: #fff; } button.learn-more .circle .icon.arrow { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); left: 0.625rem; width: 1.125rem; height: 0.125rem; background: none; } button.learn-more .circle .icon.arrow::before { position: absolute; content: ""; top: -0.29rem; right: 0.0625rem; width: 0.625rem; height: 0.625rem; border-top: 0.125rem solid #fff; border-right: 0.125rem solid #fff; transform: rotate(45deg); } button.learn-more .button-text { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 0.75rem 0; margin: 0 0 0 1.85rem; color: #282936; font-weight: 700; line-height: 1.6; text-align: center; text-transform: uppercase; } button:hover .circle { width: 100%; } button:hover .circle .icon.arrow { background: #fff; transform: translate(1rem, 0); } button:hover .button-text { color: #fff; }
<div class="card"> <div class="content"> <div class="back"> <div class="back-content"> <svg stroke="#ffffff" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" height="50px" width="50px" fill="#ffffff"> <path d="M20.84375 0.03125C20.191406 0.0703125 19.652344 0.425781 19.21875 1.53125C18.988281 2.117188 18.5 3.558594 18.03125 4.9375C17.792969 5.636719 17.570313 6.273438 17.40625 6.75C17.390625 6.796875 17.414063 6.855469 17.40625 6.90625C17.398438 6.925781 17.351563 6.949219 17.34375 6.96875L17.25 7.25C18.566406 7.65625 19.539063 8.058594 19.625 8.09375C22.597656 9.21875 28.351563 11.847656 33.28125 16.78125C38.5 22 41.183594 28.265625 42.09375 30.71875C42.113281 30.761719 42.375 31.535156 42.75 32.84375C42.757813 32.839844 42.777344 32.847656 42.78125 32.84375C43.34375 32.664063 44.953125 32.09375 46.3125 31.625C47.109375 31.351563 47.808594 31.117188 48.15625 31C49.003906 30.714844 49.542969 30.292969 49.8125 29.6875C50.074219 29.109375 50.066406 28.429688 49.75 27.6875C49.605469 27.347656 49.441406 26.917969 49.25 26.4375C47.878906 23.007813 45.007813 15.882813 39.59375 10.46875C33.613281 4.484375 25.792969 1.210938 22.125 0.21875C21.648438 0.0898438 21.234375 0.0078125 20.84375 0.03125 Z M 16.46875 9.09375L0.0625 48.625C-0.09375 48.996094 -0.00390625 49.433594 0.28125 49.71875C0.472656 49.910156 0.738281 50 1 50C1.128906 50 1.253906 49.988281 1.375 49.9375L40.90625 33.59375C40.523438 32.242188 40.222656 31.449219 40.21875 31.4375C39.351563 29.089844 36.816406 23.128906 31.875 18.1875C27.035156 13.34375 21.167969 10.804688 18.875 9.9375C18.84375 9.925781 17.8125 9.5 16.46875 9.09375 Z M 17 16C19.761719 16 22 18.238281 22 21C22 23.761719 19.761719 26 17 26C15.140625 26 13.550781 24.972656 12.6875 23.46875L15.6875 16.1875C16.101563 16.074219 16.550781 16 17 16 Z M 31 22C32.65625 22 34 23.34375 34 25C34 25.917969 33.585938 26.730469 32.9375 27.28125L32.90625 27.28125C33.570313 27.996094 34 28.949219 34 30C34 32.210938 32.210938 34 30 34C27.789063 34 26 32.210938 26 30C26 28.359375 26.996094 26.960938 28.40625 26.34375L28.3125 26.3125C28.117188 25.917969 28 25.472656 28 25C28 23.34375 29.34375 22 31 22 Z M 21 32C23.210938 32 25 33.789063 25 36C25 36.855469 24.710938 37.660156 24.25 38.3125L20.3125 39.9375C18.429688 39.609375 17 37.976563 17 36C17 33.789063 18.789063 32 21 32 Z M 9 34C10.65625 34 12 35.34375 12 37C12 38.65625 10.65625 40 9 40C7.34375 40 6 38.65625 6 37C6 35.34375 7.34375 34 9 34 Z"></path> </svg> </div> </div> </div> </div>
.card { position: relative; width: 190px; height: 254px; background-color: #000; display: flex; flex-direction: column; justify-content: end; padding: 12px; gap: 12px; border-radius: 8px; cursor: pointer; } .card::before { content: ''; position: absolute; inset: 0; left: -5px; margin: auto; width: 200px; height: 264px; border-radius: 10px; background: linear-gradient(-45deg, #e81cff 0%, #40c9ff 100% ); z-index: -10; pointer-events: none; transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .card::after { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(-45deg, #fc00ff 0%, #00dbde 100% ); transform: translate3d(0, 0, 0) scale(0.95); filter: blur(20px); } .heading { font-size: 20px; text-transform: capitalize; font-weight: 700; } .card p:not(.heading) { font-size: 14px; } .card p:last-child { color: #e81cff; font-weight: 600; } .card:hover::after { filter: blur(30px); } .card:hover::before { transform: rotate(-90deg) scaleX(1.34) scaleY(0.77); }
<div class="progress-container"> <div class="progress-bar"></div> </div>
.progress-container { width: 100%; height: 20px; background-color: #f0f0f0; border-radius: 10px; overflow: hidden; position: relative; } .progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #ff8a00, #e52e71); border-radius: 10px; animation: progress 3s ease-in-out infinite; background-size: 200% 100%; animation-direction: alternate; } @keyframes progress { 0% { width: 0%; background-position: 0% 50%; } 100% { width: 100%; background-position: 100% 50%; } }
<button class="border-button"> <span>Hover Me</span> </button>
.border-button { position: relative; padding: 15px 30px; color: #fff; font-size: 18px; font-weight: bold; text-transform: uppercase; background: transparent; border: none; cursor: pointer; overflow: hidden; } .border-button::before, .border-button::after { content: ''; position: absolute; width: 100%; height: 2px; background: #fff; transition: all 0.3s; } .border-button::before { top: 0; left: 0; transform: translateX(-100%); } .border-button::after { bottom: 0; right: 0; transform: translateX(100%); } .border-button:hover::before, .border-button:hover::after { transform: translateX(0); } .border-button span::before, .border-button span::after { content: ''; position: absolute; width: 2px; height: 100%; background: #fff; transition: all 0.3s; } .border-button span::before { top: 0; left: 0; transform: translateY(-100%); } .border-button span::after { bottom: 0; right: 0; transform: translateY(100%); } .border-button:hover span::before, .border-button:hover span::after { transform: translateY(0); }
<div class="typing-effect">Hello, World!</div>
.typing-effect { font-size: 24px; font-family: monospace; white-space: nowrap; overflow: hidden; border-right: 3px solid; width: 0; animation: typing 2s steps(20) forwards, blink 0.5s step-end infinite alternate; } @keyframes typing { from { width: 0 } to { width: 100% } } @keyframes blink { 50% { border-color: transparent } }
<button class="btn-3d">Click Me</button>
.btn-3d { position: relative; padding: 15px 30px; font-size: 18px; color: white; background: #6c5ce7; border: none; border-radius: 5px; cursor: pointer; transform-style: preserve-3d; transition: all 0.3s; box-shadow: 0 10px 0 #5649c0, 0 15px 20px rgba(0,0,0,0.3); } .btn-3d:active { transform: translateY(5px); box-shadow: 0 5px 0 #5649c0, 0 10px 15px rgba(0,0,0,0.3); } .btn-3d::before { content: ''; position: absolute; width: 100%; height: 100%; background: #5649c0; border-radius: 5px; top: 0; left: 0; transform: translateZ(-1px); }