Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SundarbansIITM authored Sep 26, 2024
2 parents ea01595 + 5c78a47 commit 9b61ec4
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 122 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ pnpm-debug.log*
*.sw?

.vercel

public/test2.html
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
<!-- Chennai, Tamil Nadu, India - 600036 -->
</p>
</div>
<div>
<!-- <div>
<a href="https://www.freecounterstat.com" title="website counter"><img src="https://counter8.optistats.ovh/private/freecounterstat.php?c=kpjrmmec7ej82depy5xffy9xf1k5gt5s" border="0" title="website counter" alt="website counter"></a>
</div>
</div> -->

<div class="flex -mx-2">
<!-- Instagram -->
Expand Down
2 changes: 1 addition & 1 deletion src/components/ClubPage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<NavBar />

<body class=" dark:bg-black">
<body class="dark:bg-black flex-grow">
<section
v-if="access"
class="container px-4 mx-auto"
Expand Down
17 changes: 9 additions & 8 deletions src/components/CouncilPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<body class="dark:bg-black">
<!-- Section: Design Block -->
<section class="mb-40">
<section class="mb-20">
<!-- Jumbotron -->
<div
class="relative overflow-hidden bg-cover bg-no-repeat"
Expand All @@ -19,7 +19,7 @@
<div class="flex h-full items-center justify-center">
<div class="px-6 text-center text-white md:px-12">
<h1
class="mt-2 mb-16 text-5xl font-bold tracking-tight md:text-6xl xl:text-7xl"
class="mt-8 mb-5 text-5xl font-bold tracking-tight md:text-6xl xl:text-7xl"
>
Sundarbans House Council
<br><span class="text-[#eab308]">2023-24</span>
Expand All @@ -34,7 +34,7 @@

<!-- upper house council -->
<section class="text-gray-400 py-10 dark:bg-black body-font">
<div class="text-center">
<div class="text-center mt-1 mb-6">
<h1
class="text-2xl font-semibold text-gray-800 capitalize lg:text-3xl dark:text-white"
>
Expand Down Expand Up @@ -106,7 +106,7 @@
</section>

<!-- active house council -->
<section class="bg-white dark:bg-black">
<section class=" mt-20 mb-5 bg-white dark:bg-black">
<div class="container px-6 py-10 mx-auto">
<h1
class="text-2xl font-semibold text-center text-gray-800 capitalize lg:text-3xl dark:text-white"
Expand Down Expand Up @@ -148,7 +148,7 @@
</section>

<!-- webops team -->
<section class="bg-white dark:bg-black">
<section class=" mt-10 mb-20 bg-white dark:bg-black">
<div class="container px-6 py-10 mx-auto">
<h1
class="text-2xl font-semibold text-center text-gray-800 capitalize lg:text-3xl dark:text-white"
Expand Down Expand Up @@ -188,9 +188,10 @@

<section
v-if="graphics"
class="bg-white dark:bg-black"
class="bg-white dark:bg-black mt-10 mb-20 pt-20 pb-20"

>
<div class="container px-6 py-10 mx-auto">
<div class="container px-6 py-10 mx-auto ">
<h1
class="text-2xl font-semibold text-center text-gray-800 capitalize lg:text-3xl dark:text-white"
>
Expand Down Expand Up @@ -228,7 +229,7 @@
</section>
<section
v-if="prteam"
class="bg-white dark:bg-black"
class="bg-white dark:bg-black mb-20"
>
<div class="container px-6 py-10 mx-auto">
<h1
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventsPage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<NavBar />

<body class="dark:bg-black">
<body class="dark:bg-black dark:text-white">
<!-- caraousal -->
<div id="carouselExampleCaptions" class="relative" data-te-carousel-init data-te-ride="carousel">
<!--Carousel indicators-->
Expand Down
4 changes: 2 additions & 2 deletions src/components/GoogleLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
</div>

<p class="mt-3 text-xl text-center text-gray-600 dark:text-gray-200">
Welcome back! , Sign in with your IITM Google Account to access this page.
Welcome back! Sign in with your IITM Google Account to access this page.
</p>

<button
class="flex items-center justify-center mt-4 text-gray-600 transition-colors duration-300 transform border rounded-lg dark:border-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600"
class="flex items-center justify-center mt-4 text-gray-600 transition-colors duration-300 transform border rounded-lg dark:border-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600 mx-auto"
@click="login"
>
<div class="px-4 py-2">
Expand Down
106 changes: 38 additions & 68 deletions src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,16 @@
class="embed-responsive embed-responsive-16by9 relative w-full overflow-hidden"
style="padding-top: 56.25%"
>
<iframe
class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full"
src="https://www.youtube.com/embed/6N-PfwyjsIQ?si=9TZ9-A541tzlhkCU"
allowfullscreen
/>
<YoutubeVid videoId="6N-PfwyjsIQ" />

</div>

<div
class="embed-responsive embed-responsive-16by9 relative w-full overflow-hidden"
style="padding-top: 56.25%"
>
<iframe
class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full"
src="https://www.youtube.com/embed/RLBxlaK_aU4?si=NF0U6NkSsvkvSNHZ"
allowfullscreen
/>
<YoutubeVid videoId="RLBxlaK_aU4" />

</div>
</div>
</div>
Expand All @@ -148,47 +142,35 @@
class="embed-responsive embed-responsive-16by9 relative w-full overflow-hidden"
style="padding-top: 56.25%"
>
<iframe
class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full"
src="https://www.youtube.com/embed/TvkTrLJonbw?si=4k-pqv4Sm3IxT1J3"
allowfullscreen
/>
<YoutubeVid videoId="TvkTrLJonbw" />

</div>
</div>
<div class="p-4 md:w-1/2 lg:w-1/4 w-full">
<div
class="embed-responsive embed-responsive-16by9 relative w-full overflow-hidden"
style="padding-top: 56.25%"
>
<iframe
class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full"
src="https://www.youtube.com/embed/kEsry2TSVKU?si=AvUDyr9nmcz3wMjv"
allowfullscreen
/>
<YoutubeVid videoId="kEsry2TSVKU" />

</div>
</div>
<div class="p-4 md:w-1/2 lg:w-1/4 w-full">
<div
class="embed-responsive embed-responsive-16by9 relative w-full overflow-hidden"
style="padding-top: 56.25%"
>
<iframe
class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full"
src="https://www.youtube.com/embed/QW4T_FQzi2I?si=AozEo2ZoQhIfZHas"
allowfullscreen
/>
<YoutubeVid videoId="QW4T_FQzi2I" />

</div>
</div>
<div class="p-4 md:w-1/2 lg:w-1/4 w-full">
<div
class="embed-responsive embed-responsive-16by9 relative w-full overflow-hidden"
style="padding-top: 56.25%"
>
<iframe
class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full"
src="https://www.youtube.com/embed/rZdih019rz4?si=Bi5QHuM6YXaO0uTX"
allowfullscreen
/>
<YoutubeVid videoId="rZdih019rz4" />

</div>
</div>
</div>
Expand All @@ -209,42 +191,38 @@
latest happenings and exciting activities within our community.
</p>

<div
class="grid grid-cols-1 gap-8 mt-8 xl:mt-12 xl:gap-12 md:grid-cols-2 xl:grid-cols-3"
>
<div class="dark:text-white grid grid-cols-1 gap-8 mt-8 xl:mt-12 xl:gap-12 md:grid-cols-2 xl:grid-cols-3">
<div v-for="event in latestEvents" :key="event.slug">
<img
class="relative z-10 object-cover w-full rounded-md h-96"
:src="prependBackendLink(event.image)"
alt="Event Image"
/>
<div
class="relative z-20 max-w-lg p-6 mx-auto -mt-20 bg-white rounded-md shadow dark:bg-black"
>
<a
:href="event.form_url"
class="font-semibold text-gray-800 hover:underline dark:text-white md:text-xl"
>
<router-link :to="'/event/' + event.slug" class="block relative">
<img class="relative z-10 object-cover w-full rounded-md h-96" :src="prependBackendLink(event.image)"
alt="Event Image">
<div class="relative z-20 max-w-lg p-6 mx-auto -mt-20 bg-white rounded-md shadow dark:bg-black">

{{ event.title }}
</a>
<p class="mt-3 text-sm text-[#eab308]">
{{ event.timestamp }}
</p>
</div>
<p class="mt-3 text-sm text-[#eab308]">
{{ event.timestamp }}
</p>
</div>
</router-link>
</div>
</div>
</div>
</div>
</section>
</body>
</template>

<script>
import NavBar from "./NavBar.vue";
import YoutubeVid from "./YoutubeVid.vue";
import axios from 'axios'
const api = axios.create({
baseURL: "https://backend-sundarbans.iitmbs.org",
});
export default {
name: "HomePage",
components: {
NavBar,
YoutubeVid,
},
data() {
return {
Expand All @@ -255,40 +233,32 @@ export default {
},
async mounted() {
// Fetch admin data and events when the component is mounted
await Promise.all([this.fetchAdmins(), this.fetchEvents()]);
await Promise.all([this.fetchEvents()]);
},
methods: {
async fetchAdmins() {
try {
const response = await axios.get("https://sundarbans.camlio.shop/council");
const data = await response.json();
this.admins = data.admins;
} catch (error) {
console.error("Error fetching admin data:", error);
}
},
async fetchEvents() {
try {
const response = await axios.get("https://sundarbans.camlio.shop/events", {
const response = await api.get("/events", {
mode: "cors",
});
if (!response.ok) {
if (response.status!=200) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
const data = response.data
console.log("API Response:", data); // Log the entire response
// Separate events into latest and upcoming
this.latestEvents = data.latest_events || [];
this.latestEvents = (data.latest_events || []).slice(0, 3);
this.upcomingEvents = data.upcoming_events || [];
} catch (error) {
console.error("Error fetching events:", error);
}
},
prependBackendLink(url) {
// Replace with your actual backend link
const backendLink = "https://sundarbans.camlio.shop";
//const backendLink = "https://sundarbans.camlio.shop";
// Check if the URL already starts with 'http' or '/'
return url && url.startsWith("/") ? backendLink + url : url;
//return url && url.startsWith("/") ? backendLink + url : url;
return url && url.startsWith('/') ? api.defaults.baseURL + url : url;
},
truncateDescription(description) {
const maxLength = 100;
Expand Down
Loading

0 comments on commit 9b61ec4

Please sign in to comment.