« Module:Infobox/Configs/Membre » : différence entre les versions
De Nefald
Autres actions
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 24 : | Ligne 24 : | ||
titre = 'Informations Générales', | titre = 'Informations Générales', | ||
champs = { | champs = { | ||
{ | |||
cle = 'discord', | cle = 'discord', | ||
label = 'Discord', | label = 'Discord', | ||
process = function(value, args) | process = function(value, args, frame) | ||
if not value or value == '' then | if not value or value == '' then | ||
return nil | return nil | ||
end | end | ||
return | |||
-- Créer un lien Discord masqué et flouté | |||
local discordLink = 'https://discord.com/users/' .. mw.text.encode(value) | |||
-- HTML avec blur et protection anti-bot | |||
local html = mw.html.create('span') | |||
:addClass('discord-masked') | |||
:css({ | |||
['filter'] = 'blur(5px)', | |||
['transition'] = 'filter 0.3s ease', | |||
['cursor'] = 'pointer', | |||
['user-select'] = 'none' | |||
}) | |||
:attr('data-discord', value) | |||
:wikitext('[' .. discordLink .. ' ' .. value .. ']') | |||
-- Ajouter le CSS au MediaWiki:Common.css | |||
local style = mw.html.create('style') | |||
:wikitext([[ | |||
.discord-masked:hover { | |||
filter: blur(0px) !important; | |||
} | |||
.discord-masked::before { | |||
content: attr(data-discord); | |||
position: absolute; | |||
opacity: 0; | |||
pointer-events: none; | |||
} | |||
]]) | |||
return tostring(style) .. tostring(html) | |||
end | end | ||
}, | }, | ||
{ | { | ||
cle = 'role', | cle = 'role', |