|
| 1 | +--- |
| 2 | +import Layout from '../layouts/Layout.astro'; |
| 3 | +import communities from '../assets/communities.json' |
| 4 | +
|
| 5 | +--- |
| 6 | + |
| 7 | +<Layout title="Comunidades - Ecuador In Tech"> |
| 8 | + <div class="container mx-auto px-4 py-12"> |
| 9 | + <h1 class="text-4xl font-bold mb-8">Comunidades</h1> |
| 10 | + <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> |
| 11 | + { |
| 12 | + communities.map((community) => ( |
| 13 | + <div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-300"> |
| 14 | + <div class="h-48 overflow-hidden"> |
| 15 | + <img |
| 16 | + src={community.image} |
| 17 | + alt={community.name} |
| 18 | + class="w-full h-full object-cover transform hover:scale-105 transition-transform duration-300" |
| 19 | + /> |
| 20 | + </div> |
| 21 | + <div class="p-6"> |
| 22 | + <div class="flex justify-between items-center mb-3"> |
| 23 | + <h2 class="text-xl font-bold text-gray-800"> |
| 24 | + {community.name} |
| 25 | + </h2> |
| 26 | + </div> |
| 27 | + <p class="text-gray-600 mb-4 line-clamp-2"> |
| 28 | + {community.description} |
| 29 | + </p> |
| 30 | + <div class="mb-4 flex flex-wrap gap-2"> |
| 31 | + {community.tags.map((tag) => ( |
| 32 | + <span class="bg-gray-100 text-gray-700 px-3 py-1 rounded-full text-sm font-medium hover:bg-gray-200 transition-colors"> |
| 33 | + {tag} |
| 34 | + </span> |
| 35 | + ))} |
| 36 | + </div> |
| 37 | + <div class="pt-4 border-t border-gray-100"> |
| 38 | + <div class="flex gap-3"> |
| 39 | + {Object.entries(community.links).map(([key, value]) => { |
| 40 | + // const hostname = new URL(link).hostname; |
| 41 | + // const icon = hostname.includes("instagram") |
| 42 | + // ? "💬" |
| 43 | + // : hostname.includes("github") |
| 44 | + // ? "📚" |
| 45 | + // : hostname.includes("linkedin") |
| 46 | + // ? "🎨" |
| 47 | + // : "🔗"; |
| 48 | + return ( |
| 49 | + <a |
| 50 | + href={value} |
| 51 | + class="inline-flex items-center gap-1 text-blue-600 hover:text-blue-800 transition-colors text-sm" |
| 52 | + target="_blank" |
| 53 | + rel="noopener noreferrer" |
| 54 | + > |
| 55 | + <span>{key}</span> |
| 56 | + {/* {hostname.split(".")[0]} */} |
| 57 | + </a> |
| 58 | + ); |
| 59 | + })} |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + )) |
| 65 | + } |
| 66 | + </div> |
| 67 | + </div> |
| 68 | +</Layout> |
0 commit comments