Compare commits
No commits in common. "8e23062fa94e789475d23c5c52b8086ba1c424e3" and "001978ce621c8c303992ff74e166c7f6b5b75edd" have entirely different histories.
8e23062fa9
...
001978ce62
21 changed files with 200 additions and 203 deletions
|
@ -31,7 +31,6 @@
|
|||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"gsap": "^3.12.5",
|
||||
"md-block": "^0.0.1",
|
||||
"svelte-material-icons": "^3.0.5",
|
||||
"svelte-transition": "^0.0.10"
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
// Initialisations
|
||||
|
||||
export const emojis = [
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ☕️',
|
||||
'with 🍵',
|
||||
'with 🍪',
|
||||
'with 💤',
|
||||
'on a 💻',
|
||||
'in 🏫',
|
||||
'at 🏠',
|
||||
'with passion',
|
||||
'with <img src="/assets/emojis/vscodium.png" alt="VSCodium" style="height: 18px;"/>',
|
||||
'with <img src="/assets/emojis/stackoverflow.png" alt="StackOverflow" style="height: 18px;"/>',
|
||||
'with <img src="/assets/emojis/svelte.png" alt="Svelte" style="height: 18px;" />'
|
||||
];
|
|
@ -1,59 +1 @@
|
|||
// index.ts
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { gsap } from 'gsap';
|
||||
import { ScrollToPlugin } from 'gsap/dist/ScrollToPlugin';
|
||||
|
||||
// export function smoothScrollTo(elementId: string) {
|
||||
// const element = document.getElementById(elementId);
|
||||
// if (element) {
|
||||
// element.scrollIntoView({
|
||||
// behavior: 'smooth'
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
export function smoothScrollTo(elementId: string) {
|
||||
gsap.registerPlugin(ScrollToPlugin);
|
||||
const element = document.getElementById(elementId);
|
||||
if (!element) return;
|
||||
|
||||
// Function to disable scrolling
|
||||
const disableScroll = (event: Event) => event.preventDefault();
|
||||
|
||||
// Disable scrolling through various events
|
||||
window.addEventListener('wheel', disableScroll, { passive: false });
|
||||
window.addEventListener('touchmove', disableScroll, { passive: false });
|
||||
window.addEventListener('keydown', (event) => {
|
||||
// Prevent scrolling through spacebar, arrow keys, page up/down
|
||||
if (['Space', 'PageUp', 'PageDown', 'ArrowUp', 'ArrowDown'].includes(event.code)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}, { passive: false });
|
||||
|
||||
gsap.to(window, {
|
||||
scrollTo: { y: element, autoKill: false },
|
||||
duration: 0.1,
|
||||
ease: "power4.out",
|
||||
onComplete: () => {
|
||||
// Re-enable scrolling after animation
|
||||
window.removeEventListener('wheel', disableScroll);
|
||||
window.removeEventListener('touchmove', disableScroll);
|
||||
window.removeEventListener('keydown', disableScroll);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function handleKeydown(event: KeyboardEvent) {
|
||||
// Trigger redirection on Enter key or Space bar
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
smoothScrollTo('home');
|
||||
}
|
||||
}
|
||||
|
||||
export function openWebsite(url: string) {
|
||||
goto(url);
|
||||
}
|
||||
// place files you want to import through the `$lib` alias in this folder.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import '../app.scss';
|
||||
import Navbar from '$lib/components/Navbar.svelte';
|
||||
import Navbar from './Navbar.svelte';
|
||||
|
||||
import { fly } from 'svelte/transition';
|
||||
export let data;
|
||||
|
|
|
@ -1,39 +1,9 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { smoothScrollTo } from '$lib/index';
|
||||
import { gsap } from 'gsap';
|
||||
import { ScrollTrigger } from 'gsap/dist/ScrollTrigger';
|
||||
import { ScrollToPlugin } from 'gsap/dist/ScrollToPlugin';
|
||||
|
||||
import Home from '$lib/components/Home.svelte';
|
||||
import About from '$lib/components/About.svelte';
|
||||
import Projects from '$lib/components/Projects.svelte';
|
||||
import Socials from '$lib/components/Socials.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
onMount(() => {
|
||||
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
|
||||
|
||||
// Assuming each section component has an id set to 'home', 'about', 'projects', 'socials'
|
||||
const sectionIds = ['home', 'about', 'projects', 'socials'];
|
||||
|
||||
sectionIds.forEach((id, i) => {
|
||||
ScrollTrigger.create({
|
||||
trigger: `#${id}`,
|
||||
onEnter: () => smoothScrollTo(id),
|
||||
start: 'top bottom',
|
||||
end: 'bottom top',
|
||||
markers: true
|
||||
});
|
||||
|
||||
ScrollTrigger.create({
|
||||
trigger: `#${id}`,
|
||||
start: 'bottom top',
|
||||
onEnterBack: () => smoothScrollTo(id),
|
||||
markers: true
|
||||
});
|
||||
});
|
||||
});
|
||||
import Home from './Home.svelte';
|
||||
import About from './About.svelte';
|
||||
import Projects from './Projects.svelte';
|
||||
import Socials from './Socials.svelte';
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -45,5 +15,5 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/index.scss';
|
||||
@import '../styles/index.scss';
|
||||
</style>
|
|
@ -1,5 +1,30 @@
|
|||
<script lang="ts">
|
||||
import { smoothScrollTo, handleKeydown } from '$lib/index';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
function smoothScrollTo(elementId: string) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
element.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function redirectToHome() {
|
||||
// goto('/');
|
||||
smoothScrollTo('home');
|
||||
}
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
// Trigger redirection on Enter key or Space bar
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
redirectToHome();
|
||||
}
|
||||
}
|
||||
|
||||
function openWebsite(url: string) {
|
||||
goto(url);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="about" class="section">
|
||||
|
@ -13,7 +38,7 @@
|
|||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
tabindex="0"
|
||||
on:click={() => smoothScrollTo('home')}
|
||||
on:click={redirectToHome}
|
||||
on:keydown={handleKeydown}
|
||||
>
|
||||
<mask
|
||||
|
@ -54,5 +79,5 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/about.scss';
|
||||
@import '../styles/about.scss';
|
||||
</style>
|
|
@ -1,6 +1,32 @@
|
|||
<script lang='ts'>
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import IconChevronDown from 'svelte-material-icons/ChevronDown.svelte';
|
||||
import { smoothScrollTo, handleKeydown } from '$lib/index';
|
||||
|
||||
function smoothScrollTo(elementId: string) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
element.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function redirectToHome() {
|
||||
// goto('/');
|
||||
smoothScrollTo('home');
|
||||
}
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
// Trigger redirection on Enter key or Space bar
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
redirectToHome();
|
||||
}
|
||||
}
|
||||
|
||||
function openWebsite(url: string) {
|
||||
goto(url);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="home" class="section">
|
||||
|
@ -54,6 +80,6 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/index.scss';
|
||||
@import '$styles/home.scss';
|
||||
@import '../styles/index.scss';
|
||||
@import '../styles/home.scss';
|
||||
</style>
|
|
@ -1,16 +1,14 @@
|
|||
<script lang="ts">
|
||||
|
||||
import { smoothScrollTo, handleKeydown } from '$lib/index';
|
||||
|
||||
// Modal
|
||||
import Modal from '$lib/components/Modal.svelte';
|
||||
import DashinitModal from '$lib/modals/dashinit.svelte';
|
||||
import SangeFaultModal from '$lib/modals/sangefault.svelte';
|
||||
import ExploreCraftModal from '$lib/modals/explorecraft.svelte';
|
||||
import UtilityClientModal from '$lib/modals/utilityclient.svelte';
|
||||
import SangeloSpaceModal from '$lib/modals/sangelospace.svelte';
|
||||
import LunivityModal from '$lib/modals/lunivity.svelte';
|
||||
import MoreProjectsModal from '$lib/modals/more.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import Modal from './Modal.svelte';
|
||||
import DashinitModal from './modals/dashinit.svelte';
|
||||
import SangeFaultModal from './modals/sangefault.svelte';
|
||||
import ExploreCraftModal from './modals/explorecraft.svelte';
|
||||
import UtilityClientModal from './modals/utilityclient.svelte';
|
||||
import SangeloSpaceModal from './modals/sangelospace.svelte';
|
||||
import LunivityModal from './modals/lunivity.svelte';
|
||||
import MoreProjectsModal from './modals/more.svelte';
|
||||
// import type { SvelteComponent } from 'svelte';
|
||||
|
||||
let showModal = false;
|
||||
let selectedModule: any = null;
|
||||
|
@ -24,6 +22,27 @@
|
|||
showModal = false;
|
||||
}
|
||||
|
||||
|
||||
function smoothScrollTo(elementId: string) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
element.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function redirectToHome() {
|
||||
// goto('/');
|
||||
smoothScrollTo('home');
|
||||
}
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
// Trigger redirection on Enter key or Space bar
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
redirectToHome();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="projects" class="section">
|
||||
|
@ -37,7 +56,7 @@
|
|||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
tabindex="0"
|
||||
on:click={() => smoothScrollTo('home')}
|
||||
on:click={redirectToHome}
|
||||
on:keydown={handleKeydown}
|
||||
>
|
||||
<mask
|
||||
|
@ -100,5 +119,5 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/projects.scss';
|
||||
@import '../styles/projects.scss';
|
||||
</style>
|
|
@ -1,8 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { slide } from 'svelte/transition';
|
||||
import { smoothScrollTo, handleKeydown, openWebsite } from '$lib/index';
|
||||
import { emojis } from '$lib/emojis';
|
||||
|
||||
// Icons
|
||||
import IconDiscord from 'svelte-material-icons/Discord.svelte';
|
||||
|
@ -15,27 +14,93 @@
|
|||
import IconMastodon from 'svelte-material-icons/Mastodon.svelte';
|
||||
import IconSteam from 'svelte-material-icons/Steam.svelte';
|
||||
|
||||
// Initialisations
|
||||
|
||||
let showMore = false;
|
||||
|
||||
const emojis = [
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ❤️',
|
||||
'with ☕️',
|
||||
'with 🍵',
|
||||
'with 🍪',
|
||||
'with 💤',
|
||||
'on a 💻',
|
||||
'in 🏫',
|
||||
'at 🏠',
|
||||
'with passion',
|
||||
'with <img src="/assets/emojis/vscodium.png" alt="VSCodium" style="height: 18px;"/>',
|
||||
'with <img src="/assets/emojis/stackoverflow.png" alt="StackOverflow" style="height: 18px;"/>',
|
||||
'with <img src="/assets/emojis/svelte.png" alt="Svelte" style="height: 18px;" />'
|
||||
];
|
||||
|
||||
let emoji = '';
|
||||
|
||||
export function changeEmoji() {
|
||||
// Functions
|
||||
|
||||
function changeEmoji() {
|
||||
emoji = emojis[Math.floor(Math.random() * emojis.length)];
|
||||
}
|
||||
|
||||
export function toggleShowMore() {
|
||||
function toggleShowMore() {
|
||||
showMore = !showMore;
|
||||
}
|
||||
|
||||
export function handleKeydownToggleMore(event: KeyboardEvent) {
|
||||
onMount(() => {
|
||||
changeEmoji();
|
||||
});
|
||||
|
||||
function smoothScrollTo(elementId: string) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
element.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function redirectToHome() {
|
||||
// goto('/');
|
||||
smoothScrollTo('home');
|
||||
}
|
||||
|
||||
function handleKeydownHome(event: KeyboardEvent) {
|
||||
// Trigger redirection on Enter key or Space bar
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
redirectToHome();
|
||||
}
|
||||
}
|
||||
|
||||
function handleKeydownToggleMore(event: KeyboardEvent) {
|
||||
// Trigger redirection on Enter key or Space bar
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
toggleShowMore();
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
changeEmoji();
|
||||
});
|
||||
function openWebsite(url: string) {
|
||||
goto(url);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="socials" class="section">
|
||||
|
@ -234,8 +299,8 @@
|
|||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
tabindex="0"
|
||||
on:click={() => smoothScrollTo('home')}
|
||||
on:keydown={handleKeydown}
|
||||
on:click={redirectToHome}
|
||||
on:keydown={handleKeydownHome}
|
||||
>
|
||||
<mask
|
||||
id="mask0_1404_2"
|
||||
|
@ -271,5 +336,5 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/socials.scss';
|
||||
@import '../styles/socials.scss';
|
||||
</style>
|
|
@ -37,6 +37,6 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
</style>
|
|
@ -37,6 +37,6 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
</style>
|
|
@ -37,6 +37,6 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
</style>
|
|
@ -1,4 +1,10 @@
|
|||
<script lang="ts">
|
||||
import Modal from '../Modal.svelte';
|
||||
import DashinitModal from './dashinit.svelte';
|
||||
import SangeFaultModal from './sangefault.svelte';
|
||||
import ExploreCraftModal from './explorecraft.svelte';
|
||||
import UtilityClientModal from './utilityclient.svelte';
|
||||
import SangeloSpaceModal from './sangelospace.svelte'
|
||||
|
||||
import IconCobweb from 'svelte-material-icons/SpiderWeb.svelte';
|
||||
import IconArchive from 'svelte-material-icons/ArchiveOutline.svelte';
|
||||
|
@ -126,7 +132,7 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '$styles/modal-more.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal-more.scss';
|
||||
</style>
|
|
@ -37,6 +37,6 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
</style>
|
|
@ -37,6 +37,6 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
</style>
|
|
@ -37,6 +37,6 @@
|
|||
</content>
|
||||
|
||||
<style lang="scss">
|
||||
@import '$styles/modal.scss';
|
||||
@import '$styles/mobile/modal-mobile.scss';
|
||||
@import '../../styles/modal.scss';
|
||||
@import '../../styles/mobile/modal-mobile.scss';
|
||||
</style>
|
|
@ -2,8 +2,8 @@
|
|||
.container {
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
// scroll-snap-type: y mandatory;
|
||||
// overflow-y: scroll;
|
||||
scroll-snap-type: y mandatory;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.section {
|
||||
|
|
|
@ -8,13 +8,6 @@ const config = {
|
|||
// for more information about preprocessors
|
||||
preprocess: [vitePreprocess({})],
|
||||
|
||||
onwarn: (warning, handler) => {
|
||||
if (warning.code === 'css-unused-selector') {
|
||||
return;
|
||||
}
|
||||
handler(warning);
|
||||
},
|
||||
|
||||
kit: {
|
||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||
|
@ -27,13 +20,7 @@ const config = {
|
|||
fallback: undefined,
|
||||
precompress: false,
|
||||
strict: true
|
||||
}),
|
||||
|
||||
alias: {
|
||||
$routes: "src/routes",
|
||||
$components: "src/components",
|
||||
$styles: "src/styles"
|
||||
},
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -934,11 +934,6 @@ graphemer@^1.4.0:
|
|||
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
|
||||
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
||||
|
||||
gsap@^3.12.5:
|
||||
version "3.12.5"
|
||||
resolved "https://registry.yarnpkg.com/gsap/-/gsap-3.12.5.tgz#136c02dad4c673b441bdb1ca00104bfcb4eae7f4"
|
||||
integrity sha512-srBfnk4n+Oe/ZnMIOXt3gT605BX9x5+rh/prT2F1SsNJsU1XuMiP0E2aptW481OnonOGACZWBqseH5Z7csHxhQ==
|
||||
|
||||
has-flag@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
||||
|
|
Loading…
Reference in a new issue