Simulateur iPhone 15 intelligent

body {
font-family: Arial, sans-serif;
background: #111;
color: white;
padding: 20px;
}

h1 {
color: #00e6b8;
}

h2 {
margin-top: 30px;
}

.section {
margin-bottom: 20px;
}

button {
margin: 5px;
padding: 10px 14px;
border: none;
border-radius: 8px;
background: #222;
color: white;
cursor: pointer;
transition: 0.2s;
}

button:hover {
background: #00e6b8;
color: black;
}

.selected {
background: #00e6b8 !important;
color: black !important;
font-weight: bold;
}

.desc {
font-size: 13px;
color: #aaa;
margin-bottom: 8px;
margin-left: 6px;
}

.total {
font-size: 32px;
color: #00e6b8;
}

#details {
margin-top: 20px;
line-height: 1.8;
}

#offerBox {
margin-top: 20px;
padding: 15px;
border-radius: 10px;
background: #1c1c1c;
border: 1px solid #333;
}

.offer-title {
color: #00e6b8;
font-weight: bold;
margin-bottom: 8px;
}

Simulateur iPhone 15 intelligent

Batterie

Aucune réparation

Version originale du fabricant

Excellent rapport qualité/prix

Qualité supérieure

Version la plus abordable

Écran

Aucune réparation

Version originale du fabricant

Excellent rapport qualité/prix

Qualité supérieure

Version la plus abordable

Back

Aucune réparation

Version originale du fabricant

Excellent rapport qualité/prix

Qualité supérieure

Version la plus abordable

Main d’oeuvre

Service auto : 0$

Total: 0$

Batterie : Ne pas changer
Écran : Ne pas changer
Back : Ne pas changer
Service : 0$
Offre intelligente
Sélectionne une ou plusieurs réparations pour voir une offre intelligente.

let prices = { batterie:0, ecran:0, back:0, service:0 };
let labels = {
batterie: »Ne pas changer »,
ecran: »Ne pas changer »,
back: »Ne pas changer »,
service: »0$ »
};
let selectedTypes = { batterie: »NONE », ecran: »NONE », back: »NONE » };

function setPrice(category,value,label,type,button){
let section = document.getElementById(« section-« +category);
let buttons = section.querySelectorAll(« button »);

buttons.forEach(btn=>btn.classList.remove(« selected »));
button.classList.add(« selected »);

prices[category]=value;
labels[category]=label;
selectedTypes[category]=type;

updateService();
updateTotal();
updateOffer();
}

function getSelectedCount(){
let c=0;
if(selectedTypes.batterie!== »NONE »)c++;
if(selectedTypes.ecran!== »NONE »)c++;
if(selectedTypes.back!== »NONE »)c++;
return c;
}

function batterieService(t){
if(t=== »OEM »)return 95;
if(t=== »PULL_A »)return 85;
if(t=== »AFTERMARKET »)return 85;
if(t=== »BASIC »)return 75;
return 0;
}
function ecranService(t){
if(t=== »OEM »)return 110;
if(t=== »PULL_A »)return 100;
if(t=== »AFTERMARKET »)return 90;
if(t=== »LCD »)return 80;
return 0;
}
function backService(t){
if(t=== »OEM »)return 140;
if(t=== »PULL_A »)return 120;
if(t=== »AFTERMARKET »)return 110;
if(t=== »OTHER_COLOR »)return 95;
return 0;
}

function updateService(){
let count=getSelectedCount();
let raw=batterieService(selectedTypes.batterie)+ecranService(selectedTypes.ecran)+backService(selectedTypes.back);

let final=0;
if(count===1)final=raw;
if(count===2)final=raw-25;
if(count===3)final=raw-55;

if(final<0)final=0;

prices.service=final;
labels.service=final+"$";

document.getElementById("serviceLabel").textContent="Service auto : "+final+"$";
}

function updateTotal(){
let total=prices.batterie+prices.ecran+prices.back+prices.service;
document.getElementById("total").textContent=total;

document.getElementById("details").innerHTML=
"Batterie : "+labels.batterie+"
« +
« Écran : « +labels.ecran+ »
« +
« Back : « +labels.back+ »
« +
« Service : « +labels.service;
}

function updateOffer(){
let c=getSelectedCount();
let txt= »Sélectionne une ou plusieurs réparations pour voir une offre intelligente. »;

if(c===0)txt= »Aucune réparation choisie. »;
if(c===2)txt= »Bundle 2 réparations : rabais de 25$. »;
if(c===3)txt= »Bundle 3 réparations : rabais de 55$. »;

document.getElementById(« offerText »).textContent=txt;
}