187 lines
8.5 KiB
JavaScript
187 lines
8.5 KiB
JavaScript
|
|
// Função para criar os blocos com base nos dados fornecidos
|
|
function criarBlocos(dados) {
|
|
const entrada_1 = document.getElementById('entrada_1');
|
|
if (entrada_1) {
|
|
entrada_1.innerHTML = '';
|
|
|
|
// Iterar sobre o array de dados dos blocos
|
|
dados.forEach(dadosDoBloco => {
|
|
const Painel = document.createElement('section');
|
|
const cab = document.createElement('section');
|
|
cab.classList.add('menu');
|
|
const Matriz = document.createElement('main');
|
|
Matriz.classList.add('matriz');
|
|
|
|
// Cabeçalho
|
|
const sucab = document.createElement('header');
|
|
sucab.classList.add('cabecario_1');
|
|
|
|
// Bloco responsável pela imagem de logo da itguys
|
|
const bloco_subcab1_1 = document.createElement('div');
|
|
bloco_subcab1_1.classList.add('Bloco_subcab1_1');
|
|
const img_cab = document.createElement('img');
|
|
img_cab.classList.add('icon_subcab1_1');
|
|
img_cab.src = dadosDoBloco.imagem_Cab;
|
|
img_cab.alt = '';
|
|
bloco_subcab1_1.appendChild(img_cab);
|
|
|
|
const bloco_subcab1_2 = document.createElement('div');
|
|
bloco_subcab1_2.classList.add('Bloco_subcab1_2');
|
|
const bloco_a_cab = document.createElement('a');
|
|
bloco_a_cab.href = dadosDoBloco.A_cab;
|
|
bloco_subcab1_2.appendChild(bloco_a_cab);
|
|
const bloco_button_cab = document.createElement('button');
|
|
bloco_button_cab.textContent = dadosDoBloco.button_Cab;
|
|
bloco_a_cab.appendChild(bloco_button_cab);
|
|
|
|
sucab.appendChild(bloco_subcab1_1);
|
|
sucab.appendChild(bloco_subcab1_2);
|
|
cab.appendChild(sucab);
|
|
Matriz.appendChild(cab);
|
|
|
|
// Matriz
|
|
const capitulo_1 = document.createElement('section');
|
|
capitulo_1.classList.add('capitulo_1');
|
|
const Corpo_1 = document.createElement('section');
|
|
Corpo_1.classList.add('Corpo_1');
|
|
const Coluna_1 = document.createElement('div');
|
|
Coluna_1.classList.add('Colunas_1');
|
|
|
|
// Menu Lateral
|
|
const seguimento_1 = document.createElement('div');
|
|
seguimento_1.classList.add('seguimentos_1');
|
|
Coluna_1.appendChild(seguimento_1);
|
|
const seguimento_1_button = document.createElement('button');
|
|
seguimento_1.appendChild(seguimento_1_button);
|
|
const seguimento_1_img = document.createElement('img');
|
|
seguimento_1_img.id = "menu";
|
|
seguimento_1_img.src = dadosDoBloco.imagem_segumento_1;
|
|
seguimento_1_img.alt = "";
|
|
seguimento_1_button.appendChild(seguimento_1_img);
|
|
|
|
const seguimento_2 = document.createElement('div');
|
|
seguimento_2.classList.add('seguimentos_2');
|
|
Coluna_1.appendChild(seguimento_2);
|
|
|
|
const user_1 = document.createElement('div');
|
|
user_1.classList.add('user_1');
|
|
seguimento_2.appendChild(user_1);
|
|
|
|
const seguimento_2_img_1_user_1 = document.createElement('img');
|
|
seguimento_2_img_1_user_1.src = dadosDoBloco.imagem_User_1_segumento_2;
|
|
seguimento_2_img_1_user_1.alt = "";
|
|
user_1.appendChild(seguimento_2_img_1_user_1);
|
|
|
|
const user_2 = document.createElement('div');
|
|
user_2.classList.add('user_2');
|
|
seguimento_2.appendChild(user_2);
|
|
const seguimento_2_img_2_user_2 = document.createElement('img');
|
|
seguimento_2_img_2_user_2.src = dadosDoBloco.imagem_User_2_segumento_2;
|
|
seguimento_2_img_2_user_2.alt = "";
|
|
user_2.appendChild(seguimento_2_img_2_user_2);
|
|
|
|
const empresa_1 = document.createElement('div');
|
|
empresa_1.classList.add('empresa_1');
|
|
seguimento_2.appendChild(empresa_1);
|
|
const empresa_1_h2 = document.createElement('h2');
|
|
empresa_1_h2.textContent = dadosDoBloco.texto_User_segumento_2;
|
|
empresa_1.appendChild(empresa_1_h2);
|
|
|
|
const empresa_2 = document.createElement('div');
|
|
empresa_2.classList.add('empresa_2');
|
|
seguimento_2.appendChild(empresa_2);
|
|
const empresa_2_h3 = document.createElement('h3');
|
|
empresa_2_h3.textContent = dadosDoBloco.texto_Empresa_segumento_2;
|
|
empresa_2.appendChild(empresa_2_h3);
|
|
|
|
// Menu Lateral Principal
|
|
const seguimento_3 = document.createElement('div');
|
|
seguimento_3.classList.add('seguimentos_3');
|
|
Coluna_1.appendChild(seguimento_3);
|
|
|
|
const home_a = document.createElement('a');
|
|
home_a.href = dadosDoBloco.Menu_home_a;
|
|
home_a.target = "iframe_a";
|
|
seguimento_3.appendChild(home_a);
|
|
const home_div = document.createElement('div');
|
|
home_div.classList.add('home');
|
|
home_a.appendChild(home_div);
|
|
const home_img = document.createElement('img');
|
|
home_img.src = dadosDoBloco.Menu_home_img;
|
|
home_img.alt = "";
|
|
home_div.appendChild(home_img);
|
|
const home_h3 = document.createElement('h3');
|
|
home_h3.textContent = dadosDoBloco.Menu_home_text;
|
|
home_div.appendChild(home_h3);
|
|
|
|
const Monitor_a = document.createElement('a');
|
|
Monitor_a.href = dadosDoBloco.Menu_Monitor_a;
|
|
Monitor_a.target = "iframe_a";
|
|
seguimento_3.appendChild(Monitor_a);
|
|
const Monitor_div = document.createElement('div');
|
|
Monitor_div.classList.add('monitor');
|
|
Monitor_a.appendChild(Monitor_div);
|
|
const Monitor_img = document.createElement('img');
|
|
Monitor_img.src = dadosDoBloco.Menu_Monitor_img;
|
|
Monitor_img.alt = "";
|
|
Monitor_div.appendChild(Monitor_img);
|
|
const Monitor_h3 = document.createElement('h3');
|
|
Monitor_h3.textContent = dadosDoBloco.Menu_Monitor_text;
|
|
Monitor_div.appendChild(Monitor_h3);
|
|
|
|
const Servicedesk_a = document.createElement('a');
|
|
Servicedesk_a.href = dadosDoBloco.Menu_Servicedesk_a;
|
|
Servicedesk_a.target = "iframe_a";
|
|
seguimento_3.appendChild(Servicedesk_a);
|
|
const Servicedesk_div = document.createElement('div');
|
|
Servicedesk_div.classList.add('Servicedesk');
|
|
Servicedesk_a.appendChild(Servicedesk_div);
|
|
const Servicedesk_img = document.createElement('img');
|
|
Servicedesk_img.src = dadosDoBloco.Menu_Servicedesk_img;
|
|
Servicedesk_img.alt = "";
|
|
Servicedesk_div.appendChild(Servicedesk_img);
|
|
const Servicedesk_h3 = document.createElement('h3');
|
|
Servicedesk_h3.textContent = dadosDoBloco.Menu_Servicedesk_text;
|
|
Servicedesk_div.appendChild(Servicedesk_h3);
|
|
|
|
const Suporte_a = document.createElement('a');
|
|
Suporte_a.href = dadosDoBloco.Menu_Suporte_a;
|
|
Suporte_a.target = "iframe_a";
|
|
seguimento_3.appendChild(Suporte_a);
|
|
const Suporte_div = document.createElement('div');
|
|
Suporte_div.classList.add('Suporte');
|
|
Suporte_a.appendChild(Suporte_div);
|
|
const Suporte_img = document.createElement('img');
|
|
Suporte_img.src = dadosDoBloco.Menu_Suporte_img;
|
|
Suporte_img.alt = "";
|
|
Suporte_div.appendChild(Suporte_img);
|
|
const Suporte_h3 = document.createElement('h3');
|
|
Suporte_h3.textContent = dadosDoBloco.Menu_Suporte_text;
|
|
Suporte_div.appendChild(Suporte_h3);
|
|
|
|
const Config_a = document.createElement('a');
|
|
Config_a.href = dadosDoBloco.Menu_Config_a;
|
|
Config_a.target = "iframe_a";
|
|
seguimento_3.appendChild(Config_a);
|
|
const Config_div = document.createElement('div');
|
|
Config_div.classList.add('Config');
|
|
Config_a.appendChild(Config_div);
|
|
const Config_img = document.createElement('img');
|
|
Config_img.src = dadosDoBloco.Menu_Config_img;
|
|
Config_img.alt = "";
|
|
Config_div.appendChild(Config_img);
|
|
const Config_h3 = document.createElement('h3');
|
|
Config_h3.textContent = dadosDoBloco.Menu_Config_text;
|
|
Config_div.appendChild(Config_h3);
|
|
|
|
Corpo_1.appendChild(Coluna_1);
|
|
capitulo_1.appendChild(Corpo_1);
|
|
Matriz.appendChild(capitulo_1);
|
|
Painel.appendChild(Matriz);
|
|
|
|
entrada_1.appendChild(Painel);
|
|
});
|
|
}
|
|
}
|