{"id":1,"date":"2024-01-29T21:20:46","date_gmt":"2024-01-29T20:20:46","guid":{"rendered":"https:\/\/cuenti.xyz\/?p=1"},"modified":"2024-01-30T16:45:15","modified_gmt":"2024-01-30T15:45:15","slug":"hola-mundo","status":"publish","type":"post","link":"https:\/\/cuenti.xyz\/index.php\/2024\/01\/29\/hola-mundo\/","title":{"rendered":"\u00a1Hola, mundo!"},"content":{"rendered":"\n<p>Te damos la bienvenida a WordPress. Esta es tu primera entrada. Ed\u00edtala o b\u00f3rrala, \u00a1luego empieza a escribir!<\/p>\n\n\n    <style>\n    .input-cuenti {\n      height: 40px;\n      border-radius: 20px;\n      border: rgb(220, 220, 220);\n      padding: 0px 20px;\n      position: relative;\n      width: 100%;\n    }\n\n    .img-cuenti {\n      display: none;\n    }\n\n    .empty-container {\n      width: 50%;\n      display: none;\n    }\n\n    .right-container {\n      display: flex;\n      flex-direction: column;\n      align-items: left;\n      width: 100%;\n    }\n\n    .btn-submit {\n      min-height: 40px;\n      width: 100%;\n      border-radius: 20px;\n      border: none;\n      color: #003d88;\n      background-color: #f9c626;\n      cursor: pointer;\n      text-align: center;\n    }\n\n    .empty-container-submit {\n      display: none;\n    }\n\n    .title-cuenti {\n      color: #f9c626;\n      font-weight: lighter;\n      text-transform: uppercase;\n      font-size: 25px;\n      margin-top: 0;\n    }\n\n    .text-cuenti {\n      margin: 20px 0px;\n      color: white;\n      font-weight: lighter;\n      font-size: 18px;\n    }\n\n    .icons-cuenti-mail {\n      position: absolute;\n      height: 15px;\n      width: auto;\n      right: 15px;\n      top: 50%;\n      transform: translateY(-50%);\n    }\n\n    .icons-cuenti-person {\n      position: absolute;\n      height: 20px;\n      width: auto;\n      right: 15px;\n      top: 50%;\n      transform: translateY(-50%);\n    }\n\n\n    @media (min-width: 900px) {\n      .img-cuenti {\n        display: block;\n        position: absolute;\n        bottom: 0;\n        left: -50px;\n        height: 350px;\n      }\n\n      .empty-container {\n        width: 50%;\n        display: block;\n      }\n\n      .right-container {\n        width: auto;\n      }\n\n      .btn-submit {\n        width: 30%;\n      }\n\n      .empty-container-submit {\n        display: block;\n        width: 70%;\n      }\n    }\n  <\/style>\n\n  <div style=\"max-width: 1000px; position: relative\" id=\"formcontainer\">\n    <img decoding=\"async\" class=\"img-cuenti\" src=\"https:\/\/cuenti.com\/wp-content\/uploads\/2023\/12\/mockups-web.png\" alt=\"cuenti-boletin\" \/>\n    <div style=\"\n          background: linear-gradient(to right, #001e43, #003d88);\n          border-radius: 20px;\n          padding: 20px;\n          display: flex;\n        \">\n      <div class=\"empty-container\" style=\"width: 50%\"><\/div>\n      <div class=\"right-container\" id=\"containerprincipal\">\n        <div>\n          <h3 class=\"title-cuenti\">\n            \u00danete a la exclusiva comunidad de\n            <span style=\"font-weight: bold\">CUENTI<\/span>\n          <\/h3>\n          <p class=\"text-cuenti\">\n            \u00a1D\u00f3nde la magia de la contabilidad transforma tu empresa y descubre c\u00f3mo mantener tu negocio en perfecto\n            orden y control para potenciar tus ventas! \ud83d\ude80\n          <\/p>\n        <\/div>\n        <div style=\"display: flex; width: 100%; flex-direction: column; gap: 20px\">\n          <div style=\"width: 100%; position: relative; display: flex\">\n            <input class=\"input-cuenti\" type=\"text\" placeholder=\"Ingresa tu nombre\" id=\"nombre\" \/>\n            <img decoding=\"async\" src=\"https:\/\/cuenti.com\/wp-content\/uploads\/2023\/12\/person-icon-04.svg\" alt=\"person-icon\"\n              class=\"icons-cuenti-person\" \/>\n          <\/div>\n          <div style=\"width: 100%; position: relative; display: flex\">\n            <input class=\"input-cuenti\" type=\"text\" placeholder=\"Ingresa tu correo\" id=\"correo\" \/>\n            <img decoding=\"async\" src=\"https:\/\/cuenti.com\/wp-content\/uploads\/2023\/12\/mail-icon-03.svg\" alt=\"mail-icon\"\n              class=\"icons-cuenti-mail\" \/>\n          <\/div>\n\n          <div style=\"display: flex; width: 100%\">\n            <div class=\"empty-container-submit\"><\/div>\n            <button class=\"btn-submit\" type=\"button\" onclick=\"botonclicked()\">Suscribirme<\/button>\n          <\/div>\n        <\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n  \n<script>\n\n  const listNegocioRelacion = [\n    { \"bd\": 2, \"brevo\": 83 },\n    { \"bd\": 3, \"brevo\": 84 },\n    { \"bd\": 4, \"brevo\": 85 },\n    { \"bd\": 5, \"brevo\": 86 },\n    { \"bd\": 6, \"brevo\": 87 },\n    { \"bd\": 7, \"brevo\": 88 },\n    { \"bd\": 8, \"brevo\": 89 },\n    { \"bd\": 9, \"brevo\": 90 },\n    { \"bd\": 10, \"brevo\": 91 },\n    { \"bd\": 11, \"brevo\": 92 },\n  ]\n\n\n  async function botonclicked() {\n\n    let objectToSave = {\n      nombre: \"\",\n      correo: \"\"\n    }\n\n    let nombre = document.getElementById('nombre').value;\n    let correo = document.getElementById('correo').value;\n\n    if (!nombre || !correo) {\n      alert(\"por favor ingrese todos los campos requeridos\");\n      return;\n    }\n\n    if (!ValidateEmail(correo)) {\n      alert(\"Correo ingresado no valido!\");\n      return;\n    }\n\n    let datasaved = localStorage.getItem(\"modalvalue\");\n    if (datasaved) {\n      let modaldata = JSON.parse(datasaved);\n      let nickname = nombre.split(' ')[0];\n      let bodydata = {\n        email: correo,\n        attributes: {\n          NOMBRE: nombre,\n          CODIGO_WHATSAPP: modaldata.calling_code,\n          CIUDAD: modaldata.city,\n          PAIS: modaldata.country,\n          OTRO_TIPO_DE_NEGOCIO: modaldata.reference,\n          NICKNAME: nickname,\n          URL: window.location.pathname\n        }\n      }\n\n      listNegocioRelacion.forEach(item => {\n\n        if (item.bd === parseInt(modaldata.opcion)) {\n          bodydata[\"listIDs\"] = [item.brevo, 28];\n        }\n\n      });\n\n      if (modaldata.opcion === '11') {\n        bodydata.attributes[\"OTRO_TIPO_DE_NEGOCIO\"] = modaldata.otrocomercio;\n      }\n\n      try {\n        const response = await fetch('https:\/\/api-conexion.cuenti.com\/EM\/createContact', {\n          method: 'POST',\n          headers: {\n            'Content-Type': 'application\/json',\n          },\n          body: JSON.stringify(bodydata),\n        });\n\n        if (!response.ok) {\n          throw new Error(`HTTP error! Status: ${response.status}`);\n        }\n\n        const jsonResponse = await response.json();\n        console.log(jsonResponse);\n\n      } catch (error) {\n        console.error('error llamando api crear contacto en brevo:' + error.message);\n      }\n\n      objectToSave.nombre = nombre;\n      objectToSave.correo = correo;\n      localStorage.setItem(\"formvalue\", JSON.stringify(objectToSave));\n\n      let nuevoContenido = \"\u00a1Gracias por suscribirte a nuestro boletin!\";\n      let miDiv = document.getElementById(\"containerprincipal\");\n      let miDiv2 = document.getElementById(\"formcontainer\");\n      let imagen = miDiv2.getElementsByTagName(\"img\")[0];\n      if (imagen) {\n        miDiv2.removeChild(imagen);\n      }\n\n      let nuevoParrafo = document.createElement(\"p\");\n      nuevoParrafo.innerHTML = nuevoContenido;\n\n      nuevoParrafo.classList.add(\"title-cuenti\");\n\n      miDiv.innerHTML = \"\";\n      miDiv.appendChild(nuevoParrafo);\n\n    } else {\n\n      objectToSave.nombre = nombre;\n      objectToSave.correo = correo;\n      localStorage.setItem(\"formvalue\", JSON.stringify(objectToSave));\n\n    }\n\n  }\n  function ValidateEmail(input) {\n\n    let validRegex = \/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$\/;\n\n    if (input.match(validRegex)) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  function mostrarForm() {\n    let form = document.getElementById(\"formcontainer\");\n    let dataJsonSaved = JSON.parse(localStorage.getItem(\"formvalue\"));\n    if (!dataJsonSaved || !dataJsonSaved.correo) {\n      form.style.display = \"block\";\n    } else {\n      form.style.display = \"none\";\n    }\n  }\n  mostrarForm();\n\n<\/script>\n\n\n\n\n<p>Otro texto para esta vaina<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Te damos la bienvenida a WordPress. Esta es tu primera entrada. Ed\u00edtala o b\u00f3rrala, \u00a1luego empieza a escribir! Otro texto para esta vaina<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/posts\/1"}],"collection":[{"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":2,"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions\/25"}],"wp:attachment":[{"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cuenti.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}