diff --git a/index.html b/index.html index 041d79d..d0c9cec 100755 --- a/index.html +++ b/index.html @@ -197,6 +197,21 @@
+
+

Alternate Venn Diagram

+ + +

Wires to cut:

+
+ +

Wires to not cut:

+
+
+

Passwords

diff --git a/ktane.css b/ktane.css index ffb5ed1..af1b753 100755 --- a/ktane.css +++ b/ktane.css @@ -364,3 +364,8 @@ nav { #sequenceInstruction button { margin-right: 0.2em; } + +#sectionVenn2 td { + height: 1.5em; + width: 1em; +} diff --git a/ktane.js b/ktane.js index f1439d9..7fc5381 100755 --- a/ktane.js +++ b/ktane.js @@ -617,7 +617,7 @@ $('section').each(function () { } } }, - $checkboxes = $('#vennOptions > li > input'), + $checkboxes = $('#vennOptions input[type="checkbox"]'), $instruction = $('#sectionVenn .instruction'); // Red Blue Star LED @@ -648,6 +648,69 @@ $('section').each(function () { }).triggerHandler('change'); })(); +(function () { + /** + * Alternate Venn diagram + */ + var $doCut = $('#venn2DoCut'), + $doNotCut = $('#venn2DoNotCut'), + $checkboxes = $('#sectionVenn2 input[type="checkbox"]'), + $serialEven = $('#venn2SerialEven'), + $parallelExists = $('#venn2ParallelExists'), + $multipleBatteries = $('#venn2MultipleBatteries'); + + $checkboxes.on('change', function () { + var $serialList, + $parallelList, + $batteryList; + + $doCut.empty(); + $doNotCut.empty(); + + $serialList = $serialEven.prop('checked') ? $doCut : $doNotCut; + $parallelList = $parallelExists.prop('checked') ? $doCut : $doNotCut; + $batteryList = $multipleBatteries.prop('checked') ? $doCut : $doNotCut; + + addRow($doCut, [ + {}, + {star: true}, + {red: true, star: true} + ]); + addRow($doNotCut, [ + {light: true}, + {blue: true, light: true}, + {red: true, blue: true, star: true, light: true} + ]); + addRow($serialList, [ + {red: true}, + {blue: true}, + {red: true, blue: true}, + {red: true, blue: true, light: true} + ]); + addRow($parallelList, [ + {blue: true, light: true}, + {red: true, blue: true, star: true}, + {blue: true, star: true, light: true} + ]); + addRow($batteryList, [ + {red: true, light: true}, + {star: true, light: true}, + {red: true, star: true, light: true} + ]); + }).triggerHandler('change'); + + function addRow($table, items) { + $.each(items, function (i, item) { + var $tr = $(''); + $tr.append($('' + (item.star ? '★' : '') + '')); + $tr.append($('')); + $tr.append($('')); + $tr.append($('' + (item.light ? '💡' : '') + '')); + $table.append($tr); + }); + } +})(); + (function () { /** * Passwords