Skip to content

Commit

Permalink
wrong merge, oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Janic Beauchemin committed Sep 3, 2014
1 parent aa501d8 commit 5be5ad9
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 57 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jquery.switcher v1.2.3

Custom checkbox / radio button in jquery

see live example [here](https://cdn.rawgit.com/djanix/jquery.switcher/master/index.html)
see live example [here](https://rawgit.com/djanix/jquery.switcher/master/index.html)

### How to get it

Expand Down
15 changes: 3 additions & 12 deletions dist/switcher.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
/*
* jQuery Boilerplate - v3.3.4
* A jump-start for jQuery plugins development.
* http://jqueryboilerplate.com
*
* Made by Zeno Rocha
* Under MIT License
*/

/* jquery.switcher - 1.2.3
* Copyright (c) 2014-08-19 Janic Beauchemin - https://github.com/djanix/ */
* Copyright (c) 2014-09-03 Janic Beauchemin - https://github.com/djanix/ */

;(function ($, window, document, undefined) {
;(function ($, undefined) {
var pluginName = "switcher";

var defaults = {
Expand Down Expand Up @@ -262,4 +253,4 @@
});
// END SWIPE EVENTS
// -----------------------------------------------------------------------
})($, window, document);
})($);
2 changes: 1 addition & 1 deletion dist/switcher.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
margin: 0.5em 0;
}

label {
font-size: 14px;
margin-bottom: 5px;

display: inline-block;
*display: inline;
*zoom: 1;
}

.style {
border-bottom: 3px solid #519b20;
text-align: left;
Expand Down Expand Up @@ -63,7 +72,7 @@
<h1>Jquery Switcher</h1>

<div class="style style1">
<h2>Style #1 (default style):</h2>
<h2>Style #1 (default):</h2>

<div class="checkbox">
<h3>Checkbox</h3>
Expand Down Expand Up @@ -104,7 +113,7 @@ <h4>Controls:</h4>
</div>

<div class="style style2">
<h2>Style #2:</h2>
<h2>Style #2 (short):</h2>

<div class="checkbox">
<h3>Checkbox</h3>
Expand Down
15 changes: 3 additions & 12 deletions switcher.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
/*
* jQuery Boilerplate - v3.3.4
* A jump-start for jQuery plugins development.
* http://jqueryboilerplate.com
*
* Made by Zeno Rocha
* Under MIT License
*/

/* jquery.switcher - 1.2.3
* Copyright (c) 2014-08-19 Janic Beauchemin - https://github.com/djanix/ */
* Copyright (c) 2014-09-03 Janic Beauchemin - https://github.com/djanix/ */

;(function ($, window, document, undefined) {
;(function ($, undefined) {
var pluginName = "switcher";

var defaults = {
Expand Down Expand Up @@ -262,4 +253,4 @@
});
// END SWIPE EVENTS
// -----------------------------------------------------------------------
})($, window, document);
})($);
65 changes: 36 additions & 29 deletions switcher.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ $fontFamily: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
display: none;
}

.slider {
background-color: $colorSecondary;
border-radius: 4px;
box-shadow: 0 0 2px 1px $colorBorder;
height: 26px;
left: 0;
position: absolute;
top: 0;
transform: translateX(0%);
transition: transform 0.3s;
width: 50%;
z-index: 2;
}

.text {
width: 50%;

Expand All @@ -71,51 +85,44 @@ $fontFamily: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
transform: translateX(100%);
}
}

.slider {
background-color: $colorSecondary;
border-radius: 4px;
box-shadow: 0 0 2px 1px $colorBorder;
height: 26px;
left: 0;
position: absolute;
top: 0;
transform: translateX(0%);
transition: transform 0.3s;
width: 50%;
z-index: 2;
}
}

.switcher.short {
$colorActive: #519b20;
$colorSecondary: #BF1111;
$colorBorder: #dfdfdf;
$colorBorder: #aaa;

border: 1px solid $colorBorder;
border-radius: 50%;
margin-bottom: -3px;
padding: 1px;
cursor: pointer;
display: inline-block;
margin-right: 5px;
vertical-align: middle;

input {
display: none;
}

.slider {
background-color: $colorSecondary;
.content {
border: 1px solid $colorBorder;
border-radius: 50%;
height: 15px;
transition: background-color 0.3s;
width: 15px;
height: 18px;
padding: 0;
width: 18px;
}

&:after {
color: #fff;
}
.slider {
background-color: $colorActive;
border-radius: 50%;
height: 12px;
margin: 3px;
opacity: 0;
transform: scale(0);
transition: all 0.2s;
width: 12px;
}

&.is-active {
.slider {
background-color: $colorActive;
opacity: 1;
transform: scale(1);
}
}
}

0 comments on commit 5be5ad9

Please sign in to comment.