Skip to content

Commit

Permalink
Merge pull request #78 from acmauth/AboutFAQ
Browse files Browse the repository at this point in the history
Added a json for contributors instead of scraping the md
  • Loading branch information
Christos Balaktsis authored Feb 29, 2024
2 parents 7082afb + 1191157 commit 31cb457
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 57 deletions.
67 changes: 19 additions & 48 deletions src/lib/components/about/about.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,31 @@
import { onMount } from 'svelte';
import { writable } from 'svelte/store';
let personal_links = [
"https://github.com/TolisSth",
"https://www.linkedin.com/in/christos-balaktsis/",
"https://github.com/dangelidou",
"https://github.com/Kostaga",
"https://github.com/VirtualVirtuosoV1",
"https://gr.linkedin.com/in/myrto-gkogkou-67b004260",
"https://www.linkedin.com/in/neronmkp/",
"https://github.com/VasilisMicha"
];
// Define a writable store for team members
const teamMembers = writable([]);
// Function to fetch team members from the GitHub Markdown file
async function fetchTeamMembers() {
try {
const response = await fetch('https://raw.githubusercontent.com/acmauth/StudentCompanion/dev/README.md');
const markdownText = await response.text();
// Regular expression to match the table containing team members
const regex = /<table>(.*?)<\/table>/gs;
const tableMatch = regex.exec(markdownText);
if (!tableMatch) {
throw new Error('Table not found in the Markdown file');
}
// Regular expression to extract image URLs and names from table rows
const memberRegex = /<img src="(.*?)" .*?alt="(.*?)"\/>/g;
let members = [];
let match;
while ((match = memberRegex.exec(tableMatch[1])) !== null) {
members.push({ imageUrl: match[1], name: match[2] });
}
// Update the teamMembers store with the fetched data
const response = await fetch('/src/lib/components/about/contributors.json');
const data = await response.json();
const members = data.contributors;
teamMembers.set(members);
} catch (error) {
console.error('Error fetching team members:', error);
}
}
// Fetch team members on component mount
onMount(fetchTeamMembers);
</script>

<ion-content class="ion-padding">
<div>
<!-- About Us Card -->
<div class="about-card">
<div class="card-content">

<!-- Introduction -->
<div class="section">
<h2 class="section-title">Ποιοι είμαστε</h2>
Expand All @@ -64,13 +38,12 @@
<!-- Meet the Team -->
<div class="section">
<h2 class="section-title">Γνώρισε την ομάδα μας</h2>
<!-- Use reactive statement to update UI when teamMembers changes -->
{#each $teamMembers as member, index}
<ion-card href={personal_links[index]}>
{#each $teamMembers as member}
<ion-card href={member.personal_link}>
<ion-card-content class="team-card-content">
<div class="member-info">
<ion-avatar slot="start">
<img src={member.imageUrl} alt={member.name}>
<img src={member.image_url} alt={member.name}>
</ion-avatar>
<h3 class="member-name">{member.name}</h3>
</div>
Expand Down Expand Up @@ -112,7 +85,7 @@
</ion-content>

<style>
/* Custom styles */
.card-content {
padding: 20px;
}
Expand All @@ -126,34 +99,32 @@
color: var(--ion-color-primary);
}
.member-info {
display: flex;
align-items: center;
}
.member-name {
margin-left: 10px; /* Adjust as needed */
margin-left: 10px;
}
.social-icons {
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
}
.social-icon {
width: 40px; /* Adjust the size of the icons */
width: 40px;
height: 40px;
margin: 0 15px;
transition: transform 0.3s ease; /* Smooth transition on hover */
transition: transform 0.3s ease;
}
.social-icon:hover {
transform: scale(1.2); /* Increase size on hover */
transform: scale(1.2);
}
</style>

45 changes: 45 additions & 0 deletions src/lib/components/about/contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"contributors": [
{
"name": "Apostolos Halis",
"personal_link": "https://github.com/TolisSth",
"image_url": "https://avatars.githubusercontent.com/u/93685610?v=4?s=100"
},
{
"name": "Christos Balaktsis",
"personal_link": "https://www.linkedin.com/in/christos-balaktsis/",
"image_url": "https://avatars.githubusercontent.com/u/74056421?v=4?s=100"
},
{
"name": "Dimitra Angelidou",
"personal_link": "https://github.com/dangelidou",
"image_url": "https://avatars.githubusercontent.com/u/115474360?v=4?s=100"
},
{
"name": "Konstantinos Agathopoulos",
"personal_link": "https://github.com/Kostaga",
"image_url": "https://avatars.githubusercontent.com/u/59094550?v=4?s=100"
},
{
"name": "Michalis Karypidis",
"personal_link": "https://github.com/VirtualVirtuosoV1",
"image_url": "https://avatars.githubusercontent.com/u/110724304?v=4?s=100"
},
{
"name": "Myrto Gkogkou",
"personal_link": "https://gr.linkedin.com/in/myrto-gkogkou-67b004260",
"image_url": "https://avatars.githubusercontent.com/u/75997814?v=4?s=100"
},
{
"name": "Neron Panagiotopoulos",
"personal_link": "https://www.linkedin.com/in/neronmkp/",
"image_url": "https://avatars.githubusercontent.com/u/18248043?v=4?s=100"
},
{
"name": "Vasilis Michaelidis",
"personal_link": "https://github.com/VasilisMicha",
"image_url": "https://avatars.githubusercontent.com/u/145148992?v=4?s=100"
}
]
}

9 changes: 0 additions & 9 deletions src/lib/components/faq/faq.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
{ id: 7, title: "Εντόπισα λάθος στα δεδομένα της εφαρμογής. Τι κάνω; ", answer: "Οι πληροφορίες για τα μαθήματα, τις επιδόσεις σου και τα προσωπικά σου στοιχεία λαμβάνονται από κατάλληλα συστήματα του ΑΠΘ. Η διαλειτουργικότητα μεταξύ συστημάτων πάντα ενέχει την πιθανότητα ελλείψεων ή παραλλαγμένης παρουσίασης των δεδομένων. Αν σε προβληματίζει κάτι που βλέπεις στην εφαρμογή, βασίσου στις πληροφορίες που παρουσιάζονται online απευθείας από το πανεπιστήμιο. Ωστόσο, θα μας βοηθούσε πολύ να επικοινωνήσεις μαζί μας στο <a href='mailto:aristomate@auth.acm.org'>aristomate@auth.acm.org</a> για να μας περιγράψεις το πρόβλημα!" },
];
function toggleFullTitle(faq) {
faq.showFullTitle = !faq.showFullTitle;
}
onMount(() => {
faqs.forEach(faq => {
const answerDiv = document.getElementById(`faq-answer-${faq.id}`);
Expand All @@ -23,7 +19,6 @@
});
</script>

<!-- FAQ.svelte -->
<ion-content class="ion-padding">
<ion-accordion-group expand="inset">
{#each faqs as faq}
Expand All @@ -39,8 +34,4 @@
</ion-accordion-group>
</ion-content>


<style>
</style>

0 comments on commit 31cb457

Please sign in to comment.