-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* defaultTheme * defaultSize (TODO) * includedThemes * excludedThemes exclude will take out themes from include, and if include is blank, all themes are included, with exclude removing from there as well. If you exclude a theme, and then use it, the component will still render, but will be transparent. The todo here is to use 'default', which probably should always be included.
- Loading branch information
Ilya Radchenko
committed
Oct 10, 2014
1 parent
eaf4525
commit 7b39160
Showing
11 changed files
with
244 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = function(/* environment, appConfig */) { | ||
module.exports = function(/*environment, appConfig */) { | ||
return { }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,43 @@ | ||
module.exports = { | ||
name: 'ember-cli-toggle' | ||
name: 'ember-cli-toggle', | ||
|
||
included: function(app) { | ||
this.app = app; | ||
|
||
var config = this.project.config(this.app.env); | ||
var toggleConfig = config['ember-cli-toggle']; | ||
|
||
app.import('vendor/ember-cli-toggle/base.css'); | ||
|
||
if (toggleConfig && Object.keys(toggleConfig).length) { | ||
var allThemes = ['light', 'ios', 'default', 'flat', 'skewed', 'flip']; | ||
var themes = []; | ||
|
||
if (toggleConfig.includedThemes) { | ||
themes = themes.concat(toggleConfig.includedThemes); | ||
} | ||
|
||
if (!themes.length) { | ||
themes = allThemes; | ||
} | ||
|
||
if (toggleConfig.excludedThemes) { | ||
var excluded = toggleConfig.excludedThemes; | ||
|
||
themes = themes.filter(function (theme) { | ||
return excluded.indexOf(theme) === -1; | ||
}); | ||
} | ||
|
||
themes = themes.filter(function (theme) { | ||
return theme && allThemes.indexOf(theme) !== -1; | ||
}); | ||
|
||
themes.forEach(function (theme) { | ||
app.import('vendor/ember-cli-toggle/themes/' + theme + '.css'); | ||
}); | ||
|
||
toggleConfig.userThemes = themes; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.x-toggle-default + .x-toggle-btn { | ||
padding: 0.1em; | ||
background-color: #E7E7E7; | ||
border-radius: 0.2em; | ||
transition: background-color 0.2s; | ||
} | ||
|
||
.x-toggle-default:checked + .x-toggle-btn { | ||
background-color: #797979; | ||
} | ||
|
||
.x-toggle-default + .x-toggle-btn:after { | ||
background-color: #FFFFFF; | ||
transition: left 0.2s; | ||
border-radius: 0.2em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.x-toggle-flat + .x-toggle-btn { | ||
padding: 2px; | ||
-webkit-transition: all .2s ease; | ||
transition: all .2s ease; | ||
background: #fff; | ||
border: 4px solid #f2f2f2; | ||
border-radius: 2em; | ||
} | ||
.x-toggle-flat + .x-toggle-btn:after { | ||
-webkit-transition: all .2s ease; | ||
transition: all .2s ease; | ||
background: #f2f2f2; | ||
content: ""; | ||
border-radius: 1em; | ||
} | ||
.x-toggle-flat:checked + .x-toggle-btn { | ||
border: 4px solid #7FC6A6; | ||
} | ||
.x-toggle-flat:checked + .x-toggle-btn:after { | ||
left: 50%; | ||
background: #7FC6A6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.x-toggle-flip + .x-toggle-btn { | ||
padding: 2px; | ||
-webkit-transition: all .2s ease; | ||
transition: all .2s ease; | ||
font-family: sans-serif; | ||
-webkit-perspective: 100px; | ||
perspective: 100px; | ||
} | ||
.x-toggle-flip + .x-toggle-btn:after, .x-toggle-flip + .x-toggle-btn:before { | ||
display: inline-block; | ||
-webkit-transition: all .4s ease; | ||
transition: all .4s ease; | ||
width: 100%; | ||
text-align: center; | ||
position: absolute; | ||
line-height: 2em; | ||
font-weight: bold; | ||
color: #fff; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
-webkit-backface-visibility: hidden; | ||
backface-visibility: hidden; | ||
border-radius: 4px; | ||
} | ||
.x-toggle-flip + .x-toggle-btn:after { | ||
content: attr(data-tg-on); | ||
background: #02C66F; | ||
-webkit-transform: rotateY(-180deg); | ||
transform: rotateY(-180deg); | ||
} | ||
.x-toggle-flip + .x-toggle-btn:before { | ||
background: #FF3A19; | ||
content: attr(data-tg-off); | ||
} | ||
.x-toggle-flip + .x-toggle-btn:active:before { | ||
-webkit-transform: rotateY(-20deg); | ||
transform: rotateY(-20deg); | ||
} | ||
.x-toggle-flip:checked + .x-toggle-btn:before { | ||
-webkit-transform: rotateY(180deg); | ||
transform: rotateY(180deg); | ||
} | ||
.x-toggle-flip:checked + .x-toggle-btn:after { | ||
-webkit-transform: rotateY(0); | ||
transform: rotateY(0); | ||
left: 0; | ||
background: #7FC6A6; | ||
} | ||
.x-toggle-flip:checked + .x-toggle-btn:active:after { | ||
-webkit-transform: rotateY(20deg); | ||
transform: rotateY(20deg); | ||
} |
Oops, something went wrong.