Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Song video: Difference between revisions

From Sekaipedia
Content added Content deleted
(created video box without parameters)
 
(alternate way to show youtube)
Line 39: Line 39:
['text-align'] = 'center'
['text-align'] = 'center'
})
})
:wikitext(frame:extensionTag{
:wikitext('<youtube width="320" height="180">BfO7ceHcMW4</youtube>')
title = 'youtube',
args = { width = "320", height= "180" },
content = 'BfO7ceHcMW4'
})
:done()
:done()

Revision as of 04:05, 30 October 2021

Documentation for this module may be created at Module:Song video/doc

local getArgs   = require('Module:Arguments').getArgs


local p = {}

function p.main(frame)
	local args = getArgs(frame)
	
	
	local root = mw.html.create('div')
		:css({
			['display'] = 'inline-block',
			['margin-right'] = '10px',
			['margin-bottom'] = '10px'
		})
	
	local header = root:tag('div')
		:css({
			['border-radius'] = '6px',
			['background-color'] = '#FFA900',
			['font-weight'] = 'bold',
			['text-align'] = 'center',
			['margin-bottom'] = '5px',
			['padding'] = '5px'
		})
		:wikitext('Hard Preview')
		:done()
	
	local body = root:tag('div')
		:css({
			['display'] = 'flex',
			['flex-wrap'] = 'wrap',
			['gap'] = '5px'
		})

	local video = mw.html.create('div')
		:css({
			['flex'] = '1 0 1px',
			['text-align'] = 'center'
		})
		:wikitext(frame:extensionTag{ 
			title = 'youtube',
			args = { width = "320", height= "180" },
			content = 'BfO7ceHcMW4'
		})
		:done()
	
	local infoHeaderCss = {
		['border-radius'] = '6px',
		['background-color'] = '#a7ee75',
		['padding'] = '5px 10px'
	}
	local infoCellCss = {
		['padding'] = '5px'
	}
	
	local info = mw.html.create('div')
		:css({
			['display'] = 'grid',
			['grid-template-columns'] = '1fr 1fr',
			['grid-auto-rows'] = 'min-content',
			['gap'] = '5px'
		})
		:tag('div')
			:css(infoHeaderCss)
			:wikitext('Release Date')
			:done()
		:tag('div')
			:css(infoCellCss)
			:wikitext('2021/08/18')
			:done()
		:tag('div')
			:css(infoHeaderCss)
			:wikitext('Illust')
			:done()
		:tag('div')
			:css(infoCellCss)
			:wikitext('Sidu')
			:done()
		:tag('div')
			:css(infoHeaderCss)
			:wikitext('Movie')
			:done()
		:tag('div')
			:css(infoCellCss)
			:wikitext('Lye')
			:done()
		
	body:node(video)
	body:node(info)
	
	return tostring(root)
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.