Код:
// @author "VU Meter component/object by DRON, jscript by Br3tt aka Falstaff >> http://br3tt.deviantart.com"
// @adapted - San_dr
function RGB(r, g, b) { return (0xff000000 | (r << 16) | (g << 8) | (b));
};
function RGBA(r, g, b, a) { return ((a << 24) | (r << 16) | (g << 8) | (b));
};
// VUMeter Object
VUMeter = new ActiveXObject("VUMeter");
VUMeter.RegisterWindow(window.ID);
// Globals
var ww = 0, wh = 0;
var color = RGB(227,207,230);
var color3 = RGB(97,97,127);
function on_size() {
ww = window.Width;
wh = window.Height;
};
function on_paint(gr) {
D=(ww-148)/21
N=wh/12;
L=VUMeter.LeftLevel;
R=VUMeter.RightLevel;
LM = VUMeter.LeftPeak;
RM = VUMeter.RightPeak;
// create draw area
//scale
var m = D;
while (m < ww+1) {
gr.FillSolidRect(m-D+7, N-3, D, 4*N, RGB(175,175,175));
gr.FillSolidRect(m-D+7, 7*N+3, D, 4*N, RGB(175,175,175));
m = m +D+7;
}
// fill bgcolor
gr.FillGradRect(0, 0, ww/2, wh,0, RGBA(207,197,220,235),RGBA(57,47,67,200));
gr.FillGradRect(ww/2, 0, ww/2, wh,2, RGBA(57,47,67,200),RGBA(207,197,220,235));
// Draw Peak
// left peak
var i = -D;
while (i < ww*LM+1) {
var g_leftcolor = ( i>15*D+28 && i < 17*D+32) ? RGB(177,227,127) : (i > 17*D+32 && i <19*D +32 ) ? RGB(240,220,140) : (i > 19*D +32) ? RGB(255,200,247) : RGBA(200,230,230,150) ;
gr.FillSolidRect(i, N-3, D, 4*N, g_leftcolor);
i = i +D+7;
}
// right peak
var k = -D;
while (k < ww*RM+1) {
var g_rightcolor = ( k>15*D+28 && k < 17*D+32) ? RGB(177,227,127) : (k > 17*D+32 && k <19*D +32 ) ? RGB(240,220,140) : (k > 19*D +32) ? RGB(255,200,247) : RGBA(200,230,230,150) ;
gr.FillSolidRect(k, 7*N+3, D, 4*N, g_rightcolor);
k = k +D+7;
}
// left level
gr.FillGradRect(0, 0, ww*L, 6*N-5, 0, RGBA(190,175,225,227), RGBA(20,16,26,150), 1);
gr.FillSolidRect(ww*L-3, 0, 2, 6*N-5, RGB(60,40,80));
// right level
gr.FillGradRect(-3, 6*N+5, ww*R, 6*N-5, 0,RGBA(210,195,245,227), RGBA(20,16,26,150), 1);
gr.FillSolidRect(ww*R-3, 6*N+5, 2, 6*N-5, RGB(60,40,80));
}
Для работы необходим компонент