LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Checkbox (multiple choice)

Radio (single choice)

Checkbox Boolean (Specifically Yes or No)


CSS
/* PAGE STYLING */
* {
  padding: 0;
  margin: 0;
}

html, body {
  background-image: linear-gradient(top, #292929, #090909);
  background-image: -webkit-linear-gradient(top, #292929, #090909);
  background-image: -moz-linear-gradient(top, #292929, #090909);
  background-image: -o-linear-gradient(top, #292929, #090909);
}

html {
  color: white;
  font-family: arial;
  font-size: 14px;
  background-color: #191919;
}

#wrap {
  width: 420px;
  margin: auto;
}

h2 {
  font-weight: normal;
  padding: 30px 0 10px;
}

label {
  cursor: pointer;
  display: block;
  margin-bottom: 15px;
}


/* GENERAL INPUT STYLING */
input {
  outline: none;
}

input:not([type="textbox"]) {
  visibility: hidden;
  position: absolute;
}

[data-type], [data-type] * {
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
   user-select: none;
}


/* CHECKBOX */
[data-type="checkbox"] {
  float: left;
  margin-right: 8px;
  margin-top: 4px;
  width: 22px;
  height: 7px;
  border-radius: 2px;
  background: #909090;
  transition: all 0.6s ease;
  -ms-transition: all 0.6s ease;
  -webkit-transition: all 0.6s ease;
  -moz-transition: all 0.6s ease;
  -o-transition: all 0.6s ease;
}

input:checked + label [data-type="checkbox"] {
  background: #FFFFFF;
  box-shadow: 0 0 7px 1px white;
  transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  -webkit-transform: rotate(180deg);
  -moz-transform: rotate(180deg);
  -o-transform: rotate(180deg);
}

label span {
  color: #909090;
  transition: all 0.2s linear;
  -ms-transition: all 0.2s linear;
  -webkit-transition: all 0.2s linear;
  -moz-transition: all 0.2s linear;
  -o-transition: all 0.2s linear;
}
input:checked + label span, label:hover span {
  color: #FFFFFF;
}

/* ARROW RADIO */
[data-type="pointer"] {
  float: left;
  width: 20px;
  margin-top: 2px;
  position: relative;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 10px solid #909090;
  transition: all 0.2s linear;
  -ms-transition: all 0.2s linear;
  -webkit-transition: all 0.2s linear;
  -moz-transition: all 0.2s linear;
  -o-transition: all 0.2s linear;
}

input:checked + label [data-type="pointer"] {
  left: 6px;
  border-left-color: white;
}

label [data-type="pointer"] + span {
  position: relative;
  left: 6px;
}
input:checked + label [data-type="pointer"] + span {
  left: 0;
}


/* CHECKBOX BOOLEAN (true/false) */
[data-type="checkbool"] {
  position: relative;
  top: 5px;
  margin-left: 10px;
  color: black !important;
  display: inline-block;
  overflow: hidden;
  width: 40px;
  border-radius: 22px;
  transition: all 0.4s ease;
  -ms-transition: all 0.4s ease;
  -webkit-transition: all 0.4s ease;
  -moz-transition: all 0.4s ease;
  -o-transition: all 0.4s ease;
}

[data-type="checkbool"] > div {
  position: relative;
  width: 120px;
  cursor: pointer;
  font-size: 14px;
  transition: left 0.3s ease;
  -ms-transition: left 0.3s ease;
  -webkit-transition: left 0.4s ease;
  -moz-transition: left 0.3s ease;
  -o-transition: left 0.3s ease;
}

[data-type="checkbool"] > div > div {
  float: left;
  text-align: center;
  padding: 3px 0;
  width: 40px;
}

[data-type="checkbool"] .yes {
  background: #E8E8E8;
}
[data-type="checkbool"] .no {
  background: #909090;
}

input + label [data-type="checkbool"] > div {
  left: -40px;
}
input + label [data-type="checkbool"] {
}

input:checked + label [data-type="checkbool"] > div {
  left: 0;
}
input:checked + label [data-type="checkbool"] {
  box-shadow: 0 0 8px 0 white;
}


/* TEXTBOX */
input[type="textbox"] {
  color: white;
  font-style: italic;
  border: 0;
  width: 200px;
  padding: 3px;
  border-radius: 4px;
  border-bottom: 1px solid gray;
  background: transparent;
  transition: all 0.4s ease;
  -ms-transition: all 0.4s ease;
  -webkit-transition: all 0.4s ease;
  -moz-transition: all 0.4s ease;
  -o-transition: all 0.4s ease;
}
input[type="textbox"]:focus {  
  border-bottom-color: white;
}

Description

Some custom made input styles/animations with CSS.
Term
Wed, 12/06/2017 - 19:43

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv