2023-10-29 12:07:34 +00:00
|
|
|
<script lang="ts">
|
2021-07-31 23:06:14 +03:00
|
|
|
import { onMount } from 'svelte';
|
2023-12-08 18:47:51 +03:00
|
|
|
import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit';
|
2023-10-30 04:52:00 +00:00
|
|
|
import { fly } from 'svelte/transition';
|
2021-09-11 19:27:11 +03:00
|
|
|
import { derived } from 'svelte/store';
|
2023-08-02 19:35:27 +01:00
|
|
|
import { goto } from '$app/navigation';
|
2023-12-11 21:18:31 +03:00
|
|
|
import { browser, dev } from '$app/environment';
|
2023-08-02 19:35:27 +01:00
|
|
|
import { page, navigating } from '$app/stores';
|
2023-05-11 15:15:18 +00:00
|
|
|
import isEmpty from 'lodash/isEmpty';
|
2023-10-30 04:52:00 +00:00
|
|
|
import { Theme, ToastNotification, Loading } from 'carbon-components-svelte';
|
2023-10-29 12:07:34 +00:00
|
|
|
import type { CarbonTheme } from 'carbon-components-svelte/types/Theme/Theme.svelte';
|
2023-08-02 19:35:27 +01:00
|
|
|
import LandingNavigation from '$lib/components/Navigation/index.svelte';
|
|
|
|
|
import OrgNavigation from '$lib/components/Navigation/app.svelte';
|
|
|
|
|
import LMSNavigation from '$lib/components/Navigation/lms.svelte';
|
|
|
|
|
import OrgLandingPage from '$lib/components/Org/LandingPage/index.svelte';
|
|
|
|
|
import Snackbar from '$lib/components/Snackbar/index.svelte';
|
|
|
|
|
import Backdrop from '$lib/components/Backdrop/index.svelte';
|
|
|
|
|
import OrgSideBar from '$lib/components/Org/SideBar.svelte';
|
|
|
|
|
import LMSSideBar from '$lib/components/LMS/SideBar.svelte';
|
|
|
|
|
import Apps from '$lib/components/Apps/index.svelte';
|
|
|
|
|
import PlayQuiz from '$lib/components/Org/Quiz/Play/index.svelte';
|
2023-08-05 04:44:32 +01:00
|
|
|
import { course } from '$lib/components/Course/store';
|
2023-08-02 21:17:17 +00:00
|
|
|
import { isCoursesPage, isOrgPage, isLMSPage, isQuizPage } from '$lib/utils/functions/app';
|
2023-08-02 19:35:27 +01:00
|
|
|
import showAppsSideBar from '$lib/utils/functions/showAppsSideBar';
|
|
|
|
|
import isPublicRoute from '$lib/utils/functions/routes/isPublicRoute';
|
|
|
|
|
import { user, profile } from '$lib/utils/store/user';
|
2023-11-30 14:25:14 +03:00
|
|
|
import { getSupabase, isSupabaseTokenInLocalStorage } from '$lib/utils/functions/supabase';
|
2023-08-02 19:35:27 +01:00
|
|
|
import { isMobile } from '$lib/utils/store/useMobile';
|
2023-09-01 15:28:47 +01:00
|
|
|
import { ROUTE } from '$lib/utils/constants/routes';
|
2023-09-11 11:47:30 +01:00
|
|
|
import { getOrganizations } from '$lib/utils/services/org';
|
2023-09-07 10:47:25 +00:00
|
|
|
import { toggleBodyByMode } from '$lib/utils/functions/app';
|
2023-08-02 19:35:27 +01:00
|
|
|
import { appStore } from '$lib/utils/store/app';
|
|
|
|
|
import { currentOrg } from '$lib/utils/store/org';
|
2023-08-24 07:32:19 +00:00
|
|
|
import { setTheme } from '$lib/utils/functions/theme';
|
2023-09-11 11:47:30 +01:00
|
|
|
import hideNavByRoute from '$lib/utils/functions/routes/hideNavByRoute';
|
2023-09-13 06:38:12 +01:00
|
|
|
import shouldRedirectOnAuth from '$lib/utils/functions/routes/shouldRedirectOnAuth';
|
2023-09-11 11:47:30 +01:00
|
|
|
import AddOrgModal from '$lib/components/Org/AddOrgModal/AddOrgModal.svelte';
|
2023-10-30 06:04:53 +00:00
|
|
|
import { identifyPosthogUser, initPosthog } from '$lib/utils/services/posthog';
|
|
|
|
|
import { initSentry, setSentryUser } from '$lib/utils/services/sentry';
|
2020-12-24 20:32:05 +02:00
|
|
|
|
2023-08-02 19:35:27 +01:00
|
|
|
import '../app.postcss';
|
2021-07-12 05:55:57 +03:00
|
|
|
|
2023-08-14 06:22:03 +01:00
|
|
|
export let data;
|
|
|
|
|
|
2023-08-02 19:35:27 +01:00
|
|
|
let supabase = getSupabase();
|
2023-08-10 12:46:14 +01:00
|
|
|
let path = $page.url?.pathname?.replace('/', '');
|
2023-10-29 12:07:34 +00:00
|
|
|
let carbonTheme: CarbonTheme = 'white';
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-08-02 19:35:27 +01:00
|
|
|
const delayedPreloading = derived(navigating, (currentPreloading, set) => {
|
2021-09-11 19:27:11 +03:00
|
|
|
setTimeout(() => set(currentPreloading), 250);
|
|
|
|
|
});
|
|
|
|
|
|
2023-10-30 06:04:53 +00:00
|
|
|
function setupAnalytics() {
|
|
|
|
|
// Set up sentry
|
|
|
|
|
initSentry();
|
|
|
|
|
|
|
|
|
|
// Set up posthog
|
|
|
|
|
initPosthog();
|
2023-12-11 21:18:31 +03:00
|
|
|
|
|
|
|
|
if (!dev) {
|
|
|
|
|
injectSpeedInsights();
|
|
|
|
|
}
|
2023-10-29 12:07:34 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-30 06:04:53 +00:00
|
|
|
function setAnalyticsUser() {
|
|
|
|
|
if ($profile.id) {
|
|
|
|
|
setSentryUser({
|
2023-10-29 12:07:34 +00:00
|
|
|
id: $profile.id,
|
|
|
|
|
username: $profile.username,
|
|
|
|
|
email: $profile.email,
|
|
|
|
|
fullname: $profile.fullname
|
2023-08-02 19:35:27 +01:00
|
|
|
});
|
2023-10-30 06:04:53 +00:00
|
|
|
|
|
|
|
|
identifyPosthogUser($profile.id, { email: $profile.email, name: $profile.fullname });
|
2023-08-02 19:35:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-31 23:06:14 +03:00
|
|
|
async function getProfile() {
|
2023-05-16 04:31:45 +00:00
|
|
|
const params = new URLSearchParams(window.location.search);
|
2021-07-31 23:06:14 +03:00
|
|
|
// Get user profile
|
2023-08-02 19:35:27 +01:00
|
|
|
const {
|
2023-08-02 21:17:17 +00:00
|
|
|
data: { session }
|
2023-08-02 19:35:27 +01:00
|
|
|
} = await supabase.auth.getSession();
|
2023-08-05 04:44:32 +01:00
|
|
|
const { user: authUser } = session || {};
|
2023-11-23 22:18:31 +00:00
|
|
|
console.log('Get user', authUser);
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-12-09 10:56:46 +03:00
|
|
|
if (!authUser && !isPublicRoute($page.url?.pathname)) {
|
2023-12-05 08:31:26 +03:00
|
|
|
return goto('/login?redirect=/' + path);
|
2023-08-05 04:44:32 +01:00
|
|
|
}
|
|
|
|
|
|
2021-07-31 23:06:14 +03:00
|
|
|
// Check if user has profile
|
|
|
|
|
let {
|
|
|
|
|
data: profileData,
|
|
|
|
|
error,
|
2023-08-02 21:17:17 +00:00
|
|
|
status
|
|
|
|
|
} = await supabase.from('profile').select(`*`).eq('id', authUser?.id).single();
|
2023-11-23 22:18:31 +00:00
|
|
|
console.log('Get profile', profileData);
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-08-02 19:35:27 +01:00
|
|
|
if (error && !profileData && status === 406 && authUser) {
|
2021-07-31 23:06:14 +03:00
|
|
|
// User wasn't found, create profile
|
2021-08-18 19:47:02 +03:00
|
|
|
console.log(`User wasn't found, create profile`);
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-08-02 21:17:17 +00:00
|
|
|
const [regexUsernameMatch] = [...(authUser.email?.matchAll(/(.*)@/g) || [])];
|
2021-08-18 19:47:02 +03:00
|
|
|
|
2023-10-29 12:07:34 +00:00
|
|
|
const { data: newProfileData, error } = await supabase
|
2023-08-02 19:35:27 +01:00
|
|
|
.from('profile')
|
|
|
|
|
.insert({
|
|
|
|
|
id: authUser.id,
|
2023-09-01 15:28:47 +01:00
|
|
|
username: regexUsernameMatch[1] + `${new Date().getTime()}`,
|
2023-08-02 19:35:27 +01:00
|
|
|
fullname: regexUsernameMatch[1],
|
2023-08-02 21:17:17 +00:00
|
|
|
email: authUser.email
|
2023-08-02 19:35:27 +01:00
|
|
|
})
|
|
|
|
|
.select();
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-09-01 15:28:47 +01:00
|
|
|
// Profile created, go to onboarding or lms
|
2023-10-29 12:07:34 +00:00
|
|
|
if (!error && newProfileData) {
|
2021-08-18 19:47:02 +03:00
|
|
|
$user.fetchingUser = false;
|
|
|
|
|
$user.isLoggedIn = true;
|
|
|
|
|
$user.currentSession = authUser;
|
|
|
|
|
|
2023-10-29 12:07:34 +00:00
|
|
|
profile.set(newProfileData[0]);
|
2021-08-18 19:47:02 +03:00
|
|
|
|
2023-10-30 06:04:53 +00:00
|
|
|
setAnalyticsUser();
|
2022-12-03 22:45:01 +01:00
|
|
|
|
2023-08-14 06:22:03 +01:00
|
|
|
if (data.isOrgSite) {
|
2023-05-16 04:31:45 +00:00
|
|
|
const { data, error } = await supabase
|
|
|
|
|
.from('organizationmember')
|
|
|
|
|
.insert({
|
|
|
|
|
organization_id: $currentOrg.id,
|
|
|
|
|
profile_id: $profile.id,
|
2023-08-02 21:17:17 +00:00
|
|
|
role_id: 3
|
2023-08-02 19:35:27 +01:00
|
|
|
})
|
|
|
|
|
.select();
|
2023-05-16 04:31:45 +00:00
|
|
|
if (error) {
|
|
|
|
|
console.error('Error adding user to organisation', error);
|
|
|
|
|
} else {
|
|
|
|
|
console.log('Success adding user to organisation', data);
|
2023-05-20 23:53:28 +00:00
|
|
|
const memberId = data?.[0]?.id || '';
|
|
|
|
|
|
|
|
|
|
$currentOrg.memberId = memberId;
|
2023-05-16 04:31:45 +00:00
|
|
|
}
|
|
|
|
|
|
2023-08-02 19:35:27 +01:00
|
|
|
if (params.get('redirect')) {
|
|
|
|
|
goto(params.get('redirect') || '');
|
2023-05-16 04:31:45 +00:00
|
|
|
} else {
|
|
|
|
|
goto('/lms');
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-01 15:28:47 +01:00
|
|
|
// On invite page, don't go to onboarding
|
|
|
|
|
if (!path.includes('invite')) {
|
|
|
|
|
goto(ROUTE.ONBOARDING);
|
|
|
|
|
}
|
2021-07-31 23:06:14 +03:00
|
|
|
}
|
2022-11-30 09:18:41 +01:00
|
|
|
$user.fetchingUser = false;
|
2021-07-31 23:06:14 +03:00
|
|
|
} else if (profileData) {
|
|
|
|
|
// Profile exists, go to profile page
|
2021-08-18 19:47:02 +03:00
|
|
|
$user.fetchingUser = false;
|
|
|
|
|
$user.isLoggedIn = true;
|
|
|
|
|
$user.currentSession = authUser;
|
2021-07-31 23:06:14 +03:00
|
|
|
profile.set(profileData);
|
2021-08-18 19:47:02 +03:00
|
|
|
|
2021-10-22 14:55:33 +03:00
|
|
|
// Set user in sentry
|
2023-10-30 06:04:53 +00:00
|
|
|
setAnalyticsUser();
|
2023-06-17 19:11:29 +00:00
|
|
|
|
2023-10-30 04:52:00 +00:00
|
|
|
const orgRes = await getOrganizations(profileData.id);
|
2021-10-22 14:55:33 +03:00
|
|
|
|
2023-05-16 04:31:45 +00:00
|
|
|
// student redirect
|
2023-08-14 06:22:03 +01:00
|
|
|
if (data.isOrgSite) {
|
2023-05-16 04:31:45 +00:00
|
|
|
if (params.has('redirect')) {
|
2023-08-02 19:35:27 +01:00
|
|
|
goto(params.get('redirect') || '');
|
2023-09-30 10:43:13 +01:00
|
|
|
} else if (shouldRedirectOnAuth(path)) {
|
2023-05-16 04:31:45 +00:00
|
|
|
goto('/lms');
|
|
|
|
|
}
|
2023-05-15 15:13:42 +00:00
|
|
|
} else {
|
2023-09-01 15:28:47 +01:00
|
|
|
// Not on invite page or no org, go to onboarding
|
|
|
|
|
if (isEmpty(orgRes.orgs) && !path.includes('invite')) {
|
2023-05-15 15:13:42 +00:00
|
|
|
goto(ROUTE.ONBOARDING);
|
2023-09-11 11:47:30 +01:00
|
|
|
} else if (params.has('redirect')) {
|
|
|
|
|
goto(params.get('redirect') || '');
|
2023-09-13 06:38:12 +01:00
|
|
|
} else if (shouldRedirectOnAuth(path)) {
|
2023-05-15 15:13:42 +00:00
|
|
|
// By default redirect to first organization
|
|
|
|
|
goto(`/org/${orgRes.currentOrg.siteName}`);
|
|
|
|
|
}
|
2023-09-27 05:35:06 +01:00
|
|
|
}
|
|
|
|
|
if (typeof orgRes?.currentOrg?.theme === 'string') {
|
|
|
|
|
setTheme(orgRes.currentOrg.theme);
|
2021-08-18 19:47:02 +03:00
|
|
|
}
|
2021-07-31 23:06:14 +03:00
|
|
|
}
|
2023-11-23 22:18:31 +00:00
|
|
|
|
2023-12-09 10:56:46 +03:00
|
|
|
if (!profileData && !isPublicRoute($page.url?.pathname)) {
|
2023-11-23 22:18:31 +00:00
|
|
|
goto('/login?redirect=/' + path);
|
|
|
|
|
}
|
2021-07-31 23:06:14 +03:00
|
|
|
}
|
|
|
|
|
|
2021-09-17 06:33:49 +03:00
|
|
|
function handleResize() {
|
|
|
|
|
isMobile.update(() => window.innerWidth <= 760);
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-31 23:06:14 +03:00
|
|
|
onMount(() => {
|
2023-05-13 07:16:32 +01:00
|
|
|
console.log(
|
|
|
|
|
'Welcome to ClassroomIO, we are grateful you chose us.',
|
2023-08-02 19:35:27 +01:00
|
|
|
$page.url.host,
|
2023-08-14 06:22:03 +01:00
|
|
|
`\nIs student domain: ${data.isOrgSite}`
|
2023-05-13 07:16:32 +01:00
|
|
|
);
|
2021-11-10 16:20:17 +02:00
|
|
|
|
2023-09-07 10:47:25 +00:00
|
|
|
if (browser) {
|
|
|
|
|
// Update theme - dark or light mode
|
|
|
|
|
$appStore.isDark = localStorage.getItem('mode') === 'dark';
|
|
|
|
|
toggleBodyByMode($appStore.isDark);
|
|
|
|
|
|
|
|
|
|
const theme = localStorage.getItem('theme');
|
2023-09-27 05:35:06 +01:00
|
|
|
if (data.isOrgSite && data.org?.theme) {
|
|
|
|
|
setTheme(data.org?.theme);
|
|
|
|
|
} else if (theme) {
|
|
|
|
|
setTheme(theme);
|
|
|
|
|
}
|
2023-09-07 10:47:25 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-30 06:04:53 +00:00
|
|
|
setupAnalytics();
|
2023-08-02 19:35:27 +01:00
|
|
|
|
2021-09-17 06:33:49 +03:00
|
|
|
handleResize();
|
|
|
|
|
|
2023-12-09 10:56:46 +03:00
|
|
|
if (!isSupabaseTokenInLocalStorage() && !isPublicRoute($page.url?.pathname)) {
|
2023-08-05 04:44:32 +01:00
|
|
|
console.log('No auth token and is not a public route, redirect to login', path);
|
2023-09-11 11:47:30 +01:00
|
|
|
return goto('/login?redirect=/' + path);
|
2023-08-05 04:44:32 +01:00
|
|
|
}
|
2023-07-07 18:31:22 +01:00
|
|
|
|
2023-08-02 21:17:17 +00:00
|
|
|
const { data: authListener } = supabase.auth.onAuthStateChange((event, session) => {
|
|
|
|
|
// Log key events
|
|
|
|
|
console.log(`event`, event);
|
|
|
|
|
if (event == 'PASSWORD_RECOVERY') {
|
|
|
|
|
console.log('PASSWORD RESET');
|
2021-07-31 23:06:14 +03:00
|
|
|
}
|
2023-08-02 21:17:17 +00:00
|
|
|
|
|
|
|
|
if (path.includes('reset')) {
|
|
|
|
|
console.log('Dont change auth when on reset page');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Skip Authentication
|
2023-08-14 06:22:03 +01:00
|
|
|
if (data.skipAuth) return;
|
2023-08-02 21:17:17 +00:00
|
|
|
|
|
|
|
|
// Authentication Steps
|
2023-12-05 08:31:26 +03:00
|
|
|
if (event === 'SIGNED_IN' || event === 'INITIAL_SESSION') {
|
2023-08-02 21:17:17 +00:00
|
|
|
$user.fetchingUser = true;
|
|
|
|
|
getProfile();
|
2023-12-05 08:31:26 +03:00
|
|
|
} else if (!['TOKEN_REFRESHED'].includes(event)) {
|
2023-08-02 21:17:17 +00:00
|
|
|
console.log('not logged in, go to login');
|
|
|
|
|
return goto('/login');
|
|
|
|
|
}
|
|
|
|
|
});
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-08-14 06:22:03 +01:00
|
|
|
if (data.isOrgSite) {
|
2023-08-24 07:32:19 +00:00
|
|
|
if (!data.org) {
|
|
|
|
|
goto('/404');
|
|
|
|
|
} else {
|
|
|
|
|
$appStore.orgSiteName = data.orgSiteName;
|
|
|
|
|
$appStore.isOrgSite = data.isOrgSite;
|
2023-08-20 19:08:48 +00:00
|
|
|
|
2023-08-24 07:32:19 +00:00
|
|
|
currentOrg.set(data.org);
|
|
|
|
|
}
|
2023-05-16 04:31:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-07-31 23:06:14 +03:00
|
|
|
return () => {
|
2023-08-02 21:17:17 +00:00
|
|
|
console.log('unsubscribed');
|
2023-10-29 12:07:34 +00:00
|
|
|
authListener.subscription.unsubscribe();
|
2021-07-31 23:06:14 +03:00
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
2023-08-10 12:46:14 +01:00
|
|
|
$: path = $page.url?.pathname?.replace('/', '');
|
2023-09-27 05:35:06 +01:00
|
|
|
$: carbonTheme = $appStore.isDark ? 'g100' : 'white';
|
2020-12-24 20:32:05 +02:00
|
|
|
</script>
|
|
|
|
|
|
2021-09-17 06:33:49 +03:00
|
|
|
<svelte:window on:resize={handleResize} />
|
2022-12-30 13:08:54 +01:00
|
|
|
|
|
|
|
|
<svelte:head>
|
|
|
|
|
<link href="/css/carbon.css" rel="stylesheet" />
|
|
|
|
|
</svelte:head>
|
2023-05-11 15:15:18 +00:00
|
|
|
|
2023-09-27 05:35:06 +01:00
|
|
|
<Theme bind:theme={carbonTheme} />
|
2021-05-07 03:43:37 +03:00
|
|
|
|
2021-08-28 22:44:06 +03:00
|
|
|
<Snackbar />
|
2021-05-07 03:43:37 +03:00
|
|
|
|
2023-08-14 06:22:03 +01:00
|
|
|
{#if data.skipAuth}
|
2023-06-17 19:11:29 +00:00
|
|
|
<PlayQuiz />
|
2023-08-14 06:22:03 +01:00
|
|
|
{:else if data.isOrgSite && !path}
|
2023-08-24 07:32:19 +00:00
|
|
|
<OrgLandingPage orgSiteName={data.orgSiteName} org={data.org} />
|
2023-05-15 15:13:42 +00:00
|
|
|
{:else}
|
2023-09-16 22:44:20 +01:00
|
|
|
<main class="dark:bg-black">
|
2023-08-02 19:35:27 +01:00
|
|
|
{#if $navigating && $delayedPreloading}
|
2023-10-30 04:52:00 +00:00
|
|
|
<Backdrop disableCenteredContent={true} className="opacity-90">
|
|
|
|
|
<div class="h-full w-full relative" transition:fly={{ x: -200, duration: 500 }}>
|
|
|
|
|
<ToastNotification kind="info-square" class="absolute bottom-5 left-5">
|
|
|
|
|
<span slot="title" class="flex items-center">
|
|
|
|
|
<span class="mr-2">Redirecting</span>
|
|
|
|
|
<Loading withOverlay={false} small />
|
|
|
|
|
</span>
|
|
|
|
|
<span slot="caption">Taking you to the next page, please wait.</span>
|
|
|
|
|
</ToastNotification>
|
|
|
|
|
</div>
|
2023-05-15 15:13:42 +00:00
|
|
|
</Backdrop>
|
|
|
|
|
{/if}
|
2023-12-09 10:56:46 +03:00
|
|
|
{#if !hideNavByRoute($page.url?.pathname)}
|
|
|
|
|
{#if isOrgPage($page.url?.pathname) || $page.url?.pathname.includes('profile') || isCoursesPage(path)}
|
2023-08-05 04:44:32 +01:00
|
|
|
<OrgNavigation bind:title={$course.title} isCoursePage={isCoursesPage(path)} />
|
2023-12-09 10:56:46 +03:00
|
|
|
{:else if isLMSPage($page.url?.pathname)}
|
2023-05-16 04:31:45 +00:00
|
|
|
<LMSNavigation />
|
2023-05-15 15:13:42 +00:00
|
|
|
{:else}
|
2023-05-16 04:31:45 +00:00
|
|
|
<LandingNavigation
|
2023-08-14 06:22:03 +01:00
|
|
|
isOrgSite={data.isOrgSite}
|
|
|
|
|
logo={data.isOrgSite ? $currentOrg.avatar_url : undefined}
|
|
|
|
|
orgName={data.isOrgSite ? $currentOrg.name : undefined}
|
2023-08-18 19:28:41 +00:00
|
|
|
disableSignup={false}
|
2023-05-16 04:31:45 +00:00
|
|
|
/>
|
2023-05-15 15:13:42 +00:00
|
|
|
{/if}
|
2023-01-03 09:26:08 +01:00
|
|
|
{/if}
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-05-15 15:13:42 +00:00
|
|
|
<div class="flex justify-between">
|
2023-12-13 09:02:52 +03:00
|
|
|
<slot />
|
2021-07-31 23:06:14 +03:00
|
|
|
|
2023-05-15 15:13:42 +00:00
|
|
|
{#if showAppsSideBar(path)}
|
|
|
|
|
<Apps />
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
2021-07-31 23:06:14 +03:00
|
|
|
{/if}
|
2021-05-07 03:43:37 +03:00
|
|
|
|
2020-12-24 20:32:05 +02:00
|
|
|
<style>
|
2020-12-30 22:29:01 +02:00
|
|
|
main {
|
2023-08-18 19:28:41 +00:00
|
|
|
background-color: white;
|
2020-12-30 22:29:01 +02:00
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2020-12-26 02:22:37 +02:00
|
|
|
|
2021-04-03 16:43:02 +03:00
|
|
|
:global(a:hover) {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
2021-05-06 08:22:25 +03:00
|
|
|
:global(:root) {
|
2021-07-28 22:29:23 +03:00
|
|
|
--main-primary-color: rgba(29, 78, 216, 1);
|
2021-05-06 08:22:25 +03:00
|
|
|
--border-color: #eaecef;
|
2022-11-28 11:23:46 +01:00
|
|
|
--app-background-color: #fafbfc;
|
2023-08-18 08:28:18 +01:00
|
|
|
--app-background: radial-gradient(
|
|
|
|
|
circle at 10% 20%,
|
|
|
|
|
rgb(239, 246, 249) 0%,
|
|
|
|
|
rgb(206, 239, 253) 90%
|
|
|
|
|
);
|
2023-09-26 11:23:54 +01:00
|
|
|
--dark-app-background: radial-gradient(circle at 10% 20%, rgb(0 0 0) 0%, rgb(27 60 74) 90%);
|
2022-11-28 11:23:46 +01:00
|
|
|
}
|
|
|
|
|
|
2023-08-18 08:28:18 +01:00
|
|
|
:global(.app-background) {
|
|
|
|
|
background: var(--app-background);
|
2021-05-06 08:22:25 +03:00
|
|
|
}
|
2023-09-26 11:23:54 +01:00
|
|
|
:global(.dark .app-background) {
|
|
|
|
|
background: var(--dark-app-background);
|
|
|
|
|
}
|
2023-04-23 22:28:18 +00:00
|
|
|
|
|
|
|
|
:global(.bx--data-table-container) {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2023-05-05 20:19:45 +00:00
|
|
|
|
2023-08-20 21:28:55 +01:00
|
|
|
:global(.dark svg.dark) {
|
2023-05-05 20:19:45 +00:00
|
|
|
fill: #fff;
|
|
|
|
|
}
|
2023-05-11 15:15:18 +00:00
|
|
|
|
|
|
|
|
:global(.border-c) {
|
|
|
|
|
border: 1px solid var(--border-color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.border-bottom-c) {
|
|
|
|
|
border-bottom: 1px solid var(--border-color);
|
|
|
|
|
}
|
2023-08-07 09:53:07 +00:00
|
|
|
|
|
|
|
|
:global(.bx--search-close > svg) {
|
|
|
|
|
fill: black;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.dark .bx--search-close:hover > svg) {
|
|
|
|
|
fill: #fff;
|
|
|
|
|
}
|
2023-08-11 09:44:50 +01:00
|
|
|
|
|
|
|
|
:global(.plyr__controls) {
|
2023-12-04 19:39:39 +03:00
|
|
|
background:
|
|
|
|
|
url(/logo-192.png) 99% 70% no-repeat,
|
2023-08-11 09:44:50 +01:00
|
|
|
linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5)) !important;
|
2023-12-04 19:39:39 +03:00
|
|
|
background-size:
|
|
|
|
|
50px auto,
|
|
|
|
|
auto !important;
|
2023-08-11 09:44:50 +01:00
|
|
|
}
|
2023-08-24 07:32:19 +00:00
|
|
|
|
|
|
|
|
:global(.cards-container) {
|
|
|
|
|
width: 90%;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 0;
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
|
|
|
column-gap: 12px;
|
|
|
|
|
row-gap: 12px;
|
|
|
|
|
}
|
2023-09-12 11:31:20 +00:00
|
|
|
|
2023-09-08 09:17:05 +00:00
|
|
|
@media screen and (max-width: 768px) {
|
|
|
|
|
:global(.cards-container) {
|
|
|
|
|
width: 95%;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 0;
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
|
|
|
column-gap: 12px;
|
|
|
|
|
row-gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@media screen and (max-width: 457px) {
|
|
|
|
|
.org-slot {
|
|
|
|
|
min-width: 100%;
|
2023-09-08 15:29:08 +01:00
|
|
|
max-height: calc(100vh - 48px);
|
2023-09-08 09:17:05 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-24 20:32:05 +02:00
|
|
|
</style>
|