Prompts images

Author: Gerald Vernay — · Updated:

Short summary: Ce contenu explique comment utiliser une image de référence pour générer des portraits ultra-réalistes via ChatGPT, en préservant tous les détails identitaires du sujet. Les instructions incluent des spécifications sur les angles de prise de vue, l'éclairage et les expressions faciales, sans stylisation ni altération des caractéristiques.

Quick overview

Site
Le Labo des CIP
Canonical URL
https://lelabodescip.fr/prompts-images/
LLM HTML version
https://lelabodescip.fr/prompts-images/llm
LLM JSON version
https://lelabodescip.fr/prompts-images/llm.json
Manifest
https://lelabodescip.fr/llm-endpoints-manifest.json
Estimated reading time
2 minutes (67 seconds)
Word count
223

Key points

Primary visual

Prompts images
Main illustration associated with the content.

Structured content

🧪 Outil exclusif pour les adhérents payants du Labo

🧪 Outil exclusif pour les adhérents payants du Labo

Une image te plaît ? Cliques sur prompt. Copie le prompt, colle-le dans ChatGPT avec ta photo… et laisse la magie opérer (sans baguette).

Des dizaines de modèles et des nouveaux chaque semaine.

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

.cptc-wrap{ margin:.6rem 0 1.4rem; display:flex; justify-content:center; /* bouton centré */ } .cptc-btn{ font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; /* texte en gras */ font-size: 14px; padding: .75rem 1.2rem; border-radius: 12px; border: 1.5px solid #39FF14; /* vert fluo Labo */ background: #000000; /* fond noir */ color: #ffffff; /* texte blanc */ cursor: pointer; width: 300%; /* 3 fois plus large */ max-width: 640px; /* limite raisonnable */ text-align: center; box-shadow: 0 0 0 rgba(57,255,20,0); transition: all .18s ease; } .cptc-btn:active{ transform: translateY(1px) scale(0.98); } .cptc-btn.is-done{ background:#39FF14; /* feedback visuel copié */ color:#000000; box-shadow:0 0 14px rgba(57,255,20,.7); opacity:1; } /* Option discrète : bouton visible au survol du paragraphe (si adjacent) */ .cptc-para + .cptc-wrap{opacity:0;height:0;overflow:hidden;transition:opacity .15s ease;} .cptc-para:hover + .cptc-wrap, .cptc-para:focus-within + .cptc-wrap{opacity:1;height:auto;overflow:visible;} <!-- Exemple d’usage :

Votre paragraphe à copier…

[COLLEZ ICI LE BLOC CI-DESSOUS] -->
(function(){ 'use strict'; function toast(btn, msg){ var old = btn.textContent; btn.textContent = msg; btn.classList.add('is-done'); setTimeout(function(){ btn.textContent = old; btn.classList.remove('is-done'); }, 1100); } async function copyText(text){ // Essayez d’abord l’API moderne try { await navigator.clipboard.writeText(text); return true; } catch(e) { // Fallback try { var ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); return true; } catch(err){ return false; } } } // Initialise tous les boutons du document (au cas où vous collez plusieurs blocs) document.querySelectorAll('.cptc-wrap .cptc-btn').forEach(function(btn){ if (btn.dataset.cptcBound === '1') return; btn.dataset.cptcBound = '1'; btn.addEventListener('click', async function(){ // Le paragraphe à copier : le "p" le plus proche juste avant le bouton. // 1) Si le paragraphe a la classe .cptc-para (recommandé) // 2) Sinon, on remonte au paragraphe précédent dans le DOM var wrap = btn.closest('.cptc-wrap'); var prev = wrap ? wrap.previousElementSibling : null; var para = null; if (prev && prev.matches && prev.matches('p.cptc-para')) { para = prev; } else { // fallback : cherche le dernier

avant le wrap var el = wrap; while (el && el.previousElementSibling) { el = el.previousElementSibling; if (el.tagName && el.tagName.toLowerCase() === 'p') { para = el; break; } } } var text = (para ? (para.innerText || para.textContent) : '').trim(); if (!text){ toast(btn, 'Rien à copier 😅'); return; } var ok = await copyText(text); toast(btn, ok ? 'Copié ✅' : 'Erreur ❌'); }); }); })();

Topics and keywords

Themes: CIP, Labonautes

Keywords: labonautes

License & attribution

License: CC BY-ND 4.0.

Attribution required: yes.

Manifest: https://lelabodescip.fr/llm-endpoints-manifest.json

LLM Endpoints plugin version 1.1.2.