| OLD | NEW |
| (Empty) | |
| 1 <polymer-element name="sliding-checkbox"> |
| 2 <template> |
| 3 <style> |
| 4 .switch { |
| 5 position: relative; |
| 6 width: 121px; |
| 7 -webkit-user-select: none; |
| 8 -moz-user-select: none; |
| 9 -ms-user-select: none; |
| 10 } |
| 11 .hide { |
| 12 display: none; |
| 13 } |
| 14 .label { |
| 15 display: block; |
| 16 overflow: hidden; |
| 17 cursor: pointer; |
| 18 border: 2px solid #999999; |
| 19 border-radius: 15px; |
| 20 } |
| 21 .content { |
| 22 width: 200%; |
| 23 margin-left: -100%; |
| 24 -moz-transition: margin 0.3s ease-in 0s; |
| 25 -webkit-transition: margin 0.3s ease-in 0s; |
| 26 -o-transition: margin 0.3s ease-in 0s; |
| 27 transition: margin 0.3s ease-in 0s; |
| 28 } |
| 29 .content:before, .content:after { |
| 30 float: left; |
| 31 width: 50%; |
| 32 height: 30px; |
| 33 padding: 0; |
| 34 line-height: 30px; |
| 35 color: white; |
| 36 font: 400 14px 'Montserrat', sans-serif; |
| 37 -moz-box-sizing: border-box; |
| 38 -webkit-box-sizing: border-box; |
| 39 box-sizing: border-box; |
| 40 } |
| 41 .content:before { |
| 42 content: "{{ onText }}"; |
| 43 padding-left: 10px; |
| 44 background-color: #0489C3; |
| 45 } |
| 46 .content:after { |
| 47 content: "{{ offText }}"; |
| 48 padding-right: 10px; |
| 49 background-color: #EEEEEE; |
| 50 color: #999999; |
| 51 text-align: right; |
| 52 } |
| 53 .dot { |
| 54 width: 14px; |
| 55 margin: 8px; |
| 56 background: #FFFFFF; |
| 57 border: 2px solid #999999; |
| 58 border-radius: 15px; |
| 59 position: absolute; |
| 60 top: 0; |
| 61 bottom: 0; |
| 62 right: 87px; |
| 63 -moz-transition: all 0.3s ease-in 0s; |
| 64 -webkit-transition: all 0.3s ease-in 0s; |
| 65 -o-transition: all 0.3s ease-in 0s; |
| 66 transition: all 0.3s ease-in 0s; |
| 67 } |
| 68 :checked + .label .content { |
| 69 margin-left: 0; |
| 70 } |
| 71 :checked + .label .dot { |
| 72 right: 0px; |
| 73 } |
| 74 </style> |
| 75 <div class="switch"> |
| 76 <input type="checkbox" |
| 77 class="hide" |
| 78 id="slide-switch" |
| 79 on-change="{{ change }}"> |
| 80 <label class="label" for="slide-switch"> |
| 81 <div class="content"></div> |
| 82 <div class="dot"></div> |
| 83 </label> |
| 84 </div> |
| 85 </template> |
| 86 <script type="application/dart" src="sliding_checkbox.dart"></script> |
| 87 </polymer-element> |
| OLD | NEW |