From 96268517794530362a75ef2282b3be09a0400122 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sharma <53289186+AnkitSharmaOnGithub@users.noreply.github.com> Date: Fri, 2 Aug 2019 12:23:02 +0530 Subject: [PATCH 1/6] Updated index.html with Predefined Classes Added predefined classes for switch-like primary, danger, black, transparent etc. --- index.html | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a1f777c..086754b 100644 --- a/index.html +++ b/index.html @@ -125,6 +125,31 @@

color

+ +
+

Predefined Classes

+
+
+            
+                <input type="checkbox" class="switch-primary" />
+ <input type="checkbox" class="switch-success" />
+ <input type="checkbox" class="switch-danger" />
+ <input type="checkbox" class="switch-black" />
+ <input type="checkbox" class="switch-warning" />
+ <input type="checkbox" class="switch-info" />
+ <input type="checkbox" class="switch-transparent" />
+
+
+ + + + + + + +
+
+

disabled

@@ -219,6 +244,48 @@

remove

onJackColor : '#1453B3', offJackColor : '#A4B363' }, + 'switch-danger' : { + offSwitchColor : '#d06d6d', + onSwitchColor : '#e61818', + onJackColor : '#f17d05', + offJackColor : '#ffffff' + }, + 'switch-primary' : { + offSwitchColor : '#5e81a7', + onSwitchColor : '#0575ef', + onJackColor : '#1453B3', + offJackColor : '#ffffff' + }, + 'switch-black' : { + offSwitchColor : '#bec3c7', + onSwitchColor : '#101010', + onJackColor : '#1453B3', + offJackColor : '#ffffff' + }, + 'switch-success' : { + offSwitchColor : '#8fc59b', + onSwitchColor : '#28bd4a', + onJackColor : '#03f56f', + offJackColor : '#ffffff' + }, + 'switch-warning' : { + offSwitchColor : '#eacd74', + onSwitchColor : '#fdbf00', + onJackColor : '#855439', + offJackColor : '#ffffff' + }, + 'switch-info' : { + offSwitchColor : '#7bc5d2', + onSwitchColor : '#09d3f7', + onJackColor : '#1453B3', + offJackColor : '#ffffff' + }, + 'switch-transparent' : { + offSwitchColor : '#ffffff', + onSwitchColor : '#ffffff', + onJackColor : '#1453B3', + offJackColor : '#ffffff' + }, 'demo-disabled-1': { checked: true, disabled: true @@ -239,4 +306,4 @@

remove

- \ No newline at end of file + From 3dabad1cdd4003c855d85bbef358f88358d9c902 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sharma <53289186+AnkitSharmaOnGithub@users.noreply.github.com> Date: Sun, 11 Aug 2019 18:53:17 +0530 Subject: [PATCH 2/6] Updated ReadMe Added Predefined Classes to Read Me --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 0c8cf72..112110d 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,17 @@ defaults = { - `beforeDestroy` : called before `remove all events on switch element` - `onDestroy` : called when `remove all events on switch element` done + +## Predefined Classes + +`switch-danger` +`switch-primary` +`switch-black` +`switch-success` +`switch-warning` +`switch-info` +`switch-transparent` + ## API ##### .getChecked() From 075f94b666501f9fe2ec8231c9e7859561740c61 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sharma <53289186+AnkitSharmaOnGithub@users.noreply.github.com> Date: Fri, 4 Oct 2019 16:08:31 +0530 Subject: [PATCH 3/6] Remodified Clasees for Buttons Remodified Classes for Buttons. Please add and update these in the http://weatherstar.me/switch/. --- index.html | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 086754b..3a95fd2 100644 --- a/index.html +++ b/index.html @@ -125,7 +125,7 @@

color

- +

Predefined Classes

@@ -140,16 +140,17 @@

Predefined Classes

<input type="checkbox" class="switch-transparent" />
- - - - - - - + + + + + + +
- + +

disabled

@@ -244,43 +245,43 @@

remove

onJackColor : '#1453B3', offJackColor : '#A4B363' }, - 'switch-danger' : { + 'demo-switch-danger' : { offSwitchColor : '#d06d6d', onSwitchColor : '#e61818', onJackColor : '#f17d05', offJackColor : '#ffffff' }, - 'switch-primary' : { + 'demo-switch-primary' : { offSwitchColor : '#5e81a7', onSwitchColor : '#0575ef', onJackColor : '#1453B3', offJackColor : '#ffffff' }, - 'switch-black' : { + 'demo-switch-black' : { offSwitchColor : '#bec3c7', onSwitchColor : '#101010', onJackColor : '#1453B3', offJackColor : '#ffffff' }, - 'switch-success' : { + 'demo-switch-success' : { offSwitchColor : '#8fc59b', onSwitchColor : '#28bd4a', onJackColor : '#03f56f', offJackColor : '#ffffff' }, - 'switch-warning' : { + 'demo-switch-warning' : { offSwitchColor : '#eacd74', onSwitchColor : '#fdbf00', onJackColor : '#855439', offJackColor : '#ffffff' }, - 'switch-info' : { + 'demo-switch-info' : { offSwitchColor : '#7bc5d2', onSwitchColor : '#09d3f7', onJackColor : '#1453B3', offJackColor : '#ffffff' }, - 'switch-transparent' : { + 'demo-switch-transparent' : { offSwitchColor : '#ffffff', onSwitchColor : '#ffffff', onJackColor : '#1453B3', @@ -296,6 +297,7 @@

remove

}; Object.keys(switchConfig).forEach(function (key) { + console.log(document.querySelector('.' + key)); switches[key] = new Switch(document.querySelector('.' + key),switchConfig[key]); }); @@ -306,4 +308,4 @@

remove

- + \ No newline at end of file From e92a629ef343600a34510e66bcd5e7424b2e6235 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sharma <53289186+AnkitSharmaOnGithub@users.noreply.github.com> Date: Fri, 4 Oct 2019 17:08:47 +0530 Subject: [PATCH 4/6] Re modified Classes for Buttons Remodified Classes for Buttons. Please add and update these in the http://weatherstar.me/switch/. --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 3a95fd2..36a443d 100644 --- a/index.html +++ b/index.html @@ -131,13 +131,13 @@

Predefined Classes

             
-                <input type="checkbox" class="switch-primary" />
- <input type="checkbox" class="switch-success" />
- <input type="checkbox" class="switch-danger" />
- <input type="checkbox" class="switch-black" />
- <input type="checkbox" class="switch-warning" />
- <input type="checkbox" class="switch-info" />
- <input type="checkbox" class="switch-transparent" />
+ <input type="checkbox" class="demo-switch-primary" />
+ <input type="checkbox" class="demo-switch-success" />
+ <input type="checkbox" class="demo-switch-danger" />
+ <input type="checkbox" class="demo-switch-black" />
+ <input type="checkbox" class="demo-switch-warning" />
+ <input type="checkbox" class="demo-switch-info" />
+ <input type="checkbox" class="demo-switch-transparent" />
From 662cac9544674b3ab9a056c474dc954bb3c4959b Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sharma <53289186+AnkitSharmaOnGithub@users.noreply.github.com> Date: Sat, 5 Oct 2019 11:23:45 +0530 Subject: [PATCH 5/6] Updated Read Me with Predefined Classes --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 112110d..2bf2c8d 100644 --- a/README.md +++ b/README.md @@ -90,13 +90,13 @@ defaults = { ## Predefined Classes -`switch-danger` -`switch-primary` -`switch-black` -`switch-success` -`switch-warning` -`switch-info` -`switch-transparent` +`demo-switch-danger` +`demo-switch-primary` +`demo-switch-black` +`demo-switch-success` +`demo-switch-warning` +`demo-switch-info` +`demo-switch-transparent` ## API From 42e7b8bd0fb9d89f568054e6fe35a74ebf1fc079 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sharma <53289186+AnkitSharmaOnGithub@users.noreply.github.com> Date: Thu, 1 Oct 2020 15:52:56 +0530 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2bf2c8d..5836c59 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ defaults = { }; ``` -- `size` : size of switch element, can be `default` | `small` | `large` -- `checked` : state of switch and checbox, if `undefined` the switch state according to the checkbox +- `size` : the size of a switch element, can be default | small | large +- `checked` : state of switch and checkbox, if undefined the switch state according to the checkbox - `onText` : text in the jack when switch ON - `offText` : text in the jack when switch OFF - `onSwitchColor` : color of checked switch element