This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="icons">
<i class="fab fa-instagram icon" id="insta" aria-hidden="true"></i>
<i class="fab fa-tiktok icon" id="tiktok" aria-hidden="true"></i>
<i class="fab fa-whatsapp icon" id="num" aria-hidden="true"></i>
</div>
<div class="icons">
<i class="fab fa-instagram icon" id="insta" aria-hidden="true"></i>
<i class="fab fa-tiktok icon" id="tiktok" aria-hidden="true"></i>
<i class="fab fa-whatsapp icon" id="num" aria-hidden="true"></i>
</div>
😁6🔥1
CSS
.icon{
display: inline-block;
animation: animated 5s ease-in-out infinite;
color: #fff;
right: 0;
cursor: pointer;
font-size: 1.3em;
transition: 0.3s;
}
#insta{
animation-delay: 1s;
}
#tiktok{
animation-delay: 2s;
}
@keyframes animated {
0%
{
transform: translateY(0);
}
50%
{
transform: translateY(-15px);
}
100%
{
transform: translateY(0);
}
}
.icon{
display: inline-block;
animation: animated 5s ease-in-out infinite;
color: #fff;
right: 0;
cursor: pointer;
font-size: 1.3em;
transition: 0.3s;
}
#insta{
animation-delay: 1s;
}
#tiktok{
animation-delay: 2s;
}
@keyframes animated {
0%
{
transform: translateY(0);
}
50%
{
transform: translateY(-15px);
}
100%
{
transform: translateY(0);
}
}
👍3😁3
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="container">
<div class="card">
<div class="icon">
<img src="#">
</div>
<div class="icon back">
<i id="i" class="fab fa-tiktok" aria-hidden="true"></i>
<i id="i" class="fab fa-youtube" aria-hidden="true"></i>
<i id="i" class="fab fa-instagram" aria-hidden="true"></i>
</div>
</div>
</div>
<div class="container">
<div class="card">
<div class="icon">
<img src="#">
</div>
<div class="icon back">
<i id="i" class="fab fa-tiktok" aria-hidden="true"></i>
<i id="i" class="fab fa-youtube" aria-hidden="true"></i>
<i id="i" class="fab fa-instagram" aria-hidden="true"></i>
</div>
</div>
</div>
👍3
CSS
.container{
cursor: pointer;
height: 150px;
perspective: 600;
position: relative;
width: 150px;
}
.card{
height: 100%;
position: absolute;
transform-style: preserve-3d;
transition: all 1s ease-in-out;
width: 100%;
}
.card:hover{
transform: rotateY(180deg);
}
.card .icon{
backface-visibility: hidden;
border-radius: 6px;
height: 100%;
position: absolute;
overflow: hidden;
width: 100%;
}
.card .back{
background: #eaeaed;
color: #0087cc;
line-height: 150px;
text-align: center;
transform: rotateY(180deg);
font-size: 1.2em;
margin: 0 15px
}
.container{
cursor: pointer;
height: 150px;
perspective: 600;
position: relative;
width: 150px;
}
.card{
height: 100%;
position: absolute;
transform-style: preserve-3d;
transition: all 1s ease-in-out;
width: 100%;
}
.card:hover{
transform: rotateY(180deg);
}
.card .icon{
backface-visibility: hidden;
border-radius: 6px;
height: 100%;
position: absolute;
overflow: hidden;
width: 100%;
}
.card .back{
background: #eaeaed;
color: #0087cc;
line-height: 150px;
text-align: center;
transform: rotateY(180deg);
font-size: 1.2em;
margin: 0 15px
}
👍5
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="box">
<i class="fab fa-apple logo" aria-hidden="true"></i>
</div>
<script src="https://kit.fontawesome.com/95a02bd20d.js"></script>
CSS
body{
height: 100vh;
background: #000;
display: flex;
justify-content: center;
align-items: center;
}
.logo{
position : relative ;
color : #fff ;
font-size : 5em ;
text-shadow : 0 0 50px #0f0,
0 0 100px #0f0,
0 0 150px #0f0,
0 0 200px #0f0,
0 0 250px #0f0;
animation: animate 5s linear infinite;
}
@keyframes animate
{
0%
{
filter: hue-rotate(0deg);
}
100%
{
filter: hue-rotate(360deg);
}
}
<div class="box">
<i class="fab fa-apple logo" aria-hidden="true"></i>
</div>
<script src="https://kit.fontawesome.com/95a02bd20d.js"></script>
CSS
body{
height: 100vh;
background: #000;
display: flex;
justify-content: center;
align-items: center;
}
.logo{
position : relative ;
color : #fff ;
font-size : 5em ;
text-shadow : 0 0 50px #0f0,
0 0 100px #0f0,
0 0 150px #0f0,
0 0 200px #0f0,
0 0 250px #0f0;
animation: animate 5s linear infinite;
}
@keyframes animate
{
0%
{
filter: hue-rotate(0deg);
}
100%
{
filter: hue-rotate(360deg);
}
}
👍5❤1
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<label>
<input type="checkbox">
<span class="btn"></span>
<i id="icon" class="fa fa-power-off" aria-hidden="true"></i>
</label>
<label>
<input type="checkbox">
<span class="btn"></span>
<i id="icon" class="fa fa-power-off" aria-hidden="true"></i>
</label>
👍4
CSS
body{
display: flex;
}
label{
position: relative;
width: 80px;
height: 80px;
border-radius: 50%;
cursor: pointer;
}
label .btn{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #1b1b1b;
border-radius: 50%;
box-shadow: 0 3px 4px rgba(0, 0, 0, 1),
inset 0 -2px 5px rgba(0, 0, 0, 1),
0 0 0 2px #000,
0 0 0 5px #0c0c0c,
inset 0 2px 2px rgba(255, 255, 255, 0.5),
0 0 0 5.5px #080808;
}
label input[type="checkbox"]:checked ~ .btn{
box-shadow: 0 0 0 rgba(0, 0, 0, 1),
inset 0 1px 1px rgba(255, 255, 255, 0.1),
0 0 0 2px #000,
0 0 0 5px #0c0c0c,
inset 0 -2px 5px rgba(0, 0, 0, 1),
0 0 0 5.5px #00a1ff;
}
label input[type="checkbox"]{
-webkit-appearance : none;
}
label .fa{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 2.5em;
color: #0c0c0c;
}
label input[type="checkbox"]:checked ~ #icon{
color: #00ffe7;
text-shadow: 0 0 15px #00a1ff,
0 0 30px #00a1ff;
}
body{
display: flex;
}
label{
position: relative;
width: 80px;
height: 80px;
border-radius: 50%;
cursor: pointer;
}
label .btn{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #1b1b1b;
border-radius: 50%;
box-shadow: 0 3px 4px rgba(0, 0, 0, 1),
inset 0 -2px 5px rgba(0, 0, 0, 1),
0 0 0 2px #000,
0 0 0 5px #0c0c0c,
inset 0 2px 2px rgba(255, 255, 255, 0.5),
0 0 0 5.5px #080808;
}
label input[type="checkbox"]:checked ~ .btn{
box-shadow: 0 0 0 rgba(0, 0, 0, 1),
inset 0 1px 1px rgba(255, 255, 255, 0.1),
0 0 0 2px #000,
0 0 0 5px #0c0c0c,
inset 0 -2px 5px rgba(0, 0, 0, 1),
0 0 0 5.5px #00a1ff;
}
label input[type="checkbox"]{
-webkit-appearance : none;
}
label .fa{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 2.5em;
color: #0c0c0c;
}
label input[type="checkbox"]:checked ~ #icon{
color: #00ffe7;
text-shadow: 0 0 15px #00a1ff,
0 0 30px #00a1ff;
}
👍1
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<label>
<input type="checkbox">
<span></span>
<i class="indicator"></i>
</label>
<label>
<input type="checkbox" checked>
<span></span>
<i class="indicator"></i>
</label>
<label>
<input type="checkbox">
<span></span>
<i class="indicator"></i>
</label>
<label>
<input type="checkbox" checked>
<span></span>
<i class="indicator"></i>
</label>
👍4
CSS
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
flex-direction: column;
background: #2b2b2b;
}
label{
position: relative;
margin: 5px 0;
cursor: pointer;
}
label input{
appearance: none;
display: none;
}
label span{
position: relative;
display: block;
width: 80px;
height: 40px;
background: #222;
border-radius: 40px;
box-shadow: inset 0 2px 15px rgba(0,0,0,0.2),
inset 0 2px 2px rgba(0,0,0,0.2),
inset 0 -1px 1px rgba(0,0,0,0.2);
}
label .indicator{
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 40px;
background: linear-gradient(to bottom, #444, #222);
border-radius: 50%;
box-shadow: 0 2px 5px rgba(0,0,0,0.5),
inset 0 1px 1px rgba(255,255,255,0.1);
transition: 0.5s;
transform: scale(0.9);
}
label input:checked ~ .indicator{
left: 40px;
}
label .indicator::before{
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 5px;
height: 5px;
background: #f00;
border-radius: 50%;
transition: 0.5s;
box-shadow: 0 0 2px #f00,
0 0 5px #f00,
0 0 10px #f00,
0 0 15px #f00,
0 0 20px #f00,
0 0 25px #f00,
0 0 30px #f00,
0 0 40px #f00;
}
label input:checked ~ .indicator::before{
background: #0f0;
box-shadow: 0 0 2px #0f0,
0 0 5px #0f0,
0 0 10px #0f0,
0 0 15px #0f0,
0 0 20px #0f0,
0 0 25px #0f0,
0 0 30px #0f0,
0 0 40px #0f0;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
flex-direction: column;
background: #2b2b2b;
}
label{
position: relative;
margin: 5px 0;
cursor: pointer;
}
label input{
appearance: none;
display: none;
}
label span{
position: relative;
display: block;
width: 80px;
height: 40px;
background: #222;
border-radius: 40px;
box-shadow: inset 0 2px 15px rgba(0,0,0,0.2),
inset 0 2px 2px rgba(0,0,0,0.2),
inset 0 -1px 1px rgba(0,0,0,0.2);
}
label .indicator{
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 40px;
background: linear-gradient(to bottom, #444, #222);
border-radius: 50%;
box-shadow: 0 2px 5px rgba(0,0,0,0.5),
inset 0 1px 1px rgba(255,255,255,0.1);
transition: 0.5s;
transform: scale(0.9);
}
label input:checked ~ .indicator{
left: 40px;
}
label .indicator::before{
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 5px;
height: 5px;
background: #f00;
border-radius: 50%;
transition: 0.5s;
box-shadow: 0 0 2px #f00,
0 0 5px #f00,
0 0 10px #f00,
0 0 15px #f00,
0 0 20px #f00,
0 0 25px #f00,
0 0 30px #f00,
0 0 40px #f00;
}
label input:checked ~ .indicator::before{
background: #0f0;
box-shadow: 0 0 2px #0f0,
0 0 5px #0f0,
0 0 10px #0f0,
0 0 15px #0f0,
0 0 20px #0f0,
0 0 25px #0f0,
0 0 30px #0f0,
0 0 40px #0f0;
}
👍5
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="icons">
<a href="#">
<div class="layer">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fab fa-instagram"></span>
</div>
</a>
<a href="#">
<div class="layer">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fab fa-youtube"></span>
</div>
</a>
</div>
<div class="icons">
<a href="#">
<div class="layer">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fab fa-instagram"></span>
</div>
</a>
<a href="#">
<div class="layer">
<span></span>
<span></span>
<span></span>
<span></span>
<span class="fab fa-youtube"></span>
</div>
</a>
</div>
👍11❤1😁1
CSS
.icons{
display: inline-flex;
}
.icons a{
margin: 0 14px;
text-decoration: none;
color: #fff;
display: block;
position: relative;
}
.icons a .layer{
width: 55px;
height: 55px;
transition: transform 0.3s;
}
.icons a:hover .layer{
transform: rotate(-35deg) skew(20deg);
}
.icons a .layer span{
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
border: 1px solid #fff;
border-radius: 5px;
transition: all 0.3s;
}
.icons a .layer span.fab{
font-size: 30px;
line-height: 55px;
text-align: center;
}
.icons a:hover .layer span:nth-child(1){
opacity: 0.2;
}
.icons a:hover .layer span:nth-child(2){
opacity: 0.4;
transform: translate(5px, -5px);
}
.icons a:hover .layer span:nth-child(3){
opacity: 0.6;
transform: translate(10px, -10px);
}
.icons a:hover .layer span:nth-child(4){
opacity: 0.8;
transform: translate(15px, -15px);
}
.icons a:hover .layer span:nth-child(5){
opacity: 1;
transform: translate(20px, -20px);
}
.icons a:nth-child(1) .layer span,
.icons a:nth-child(2){
color: #2fa7f1;
border-color: #2fa7f1;
}
.icons a:nth-child(2) .layer span,
.icons a:nth-child(2){
color: #ec467f;
border-color: #ec467f;
}
.icons a:hover:nth-child(1) .layer span{
box-shadow: -1px 1px 3px #1DA1F2;
}
.icons a:hover:nth-child(2) .layer span{
box-shadow: -1px 1px 3px #E1306C;
}
.icons a .text{
position: absolute;
left: 50%;
bottom: -5px;
opacity: 0;
font-weight: 500;
transform: translateX(-50%);
transition: bottom 0.3s ease, opacity 0.3s ease;
}
.icons{
display: inline-flex;
}
.icons a{
margin: 0 14px;
text-decoration: none;
color: #fff;
display: block;
position: relative;
}
.icons a .layer{
width: 55px;
height: 55px;
transition: transform 0.3s;
}
.icons a:hover .layer{
transform: rotate(-35deg) skew(20deg);
}
.icons a .layer span{
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
border: 1px solid #fff;
border-radius: 5px;
transition: all 0.3s;
}
.icons a .layer span.fab{
font-size: 30px;
line-height: 55px;
text-align: center;
}
.icons a:hover .layer span:nth-child(1){
opacity: 0.2;
}
.icons a:hover .layer span:nth-child(2){
opacity: 0.4;
transform: translate(5px, -5px);
}
.icons a:hover .layer span:nth-child(3){
opacity: 0.6;
transform: translate(10px, -10px);
}
.icons a:hover .layer span:nth-child(4){
opacity: 0.8;
transform: translate(15px, -15px);
}
.icons a:hover .layer span:nth-child(5){
opacity: 1;
transform: translate(20px, -20px);
}
.icons a:nth-child(1) .layer span,
.icons a:nth-child(2){
color: #2fa7f1;
border-color: #2fa7f1;
}
.icons a:nth-child(2) .layer span,
.icons a:nth-child(2){
color: #ec467f;
border-color: #ec467f;
}
.icons a:hover:nth-child(1) .layer span{
box-shadow: -1px 1px 3px #1DA1F2;
}
.icons a:hover:nth-child(2) .layer span{
box-shadow: -1px 1px 3px #E1306C;
}
.icons a .text{
position: absolute;
left: 50%;
bottom: -5px;
opacity: 0;
font-weight: 500;
transform: translateX(-50%);
transition: bottom 0.3s ease, opacity 0.3s ease;
}
👍8
CSS
html, body{
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: #333;
}
.box{
background: linear-gradient(to right, rgb(0, 247, 255), #0e1438);
color: white;
--width: 250px;
--height: calc(var(--width) / 3);
width: var(--width);
height: var(--height);
text-align: center;
line-height: var(--height);
font-size: calc(var(--height) / 2.5);
font-family: sans-serif;
letter-spacing: 0.2em;
border: 1px solid darkgoldenrod;
border-radius: 2em;
transform: perspective(500px) rotateY(-15deg);
text-shadow: 6px 3px 2px rgba(0, 0, 0, 0.2);
box-shadow: 2px 0 0 5px rgba(0, 0, 0, 0.3);
transition: 0.5s;
position: relative;
overflow: hidden;
cursor: pointer;
}
.box:hover{
transform: perspective(500px) rotateY(15deg);
text-shadow: -6px 3px 2px rgba(0, 0, 0, 0.2);
box-shadow: -2px 0 0 5px rgba(0, 0, 0, 0.2);
}
.box::before{
content: '';
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(to right, transparent, white, transparent);
left: -100%;
transition: 0.5s;
}
.box:hover::before{
left: 100%;
}
html, body{
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: #333;
}
.box{
background: linear-gradient(to right, rgb(0, 247, 255), #0e1438);
color: white;
--width: 250px;
--height: calc(var(--width) / 3);
width: var(--width);
height: var(--height);
text-align: center;
line-height: var(--height);
font-size: calc(var(--height) / 2.5);
font-family: sans-serif;
letter-spacing: 0.2em;
border: 1px solid darkgoldenrod;
border-radius: 2em;
transform: perspective(500px) rotateY(-15deg);
text-shadow: 6px 3px 2px rgba(0, 0, 0, 0.2);
box-shadow: 2px 0 0 5px rgba(0, 0, 0, 0.3);
transition: 0.5s;
position: relative;
overflow: hidden;
cursor: pointer;
}
.box:hover{
transform: perspective(500px) rotateY(15deg);
text-shadow: -6px 3px 2px rgba(0, 0, 0, 0.2);
box-shadow: -2px 0 0 5px rgba(0, 0, 0, 0.2);
}
.box::before{
content: '';
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(to right, transparent, white, transparent);
left: -100%;
transition: 0.5s;
}
.box:hover::before{
left: 100%;
}
👍4❤1
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="product">
<img class="mattress" src="https://res.cloudinary.com/dboztnq7k/image/upload/v1484647571/mattress_faprcd.png"/>
<div class="copy">
<h4>Lorem Ipsum 6500</h4>
<p>ab 450,00 €</p>
</div>
<a class="cta" href="#">Buy</a>
</div>
<div class="product">
<img class="mattress" src="https://res.cloudinary.com/dboztnq7k/image/upload/v1484647571/mattress_faprcd.png"/>
<div class="copy">
<h4>Lorem Ipsum 6500</h4>
<p>ab 450,00 €</p>
</div>
<a class="cta" href="#">Buy</a>
</div>
👍3
CSS
body {
min-height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #111;
}
.product {
cursor:pointer;
position:relative;
height:275px;
z-index:1;
}
.product:before {
content: ' ';
display:block;
width:440px;
height:180px;
position:absolute;
left:-40px;
top:-20px;
background: linear-gradient(to right, #5f7ad5, #914fff);
z-index:-1;
transition: all 0.5s ease-in-out;
}
.mattress {
margin-top:0;
transition: all 0.5s ease-in-out;
position:relative;
z-index:1;
}
.product:hover .mattress {
margin-top:-16px;
}
.product:after {
content:' ';
display:block;
height:271px;
width:383px;
position:absolute;
top: 3px;
left: 0;
background-size: 100% 100%;
background-repeat: no-repeat;
z-index:0;
opacity:.8;
transition: all 0.5s ease-in-out;
}
.product:hover:after {
top:10px;
left:2%;
background-size: 97% 97%;
opacity:0.35;
}
.product:hover:before {
height:325px;
}
.copy {
position:absolute;
top:230px;
left:0;
font-family: "Nunito", sans-serif;
color:#1f56e1;
letter-spacing: 0.3px;
transition: all 0.5s ease-in-out;
}
.copy p, .copy h4 {
margin:0;
}
.product:hover .copy {
color:#fff;
}
.cta {
opacity:0;
position:absolute;
top:230px;
right:15px;
background-color: #fff;
color: #243F81;
border-radius: 50px;
padding: 12px 48px;
font-family: 'Nunito', sans-serif;
font-size: 16px;
font-weight: 200;
text-decoration: none;
box-shadow: 0 16px 32px 0 rgba(0, 40, 120, .35);
transition: all 0.7s ease;
}
.cta:hover {
box-shadow: 0 0px 0px 0 rgba(0, 40, 120, 0);
background-color: #243F81;
color: #fff;
}
.product:hover .cta {
opacity:1;
}
body {
min-height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #111;
}
.product {
cursor:pointer;
position:relative;
height:275px;
z-index:1;
}
.product:before {
content: ' ';
display:block;
width:440px;
height:180px;
position:absolute;
left:-40px;
top:-20px;
background: linear-gradient(to right, #5f7ad5, #914fff);
z-index:-1;
transition: all 0.5s ease-in-out;
}
.mattress {
margin-top:0;
transition: all 0.5s ease-in-out;
position:relative;
z-index:1;
}
.product:hover .mattress {
margin-top:-16px;
}
.product:after {
content:' ';
display:block;
height:271px;
width:383px;
position:absolute;
top: 3px;
left: 0;
background-size: 100% 100%;
background-repeat: no-repeat;
z-index:0;
opacity:.8;
transition: all 0.5s ease-in-out;
}
.product:hover:after {
top:10px;
left:2%;
background-size: 97% 97%;
opacity:0.35;
}
.product:hover:before {
height:325px;
}
.copy {
position:absolute;
top:230px;
left:0;
font-family: "Nunito", sans-serif;
color:#1f56e1;
letter-spacing: 0.3px;
transition: all 0.5s ease-in-out;
}
.copy p, .copy h4 {
margin:0;
}
.product:hover .copy {
color:#fff;
}
.cta {
opacity:0;
position:absolute;
top:230px;
right:15px;
background-color: #fff;
color: #243F81;
border-radius: 50px;
padding: 12px 48px;
font-family: 'Nunito', sans-serif;
font-size: 16px;
font-weight: 200;
text-decoration: none;
box-shadow: 0 16px 32px 0 rgba(0, 40, 120, .35);
transition: all 0.7s ease;
}
.cta:hover {
box-shadow: 0 0px 0px 0 rgba(0, 40, 120, 0);
background-color: #243F81;
color: #fff;
}
.product:hover .cta {
opacity:1;
}
👍7
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="login">
<h2 class="active">sign in</h2>
<form>
<input type="text" class="text" name="username">
<span>username</span>
<br>
<input type="password" class="text">
<span>password</span>
<br>
<input type="checkbox"/>
<label for="checkbox-1-1">Keep me Signed in</label>
<button class="sign">Sign In</button>
<hr>
<a href="#">Forgot Password?</a>
</form>
</div>
<div class="login">
<h2 class="active">sign in</h2>
<form>
<input type="text" class="text" name="username">
<span>username</span>
<br>
<input type="password" class="text">
<span>password</span>
<br>
<input type="checkbox"/>
<label for="checkbox-1-1">Keep me Signed in</label>
<button class="sign">Sign In</button>
<hr>
<a href="#">Forgot Password?</a>
</form>
</div>
👍11❤1
CSS
.login {
position: relative;
height: 560px;
width: 405px;
margin: auto;
padding: 60px 60px;
background: #222;
box-shadow: 0px 30px 60px -5px #000;
}
form {
padding-top: 60px;
}
.active {
border-bottom: 2px solid #1161ed;
}
h2 {
padding-left: 12px;
font-size: 22px;
text-transform: uppercase;
padding-bottom: 5px;
letter-spacing: 2px;
display: inline-block;
font-weight: 100;
}
h2:first-child {
padding-left: 0px;
}
span {
text-transform: uppercase;
font-size: 12px;
opacity: 0.4;
display: inline-block;
position: relative;
top: -60px;
left: 15px;
transition: all 0.5s ease-in-out;
}
.text {
width: 100%;
height: 40px;
border-radius: 20px;
background: rgba(255, 255, 255, 0.1);
border: 2px solid rgba(255, 255, 255, 0);
margin-top: 15px;
transition: all 0.5s ease-in-out;
}
input {
color: #fff;
padding: 7px;
}
label {
display: inline-block;
padding-top: 10px;
}
.sign {
background-color: #1161ed;
color: #FFF;
width: 100%;
padding: 10px 20px;
display: block;
height: 39px;
border-radius: 20px;
margin-top: 30px;
transition: all 0.5s ease-in-out;
border: none;
text-transform: uppercase;
}
.signin:hover {
background: #4082f5;
box-shadow: 0px 4px 35px -5px #4082f5;
cursor: pointer;
}
hr {
border: 1px solid rgba(255, 255, 255, 0.1);
top: 85px;
position: relative;
}
a {
text-align: center;
display: block;
top: 120px;
position: relative;
text-decoration: none;
color: rgba(255, 255, 255, 0.2);
}
.login {
position: relative;
height: 560px;
width: 405px;
margin: auto;
padding: 60px 60px;
background: #222;
box-shadow: 0px 30px 60px -5px #000;
}
form {
padding-top: 60px;
}
.active {
border-bottom: 2px solid #1161ed;
}
h2 {
padding-left: 12px;
font-size: 22px;
text-transform: uppercase;
padding-bottom: 5px;
letter-spacing: 2px;
display: inline-block;
font-weight: 100;
}
h2:first-child {
padding-left: 0px;
}
span {
text-transform: uppercase;
font-size: 12px;
opacity: 0.4;
display: inline-block;
position: relative;
top: -60px;
left: 15px;
transition: all 0.5s ease-in-out;
}
.text {
width: 100%;
height: 40px;
border-radius: 20px;
background: rgba(255, 255, 255, 0.1);
border: 2px solid rgba(255, 255, 255, 0);
margin-top: 15px;
transition: all 0.5s ease-in-out;
}
input {
color: #fff;
padding: 7px;
}
label {
display: inline-block;
padding-top: 10px;
}
.sign {
background-color: #1161ed;
color: #FFF;
width: 100%;
padding: 10px 20px;
display: block;
height: 39px;
border-radius: 20px;
margin-top: 30px;
transition: all 0.5s ease-in-out;
border: none;
text-transform: uppercase;
}
.signin:hover {
background: #4082f5;
box-shadow: 0px 4px 35px -5px #4082f5;
cursor: pointer;
}
hr {
border: 1px solid rgba(255, 255, 255, 0.1);
top: 85px;
position: relative;
}
a {
text-align: center;
display: block;
top: 120px;
position: relative;
text-decoration: none;
color: rgba(255, 255, 255, 0.2);
}
👍14
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="calculator-grid">
<div class="output">
<div data-previous-operand class="first-operand"></div>
<div data-current-operand class="second-operand"></div>
</div>
<button data-all-clear class="doubled-grid">AC</button>
<button data-delete>DEL</button>
<button data-operation>÷</button>
<button data-number>7</button>
<button data-number>8</button>
<button data-number>9</button>
<button data-operation>*</button>
<button data-number>4</button>
<button data-number>5</button>
<button data-number>6</button>
<button data-operation>+</button>
<button data-number>1</button>
<button data-number>2</button>
<button data-number>3</button>
<button data-operation>-</button>
<button data-number>.</button>
<button data-number>0</button>
<button data-equals class="doubled-grid">=</button>
</div>
<div class="calculator-grid">
<div class="output">
<div data-previous-operand class="first-operand"></div>
<div data-current-operand class="second-operand"></div>
</div>
<button data-all-clear class="doubled-grid">AC</button>
<button data-delete>DEL</button>
<button data-operation>÷</button>
<button data-number>7</button>
<button data-number>8</button>
<button data-number>9</button>
<button data-operation>*</button>
<button data-number>4</button>
<button data-number>5</button>
<button data-number>6</button>
<button data-operation>+</button>
<button data-number>1</button>
<button data-number>2</button>
<button data-number>3</button>
<button data-operation>-</button>
<button data-number>.</button>
<button data-number>0</button>
<button data-equals class="doubled-grid">=</button>
</div>
👍11🕊1
CSS
*{
box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
}
body{
background: linear-gradient(to right,#e302f3, #00aaff);
}
.calculator-grid{
display: grid;
justify-content: center;
align-content: center;
min-height: 100vh;
grid-template-columns: repeat(4, 100px);
grid-template-rows: minmax(120px, auto) repeat(5, 100px);
}
.calculator-grid > button{
cursor: pointer;
font-size: 2rem;
border: 1px solid white;
outline: none;
background-color: rgba(255, 255, 255, 0.75);
}
.calculator-grid > button:hover{
background-color: rgba(255, 255, 255, 0.9);
}
.doubled-grid{
grid-column: span 2;
}
.output{
grid-column: 1 / -1;
background-color: rgba(0, 0, 0, 0.75);
display: flex;
align-items: flex-end;
justify-content: space-around;
flex-direction: column;
padding: 10px;
word-wrap: break-word;
word-break: break-all;
}
.output .first-operand{
color: rgba(255, 255, 255, 0.75);
font-size: 1.5rem;
}
.output .second-operand{
color: white;
font-size: 2.5rem;
}
*{
box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
}
body{
background: linear-gradient(to right,#e302f3, #00aaff);
}
.calculator-grid{
display: grid;
justify-content: center;
align-content: center;
min-height: 100vh;
grid-template-columns: repeat(4, 100px);
grid-template-rows: minmax(120px, auto) repeat(5, 100px);
}
.calculator-grid > button{
cursor: pointer;
font-size: 2rem;
border: 1px solid white;
outline: none;
background-color: rgba(255, 255, 255, 0.75);
}
.calculator-grid > button:hover{
background-color: rgba(255, 255, 255, 0.9);
}
.doubled-grid{
grid-column: span 2;
}
.output{
grid-column: 1 / -1;
background-color: rgba(0, 0, 0, 0.75);
display: flex;
align-items: flex-end;
justify-content: space-around;
flex-direction: column;
padding: 10px;
word-wrap: break-word;
word-break: break-all;
}
.output .first-operand{
color: rgba(255, 255, 255, 0.75);
font-size: 1.5rem;
}
.output .second-operand{
color: white;
font-size: 2.5rem;
}
👍7
JavaScript
class Calculator {
constructor(previousOperandTextElement, currentOperandTextElement) {
this.previousOperandTextElement = previousOperandTextElement;
this.currentOperandTextElement = currentOperandTextElement;
this.clear();
}
clear() {
this.currentOperand = '';
this.previousOperand = '';
this.operation = null;
}
delete() {
this.currentOperand = this.currentOperand.toString().slice(0, -1);
}
appendNumber(number) {
if (number === '.' && this.currentOperand.includes('.')) {
return;
}
this.currentOperand = this.currentOperand.toString() + number.toString();
}
chooseOperation(operation) {
if (this.currentOperand === '') {
return;
}
if (this.previousOperand !== '') {
return this.compute();
}
this.operation = operation;
this.previousOperand = this.currentOperand;
this.currentOperand = '';
}
compute(){
let computation;
const prev = parseFloat(this.previousOperand);
const current = parseFloat(this.currentOperand);
if (isNaN(prev) || isNaN(current)) {
return;
}
switch (this.operation) {
case '+': computation = prev + current;
break;
case '-': computation = prev - current;
break;
case '*': computation = prev * current;
break;
case '÷': computation = prev / current;
break;
default: return;
}
this.currentOperand = computation.toFixed(5);
this.operation = null;
this.previousOperand = '';
}
getDisplayNumber(number) {
const stringNumber = number.toString();
const integerDigits = parseFloat(stringNumber.split('.')[0]);
const decimalDigits = stringNumber.split('.')[1];
let integerDisplay;
if (isNaN(integerDigits)) {
integerDisplay = '';
} else {
integerDisplay = integerDigits.toLocaleString('en', {
maximumFractionDigits: 0
});
}
if (decimalDigits != null) {
return `
} else {
return integerDisplay;
}
}
updateDisplay() {
this.currentOperandTextElement.innerText = this.getDisplayNumber(
this.currentOperand
);
if (this.operation != null) {
this.previousOperandTextElement.innerText = `${this.getDisplayNumber(
this.previousOperand
)} ${this.operation}`;
} else {
this.previousOperandTextElement.innerText = '';
}
}
}
const numberButtons = document.querySelectorAll('[data-number]');
const operationButtons = document.querySelectorAll('[data-operation]');
const equalsButton = document.querySelector('[data-equals]');
const deleteButton = document.querySelector('[data-delete]');
const allClearButton = document.querySelector('[data-all-clear]');
const previousOperandTextElement = document.querySelector(
'[data-previous-operand]'
);
const currentOperandTextElement = document.querySelector(
'[data-current-operand]'
);
const calculator = new Calculator(
previousOperandTextElement,
currentOperandTextElement
);
numberButtons.forEach(button => {
button.addEventListener('click', () => {
calculator.appendNumber(button.innerText);
calculator.updateDisplay();
});
});
operationButtons.forEach(button => {
button.addEventListener('click', () => {
calculator.chooseOperation(button.innerText);
calculator.updateDisplay();
});
});
equalsButton.addEventListener('click', button => {
calculator.compute();
calculator.updateDisplay();
});
allClearButton.addEventListener('click', button => {
calculator.clear();
calculator.updateDisplay();
});
deleteButton.addEventListener('click', button => {
calculator.delete();
calculator.updateDisplay();
});
class Calculator {
constructor(previousOperandTextElement, currentOperandTextElement) {
this.previousOperandTextElement = previousOperandTextElement;
this.currentOperandTextElement = currentOperandTextElement;
this.clear();
}
clear() {
this.currentOperand = '';
this.previousOperand = '';
this.operation = null;
}
delete() {
this.currentOperand = this.currentOperand.toString().slice(0, -1);
}
appendNumber(number) {
if (number === '.' && this.currentOperand.includes('.')) {
return;
}
this.currentOperand = this.currentOperand.toString() + number.toString();
}
chooseOperation(operation) {
if (this.currentOperand === '') {
return;
}
if (this.previousOperand !== '') {
return this.compute();
}
this.operation = operation;
this.previousOperand = this.currentOperand;
this.currentOperand = '';
}
compute(){
let computation;
const prev = parseFloat(this.previousOperand);
const current = parseFloat(this.currentOperand);
if (isNaN(prev) || isNaN(current)) {
return;
}
switch (this.operation) {
case '+': computation = prev + current;
break;
case '-': computation = prev - current;
break;
case '*': computation = prev * current;
break;
case '÷': computation = prev / current;
break;
default: return;
}
this.currentOperand = computation.toFixed(5);
this.operation = null;
this.previousOperand = '';
}
getDisplayNumber(number) {
const stringNumber = number.toString();
const integerDigits = parseFloat(stringNumber.split('.')[0]);
const decimalDigits = stringNumber.split('.')[1];
let integerDisplay;
if (isNaN(integerDigits)) {
integerDisplay = '';
} else {
integerDisplay = integerDigits.toLocaleString('en', {
maximumFractionDigits: 0
});
}
if (decimalDigits != null) {
return `
${integerDisplay}.${decimalDigits}`;} else {
return integerDisplay;
}
}
updateDisplay() {
this.currentOperandTextElement.innerText = this.getDisplayNumber(
this.currentOperand
);
if (this.operation != null) {
this.previousOperandTextElement.innerText = `${this.getDisplayNumber(
this.previousOperand
)} ${this.operation}`;
} else {
this.previousOperandTextElement.innerText = '';
}
}
}
const numberButtons = document.querySelectorAll('[data-number]');
const operationButtons = document.querySelectorAll('[data-operation]');
const equalsButton = document.querySelector('[data-equals]');
const deleteButton = document.querySelector('[data-delete]');
const allClearButton = document.querySelector('[data-all-clear]');
const previousOperandTextElement = document.querySelector(
'[data-previous-operand]'
);
const currentOperandTextElement = document.querySelector(
'[data-current-operand]'
);
const calculator = new Calculator(
previousOperandTextElement,
currentOperandTextElement
);
numberButtons.forEach(button => {
button.addEventListener('click', () => {
calculator.appendNumber(button.innerText);
calculator.updateDisplay();
});
});
operationButtons.forEach(button => {
button.addEventListener('click', () => {
calculator.chooseOperation(button.innerText);
calculator.updateDisplay();
});
});
equalsButton.addEventListener('click', button => {
calculator.compute();
calculator.updateDisplay();
});
allClearButton.addEventListener('click', button => {
calculator.clear();
calculator.updateDisplay();
});
deleteButton.addEventListener('click', button => {
calculator.delete();
calculator.updateDisplay();
});
👍10❤1
This media is not supported in your browser
VIEW IN TELEGRAM
HTML
<div class="clock">
<img src="https://dl.dropbox.com/s/f3b3lyanili7zl2/clock%20template-01.svg?raw=1">
<div class="hour hand" id="hour"></div>
<div class="minute hand" id="minute"></div>
<div class="seconds hand" id="seconds"></div>
</div>
<div class="clock">
<img src="https://dl.dropbox.com/s/f3b3lyanili7zl2/clock%20template-01.svg?raw=1">
<div class="hour hand" id="hour"></div>
<div class="minute hand" id="minute"></div>
<div class="seconds hand" id="seconds"></div>
</div>
👍9❤🔥2