Files
EverShelf/test.html
T
morgane fc124c87bf
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
Ajouter test.html
2026-06-17 16:57:34 +00:00

66 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>⚡ Sandbox - Test Raccourci EverShelf</title>
<style>
body { font-family: sans-serif; background: #333; color: #fff; padding: 50px; }
.modal-preview { background: #fff; color: #000; padding: 20px; border-radius: 12px; width: 500px; margin: 0 auto; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.button-container { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
/* Styles originaux d'EverShelf simulés */
.btn { padding: 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; flex: 1; margin: 0 5px; text-align: center; text-decoration: none; }
.btn-danger { background-color: #d32f2f; color: white; }
.btn-success { background-color: #2e7d32; color: white; }
.btn-purple { background-color: #7b1fa2; color: white; }
</style>
</head>
<body>
<h2 style="text-align: center;">Zone de Test de l'Injecteur</h2>
<div class="modal-preview">
<h3>Jus ananas</h3>
<p>Emplacement : 🍷 Cave</p>
<p>Quantité : 1 pcs</p>
<div class="button-container">
<button class="btn btn-danger">Utiliser</button>
<button class="btn btn-success">Modifier</button>
<button class="btn btn-purple">Recette</button>
</div>
</div>
<script>
console.log("Page de test initialisée. Le script injecteur va tourner ici sans risque.");
setInterval(() => {
const buttons = document.querySelectorAll('button, .btn');
buttons.forEach(btn => {
// On cherche le bouton "Modifier" vert
if (btn.offsetWidth > 0 && btn.textContent.trim() === 'Modifier' && !btn.parentNode.querySelector('.btn-catalog-shortcut')) {
const container = btn.parentNode;
// Création de notre bouton de test bleu
const testBtn = document.createElement('button');
testBtn.type = 'button';
testBtn.className = 'btn btn-catalog-shortcut';
testBtn.innerText = '✏️ Modifier la fiche';
testBtn.style.cssText = 'background-color: #1976d2; color: white; font-size: 12px;';
// Action de simulation au clic
testBtn.onclick = function() {
alert("Clic réussi ! Dans l'application, ce clic redirigera vers le catalogue.");
};
// Injection
container.insertBefore(testBtn, btn);
console.log("Bouton injecté avec succès dans le bac à sable !");
}
});
}, 1000);
</script>
</body>
</html>