-
-
Save elliots/7348333 to your computer and use it in GitHub Desktop.
Shell command widget
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
return { | |
"name": "Shell Command", | |
"deviceMap": [{ "deviceType": "shell" }] | |
} |
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
background: black; | |
.shell-widget { | |
padding: 30px 10px 10px; | |
.icon { | |
font-size: 160px; | |
color: #63de00; | |
display: block; | |
text-align: center; | |
line-height: 0.5em; | |
margin: 10px; | |
text-shadow: 0 0 10px #63de00; | |
} | |
button { | |
width: 90%; | |
display: block; | |
margin: 0 auto; | |
border: 0; | |
background: #63de00; | |
} | |
.result { | |
color: #63de00; | |
padding-top: 15px; | |
text-shadow: 0 0 10px #63de00; | |
} | |
} |
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
<div class="shell-widget"> | |
<span class="icon"></span> | |
<button class="button green-gradient">Execute</button> | |
<div class="result">Result <span class="cursor">></span> <span class="out"></span></div> | |
</div> |
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
scope.onData = function(data) { | |
element.find(".result .out").html(data.DA); | |
}; | |
element.find('button').click(function() { | |
element.find(".result .out").empty(); | |
scope.ActuateAll(1); | |
}); | |
var state = true; | |
setInterval(function() { | |
element.find('.cursor').css('visibility', state = !state?'visible': 'hidden'); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment