diff --git a/assets/board.css b/assets/board.css index b330c8f..d23ddbc 100644 --- a/assets/board.css +++ b/assets/board.css @@ -323,15 +323,13 @@ opacity: 0; } - .selection-tools button:nth-child(1) { - transition: background-color .5s, transform .5s, opacity .5s; - } + .selection-tools button:nth-child(1) { transition: background-color .5s, transform .5s, opacity .5s; } - .selection-tools button:nth-child(2) { - transition: background-color .5s, transform .5s .1s, opacity .5s .1s; - } + .selection-tools button:nth-child(2) { transition: background-color .5s, transform .5s .1s, opacity .5s .1s; } + + .selection-tools button:nth-child(3) { transition: background-color .5s, transform .5s .2s, opacity .5s .2s; } - body:has(.component.selected) .selection-tools button { + body:has(.component.selected) .selection-tools button:not(.ignored) { transform: translateY(0); opacity: 1; } diff --git a/assets/scripts/components-control.js b/assets/scripts/components-control.js index bdad39f..de43e7d 100644 --- a/assets/scripts/components-control.js +++ b/assets/scripts/components-control.js @@ -16,9 +16,19 @@ $(document).on('mousedown', '.component', function (e) { $('.selected').removeClass('selected'); $(this).addClass('selected'); SelectedComponent = $(this); + if (SelectedComponent.hasClass('switch')) { + $('#activateSwitchComponent').removeClass('ignored'); + } else { + $('#activateSwitchComponent').addClass('ignored'); + } } } }); + +$('#activateSwitchComponent').click(function (e) { + activateSwitch(SelectedComponent); +}) + /* unselect on click on void */ $('#board').on('click', function (e) { diff --git a/index.html b/index.html index 7794907..161d37e 100644 --- a/index.html +++ b/index.html @@ -168,6 +168,7 @@

Are you sure ?

+