diff --git a/docs/welcome/coffee/welcome.coffee b/docs/welcome/coffee/welcome.coffee index 096d5cf..0457d81 100644 --- a/docs/welcome/coffee/welcome.coffee +++ b/docs/welcome/coffee/welcome.coffee @@ -5,13 +5,18 @@ init = -> setupHeroSelect = -> new Select el: $('.hero-select')[0] +currentThemeClassName = undefined setupThemeSelect = -> - $select = $('.themes-select') - selectDrop = new Select el: $select[0] + $showcase = $ '#themeShowcase' + $select = $ '.themes-select' + currentThemeClassName = $select.val() + select = new Select + el: $select[0] + className: currentThemeClassName - $select.change = -> + $select.on 'change', -> newClassName = $select.val() - # .... - # selectDrop.$drop + $([select.dropSelect.$drop[0], select.$target[0], $showcase[0]]).removeClass(currentThemeClassName).addClass(newClassName) + currentThemeClassName = newClassName $ init \ No newline at end of file diff --git a/docs/welcome/css/welcome.css b/docs/welcome/css/welcome.css index 64d0068..0e48b5a 100644 --- a/docs/welcome/css/welcome.css +++ b/docs/welcome/css/welcome.css @@ -99,6 +99,12 @@ table.showcase.about { margin-right: auto; } table.showcase.themes { background: #eeeeee; } + table.showcase.themes.select-theme-dark { + background: #323232; } + table.showcase.themes.select-theme-dark h1, table.showcase.themes.select-theme-dark h2 { + color: #e6e6e6; } + table.showcase.themes.select-theme-chosen { + background: white; } table.showcase.themes .themes-list { margin: 4em auto; padding: 0; diff --git a/docs/welcome/index.html b/docs/welcome/index.html index 9b17508..cb17e43 100644 --- a/docs/welcome/index.html +++ b/docs/welcome/index.html @@ -15,6 +15,7 @@ + @@ -113,8 +114,10 @@

Themes

Selects for every occasion.

diff --git a/docs/welcome/js/welcome.js b/docs/welcome/js/welcome.js index 5f9fa7f..f6e12aa 100644 --- a/docs/welcome/js/welcome.js +++ b/docs/welcome/js/welcome.js @@ -1,5 +1,5 @@ (function() { - var init, setupHeroSelect, setupThemeSelect; + var currentThemeClassName, init, setupHeroSelect, setupThemeSelect; init = function() { setupHeroSelect(); @@ -12,16 +12,23 @@ }); }; + currentThemeClassName = void 0; + setupThemeSelect = function() { - var $select, selectDrop; + var $select, $showcase, select; + $showcase = $('#themeShowcase'); $select = $('.themes-select'); - selectDrop = new Select({ - el: $select[0] + currentThemeClassName = $select.val(); + select = new Select({ + el: $select[0], + className: currentThemeClassName }); - return $select.change = function() { + return $select.on('change', function() { var newClassName; - return newClassName = $select.val(); - }; + newClassName = $select.val(); + $([select.dropSelect.$drop[0], select.$target[0], $showcase[0]]).removeClass(currentThemeClassName).addClass(newClassName); + return currentThemeClassName = newClassName; + }); }; $(init); diff --git a/docs/welcome/sass/welcome.sass b/docs/welcome/sass/welcome.sass index c98f68e..47d05c3 100644 --- a/docs/welcome/sass/welcome.sass +++ b/docs/welcome/sass/welcome.sass @@ -114,6 +114,15 @@ table.showcase &.themes background: #eee + &.select-theme-dark + background: #323232 + + h1, h2 + color: #e6e6e6 + + &.select-theme-chosen + background: #fff + .themes-list margin: 4em auto padding: 0