« Modèle:Button/doc » : différence entre les versions
De Nefald
Autres actions
Aucun résumé des modifications Balise : Révoqué |
Annulation des modifications 4038 de Hiob (discussion) Balise : Annulation |
||
| Ligne 1 : | Ligne 1 : | ||
== Utilisation == | == Utilisation == | ||
Ce modèle crée un bouton cliquable stylisé avec icône/logo pointant vers n'importe quelle destination (réseaux sociaux, services externes, pages internes, plateformes de téléchargement, etc.) | Ce modèle crée un bouton cliquable stylisé avec icône/logo pointant vers n'importe quelle destination (réseaux sociaux, services externes, pages internes, plateformes de téléchargement, etc.). | ||
=== Syntaxe === | === Syntaxe === | ||
| Ligne 7 : | Ligne 8 : | ||
<syntaxhighlight lang="mediawiki"> | <syntaxhighlight lang="mediawiki"> | ||
{{ButtonLink | {{ButtonLink | ||
|link | |link = URL du lien | ||
|image = Nom du fichier image (avec extension) | |||
|align = Alignement du bouton : left, right, center | |||
|image | |text = Texte affiché (optionnel) | ||
|color = Nom de couleur prédéfinie (optionnel) | |||
|align | |bg = Couleur d'arrière-plan personnalisée (optionnel, remplace color) | ||
| | |size = Taille de l'image (défaut : x40px) | ||
| | |title = Texte du titre au survol (défaut : valeur de text) | ||
| | |alt = Texte alternatif (défaut : valeur de text) | ||
| | |||
|alt | |||
}} | }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 28 : | Ligne 27 : | ||
| '''link''' || URL complète ou relative || Oui || - | | '''link''' || URL complète ou relative || Oui || - | ||
|- | |- | ||
| '''image''' || Nom du fichier image (ex : "Discord-Logo-White.svg") || Non || - | |||
| '''image''' || Nom du fichier image | |||
|- | |- | ||
| ''' | | '''align''' || Alignement du bouton sur la page || Non || (vide) | ||
|- | |- | ||
| ''' | | '''text''' || Texte affiché sous le logo || Non || (vide) | ||
|- | |- | ||
| ''' | | '''color''' || Nom de couleur prédéfinie || Non || gray | ||
|- | |- | ||
| ''' | | '''bg''' || Couleur d'arrière-plan personnalisée (hex, rgb, nom) || Non || (utilise color ou défaut) | ||
|- | |- | ||
| ''' | | '''size''' || Taille de l'image (format MediaWiki) || Non || x40px | ||
|- | |- | ||
| ''' | | '''title''' || Texte du titre HTML (infobulle au survol) || Non || valeur de '''text''' | ||
|- | |- | ||
| '''alt''' || Texte alternatif pour l'accessibilité || Non || valeur de '''text''' | | '''alt''' || Texte alternatif pour l'accessibilité || Non || valeur de '''text''' | ||
| Ligne 51 : | Ligne 46 : | ||
{{Bandeau|type=astuce | {{Bandeau|type=astuce | ||
| | | | ||
* | * Lorsque '''color''' est spécifié, le logo du site choisi sera affiché. | ||
* ''' | * Si '''color''' et '''bg''' sont tous deux spécifiés, '''bg''' est prioritaire.}} | ||
}} | |||
== | == Couleurs prédéfinies == | ||
=== Réseaux sociaux === | === Réseaux sociaux === | ||
| Ligne 64 : | Ligne 56 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>discord</code> || Discord || | | <code>discord</code> || Discord || violet (#5865f2) || {{ButtonLink|link=https://wiki.nefald.fr/|color=discord}} | ||
|- | |- | ||
| <code>twitter</code> || Twitter/X || Bleu (#1da1f2) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>twitter</code> || Twitter/X || Bleu (#1da1f2) || {{ButtonLink|link=https://wiki.nefald.fr/|color=twitter}} | ||
|- | |- | ||
| <code>youtube</code> || YouTube || Rouge (#ff0000) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>youtube</code> || YouTube || Rouge (#ff0000) || {{ButtonLink|link=https://wiki.nefald.fr/|color=youtube}} | ||
|- | |- | ||
| <code>twitch</code> || Twitch || Violet (#9146ff) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>twitch</code> || Twitch || Violet (#9146ff) || {{ButtonLink|link=https://wiki.nefald.fr/|color=twitch}} | ||
|- | |- | ||
| <code>reddit</code> || Reddit || Orange (#ff4500) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>reddit</code> || Reddit || Orange (#ff4500) || {{ButtonLink|link=https://wiki.nefald.fr/|color=reddit}} | ||
|- | |- | ||
| <code>mastodon</code> || Mastodon || Violet (#6364ff) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>mastodon</code> || Mastodon || Violet (#6364ff) || {{ButtonLink|link=https://wiki.nefald.fr/|color=mastodon}} | ||
|- | |- | ||
| <code>bluesky</code> || Bluesky || Bleu (#0085ff) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>bluesky</code> || Bluesky || Bleu (#0085ff) || {{ButtonLink|link=https://wiki.nefald.fr/|color=bluesky}} | ||
|- | |- | ||
| <code>linkedin</code> || LinkedIn || Bleu (#0077b5) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>linkedin</code> || LinkedIn || Bleu (#0077b5) || {{ButtonLink|link=https://wiki.nefald.fr/|color=linkedin}} | ||
|- | |- | ||
| <code>facebook</code> || Facebook || Bleu (#1877f2) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>facebook</code> || Facebook || Bleu (#1877f2) || {{ButtonLink|link=https://wiki.nefald.fr/|color=facebook}} | ||
|- | |- | ||
| <code>instagram</code> || Instagram || Dégradé || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>instagram</code> || Instagram || Dégradé || {{ButtonLink|link=https://wiki.nefald.fr/|color=instagram}} | ||
|- | |- | ||
| <code>tiktok</code> || TikTok || Noir (#000000) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>tiktok</code> || TikTok || Noir (#000000) || {{ButtonLink|link=https://wiki.nefald.fr/|color=tiktok}} | ||
|- | |- | ||
| <code>snapchat</code> || Snapchat || Jaune (#fffc00) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>snapchat</code> || Snapchat || Jaune (#fffc00) || {{ButtonLink|link=https://wiki.nefald.fr/|color=snapchat}} | ||
|- | |- | ||
| <code>threads</code> || Threads || Noir (#000000) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>threads</code> || Threads || Noir (#000000) || {{ButtonLink|link=https://wiki.nefald.fr/|color=threads}} | ||
|} | |} | ||
| Ligne 96 : | Ligne 88 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>stackoverflow</code> || Stack Overflow || Noir (#252627) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>stackoverflow</code> || Stack Overflow || Noir (#252627) || {{ButtonLink|link=https://wiki.nefald.fr/|color=stackoverflow}} | ||
|- | |- | ||
| <code>npm</code> || npm || Rouge (#cb3837) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>npm</code> || npm || Rouge (#cb3837) || {{ButtonLink|link=https://wiki.nefald.fr/|color=npm}} | ||
|- | |- | ||
| <code>pypi</code> || PyPI || Bleu (#3775a9) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>pypi</code> || PyPI || Bleu (#3775a9) || {{ButtonLink|link=https://wiki.nefald.fr/|color=pypi}} | ||
|- | |- | ||
| <code>docker</code> || Docker || Bleu (#2496ed) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>docker</code> || Docker || Bleu (#2496ed) || {{ButtonLink|link=https://wiki.nefald.fr/|color=docker}} | ||
|- | |- | ||
| <code>kubernetes</code> || Kubernetes || Bleu (#326ce5) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>kubernetes</code> || Kubernetes || Bleu (#326ce5) || {{ButtonLink|link=https://wiki.nefald.fr/|color=kubernetes}} | ||
|- | |- | ||
| <code>codepen</code> || CodePen || Blanc (#ffffff) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>codepen</code> || CodePen || Blanc (#ffffff) || {{ButtonLink|link=https://wiki.nefald.fr/|color=codepen}} | ||
|- | |- | ||
| <code>gitlab</code> || GitLab || Orange (#fc6f23) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>gitlab</code> || GitLab || Orange (#fc6f23) || {{ButtonLink|link=https://wiki.nefald.fr/|color=gitlab}} | ||
|- | |- | ||
| <code>github</code> || GitHub || Sombre (#24292e) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>github</code> || GitHub || Sombre (#24292e) || {{ButtonLink|link=https://wiki.nefald.fr/|color=github}} | ||
|} | |} | ||
| Ligne 118 : | Ligne 110 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>buymeacoffee</code> || Buy Me a Coffee || Jaune (#ffdd00) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>buymeacoffee</code> || Buy Me a Coffee || Jaune (#ffdd00) || {{ButtonLink|link=https://wiki.nefald.fr/|color=buymeacoffee}} | ||
|- | |- | ||
| <code>helloasso</code> || HelloAsso || Violet (#4C40CF) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>helloasso</code> || HelloAsso || Violet (#4C40CF) || {{ButtonLink|link=https://wiki.nefald.fr/|color=helloasso}} | ||
|- | |- | ||
| <code>kofi</code> || Ko-fi || Rouge (#ff5e5b) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>kofi</code> || Ko-fi || Rouge (#ff5e5b) || {{ButtonLink|link=https://wiki.nefald.fr/|color=kofi}} | ||
|- | |- | ||
| <code>liberapay</code> || Liberapay || Jaune (#f6c915) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>liberapay</code> || Liberapay || Jaune (#f6c915) || {{ButtonLink|link=https://wiki.nefald.fr/|color=liberapay}} | ||
|- | |- | ||
| <code>opencollective</code> || Open Collective || Bleu (#7fadf2) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>opencollective</code> || Open Collective || Bleu (#7fadf2) || {{ButtonLink|link=https://wiki.nefald.fr/|color=opencollective}} | ||
|- | |- | ||
| <code>patreon</code> || Patreon || Rouge (#ff424d) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>patreon</code> || Patreon || Rouge (#ff424d) || {{ButtonLink|link=https://wiki.nefald.fr/|color=patreon}} | ||
|- | |- | ||
| <code>stripe</code> || Stripe || Violet (#635BFF) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>stripe</code> || Stripe || Violet (#635BFF) || {{ButtonLink|link=https://wiki.nefald.fr/|color=stripe}} | ||
|} | |} | ||
| Ligne 138 : | Ligne 130 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>modrinth</code> || Modrinth || Vert (#1bd96a) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>modrinth</code> || Modrinth || Vert (#1bd96a) || {{ButtonLink|link=https://wiki.nefald.fr/|color=modrinth}} | ||
|- | |- | ||
| <code>curseforge</code> || CurseForge || Orange (#f16436) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>curseforge</code> || CurseForge || Orange (#f16436) || {{ButtonLink|link=https://wiki.nefald.fr/|color=curseforge}} | ||
|- | |- | ||
| <code>hangar</code> || Hangar || Bleu (#0d6efd) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>hangar</code> || Hangar || Bleu (#0d6efd) || {{ButtonLink|link=https://wiki.nefald.fr/|color=hangar}} | ||
|- | |- | ||
| <code>spigotmc</code> / <code>spigot</code> || SpigotMC || Jaune (#f7c03e) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>spigotmc</code> / <code>spigot</code> || SpigotMC || Jaune (#f7c03e) || {{ButtonLink|link=https://wiki.nefald.fr/|color=spigot}} | ||
|- | |- | ||
| <code>bukkit</code> || Bukkit || Orange (#f89a1e) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>bukkit</code> || Bukkit || Orange (#f89a1e) || {{ButtonLink|link=https://wiki.nefald.fr/|color=bukkit}} | ||
|- | |- | ||
| <code>paper</code> || PaperMC || Bleu (#1a8cff) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>paper</code> / <code>paper</code> || PaperMC || Bleu (#1a8cff) || {{ButtonLink|link=https://wiki.nefald.fr/|color=paper}} | ||
|- | |- | ||
| <code>purpur</code> || Purpur || Violet (#a855f7) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>purpur</code> || Purpur || Violet (#a855f7) || {{ButtonLink|link=https://wiki.nefald.fr/|color=purpur}} | ||
|- | |- | ||
| <code>polymart</code> || Polymart || Rose (#ec4899) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>polymart</code> || Polymart || Rose (#ec4899) || {{ButtonLink|link=https://wiki.nefald.fr/|color=polymart}} | ||
|- | |- | ||
| <code>github-releases</code> || GitHub Releases || Vert (#238636) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>github-releases</code> || GitHub Releases || Vert (#238636) || {{ButtonLink|link=https://wiki.nefald.fr/|color=github-releases}} | ||
|- | |- | ||
| <code>jenkins</code> || Jenkins || Rouge (#d24939) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>jenkins</code> || Jenkins || Rouge (#d24939) || {{ButtonLink|link=https://wiki.nefald.fr/|color=jenkins}} | ||
|- | |- | ||
| <code>maven</code> || Maven || Rouge (#c71a36) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>maven</code> || Maven || Rouge (#c71a36) || {{ButtonLink|link=https://wiki.nefald.fr/|color=maven}} | ||
|} | |} | ||
| Ligne 166 : | Ligne 158 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>minecraft</code> || Minecraft || Vert (#62b47a) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>minecraft</code> || Minecraft || Vert (#62b47a) || {{ButtonLink|link=https://wiki.nefald.fr/|color=minecraft}} | ||
|- | |- | ||
| <code>forge</code> || Forge || Bleu foncé (#1e2c42) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>forge</code> || Forge || Bleu foncé (#1e2c42) || {{ButtonLink|link=https://wiki.nefald.fr/|color=forge}} | ||
|- | |- | ||
| <code>fabric</code> || Fabric || Beige (#dbd3c8) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>fabric</code> || Fabric || Beige (#dbd3c8) || {{ButtonLink|link=https://wiki.nefald.fr/|color=fabric}} | ||
|- | |- | ||
| <code>quilt</code> || Quilt || Violet (#8b5cf6) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>quilt</code> || Quilt || Violet (#8b5cf6) || {{ButtonLink|link=https://wiki.nefald.fr/|color=quilt}} | ||
|- | |- | ||
| <code>neoforge</code> || NeoForge || Orange (#ff6b35) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>neoforge</code> || NeoForge || Orange (#ff6b35) || {{ButtonLink|link=https://wiki.nefald.fr/|color=neoforge}} | ||
|} | |} | ||
| Ligne 182 : | Ligne 174 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>velocity</code> || Velocity || Bleu (#3fa9f5) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>velocity</code> || Velocity || Bleu (#3fa9f5) || {{ButtonLink|link=https://wiki.nefald.fr/|color=velocity}} | ||
|- | |- | ||
| <code>waterfall</code> || Waterfall || Bleu (#0088ff) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>waterfall</code> || Waterfall || Bleu (#0088ff) || {{ButtonLink|link=https://wiki.nefald.fr/|color=waterfall}} | ||
|- | |- | ||
| <code>bungeecord</code> || BungeeCord || Jaune (#ffcc00) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>bungeecord</code> || BungeeCord || Jaune (#ffcc00) || {{ButtonLink|link=https://wiki.nefald.fr/|color=bungeecord}} | ||
|- | |- | ||
| <code>sponge</code> || Sponge || Jaune (#f7cf0d) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>sponge</code> || Sponge || Jaune (#f7cf0d) || {{ButtonLink|link=https://wiki.nefald.fr/|color=sponge}} | ||
|} | |} | ||
| Ligne 196 : | Ligne 188 : | ||
! Code !! Plateforme !! Couleur !! Exemple | ! Code !! Plateforme !! Couleur !! Exemple | ||
|- | |- | ||
| <code>ftb</code> / <code>feed-the-beast</code> || Feed The Beast || Violet (#8e44ad) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>ftb</code> / <code>feed-the-beast</code> || Feed The Beast || Violet (#8e44ad) || {{ButtonLink|link=https://wiki.nefald.fr/|color=ftb}} | ||
|- | |- | ||
| <code>technic</code> || Technic Pack || Rouge (#e74c3c) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>technic</code> || Technic Pack || Rouge (#e74c3c) || {{ButtonLink|link=https://wiki.nefald.fr/|color=technic}} | ||
|- | |- | ||
| <code>atlauncher</code> || ATLauncher || Bleu (#3498db) || {{ButtonLink|link=https://wiki.nefald.fr/| | | <code>atlauncher</code> || ATLauncher || Bleu (#3498db) || {{ButtonLink|link=https://wiki.nefald.fr/|color=atlauncher}} | ||
|} | |} | ||
| Ligne 241 : | Ligne 233 : | ||
== Exemples == | == Exemples == | ||
=== Usage basique | === Usage basique === | ||
<pre> | <pre> | ||
{{ButtonLink | {{ButtonLink | ||
|link = https://nfald.fr/discord | |link = https://nfald.fr/discord | ||
|text = Rejoignez notre | |text = Rejoignez notre communauté | ||
| | |color = discord | ||
}} | }} | ||
</pre> | </pre> | ||
{{ButtonLink | {{ButtonLink | ||
|link = https://nfald.fr/discord | |link = https://nfald.fr/discord | ||
|text = Rejoignez notre Discord | |text = Rejoignez notre Discord | ||
| | |color = discord | ||
}} | }} | ||
| Ligne 261 : | Ligne 253 : | ||
<pre> | <pre> | ||
{{ButtonLink | {{ButtonLink | ||
|link = https://github.com/nefald | |link = https://github.com/nefald | ||
| | |color = github | ||
}} | }} | ||
</pre> | </pre> | ||
{{ButtonLink | {{ButtonLink | ||
|link | |link = https://github.com/nefald | ||
| | |color = github | ||
}} | }} | ||
=== | === Couleur personnalisée === | ||
<pre> | <pre> | ||
{{ButtonLink | {{ButtonLink | ||
|link | |link = https://exemple.fr | ||
|image = Custom-Logo.svg | |||
|image | |text = Bouton personnalisé | ||
| | |bg = linear-gradient(135deg, #667eea 0%, #764ba2 100%) | ||
| | |||
}} | }} | ||
</pre> | </pre> | ||
=== Boutons d'actions === | === Boutons d'actions === | ||
| Ligne 329 : | Ligne 281 : | ||
<div class="button-link-grid"> | <div class="button-link-grid"> | ||
{{ButtonLink | {{ButtonLink | ||
|link = /wiki/Spécial:Téléverser | |link = /wiki/Spécial:Téléverser | ||
|text = Téléverser un fichier | |image = Upload-Icon.svg | ||
| | |text = Téléverser un fichier | ||
|color = primary | |||
}} | }} | ||
{{ButtonLink | {{ButtonLink | ||
|link = /wiki/Spécial:Modifications_récentes | |link = /wiki/Spécial:Modifications_récentes | ||
|text = Modifications récentes | |image = Recent-Changes-Icon.svg | ||
| | |text = Modifications récentes | ||
|color = info | |||
}} | }} | ||
{{ButtonLink | {{ButtonLink | ||
|link = /wiki/Spécial:Pages_demandées | |link = /wiki/Spécial:Pages_demandées | ||
|text = Pages demandées | |image = Wanted-Pages-Icon.svg | ||
| | |text = Pages demandées | ||
|color = warning | |||
}} | }} | ||
</div> | </div> | ||
| Ligne 349 : | Ligne 304 : | ||
* Utilise [[mw:Extension:TemplateStyles|TemplateStyles]] pour un CSS isolé | * Utilise [[mw:Extension:TemplateStyles|TemplateStyles]] pour un CSS isolé | ||
* Entièrement responsive (adapté mobile) | * Entièrement responsive (adapté mobile) | ||
* Accessible (supporte les attributs alt) | * Accessible (supporte les attributs alt et title) | ||
* Supporte les liens externes | * Supporte les liens externes | ||
* Aucun JavaScript requis | * Aucun JavaScript requis | ||
* Compatible tous navigateurs modernes | * Compatible tous navigateurs modernes | ||
* Les icônes de lien externe sont automatiquement masquées | |||
== Voir aussi == | == Voir aussi == | ||