Module:Infobox interval: Difference between revisions

Plumtree (talk | contribs)
m 2px separator added between audio buttons
Plumtree (talk | contribs)
m Timbre selectors test
Line 334: Line 334:
-- is it within hearing range?
-- is it within hearing range?
if hz >= 20 and hz <= 20000 then
if hz >= 20 and hz <= 20000 then
-- TODO: better ids
local html_id = 'interval_' .. math.random(0, 100000)
table.insert(infobox_data, {
table.insert(infobox_data, {
'<div style="display: flex;">'
'<div style="display: flex;"><div style="width: 270px; text-align: center;">'
..
..
frame:expandTemplate{
frame:expandTemplate{
title = 'User:Plumtree/Interval Sound',
title = 'User:Plumtree/Interval Sound',
args = { Frequency=tostring(hz), Timbre='violin', Right='yes', Width='135', Label='Harmonics' }
args = { Frequency=tostring(hz), Center='true', Label='Audio demonstration', Attributes='id="' .. html_id .. '"' }
}
}
..
..
'<div style="width: 2px;"></div>'
'<div class="sequence-audio-timbre-selector" data-target="' .. html_id .. '" data-key="interval-audio" data-default="semisine"></div>'
..
..
frame:expandTemplate{
'</div></div>'
title = 'User:Plumtree/Interval Sound',
args = { Frequency=tostring(hz), Timbre='semisine', Left='yes', Width='135', Label='Clear audio' }
}
..
'</div>'
})
})
end
end