<!DOCTYPE html>
<html lang=»es»>
<head>
  <meta charset=»UTF-8″>
  <title>Cuestionario de Personalidad Comprador</title>
  <style>
    body { font-family: Arial, sans-serif; background: #111; color: #ffe2a0; margin:0; }
    .container { max-width: 500px; margin: 40px auto; background: #222; padding: 30px 30px 16px 30px; border-radius:15px; }
    h1 { color: #fff6dd; text-align:center; }
    .question { font-size: 1.25em; margin-bottom: 25px; color: #fff; }
    .options { margin-bottom: 30px; }
    .options label { display:block; margin:8px 0; cursor:pointer; }
    .btn { background: #f8aa42; color: #222; border: none; padding: 12px 25px; border-radius: 7px; font-size:1em; cursor:pointer; }
    .btn:disabled { background: #444; }
    .result { background: #ffe2a0; color: #222; border-radius:8px; padding:18px; margin-top:28px; font-size:1.15em; }
  </style>
</head>
<body>
<div class=»container»>
  <h1>¿Cuál es tu estilo de comprador?</h1>
  <div id=»quiz»>
    <!– Pregunta y opciones aparecerán aquí –>
  </div>
  <div id=»result» class=»result» style=»display:none»></div>
</div>
<script>
const questions = [
  {
    text: «¿Por qué te interesa aprender publicidad digital ahora?»,
    options: [
      {text: «Para mejorar mis resultados lo antes posible», type: «impulsivo»},
      {text: «Quiero prepararme bien, pensando en el futuro», type: «racional»},
      {text: «Porque todos los negocios lo usan y no quiero quedarme atrás», type: «oportunista»}
    ]
  },
  {
    text: «¿Cómo decides inscribirte en un curso?»,
    options: [
      {text: «Investigo a fondo, comparo y decido», type: «racional»},
      {text: «Me inscribo rápido si siento que encaja conmigo», type: «impulsivo»},
      {text: «Si hay oferta especial, ¡aprovecho!», type: «oportunista»}
    ]
  },
  {
    text: «¿Cómo prefieres resolver dudas técnicas?»,
    options: [
      {text: «Prefiero buscar y resolver solo», type: «independiente»},
      {text: «Pregunto en grupo y aprovecho networking», type: «social»},
      {text: «Espero soporte directo y personalizado», type: «reservado»}
    ]
  },
  {
    text: «¿Qué te motiva más al aprender?»,
    options: [
      {text: «Probar cosas nuevas y experimentar», type: «innovador»},
      {text: «Dominar métodos antes de avanzar», type: «cauteloso»},
      {text: «Que sea rápido y práctico», type: «impulsivo»}
    ]
  }
];

let current = 0;
let counts = {};

function showQuestion(idx) {
  const q = questions[idx];
  let html = `<div class=»question»>${q.text}</div><form class=»options»>`;
  q.options.forEach((opt,i)=>{
    html += `<label><input type=»radio» name=»option» value=»${opt.type}»> ${opt.text}</label>`;
  });
  html += `</form><button class=»btn» onclick=»nextQuestion()» id=»nextBtn» disabled>Siguiente</button>`;
  document.getElementById(‘quiz’).innerHTML = html;

  document.querySelectorAll(‘input[name=option]’).forEach(el=>{
    el.addEventListener(‘change’, ()=>{
      document.getElementById(‘nextBtn’).disabled = false;
    });
  });
}

function nextQuestion() {
  const selected = document.querySelector(‘input[name=option]:checked’);
  if (!selected) return;
  counts[selected.value] = (counts[selected.value]||0) +1;
  current++;
  if(current<questions.length) showQuestion(current);
  else showResult();
}

function showResult() {
  let types = Object.keys(counts);
  let max = 0, finalType = «»;
  types.forEach(t=>{
    if(counts[t]>max) { max=counts[t]; finalType=t;}
  });

  let style=»»;
  switch(finalType) {
    case «impulsivo»: style=»¡Eres un comprador impulsivo! Aprendes rápido, decides por oportunidad y buscas resultados inmediatos.»;
      break;
    case «racional»: style=»¡Eres un comprador racional! Analizas, comparas y valoras la información y los resultados antes de invertir.»;
      break;
    case «oportunista»: style=»¡Eres un comprador oportunista! Actúas cuando hay promociones y disfrutas detectar ventajas rápidas.»;
      break;
    case «independiente»: style=»Prefieres autonomía, investigando y resolviendo por ti mismo.»;
      break;
    case «social»: style=»Aprendes mejor en grupo y aprecias el intercambio de ideas.»;
      break;
    case «reservado»: style=»Valoras la atención personalizada y una guía cercana.»;
      break;
    case «innovador»: style=»Te motiva experimentar y aplicar soluciones nuevas y creativas.»;
      break;
    case «cauteloso»: style=»Prefieres seguridad y dominar los métodos antes de lanzarte.»;
      break;
    default: style=»Tu estilo combina varios perfiles. ¡Aprovecha tu forma única de aprender y comprar!»;
  }

  document.getElementById(‘quiz’).style.display=’none’;
  document.getElementById(‘result’).style.display=’block’;
  document.getElementById(‘result’).innerHTML = style;
}

showQuestion(current);
</script>
</body>
</html>

Tendencias