Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue: #1231; #1243

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,36 @@
content="width=device-width, initial-scale=1.0, user-scalable=yes"
/>
<meta name="theme-color" content="#292929" />
<link
rel="stylesheet"
type="text/css"
href="/app.css"
/>
<!--
IMPORTANT
mobile usability override
-->
<style>
body.googlebot-override main {
overflow: hidden;
}
body.googlebot-override p,
body.googlebot-override span,
body.googlebot-override h1,
body.googlebot-override h2 {
font-size: 14px;
}
body.googlebot-override div,
body.googlebot-override button,
body.googlebot-override a,
body.googlebot-override img,
body.googlebot-override td {
margin: 10px;
}
body.googlebot-override div#splash-screen {
margin: 0;
}
</style>
<!--
[β„Ή] Website Icons & Favicons
-->
Expand Down Expand Up @@ -108,7 +138,10 @@
</head>
<body
data-sveltekit-preload-data="hover"
class="no-scrollbar">
class="
no-scrollbar
googlebot-override
">
<div id="svelte">
%sveltekit.body%
</div>
Expand Down
54 changes: 32 additions & 22 deletions src/lib/components/_Splash_screen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,46 @@
[TypeScript Written]
=================== -->
<script lang="ts">
import { onMount } from 'svelte';
import { browser } from '$app/environment';
import { onMount } from 'svelte';

/**
* Description:
* ~~~~~~~~~~~~
* Set a Timer To Show/Hide the
* Elements of the HTML Page
*/
let show: boolean = true;
onMount(async () => {
// ... itialiazing timer,
// ... reset all of the values to its initial state;
setTimeout(async () => {
show = false;
document.documentElement.classList.remove(
'no-scrollbar'
);
document.body.classList.remove(
'no-scrollbar'
);
}, 500);
});
let show: boolean = true;

$: if (browser)
{
document.documentElement.classList.remove(
'googlebot-override'
);
document.body.classList.remove(
'googlebot-override'
);
}

/**
* @summary [LIFECYCLE]
* @description triggers events onLoad of the
* page/component;
*/
onMount(async () => {
setTimeout(async () => {
show = false;
document.documentElement.classList.remove(
'no-scrollbar'
);
document.body.classList.remove(
'no-scrollbar'
);
}, 500);
});
</script>

<!-- ===================
COMPONENT HTML
=================== -->

{#if show}
<div>
<div
id="splash-screen">
<!-- FIXME: need width & height -->
<img
id="brand-svg"
Expand Down
8 changes: 4 additions & 4 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
import type { Cache_Single_Lang_Footer_Translation_Response } from '$lib/models/_main_/footer/types';
import type { Cache_Single_Lang_Header_Translation_Response } from '$lib/models/_main_/navbar/types';

import Navbar from '$lib/components/page/profile/Navbar.svelte';
import EmailSubscribe from '$lib/components/_Email_subscribe.svelte';
import Footer from '$lib/components/_main_/footer/_Footer.svelte';
import Header from '$lib/components/_main_/header/Header.svelte';
import OfflineAlert from '$lib/components/_Offline_alert.svelte';
import PlatformAlert from '$lib/components/_Platform_alert.svelte';
import SplashScreen from '$lib/components/_Splash_screen.svelte';
import Footer from '$lib/components/_main_/footer/_Footer.svelte';
import Header from '$lib/components/_main_/header/Header.svelte';
import Navbar from '$lib/components/page/profile/Navbar.svelte';

import '../app.css';
// import '../app.css';

const VALID_PROFILE_PAGE_URL: string[] = [
'/u/dashboard',
Expand Down
Loading