Re: Dashticz - Show your dashboard and how-to's!
Posted: Saturday 11 November 2017 23:36
Open source Home Automation System
https://forum.domoticz.com/
I did, and it looks great, just not for me.
Hi Jurjan, there a several ways, but the one I prefer is making an entry in custom.css like in the example.jurjan wrote: ↑Monday 13 November 2017 20:31 I got a css question, how can I set the background color of the entire block?
I placed an inline red color on the 'Fontijn' block as an example, but I cannot find how to do this by using custom.css
All -selected- blocks should become green (rgba(0,255,0,0.3)
Any help would be appreciated.
dash.jpg
Code: Select all
.block_463.transbg,
.block_464.transbg {
background-color: rgba(255, 0, 0, 0.3) !important;
}
Code: Select all
<div class="mh transbg block_20 col-xs-4 hover" onclick="switchDevice(this)" data-id="20">
<div class="col-xs-4 col-icon">
<em class="fa fa-lightbulb-o off icon" undefined=""></em>
</div><div class="col-xs-8 col-data">
<strong class="title">Fontijn</strong><br>
<span class="state">UIT</span></div>
</div>
Code: Select all
.block_463.transbg,
.block_464.transbg {
background-color: rgba(255, 0, 0, 0.3) !important;
}
First make an entry in your config.jsjurjan wrote: ↑Monday 13 November 2017 22:07 Hi, I would like the block to be green when the device is switched on and red when the device is switched off.
When I inspect the html I can see the icon (light bulb) gets a class='on' or class='off' I could use, but then I need the parent div to apply the background-color on.. As far as I know this is not possible using css.
See the em of the lightbulb below which has an 'off' class.
Code: Select all
function getStatus_20(idx,value,device){
if(device['Data']!="Off"){
$('div.block_20').removeClass('background_red').addClass('background_green');
}
else {
$('div.block_20').removeClass('background_green').addClass('background_red');
}
}
Code: Select all
.background_green {
background-color: rgba(0, 255, 0, 0.3) !important;
}
.background_red {
background-color: rgba(255, 0, 0, 0.3) !important;
}
Can you enlighten me on the relevant pieces in CONFIG.js? (Not main.js, I got that part)
The configuration is a bit difficult. I don't have mine around anymore. i see what I can do tomorrow.Ierlandfan wrote: ↑Tuesday 14 November 2017 17:52Can you enlighten me on the relevant pieces in CONFIG.js? (Not main.js, I got that part)
I want to rule out some strange things on my laptop. (No menu shows up but could be CONFIG related)
Code: Select all
,
btnVolUp = $(streamelement+' .btnVolUp').click(function() {
audio.volume(0.5);
}),
Code: Select all
html+='<div class="col-xs-4 transbg hover text-center btnVolUp">';
html+='<em class="fa fa-chevron-right fa-small"></em>';
html+='</div>';
Code: Select all
audio.volume(false, {volume: 0.5});
audio.update("volume",0.5);
audio.setVolume("volume", 0.5);
audio.setVolume(0.5);
Care to share? (guess it rhymes a bit )
Thanks
Not sure if it's possible with .js, but in PHP it should work with something like 'include_once', but that is something the developer(s) will know. I do agree with it. Maybe the var config parts as well.It would be great if it would be possible to have a separate file for blocks setting