diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle index 326e0a9b..616927ea 100644 --- a/android/app/capacitor.build.gradle +++ b/android/app/capacitor.build.gradle @@ -19,9 +19,9 @@ dependencies { implementation project(':capacitor-push-notifications') implementation project(':capacitor-status-bar') implementation project(':capacitor-toast') - implementation project(':capawesome-capacitor-android-edge-to-edge-support') implementation project(':capawesome-capacitor-app-update') implementation project(':capacitor-native-settings') + implementation project(':capacitor-plugin-safe-area') } diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle index 06451f74..c3884a5c 100644 --- a/android/capacitor.settings.gradle +++ b/android/capacitor.settings.gradle @@ -32,11 +32,11 @@ project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacit include ':capacitor-toast' project(':capacitor-toast').projectDir = new File('../node_modules/@capacitor/toast/android') -include ':capawesome-capacitor-android-edge-to-edge-support' -project(':capawesome-capacitor-android-edge-to-edge-support').projectDir = new File('../node_modules/@capawesome/capacitor-android-edge-to-edge-support/android') - include ':capawesome-capacitor-app-update' project(':capawesome-capacitor-app-update').projectDir = new File('../node_modules/@capawesome/capacitor-app-update/android') include ':capacitor-native-settings' project(':capacitor-native-settings').projectDir = new File('../node_modules/capacitor-native-settings/android') + +include ':capacitor-plugin-safe-area' +project(':capacitor-plugin-safe-area').projectDir = new File('../node_modules/capacitor-plugin-safe-area/android') diff --git a/android/variables.gradle b/android/variables.gradle index d93498de..ece122d0 100644 --- a/android/variables.gradle +++ b/android/variables.gradle @@ -1,5 +1,5 @@ ext { - minSdkVersion = 26 + minSdkVersion = 30 compileSdkVersion = 35 targetSdkVersion = 35 androidxActivityVersion = '1.9.2' diff --git a/package.json b/package.json index cb854920..95fb50b9 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "@capacitor/push-notifications": "^7.0.0", "@capacitor/status-bar": "^7.0.3", "@capacitor/toast": "^7.0.0", - "@capawesome/capacitor-android-edge-to-edge-support": "^7.2.3", "@capawesome/capacitor-app-update": "^7.0.0", "@ionic/core": "7.8.5", "@ionic/pwa-elements": "^3.2.2", @@ -59,6 +58,7 @@ "axios-cookiejar-support": "^4.0.7", "base64url": "^3.0.1", "capacitor-native-settings": "^7.0.0", + "capacitor-plugin-safe-area": "^4.0.3", "chart.js": "^4.4.0", "cheerio": "1.0.0-rc.12", "cross-fetch": "^4.0.0", diff --git a/src/lib/components/grades/gradesPage.svelte b/src/lib/components/grades/gradesPage.svelte index 6b5358d7..0dfccaa9 100644 --- a/src/lib/components/grades/gradesPage.svelte +++ b/src/lib/components/grades/gradesPage.svelte @@ -135,7 +135,7 @@ - + {$t('progress.title')} - +
{#if genericHeader} diff --git a/src/lib/globalFunctions/darkMode.ts b/src/lib/globalFunctions/darkMode.ts index 0f1fa102..9317e15c 100644 --- a/src/lib/globalFunctions/darkMode.ts +++ b/src/lib/globalFunctions/darkMode.ts @@ -1,11 +1,14 @@ -import { nativeSettings, EdgeToEdgeFunctions } from "./nativeSettings"; +import { nativeSettings } from "./nativeSettings"; +import { StatusBar, Style } from '@capacitor/status-bar'; // Check if dark mode is enabled and set it if it is export async function checkAppMode() { let darkMode = localStorage.getItem('darkMode'); + console.log("Dark mode from localStorage:", darkMode); if (darkMode === null) { // Setting default dark mode | Fixes the toggle being ticked wrongly - localStorage.setItem('darkMode', 'false'); - darkMode = "false"; + localStorage.setItem('darkMode', 'true'); + darkMode = "true"; + await StatusBar.setStyle({ style: Style.Dark }); } const isDark = darkMode === "true"; document.body.classList.toggle('dark', isDark); @@ -13,13 +16,13 @@ export async function checkAppMode() { } // Toggle dark mode on or off -export function toggleDarkTheme() { +export async function toggleDarkTheme() { const isDark = document.body.classList.toggle('dark'); localStorage.setItem('darkMode', isDark.toString()); // nativeSettings(); if (isDark) { - EdgeToEdgeFunctions.setBackgroundColorDark(); + await StatusBar.setStyle({ style: Style.Dark }); } else { - EdgeToEdgeFunctions.setBackgroundColorLight(); + await StatusBar.setStyle({ style: Style.Light }); } } diff --git a/src/lib/globalFunctions/nativeSettings.ts b/src/lib/globalFunctions/nativeSettings.ts index 8d40fc6e..24184d98 100644 --- a/src/lib/globalFunctions/nativeSettings.ts +++ b/src/lib/globalFunctions/nativeSettings.ts @@ -1,8 +1,9 @@ import { App as capacitorApp } from '@capacitor/app'; import { Capacitor } from '@capacitor/core'; import { navController } from '$components/shared/StackedNav'; -import { EdgeToEdge } from '@capawesome/capacitor-android-edge-to-edge-support'; +// import { EdgeToEdge } from '@capawesome/capacitor-android-edge-to-edge-support'; import { StatusBar, Style } from '@capacitor/status-bar'; +import { SafeArea } from 'capacitor-plugin-safe-area'; export async function nativeSettings() { /* Capacitor back button handling */ @@ -18,48 +19,56 @@ export async function nativeSettings() { } }); - await enableEdgeToEdge(); + SafeArea.getSafeAreaInsets().then((data) => { + const { insets } = data; + document.body.style.setProperty('--ion-safe-area-top', `${insets.top}px`); + document.body.style.setProperty('--ion-safe-area-right', `${insets.right}px`); + document.body.style.setProperty('--ion-safe-area-bottom', `${insets.bottom}px`); + document.body.style.setProperty('--ion-safe-area-left', `${insets.left}px`); + }); + + // Set the background color to match the app's color scheme if (document.body.classList.contains('dark')) { - await setBackgroundColorDark(); + await StatusBar.setStyle({ style: Style.Dark }); } else { - await setBackgroundColorLight(); + await StatusBar.setStyle({ style: Style.Light }); } } -const enableEdgeToEdge = async () => { - await EdgeToEdge.enable(); - await StatusBar.show(); - await StatusBar.setOverlaysWebView({ overlay: true }); -}; +// const enableEdgeToEdge = async () => { +// await EdgeToEdge.enable(); +// await StatusBar.show(); +// await StatusBar.setOverlaysWebView({ overlay: true }); +// }; -const disable = async () => { - await EdgeToEdge.disable(); -}; +// const disable = async () => { +// await EdgeToEdge.disable(); +// }; -const getInsets = async () => { - const result = await EdgeToEdge.getInsets(); - console.log('Insets:', result); -}; +// const getInsets = async () => { +// const result = await EdgeToEdge.getInsets(); +// console.log('Insets:', result); +// }; -const setBackgroundColorLight = async () => { - await EdgeToEdge.setBackgroundColor({ color: '#ffffff' }); - await StatusBar.setStyle({ style: Style.Light }); - await StatusBar.setBackgroundColor({ color: '#ffffff' }); -}; -const setBackgroundColorDark = async () => { - await EdgeToEdge.setBackgroundColor({ color: '#1f1f1f' }); - await StatusBar.setStyle({ style: Style.Dark }); - await StatusBar.setBackgroundColor({ color: '#121212' }); -}; +// const setBackgroundColorLight = async () => { +// await EdgeToEdge.setBackgroundColor({ color: '#ffffff' }); +// await StatusBar.setStyle({ style: Style.Light }); +// await StatusBar.setBackgroundColor({ color: '#ffffff' }); +// }; +// const setBackgroundColorDark = async () => { +// await EdgeToEdge.setBackgroundColor({ color: '#1f1f1f' }); +// await StatusBar.setStyle({ style: Style.Dark }); +// await StatusBar.setBackgroundColor({ color: '#121212' }); +// }; -export const EdgeToEdgeFunctions = { - enableEdgeToEdge, - disable, - getInsets, - setBackgroundColorLight, - setBackgroundColorDark -}; \ No newline at end of file +// export const EdgeToEdgeFunctions = { +// enableEdgeToEdge, +// disable, +// getInsets, +// setBackgroundColorLight, +// setBackgroundColorDark +// }; \ No newline at end of file diff --git a/src/lib/translations/translations.js b/src/lib/translations/translations.js index 0fa13eba..64201b6c 100644 --- a/src/lib/translations/translations.js +++ b/src/lib/translations/translations.js @@ -28,13 +28,14 @@ export default { "menu.closedForHolidays": 'Λέσχη κλειστή λόγω διακοπών', "menu.showingCachedData": "Εμφάνιση αποθηκευμένων δεδομένων", "about.title": "Σχετικά με εμάς", - "about.who_are_we": "Ποιοί είμαστε", - "about.who_are_we_text_1": " Γεια χαρά! Χαιρόμαστε πολύ που χρησιμοποιείς το Aristomate, την εφαρμογή που φτιάχτηκε από φοιτητές για φοιτητές!", - "about.who_are_we_text_2": "Οκτώ φοιτητές από την ομάδα της", - "about.who_are_we_text_3": "διαπιστώσαμε ότι στο χάος της καθημερινότητας ενός φοιτητή, ένας 'ψηφιακός φίλος' που συγκεντρώνει την ακαδημαϊκή του εμπειρία σε ένα και μοναδικό σημείο είναι χρήσιμος για την επιβίωσή του.", + "about.who_are_we": "Ποιοι είμαστε", + "about.who_are_we_text_1": "Γεια χαρά! Χαιρόμαστε πολύ που χρησιμοποιείς το Aristomate, την εφαρμογή που φτιάχτηκε από φοιτητές για φοιτητές!", + "about.who_are_we_text_2": "Οκτώ φοιτητές από την ομάδα της ACM AUTh διαπιστώσαμε ότι στο χάος της καθημερινότητας ενός φοιτητή, ένας 'ψηφιακός φίλος' που συγκεντρώνει την ακαδημαϊκή του εμπειρία σε ένα και μοναδικό σημείο είναι χρήσιμος για την επιβίωσή του.", "about.meet_team": "Γνώρισε την ομάδα μας", + "about.maintainers": "Συντηρητές", + "about.contributors": "Συνεισφέροντες", "about.mission": "Η αποστολή μας", - "about.mission_text": "Στόχος μας είναι να διευκολύνουμε τους φοιτητές του πανεπιστημίου τόσο στη γρηγορότερη ενημέρωσή τους πάνω στα μαθήματα και την πρόοδό τους, όσο και στην ευκολότερη φοιτητική 'επιβίωση'.", + "about.mission_text": "Με την ευγενική υποστήριξη του Αριστοτελείου Πανεπιστημίου Θεσσαλονίκης, στοχεύουμε να διευκολύνουμε τους φοιτητές τόσο στη γρηγορότερη ενημέρωσή τους πάνω στα μαθήματα και την πρόοδό τους, όσο και στην ευκολότερη φοιτητική 'επιβίωση'.", "about.find_us": "Βρες μας", "settings.language": "Γλώσσα", "settings.about": "Σχετικά με εμάς", @@ -253,13 +254,13 @@ export default { 'about.who_are_we': 'Who are we', 'about.who_are_we_text_1': 'Hello! We are very happy that you are using Aristomate, an app made by students for students!', - 'about.who_are_we_text_2': 'Eight students from the team', - 'about.who_are_we_text_3': - "have realized that in the chaos of a student's daily life, a 'digital friend' that consolidates the academic experience into a single point is useful for their survival.", + 'about.who_are_we_text_2': 'Eight students from the ACM AUTh team have realized that in the chaos of a student\'s daily life, a \'digital friend\' that consolidates the academic experience into a single point is useful for their survival.', 'about.meet_team': 'Meet our team', + 'about.maintainers': 'Maintainers', + 'about.contributors': 'Contributors', 'about.mission': 'Our mission', 'about.mission_text': - "Our goal is to facilitate university students both in their faster information on courses and progress as well as in easier student 'survival'.", + "Powered by the Aristotle University of Thessaloniki, our goal is to facilitate university students both in their faster information on courses and progress as well as in easier student 'survival'.", 'about.find_us': 'Find us', 'settings.language': 'Language', 'settings.about': 'About us', diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte deleted file mode 100644 index 9cd55f81..00000000 --- a/src/routes/about/+page.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/src/routes/faq/+page.svelte b/src/routes/faq/+page.svelte deleted file mode 100644 index 6bd2d5e8..00000000 --- a/src/routes/faq/+page.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 94356d91..87efd11e 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -117,6 +117,7 @@ } .language-switcher ion-button { + padding-top: var(--ion-safe-area-top); --color: white; --padding-start: 8px; --padding-end: 8px; diff --git a/src/routes/pages/notifications/+page.svelte b/src/routes/pages/notifications/+page.svelte index c9d21af6..ac2ab026 100644 --- a/src/routes/pages/notifications/+page.svelte +++ b/src/routes/pages/notifications/+page.svelte @@ -32,14 +32,14 @@ - + {$t('notifications.title')} - + {$t('notifications.title')} {#if Capacitor.isNativePlatform()} diff --git a/src/routes/pages/personalInfo/+page.svelte b/src/routes/pages/personalInfo/+page.svelte index 40284833..95c5d695 100644 --- a/src/routes/pages/personalInfo/+page.svelte +++ b/src/routes/pages/personalInfo/+page.svelte @@ -1,104 +1,11 @@ - - - - - {$t('settings.personal')} - - - - - - - {$t('settings.personal')} - - - - {#await getPersonalInfo()} - - {:then} - - {:catch error} - - {/await} - - - - - + + + + + + + \ No newline at end of file diff --git a/src/lib/components/about/about.svelte b/src/routes/pages/personalInfo/about.svelte similarity index 67% rename from src/lib/components/about/about.svelte rename to src/routes/pages/personalInfo/about.svelte index 58df5683..6f149393 100644 --- a/src/lib/components/about/about.svelte +++ b/src/routes/pages/personalInfo/about.svelte @@ -6,17 +6,42 @@ import github from "$lib/assets/github.svg"; import linkedin from "$lib/assets/linkedin.svg"; import facebook from "$lib/assets/facebook.svg"; - import contributors from "$lib/components/about/contributors.json"; + import contributors from "$lib/components/personalInfo/contributors.json"; import { t, locale, locales} from "$lib/i18n"; + import SubPageHeader from '$shared/subPageHeader.svelte'; + import { construct } from 'ionicons/icons'; + + interface Contributor { + name: string; + personal_link: string; + image_url: string; + maintainer: boolean; + } - const teamMembers = writable([]); + const teamMembers = writable([]); async function fetchTeamMembers() { try { - const members = contributors.contributors; - - teamMembers.set(members); + + // Separate maintainers and regular members + const maintainers = members.filter(m => m.maintainer); + const regular = members.filter(m => !m.maintainer); + + // Suffle maintainers + for (let i = maintainers.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [maintainers[i], maintainers[j]] = [maintainers[j], maintainers[i]]; + } + + // Shuffle regular members + for (let i = regular.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [regular[i], regular[j]] = [regular[j], regular[i]]; + } + + // Combine: maintainers first, then shuffled regular members + teamMembers.set([...maintainers, ...regular]); } catch (error) { console.error('Error fetching team members:', error); } @@ -26,6 +51,8 @@ + +
@@ -36,13 +63,14 @@

{$t("about.who_are_we")}

{$t("about.who_are_we_text_1")}

- {$t("about.who_are_we_text_2")} ACM AUTh {$t("about.who_are_we_text_3")} -

+ {@html $t("about.who_are_we_text_2")} +

{$t("about.meet_team")}

+ {#each $teamMembers as member} @@ -50,7 +78,12 @@ {member.name} -

{member.name}

+

+ {member.name} + {#if member.maintainer} + + {/if} +

diff --git a/src/lib/components/faq/faq.svelte b/src/routes/pages/personalInfo/faq.svelte similarity index 89% rename from src/lib/components/faq/faq.svelte rename to src/routes/pages/personalInfo/faq.svelte index 5b48bbee..d4dff953 100644 --- a/src/lib/components/faq/faq.svelte +++ b/src/routes/pages/personalInfo/faq.svelte @@ -1,5 +1,6 @@ + + {#each faqs as faq, i} diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/routes/pages/personalInfo/infoItem.svelte similarity index 100% rename from src/lib/components/personalInfo/infoItem.svelte rename to src/routes/pages/personalInfo/infoItem.svelte diff --git a/src/lib/components/personalInfo/personSkeleton.svelte b/src/routes/pages/personalInfo/personSkeleton.svelte similarity index 100% rename from src/lib/components/personalInfo/personSkeleton.svelte rename to src/routes/pages/personalInfo/personSkeleton.svelte diff --git a/src/routes/pages/personalInfo/personalInfo.svelte b/src/routes/pages/personalInfo/personalInfo.svelte new file mode 100644 index 00000000..04353872 --- /dev/null +++ b/src/routes/pages/personalInfo/personalInfo.svelte @@ -0,0 +1,106 @@ + + + + + + {$t('settings.personal')} + + + + + + + {$t('settings.personal')} + + + + {#await getPersonalInfo()} + + {:then} + + {:catch error} + + {/await} + + + + + + diff --git a/src/lib/components/personalInfo/settings.svelte b/src/routes/pages/personalInfo/settings.svelte similarity index 95% rename from src/lib/components/personalInfo/settings.svelte rename to src/routes/pages/personalInfo/settings.svelte index c456a3fd..60b4f192 100644 --- a/src/lib/components/personalInfo/settings.svelte +++ b/src/routes/pages/personalInfo/settings.svelte @@ -1,17 +1,20 @@