Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Style guide
Special
uploadwizard
Languages
Language links are at the top of the page across from the title.
BTA-Mirror
Search
Search
English
Create account
Log in
Personal tools
Dark mode
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Splash
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local splashes = require("Module:Splash/splashes") local charWidths = { ['!'] = 2, ['.'] = 2, [','] = 2, [':'] = 2, ['\''] = 2, ['i'] = 2, -- width 1 characters ['l'] = 3, -- width 2 characters ['I'] = 4, ['t'] = 4, [' '] = 4, -- width 3 characters ['k'] = 5, ['<'] = 5, ['>'] = 5, ['f'] = 5, -- width 4 characters ['A'] = 6, ['B'] = 6, ['C'] = 6, ['D'] = 6, ['E'] = 6, ['F'] = 6, ['G'] = 6, ['H'] = 6, ['J'] = 6, ['K'] = 6, ['L'] = 6, ['M'] = 6, ['N'] = 6, ['O'] = 6, ['P'] = 6, ['Q'] = 6, ['R'] = 6, ['S'] = 6, ['T'] = 6, ['U'] = 6, ['V'] = 6, ['W'] = 6, ['X'] = 6, ['Y'] = 6, ['Z'] = 6, ['a'] = 6, ['b'] = 6, ['c'] = 6, ['d'] = 6, ['e'] = 6, ['g'] = 6, ['h'] = 6, ['j'] = 6, ['m'] = 6, ['n'] = 6, ['o'] = 6, ['p'] = 6, ['q'] = 6, ['r'] = 6, ['s'] = 6, ['u'] = 6, ['v'] = 6, ['w'] = 6, ['x'] = 6, ['y'] = 6, ['z'] = 6, ['0'] = 6, ['1'] = 6, ['2'] = 6, ['3'] = 6, ['4'] = 6, ['5'] = 6, ['6'] = 6, ['7'] = 6, ['8'] = 6, ['9'] = 6, ['='] = 6, ['-'] = 6, ['^'] = 6 } function p.generateSplash( f ) local args = f if f == mw.getCurrentFrame() then args = require( 'Module:ProcessArgs' ).merge( true ) else f = mw.getCurrentFrame() end math.randomseed(os.time()) local randomSplash = "missingno" if args.splash then randomSplash = args.splash elseif os.date("*t", os.time()).month == 1 and os.date("*t", os.time()).day == 19 then randomSplash = "Happy birthday, jonkadelic!" elseif os.date("*t", os.time()).month == 4 and os.date("*t", os.time()).day == 29 then randomSplash = "Happy birthday, MaggAndGeez!" elseif os.date("*t", os.time()).month == 5 and os.date("*t", os.time()).day == 17 then randomSplash = "Happy birthday, Minecraft!" elseif os.date("*t", os.time()).month == 7 and os.date("*t", os.time()).day == 20 then randomSplash = "Happy birthday, Better than Adventure!" elseif os.date("*t", os.time()).month == 12 and os.date("*t", os.time()).day == 24 then randomSplash = "Merry X-mas!" elseif os.date("*t", os.time()).month == 1 and os.date("*t", os.time()).day == 1 then randomSplash = "Happy Halloween!" elseif os.date("*t", os.time()).month == 10 and os.date("*t", os.time()).day == 31 then randomSplash = "Happy New Year!" else randomSplash = splashes.splashes[math.random(#splashes.splashes)] end local splashWidth = 0 for i = 1, #randomSplash do local char = randomSplash:sub(i, i) -- Look up the pixel width of the character in the table local charWidth = charWidths[char] if not charWidth then charWidth = 6 -- Default width end -- Add the pixel width of the character to the total width splashWidth = splashWidth + charWidth end local div = mw.html.create('div') :addClass('splash-text') :attr('id', 'splash-text') :wikitext(randomSplash) :css('font-size', tostring(2880 / (splashWidth + 32)) .. 'px') return div end return p
Summary:
Please note that all contributions to BTA-Mirror may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BTA-Mirror:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Splash/doc
(
edit
)
Toggle limited content width