Commit e1d56d16 by Georgina Mondino

Cards

1 parent b10b3783
...@@ -12,15 +12,38 @@ function ArmarForm(data) { ...@@ -12,15 +12,38 @@ function ArmarForm(data) {
boton.setAttribute("id", "Boton" + n); boton.setAttribute("id", "Boton" + n);
boton.setAttribute("value", n); boton.setAttribute("value", n);
boton.setAttribute("class", "Botones"); boton.setAttribute("class", "Botones");
//boton.setAttribute("onclick", HabilitarTab(this) ); boton.setAttribute("onclick", "HabilitarTab(\
document.getElementById('BotonesContainer'),\
document.getElementById('TabsContainer'),\
parseInt(this.id[this.id.length - 1])\
)");
let ancho = ((100 - (0.2 * m)) / m) + "%"; let ancho = ((100 - (0.2 * m)) / m) + "%";
boton.style.width = ancho; boton.style.width = ancho;
let tab = document.createElement("div"); let tab = document.createElement("div");
tab.innerHTML = document.getElementById('TabCardcontainer').innerHTML;
padreTabs.appendChild(tab); padreTabs.appendChild(tab);
tab.style.width=ancho * m; tab.style.width=ancho * m;
tab.setAttribute("id", "Tab" + n); tab.setAttribute("id", "Tab" + n);
tab.setAttribute("class", "Tabs"); tab.setAttribute("class", "Tabs");
} }
document.getElementById("Tab0").style.display="block"; HabilitarTab(
document.getElementById('BotonesContainer'),
document.getElementById('TabsContainer'),
0
)
}
function HabilitarTab(bc,tc,n){
if (typeof n != "number") return console.log("El entero es invalido");
for (let it = 0; it < bc.children.length && it < tc.children.length; it++) {
if (it == n) {
bc.children[it].classList.add("BotonesActive");
tc.children[it].style.display = "block";
} else {
bc.children[it].classList.remove("BotonesActive");
tc.children[it].style.display = "none";
}
}
} }
...@@ -41,11 +41,9 @@ html { ...@@ -41,11 +41,9 @@ html {
margin: 0.1%; margin: 0.1%;
} }
.BotonesActive { .BotonesActive{
background-color: var(--Color); background-color: var(--Color);
border-bottom: none; height: 105%;
height: 6%;
border-bottom: none; border-bottom: none;
} }
...@@ -56,9 +54,20 @@ html { ...@@ -56,9 +54,20 @@ html {
.Tabs { .Tabs {
display: none; display: none;
height: 100%; height: 100%;
border: 3px solid var(--Color); background-color: var(--Color);
} }
.TabCard{
height: 90%;
width: 90%;
background-color: white;
box-shadow: 2px 2px 5px #575757;
padding: 2%;
border-radius: 2px;
}
@media (max-width: 600px) { @media (max-width: 600px) {
.BotonResultCont { .BotonResultCont {
margin: 1% auto; margin: 1% auto;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</section> </section>
<section id="FormularioResultante" style="display: none;"> <section id="FormularioResultante" style="display: none;">
<h1 style="margin: 2% 0% 2% 0;"> Su Formulario Ya Esta Listo!</h1> <h1 style="margin: 2% 0% 2% 0;"> Su Formulario Ya Esta Listo!</h1>
<section id="BotonesContainer" class="BotonesContainer" > <section id="BotonesContainer" class="BotonesContainer">
</section> </section>
<section id="TabsContainer"> <section id="TabsContainer">
</section> </section>
...@@ -87,5 +87,10 @@ ...@@ -87,5 +87,10 @@
</div> </div>
</template> </template>
<template id="TabCardcontainer">
<div class="TabCard">
</div>
</template>
</html> </html>
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!