brightness control yay
This commit is contained in:
parent
a4191b5116
commit
3391c3d2d5
6 changed files with 37 additions and 12 deletions
|
|
@ -153,14 +153,26 @@ module.exports = {
|
|||
return popup
|
||||
},
|
||||
|
||||
luminosityReset: function(){
|
||||
|
||||
brightnessReduce: function(){
|
||||
$('.brightness-reset.disabled, .brightness-increase.disabled').removeClass('disabled')
|
||||
var b = parseFloat($('#brightness').data('brightness')) - 0.1,
|
||||
v = parseInt(255*b)
|
||||
$('#brightness').data('brightness',b).css({background:`rgb(${v},${v},${v})`})
|
||||
if (b<=0) $('.brightness-reduce').addClass('disabled')
|
||||
},
|
||||
luminosityIncrease: function(){
|
||||
|
||||
brightnessIncrease: function(){
|
||||
$('.brightness-reset.disabled, .brightness-reduce.disabled').removeClass('disabled')
|
||||
var b = parseFloat($('#brightness').data('brightness')) + 0.1,
|
||||
v = parseInt(255*b)
|
||||
$('#brightness').data({brightness:b}).css({background:`rgb(${v},${v},${v})`})
|
||||
if (b>=1) $('.brightness-increase').addClass('disabled')
|
||||
},
|
||||
luminosityReduce: function(){
|
||||
|
||||
brightnessReset: function(){
|
||||
$('.brightness-increase.disabled, .brightness-reduce.disabled').removeClass('disabled')
|
||||
$('.brightness-reset').addClass('disabled')
|
||||
var b = .5,
|
||||
v = 127
|
||||
$('#brightness').data('brightness',b).css({background:`rgb(${v},${v},${v})`})
|
||||
},
|
||||
|
||||
editorEnable: editor.enable,
|
||||
|
|
|
|||
|
|
@ -15,16 +15,18 @@ var data = [
|
|||
actions: [
|
||||
{
|
||||
title:icon('minus'),
|
||||
action:actions.luminosityReduce
|
||||
action:actions.brightnessReduce,
|
||||
class:'brightness-reduce'
|
||||
},
|
||||
{
|
||||
title:icon('adjust'),
|
||||
action:actions.luminosityReset,
|
||||
class:'disabled'
|
||||
action:actions.brightnessReset,
|
||||
class:'disabled brightness-reset'
|
||||
},
|
||||
{
|
||||
title:icon('plus'),
|
||||
action:actions.luminosityIncrease
|
||||
action:actions.brightnessIncrease,
|
||||
class:'brightness-increase'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue