css实现13款不同的checkbox开关美化效果代码
代码语言:html
所属分类:表单美化
代码描述:css实现13款不同的checkbox开关美化效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css"> <style> body { background: #fff; margin: 0 } .header { margin-top: 60px; margin-bottom: 10px; flex-direction: "row"; display: flex; align-items: flex-end; justify-content: center; font-size: 80px } .header .text,.header .toggle { font-family: Open Sans; font-weight: lighter } .header .toggle { border-radius: .7em; background: linear-gradient(45deg,#008f68,#fae042); width: 1.9em; height: .8em; display: flex; flex-direction: row; margin-bottom: .2em } .header .toggle .circle { position: relative; left: .1em; top: .1em; width: .6em; height: .6em; border-radius: 1em; overflow: hidden; background: #fff; color: #fff } .header .toggle .re { color: #fff; line-height: .6; margin-left: .15em } .links { color: #aaa; margin: 1em auto; text-align: center } .links a { color: #888 } .links a:hover { color: #008f68 } .root { margin: 4em auto; width: 65%; padding: 0 1em; border-radius: 1em; background: #f5f5f5; box-shadow: 0 20px 68px rgba(0,0,0,.55); font-size: 13px } @media screen and (max-width: 2300px) { .root { width:65% } } @media screen and (max-width: 1700px) { .root { width:85% } } @media screen and (max-width: 800px) { .root { width:100% } } .row-wrapper { width: 100%; border-bottom: 2px solid #ddd } .row-wrapper:last-child { border-bottom: 0 } .row-wrapper .row { flex: 1 1 100%; height: 15rem; overflow: hidden } .row-wrapper .row,.row-wrapper .row .col { display: flex; align-items: center; justify-content: space-evenly } .row-wrapper .row .col { flex-direction: column; height: 100% } .row-wrapper .row .col .info-class { font-family: Lucida Console,Monaco,monospace; letter-spacing: .5px; text-align: center; line-height: 1.5; background: #ddd; padding: 5px; border-radius: 5px } .row-wrapper .name { font: 500 14px Rubik,sans-serif; letter-spacing: .5px; text-transform: uppercase; text-shadow: 0 1px 1px rgba(0,0,0,.4); text-align: right; padding: 0 10px 10px } charset "UTF-8";.mt-android,.mt-android-indigo,.mt-android-orange,.mt-android-pink,.mt-android-violet { display: inline-block; box-sizing: border-box } .mt-android-indigo label,.mt-android-orange label,.mt-android-pink label,.mt-android-violet label,.mt-android label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 4em; height: 1.75em; border-radius: .875em; background-image: linear-gradient(90deg,#848484 0,#848484 50%,#7cbcbf 0,#7cbcbf); background-size: 8em 1.7em; transition: all .3s ease } .mt-android-indigo label:before,.mt-android-orange label:before,.mt-android-pink label:before,.mt-android-violet label:before,.mt-android label:before { content: ""; display: block; position: absolute; width: 2.25em; height: 2.25em; top: -.25em; left: 0; border-radius: 2em; background: #fff; transition: .3s ease; box-shadow: 0 .125em .375em rgba(0,0,0,.5) } .mt-android-indigo input,.mt-android-orange input,.mt-android-pink input,.mt-android-violet input,.mt-android input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-android-indigo input:focus,.mt-android-orange input:focus,.mt-android-pink input:focus,.mt-android-violet input:focus,.mt-android input:focus { outline: 0 } .mt-android-indigo input:checked+label,.mt-android-orange input:checked+label,.mt-android-pink input:checked+label,.mt-android-violet input:checked+label,.mt-android input:checked+label { background-position: -100% } .mt-android-indigo input:checked+label:before,.mt-android-orange input:checked+label:before,.mt-android-pink input:checked+label:before,.mt-android-violet input:checked+label:before,.mt-android input:checked+label:before { transform: translateX(1.75em) } .mt-android-indigo input:disabled+label,.mt-android-orange input:disabled+label,.mt-android-pink input:disabled+label,.mt-android-violet input:disabled+label,.mt-android input:disabled+label { background: #ccc!important; cursor: not-allowed!important } .mt-android-indigo input:disabled+label:before,.mt-android-orange input:disabled+label:before,.mt-android-pink input:disabled+label:before,.mt-android-violet input:disabled+label:before,.mt-android input:disabled+label:before { background: #ccc!important; box-shadow: 0 .125em .375em rgba(0,0,0,.5)!important } .mt-android-indigo label { background-image: linear-gradient(90deg,#848484 0,#848484 50%,#9fa8da 0,#9fa8da) } .mt-android-violet label { background-image: linear-gradient(90deg,#848484 0,#848484 50%,#ce93d8 0,#ce93d8) } .mt-android-pink label { background-image: linear-gradient(90deg,#848484 0,#848484 50%,#f48fb1 0,#f48fb1) } .mt-android-orange label { background-image: linear-gradient(90deg,#848484 0,#848484 50%,#ffcc80 0,#ffcc80) } .mt-check,.mt-check-fruit,.mt-check-garden,.mt-check-matte,.mt-check-pink { display: inline-block; box-sizing: border-box } .mt-check-fruit label,.mt-check-garden label,.mt-check-matte label,.mt-check-pink label,.mt-check label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 7em; height: 3em; border-radius: 1.5em; background: #2e394d; border: 0; transition: all .3s ease } .mt-check-fruit label:before,.mt-check-garden label:before,.mt-check-matte label:before,.mt-check-pink label:before,.mt-check label:before { content: ""; display: block; position: absolute; width: 2.4em; height: 2.4em; top: .3em; left: .3em; border-radius: 2.5em; background: #f0134d; transition: .3s ease } .mt-check-fruit input,.mt-check-garden input,.mt-check-matte input,.mt-check-pink input,.mt-check input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-check-fruit input:focus,.mt-check-garden input:focus,.mt-check-matte input:focus,.mt-check-pink input:focus,.mt-check input:focus { outline: 0 } .mt-check-fruit input:after,.mt-check-fruit input:before,.mt-check-garden input:after,.mt-check-garden input:before,.mt-check-matte input:after,.mt-check-matte input:before,.mt-check-pink input:after,.mt-check-pink input:before,.mt-check input:after,.mt-check input:before { content: ""; display: block; position: absolute; height: .25em; border-radius: .125em; background: #fff; transition: .3s ease } .mt-check-fruit input:before,.mt-check-garden input:before,.mt-check-matte input:before,.mt-check-pink input:before,.mt-check input:before { width: 1.6875em; transform: rotate(-45deg) translate(-.525em,1.425em) } .mt-check-fruit input:after,.mt-check-garden input:after,.mt-check-matte input:after,.mt-check-pink input:after,.mt-check input:after { width: 1.6875em; transform: rotate(45deg) translate(1.425em,.525em) } .mt-check-fruit input:checked:before,.mt-check-garden input:checked:before,.mt-check-matte input:checked:before,.mt-check-pink input:checked:before,.mt-check input:checked:before { width: 1.5625em; transform: rotate(-45deg) translate(2.5375em,4.55em) } .mt-check-fruit input:checked:after,.mt-check-garden input:checked:after,.mt-check-matte input:checked:after,.mt-check-pink input:checked:after,.mt-check input:checked:after { width: .73em; transform: rotate(45deg) translate(4.55em,-2.1625em) } .mt-check-fruit input:checked+label:before,.mt-check-garden input:checked+label:before,.mt-check-matte input:checked+label:before,.mt-check-pink input:checked+label:before,.mt-check input:checked+label:before { background: #40bfc1; transform: translateX(4em) } .mt-check-fruit input:disabled:after,.mt-check-fruit input:disabled:before,.mt-check-garden input:disabled:after,.mt-check-garden input:disabled:before,.mt-check-matte input:disabled:after,.mt-check-matte input:disabled:before,.mt-check-pink input:disabled:after,.mt-check-pink input:disabled:before,.mt-check input:disabled:after,.mt-check input:disabled:before { cursor: not-allowed!important } .mt-check-fruit input:disabled+label,.mt-check-garden input:disabled+label,.mt-check-matte input:disabled+label,.mt-check-pink input:disabled+label,.mt-check input:disabled+label { background: #ccc!important; cursor: not-allowed!important } .mt-check-fruit input:disabled+label:before,.mt-check-garden input:disabled+label:before,.mt-check-matte input:disabled+label:before,.mt-check-pink input:disabled+label:before,.mt-check input:disabled+label:before { background: #ddd!important } .mt-check-garden label:before { background: #ff2e63 } .mt-check-garden input:checked+label:before { background: #21bf73 } .mt-check-pink label:before { background: #ffe3ed } .mt-check-pink input:after,.mt-check-pink input:before { background: #2e394d } .mt-check-pink input:checked+label:before { background: #beebe9 } .mt-check-matte label:before { background: #c9485b } .mt-check-matte input:checked+label:before { background: #75b79e } .mt-check-fruit label:before { background: #ff8364 } .mt-check-fruit input:checked+label:before { background: #5f6caf } .mt-emoji,.mt-emoji-gender,.mt-emoji-like,.mt-emoji-mood,.mt-emoji-mute,.mt-emoji-pet { display: inline-block; box-sizing: border-box } .mt-emoji-gender label,.mt-emoji-like label,.mt-emoji-mood label,.mt-emoji-mute label,.mt-emoji-pet label,.mt-emoji label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 7em; height: .8em; border-radius: 1em; background: #fff; border: .2em solid #888; transition: all .3s ease } .mt-emoji-gender label:before,.mt-emoji-like label:before,.mt-emoji-mood label:before,.mt-emoji-mute label:before,.mt-emoji-pet label:before,.mt-emoji label:before { content: ""; display: block; position: absolute; font-size: 3em; transition: .3s ease; left: 0; top: -.6em } .mt-emoji-gender input,.mt-emoji-like input,.mt-emoji-mood input,.mt-emoji-mute input,.mt-emoji-pet input,.mt-emoji input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-emoji-gender input:focus,.mt-emoji-like input:focus,.mt-emoji-mood input:focus,.mt-emoji-mute input:focus,.mt-emoji-pet input:focus,.mt-emoji input:focus { outline: 0 } .mt-emoji-gender input:checked+label:before,.mt-emoji-like input:checked+label:before,.mt-emoji-mood input:checked+label:before,.mt-emoji-mute input:checked+label:before,.mt-emoji-pet input:checked+label:before,.mt-emoji input:checked+label:before { transform: translateX(.8em) } .mt-emoji-gender input:disabled+label,.mt-emoji-like input:disabled+label,.mt-emoji-mood input:disabled+label,.mt-emoji-mute input:disabled+label,.mt-emoji-pet input:disabled+label,.mt-emoji input:disabled+label { cursor: not-allowed!important } .mt-emoji-mood label:before { content: "😄" } .mt-emoji-mood input:checked+label:before { content: "😠" } .mt-emoji-gender label:before { content: "👨" } .mt-emoji-gender input:checked+label:before { content: "👩" } .mt-emoji-pet label:before { content: "🐶" } .mt-emoji-pet input:checked+label:before { content: "🐱" } .mt-emoji-mute label:before { content: "🔇" } .mt-emoji-mute input:checked+label:before { content: "🔊" } .mt-emoji-like label:before { content: "👍" } .mt-emoji-like input:checked+label:before { content: "👎" } .mt-star,.mt-star-garden,.mt-star-golden,.mt-star-pink,.mt-star-tomato { display: inline-block; box-sizing: border-box } .mt-star-garden label,.mt-star-golden label,.mt-star-pink label,.mt-star-tomato label,.mt-star label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 5em; height: 5em; transition: all .3s ease; overflow: hidden; clip-path: polygon(88.42% 39.625%,62.765% 36.275%,51.645% 12.85%,51.58018% 12.7258%,48.355% 12.85%,37.235% 36.275%,11.58% 39.625%,10.40617% 40.27148%,10.565% 42.7%,29.365% 60.54%,24.62% 86.05%,25.83849% 88.08153%,27.285% 87.945%,50% 75.545%,72.715% 87.94%,75.40571% 86.24281%,75.38% 86.045%,70.635% 60.53%,89.435% 42.69%,88.42% 39.625%,67.405% 58.615%,66.89479% 59.48382%,66.88% 60.235%); -webkit-clip-path: polygon(88.42% 39.625%,62.765% 36.275%,51.645% 12.85%,51.58018% 12.7258%,48.355% 12.85%,37.235% 36.275%,11.58% 39.625%,10.40617% 40.27148%,10.565% 42.7%,29.365% 60.54%,24.62% 86.05%,25.83849% 88.08153%,27.285% 87.945%,50% 75.545%,72.715% 87.94%,75.40571% 86.24281%,75.38% 86.045%,70.635% 60.53%,89.435% 42.69%,88.42% 39.625%,67.405% 58.615%,66.89479% 59.48382%,66.88% 60.235%) } .mt-star-garden label:before,.mt-star-golden label:before,.mt-star-pink label:before,.mt-star-tomato label:before,.mt-star label:before { content: ""; display: block; position: absolute; width: 5em; height: 10em; background: linear-gradient(#cac9d1,#cac9d1 42%,#91e0f8 55%,#1b68cb); transition: .2s ease } .mt-star-garden input,.mt-star-golden input,.mt-star-pink input,.mt-star-tomato input,.mt-star input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-star-garden input:focus,.mt-star-golden input:focus,.mt-star-pink input:focus,.mt-star-tomato input:focus,.mt-star input:focus { outline: 0 } .mt-star-garden input:after,.mt-star-garden input:before,.mt-star-golden input:after,.mt-star-golden input:before,.mt-star-pink input:after,.mt-star-pink input:before,.mt-star-tomato input:after,.mt-star-tomato input:before,.mt-star input:after,.mt-star input:before { content: ""; display: block; position: absolute } .mt-star-garden input:checked+label:before,.mt-star-golden input:checked+label:before,.mt-star-pink input:checked+label:before,.mt-star-tomato input:checked+label:before,.mt-star input:checked+label:before { transform: translateY(-50%) } .mt-star-garden input:disabled+label,.mt-star-golden input:disabled+label,.mt-star-pink input:disabled+label,.mt-star-tomato input:disabled+label,.mt-star input:disabled+label { cursor: not-allowed!important } .mt-star-garden label:before { background: linear-gradient(#cac9d1,#cac9d1 42%,#7fee7f 55%,#21bf73) } .mt-star-tomato label:before { background: linear-gradient(#cac9d1,#cac9d1 42%,#f1a27d 55%,tomato) } .mt-star-pink label:before { background: linear-gradient(#cac9d1,#cac9d1 42%,#ffc1d7 55%,#ff77a6) } .mt-star-golden label:before { background: linear-gradient(#cac9d1,#cac9d1 42%,#ffed88 55%,#f3cf01) } .mt-heart,.mt-heart-blush,.mt-heart-golden,.mt-heart-indigo,.mt-heart-pink { display: inline-block; box-sizing: border-box } .mt-heart-blush label,.mt-heart-golden label,.mt-heart-indigo label,.mt-heart-pink label,.mt-heart label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 5em; height: 5em; transition: all .3s ease; overflow: hidden; clip-path: polygon(48.595% 85.365%,15.785% 52.815%,15.58945% 52.6185%,12.68962% 48.99466%,12.305% 48.375%,10.57963% 44.86051%,9.35896% 40.38282%,9.08571% 35.74977%,9.76901% 31.15918%,11.37828% 26.80595%,13.84412% 22.87395%,15.775% 20.7%,17.05533% 19.52258%,20.87248% 16.88208%,25.14556% 15.07038%,29.69731% 14.16234%,31.94% 14.055%,34.33933% 14.174%,38.88594% 15.10612%,43.14179% 16.95734%,46.93771% 19.62896%,50% 22.815%,50.13928% 22.64012%,53.40377% 19.34025%,57.24963% 16.74118%,61.54157% 14.97537%,66.10584% 14.13355%,68.06% 14.055%,70.74723% 14.20914%,75.28062% 15.20472%,79.51742% 17.09965%,83.2818% 19.81486%,84.225% 20.7%,86.42617% 23.22899%,88.81355% 27.2091%,90.33651% 31.59327%,90.92925% 36.19641%,90.56441% 40.82313%,89.25522% 45.27574%,87.69% 48.385%,87.0678% 49.36971%,84.215% 52.82%,51.405% 85.37%,51.05969% 85.64527%,48.595% 85.365%,31.94% 18.05%); -webkit-clip-path: polygon(48.595% 85.365%,15.785% 52.815%,15.58945% 52.6185%,12.68962% 48.99466%,12.305% 48.375%,10.57963% 44.86051%,9.35896% 40.38282%,9.08571% 35.74977%,9.76901% 31.15918%,11.37828% 26.80595%,13.84412% 22.87395%,15.775% 20.7%,17.05533% 19.52258%,20.87248% 16.88208%,25.14556% 15.07038%,29.69731% 14.16234%,31.94% 14.055%,34.33933% 14.174%,38.88594% 15.10612%,43.14179% 16.95734%,46.93771% 19.62896%,50% 22.815%,50.13928% 22.64012%,53.40377% 19.34025%,57.24963% 16.74118%,61.54157% 14.97537%,66.10584% 14.13355%,68.06% 14.055%,70.74723% 14.20914%,75.28062% 15.20472%,79.51742% 17.09965%,83.2818% 19.81486%,84.225% 20.7%,86.42617% 23.22899%,88.81355% 27.2091%,90.33651% 31.59327%,90.92925% 36.19641%,90.56441% 40.82313%,89.25522% 45.27574%,87.69% 48.385%,87.0678% 49.36971%,84.215% 52.82%,51.405% 85.37%,51.05969% 85.64527%,48.595% 85.365%,31.94% 18.05%) } .mt-heart-blush label:before,.mt-heart-golden label:before,.mt-heart-indigo label:before,.mt-heart-pink label:before,.mt-heart label:before { content: ""; display: block; position: absolute; width: 5em; height: 10em; background: linear-gradient(200deg,#cac9d1,#cac9d1 42%,#ff7ea1 55%,#f00846); transition: .2s ease } .mt-heart-blush input,.mt-heart-golden input,.mt-heart-indigo input,.mt-heart-pink input,.mt-heart input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-heart-blush input:focus,.mt-heart-golden input:focus,.mt-heart-indigo input:focus,.mt-heart-pink input:focus,.mt-heart input:focus { outline: 0 } .mt-heart-blush input:after,.mt-heart-blush input:before,.mt-heart-golden input:after,.mt-heart-golden input:before,.mt-heart-indigo input:after,.mt-heart-indigo input:before,.mt-heart-pink input:after,.mt-heart-pink input:before,.mt-heart input:after,.mt-heart input:before { content: ""; display: block; position: absolute } .mt-heart-blush input:checked+label:before,.mt-heart-golden input:checked+label:before,.mt-heart-indigo input:checked+label:before,.mt-heart-pink input:checked+label:before,.mt-heart input:checked+label:before { transform: translateY(-50%) } .mt-heart-blush input:disabled+label,.mt-heart-golden input:disabled+label,.mt-heart-indigo input:disabled+label,.mt-heart-pink input:disabled+label,.mt-heart input:disabled+label { cursor: not-allowed!important } .mt-heart-blush label:before { background: linear-gradient(200deg,#cac9d1,#cac9d1 42%,#ffaab7 55%,#ff435f) } .mt-heart-indigo label:before { background: linear-gradient(200deg,#cac9d1,#cac9d1 42%,#a4a9ff 55%,#4b54ff) } .mt-heart-pink label:before { background: linear-gradient(200deg,#cac9d1,#cac9d1 42%,#ffc1d7 55%,#ff77a6) } .mt-heart-golden label:before { background: linear-gradient(200deg,#cac9d1,#cac9d1 42%,#ffe679 55%,#f3cf01) } .mt-ios,.mt-ios-blue,.mt-ios-red { display: inline-block; box-sizing: border-box } .mt-ios-blue label,.mt-ios-red label,.mt-ios label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 5em; height: 3em; border-radius: 1.5em; background: #f8f8f8; box-shadow: inset 0 0 0 0 #13bf11,0 0 0 .1875em #ddd; transition: .25s ease-in-out } .mt-ios-blue label:before,.mt-ios-red label:before,.mt-ios label:before { content: ""; display: block; position: absolute; width: 3em; height: 3em; border-radius: 1.5em; background: #fff; box-shadow: 0 .375em .375em rgba(0,0,0,.2),0 0 0 .1875em #ddd; transition: .25s ease-in-out } .mt-ios-blue input,.mt-ios-red input,.mt-ios input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-ios-blue input:focus,.mt-ios-red input:focus,.mt-ios input:focus { outline: 0 } .mt-ios-blue input:checked+label,.mt-ios-red input:checked+label,.mt-ios input:checked+label { box-shadow: inset 0 0 0 1.5em #13bf11,0 0 0 .1875em #13bf11 } .mt-ios-blue input:checked+label:before,.mt-ios-red input:checked+label:before,.mt-ios input:checked+label:before { transform: translateX(2em); box-shadow: 0 0 0 .1875em transparent,0 .375em .375em rgba(0,0,0,.3) } .mt-ios-blue input:disabled+label,.mt-ios-red input:disabled+label,.mt-ios input:disabled+label { background: #ddd!important; box-shadow: inset 0 0 0 0 #13bf11,0 0 0 .1875em #ccc!important; cursor: not-allowed!important } .mt-ios-blue input:disabled+label:before,.mt-ios-red input:disabled+label:before,.mt-ios input:disabled+label:before { background: #eee!important; box-shadow: none!important } .mt-ios-red label { box-shadow: inset 0 0 0 0 #f35f42,0 0 0 .1875em #ddd } .mt-ios-red input:checked+label { box-shadow: inset 0 0 0 1.5em #f35f42,0 0 0 .1875em #f35f42 } .mt-ios-blue label { box-shadow: inset 0 0 0 0 #1fc1c8,0 0 0 .1875em #ddd } .mt-ios-blue input:checked+label { box-shadow: inset 0 0 0 1.5em #1fc1c8,0 0 0 .1875em #1fc1c8 } .mt-normal,.mt-normal-garden,.mt-normal-juice,.mt-normal-navi,.mt-normal-violet { display: inline-block; box-sizing: border-box; width: 7em; height: 3em } .mt-normal-garden label,.mt-normal-juice label,.mt-normal-navi label,.mt-normal-violet label,.mt-normal label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 100%; height: 100%; border-radius: 1.5em; background: #f0134d; border: .5px solid hsla(0,0%,45.9%,.31); box-shadow: inset 0 0 .25em 0 rgba(0,0,0,.2),0 -.1875em .25em rgba(0,0,0,.15); transition: all .3s ease; transform-origin: 20% center } .mt-normal-garden label:before,.mt-normal-juice label:before,.mt-normal-navi label:before,.mt-normal-violet label:before,.mt-normal label:before { content: ""; display: block; position: absolute; top: .25em; left: .25em; width: 2.5em; height: 2.5em; border: 0; border-radius: 2em; transition: .3s ease; box-shadow: inset .5px -1px 1px rgba(0,0,0,.35); background: #fff } .mt-normal-garden label:after,.mt-normal-juice label:after,.mt-normal-navi label:after,.mt-normal-violet label:after,.mt-normal label:after { content: ""; display: block; position: absolute; top: -.3125em; left: -.25em; width: calc(100%+.5em); height: calc(100%+.5em); background: transparent; border-radius: 30px; box-shadow: inset 0 .125em .25em -.125em rgba(0,0,0,.2),0 1px .125em 0 hsla(0,0%,59.2%,.2) } .mt-normal-garden input,.mt-normal-juice input,.mt-normal-navi input,.mt-normal-violet input,.mt-normal input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-normal-garden input:focus,.mt-normal-juice input:focus,.mt-normal-navi input:focus,.mt-normal-violet input:focus,.mt-normal input:focus { outline: 0 } .mt-normal-garden input:checked+label,.mt-normal-juice input:checked+label,.mt-normal-navi input:checked+label,.mt-normal-violet input:checked+label,.mt-normal input:checked+label { background: #40bfc1 } .mt-normal-garden input:checked+label:before,.mt-normal-juice input:checked+label:before,.mt-normal-navi input:checked+label:before,.mt-normal-violet input:checked+label:before,.mt-normal input:checked+label:before { left: 4.2em } .mt-normal-garden input:disabled+label,.mt-normal-juice input:disabled+label,.mt-normal-navi input:disabled+label,.mt-normal-violet input:disabled+label,.mt-normal input:disabled+label { background: #ccc!important; border: none!important; cursor: not-allowed!important } .mt-normal-garden input:disabled+label:before,.mt-normal-juice input:disabled+label:before,.mt-normal-navi input:disabled+label:before,.mt-normal-violet input:disabled+label:before,.mt-normal input:disabled+label:before { background: #ddd!important; box-shadow: none!important } .mt-normal-garden input:disabled+label:after,.mt-normal-juice input:disabled+label:after,.mt-normal-navi input:disabled+label:after,.mt-normal-violet input:disabled+label:after,.mt-normal input:disabled+label:after { box-shadow: none!important } .mt-normal-garden label { background: #ff2e63 } .mt-normal-garden input:checked+label { background: #21bf73 } .mt-normal-navi label { background: #f5f0e3 } .mt-normal-navi input:checked+label { background: #5f6caf } .mt-normal-violet label { background: #f0e3ff } .mt-normal-violet input:checked+label { background: #3e206d } .mt-normal-juice label { background: #f9f6f7 } .mt-normal-juice input:checked+label { background: #ff971d } .mt-square,.mt-square-garden,.mt-square-matcha,.mt-square-pink,.mt-square-tomato { display: inline-block; box-sizing: border-box } .mt-square-garden label,.mt-square-matcha label,.mt-square-pink label,.mt-square-tomato label,.mt-square label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 8em; height: 3em; background: #fff; transition: all .3s ease } .mt-square-garden label:before,.mt-square-matcha label:before,.mt-square-pink label:before,.mt-square-tomato label:before,.mt-square label:before { content: ""; display: block; position: absolute; width: 4em; height: 3em; background: #f0134d; transition: .3s ease; z-index: 1 } .mt-square-garden input,.mt-square-matcha input,.mt-square-pink input,.mt-square-tomato input,.mt-square input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-square-garden input:focus,.mt-square-matcha input:focus,.mt-square-pink input:focus,.mt-square-tomato input:focus,.mt-square input:focus { outline: 0 } .mt-square-garden input:after,.mt-square-garden input:before,.mt-square-matcha input:after,.mt-square-matcha input:before,.mt-square-pink input:after,.mt-square-pink input:before,.mt-square-tomato input:after,.mt-square-tomato input:before,.mt-square input:after,.mt-square input:before { content: ""; display: block; position: absolute; width: 4em; height: 3em; z-index: 0; display: flex; justify-content: center; align-items: center; color: #888; letter-spacing: 1px } .mt-square-garden input:before,.mt-square-matcha input:before,.mt-square-pink input:before,.mt-square-tomato input:before,.mt-square input:before { content: "ON" } .mt-square-garden input:after,.mt-square-matcha input:after,.mt-square-pink input:after,.mt-square-tomato input:after,.mt-square input:after { content: "OFF"; left: 4em } .mt-square-garden input:checked+label:before,.mt-square-matcha input:checked+label:before,.mt-square-pink input:checked+label:before,.mt-square-tomato input:checked+label:before,.mt-square input:checked+label:before { background: #40bfc1; transform: translateX(4em) } .mt-square-garden input:disabled:after,.mt-square-garden input:disabled:before,.mt-square-matcha input:disabled:after,.mt-square-matcha input:disabled:before,.mt-square-pink input:disabled:after,.mt-square-pink input:disabled:before,.mt-square-tomato input:disabled:after,.mt-square-tomato input:disabled:before,.mt-square input:disabled:after,.mt-square input:disabled:before { cursor: not-allowed!important } .mt-square-garden input:disabled+label,.mt-square-matcha input:disabled+label,.mt-square-pink input:disabled+label,.mt-square-tomato input:disabled+label,.mt-square input:disabled+label { background: #ccc!important; cursor: not-allowed!important } .mt-square-garden input:disabled+label:before,.mt-square-matcha input:disabled+label:before,.mt-square-pink input:disabled+label:before,.mt-square-tomato input:disabled+label:before,.mt-square input:disabled+label:before { background: #ddd!important } .mt-square-garden label:before { background: #ff2e63 } .mt-square-garden input:checked+label:before { background: #21bf73 } .mt-square-tomato label:before { background: tomato } .mt-square-tomato input:checked+label:before { background: #32cd32 } .mt-square-matcha label:before { background: #5b5656 } .mt-square-matcha input:checked+label:before { background: #7fcd91 } .mt-square-pink label:before { background: #ffe3ed } .mt-square-pink input:checked+label:before { background: #beebe9 } .mt-square3d,.mt-square3d-blush,.mt-square3d-garden,.mt-square3d-matcha,.mt-square3d-tomato { display: inline-block; box-sizing: border-box } .mt-square3d-blush label,.mt-square3d-garden label,.mt-square3d-matcha label,.mt-square3d-tomato label,.mt-square3d label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 7em; height: 2em; background: #fff; box-shadow: inset 0 .1em .03em rgba(0,0,0,.2),inset 0 .1em .3em rgba(0,0,0,.3),0 0 2em hsla(0,0%,100%,.6); transition: all .3s ease } .mt-square3d-blush label:before,.mt-square3d-garden label:before,.mt-square3d-matcha label:before,.mt-square3d-tomato label:before,.mt-square3d label:before { content: ""; display: block; position: absolute; width: 3.6em; height: 3.2em; top: -.7em; left: -.1em; background: #f0134d; border-bottom: .07em solid #f7449a; box-shadow: 0 .16em .01em #b4085a,0 .12em .3em rgba(180,8,90,.6),0 .12em 2em rgba(0,0,0,.3),.12em .15em .2em rgba(0,0,0,.2); transition: .5s cubic-bezier(.52,-.41,.55,1.46) } .mt-square3d-blush input,.mt-square3d-garden input,.mt-square3d-matcha input,.mt-square3d-tomato input,.mt-square3d input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-square3d-blush input:focus,.mt-square3d-garden input:focus,.mt-square3d-matcha input:focus,.mt-square3d-tomato input:focus,.mt-square3d input:focus { outline: 0 } .mt-square3d-blush input:checked+label:before,.mt-square3d-garden input:checked+label:before,.mt-square3d-matcha input:checked+label:before,.mt-square3d-tomato input:checked+label:before,.mt-square3d input:checked+label:before { background: #40bfc1; border-bottom: .07em solid #67cccd; box-shadow: 0 .16em .01em #2c8788,0 .12em .3em rgba(44,135,136,.6),0 .12em 2em rgba(0,0,0,.3),-.12em .15em .2em rgba(0,0,0,.2); transform: translateX(3.5em) } .mt-square3d-blush input:disabled+label,.mt-square3d-garden input:disabled+label,.mt-square3d-matcha input:disabled+label,.mt-square3d-tomato input:disabled+label,.mt-square3d input:disabled+label { background: #ccc!important; cursor: not-allowed!important } .mt-square3d-blush input:disabled+label:before,.mt-square3d-garden input:disabled+label:before,.mt-square3d-matcha input:disabled+label:before,.mt-square3d-tomato input:disabled+label:before,.mt-square3d input:disabled+label:before { background: #ccc!important; border-bottom: .07em solid #ccc!important; box-shadow: 0 .16em .01em #aaa,0 .12em .3em hsla(0,0%,39.2%,.6),0 .12em 2em rgba(0,0,0,.3),.12em .15em .2em rgba(0,0,0,.2)!important } .mt-square3d-garden label:before { background: #ff2e63; border-bottom: .07em solid #ff6189; box-shadow: 0 .16em .01em #e10039,0 .12em .3em rgba(225,0,57,.6),0 .12em 2em rgba(0,0,0,.3),.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-garden input:checked+label:before { background: #21bf73; border-bottom: .07em solid #37dc8d; box-shadow: 0 .16em .01em #167e4c,0 .12em .3em rgba(22,126,76,.6),0 .12em 2em rgba(0,0,0,.3),-.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-tomato label:before { background: tomato; border-bottom: .07em solid #ff8e7a; box-shadow: 0 .16em .01em #fa2600,0 .12em .3em rgba(250,38,0,.6),0 .12em 2em rgba(0,0,0,.3),.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-tomato input:checked+label:before { background: #32cd32; border-bottom: .07em solid #5bd75b; box-shadow: 0 .16em .01em #239023,0 .12em .3em rgba(35,144,35,.6),0 .12em 2em rgba(0,0,0,.3),-.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-matcha label:before { background: #5b5656; border-bottom: .07em solid #756f6f; box-shadow: 0 .16em .01em #343131,0 .12em .3em rgba(52,49,49,.6),0 .12em 2em rgba(0,0,0,.3),.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-matcha input:checked+label:before { background: #7fcd91; border-bottom: .07em solid #a4dbb1; box-shadow: 0 .16em .01em #48b862,0 .12em .3em rgba(72,184,98,.6),0 .12em 2em rgba(0,0,0,.3),-.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-blush label:before { background: #ff677d; border-bottom: .07em solid #ff9aa9; box-shadow: 0 .16em .01em #ff1b3c,0 .12em .3em rgba(255,27,60,.6),0 .12em 2em rgba(0,0,0,.3),.12em .15em .2em rgba(0,0,0,.2) } .mt-square3d-blush input:checked+label:before { background: #9399ff; border-bottom: .07em solid #c6c9ff; box-shadow: 0 .16em .01em #4751ff,0 .12em .3em rgba(71,81,255,.6),0 .12em 2em rgba(0,0,0,.3),-.12em .15em .2em rgba(0,0,0,.2) } .mt-transparent,.mt-transparent-blood,.mt-transparent-brown,.mt-transparent-navi,.mt-transparent-violet { display: inline-block; box-sizing: border-box } .mt-transparent-blood label,.mt-transparent-brown label,.mt-transparent-navi label,.mt-transparent-violet label,.mt-transparent label { display: inline-block; position: relative; box-sizing: border-box; cursor: pointer; width: 7em; height: 3em; border-radius: 50px; background: transparent; border: .2em solid #333; transition: all .3s ease } .mt-transparent-blood label:before,.mt-transparent-brown label:before,.mt-transparent-navi label:before,.mt-transparent-violet label:before,.mt-transparent label:before { content: ""; display: block; position: absolute; width: 2em; height: 2em; top: .3em; left: .3em; border-radius: 2em; background: #333; transition: .3s ease } .mt-transparent-blood input,.mt-transparent-brown input,.mt-transparent-navi input,.mt-transparent-violet input,.mt-transparent input { position: absolute; box-sizing: border-box; height: 0; width: 0; font-size: inherit; margin: 0; border: 0; z-index: 1; cursor: pointer; -moz-appearance: none; -webkit-appearance: none } .mt-transparent-blood input:focus,.mt-transparent-brown input:focus,.mt-transparent-navi input:focus,.mt-transparent-violet input:focus,.mt-transparent input:focus { outline: 0 } .mt-transparent-blood input:checked+label,.mt-transparent-brown input:checked+label,.mt-transparent-navi input:checked+label,.mt-transparent-violet input:checked+label,.mt-transparent input:checked+label { background: rgba(0,0,0,.1) } .mt-transparent-blood input:checked+label:before,.mt-transparent-brown input:checked+label:before,.mt-transparent-navi input:checked+label:before,.mt-transparent-violet input:checked+label:before,.mt-transparent input:checked+label:before { transform: translateX(4em) } .mt-transparent-blood input:disabled+label,.mt-transparent-brown input:disabled+label,.mt-transparent-navi input:disabled+label,.mt-transparent-violet input:disabled+label,.mt-transparent input:disabled+label { background: #ccc!important; border: .2em solid #ccc!important; cursor: not-allowed!important } .mt-transparent-blood input:disabled+label:before,.mt-transparent-brown input:disabled+label:before,.mt-transparent-navi input:disab.........完整代码请登录后点击上方下载按钮下载查看
网友评论0