This commit is contained in:
Cat /dev/Nulo 2023-07-03 12:08:45 -03:00
parent e0b4d9f375
commit bb89b9d817

View file

@ -59,22 +59,16 @@ export async function render(data) {
{Object.entries(data.frontpageCuadrados).map( {Object.entries(data.frontpageCuadrados).map(
([color, { título, content }]) => { ([color, { título, content }]) => {
// ¿por qué así en vez de `bg-${color}`? para que lo detecte tailwind. // ¿por qué así en vez de `bg-${color}`? para que lo detecte tailwind.
const bgs = { const classes = {
celeste: "bg-celeste", celeste: "bg-celeste",
amarillo: "bg-amarillo", amarillo: "bg-amarillo lg:order-last xl:order-none",
naranja: "bg-naranja", naranja: "bg-naranja xl:order-last",
violeta: "bg-violeta", violeta: "bg-violeta lg:order-last",
};
const pos = {
celeste: "",
amarillo: "lg:order-last xl:order-none",
naranja: "xl:order-last",
violeta: "lg:order-last",
}; };
return ( return (
<div class="grid lg:grid-cols-2"> <div class="grid lg:grid-cols-2">
<div <div
class={`aspect-square h-auto w-full max-w-[24rem] overflow-y-scroll ${bgs[color]} ${pos[color]}`} class={`aspect-square h-auto w-full max-w-[24rem] overflow-y-scroll ${classes[color]}`}
></div> ></div>
<div class="aspect-square h-auto w-full max-w-[24rem] overflow-y-scroll p-8"> <div class="aspect-square h-auto w-full max-w-[24rem] overflow-y-scroll p-8">
<h2 class="mb-4 text-4xl">{título}</h2> <h2 class="mb-4 text-4xl">{título}</h2>