const svg = require('./svg.js'); const html = { main: (option, index, tran) => { let videos = ``; videos += html.video(true, option.video.pic, option.screenshot, option.preload, option.video.url); return `
${videos} ${option.logo ? ` ` : ``}
${option.danmaku ? `${tran('Danmaku is loading')}` : ``}
0:00 / 0:00
${option.video.quality ? `
${html.qualityList(option.video.quality)}
` : ``} ${option.screenshot ? ` ${svg('camera')} ` : ``}
${tran('Set danmaku color')}
${tran('Set danmaku type')}
${html.contextmenuList(option.contextmenu, tran)}
`; }, danmakumargin: (margin) => { let result = ''; if (margin) { for (const key in margin) { result += `${key}:${margin[key]};`; } } return result; }, contextmenuList: (contextmenu, tran) => { let result = '
'; for (let i = 0; i < contextmenu.length; i++) { result += `
${tran(contextmenu[i].text)}
`; } result += '
'; return result; }, qualityList: (quality) => { let result = '
'; for (let i = 0; i < quality.length; i++) { result += `
${quality[i].name}
`; } result += '
'; return result; }, video: (current, pic, screenshot, preload, url) => ``, setting: (tran) => ({ 'original': `
${tran('Speed')}
${svg('right')}
${tran('Loop')}
${tran('Show danmaku')}
${tran('Unlimited danmaku')}
${tran('Opacity for danmaku')}
`, 'speed': `
0.5
0.75
${tran('Normal')}
1.25
1.5
2
` }) }; module.exports = html;