Skip to content

Commit a9c9f62

Browse files
committed
🔥 Remove loader component and update wrapper styles
1 parent 802efb4 commit a9c9f62

File tree

1 file changed

+4
-48
lines changed

1 file changed

+4
-48
lines changed

src/pages/index.astro

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import ButtonTop from '@components/buttons/button-top.svelte';
44
import Contact from '@components/Contact.astro';
55
import Header from '@components/Header.astro';
66
import Hero from '@components/Hero.astro';
7-
import Loader from '@components/Loader.astro';
87
import Navigation from '@components/Navigation.svelte';
98
import Portfolio from '@components/Portfolio.astro';
109
import Skills from '@components/Skills.astro';
@@ -25,63 +24,20 @@ import Layout from '@layouts/Layout.astro';
2524
<Contact />
2625
</div>
2726
</div>
28-
<div class="loader">
29-
<Loader />
30-
</div>
3127
<ButtonTop client:idle/>
3228
</Layout>
3329

34-
<script>
35-
document.addEventListener("DOMContentLoaded", function() {
36-
const loader = document.querySelector('.loader');
37-
const wrapper = document.querySelector('.wrapper');
38-
const load = (): Promise<void> => {
39-
return new Promise(resolve => setTimeout(resolve, 0));
40-
}
41-
42-
load().then(() => {
43-
loader?.remove();
44-
const fragment = window.location.hash;
45-
wrapper?.classList.add('visible');
46-
if(fragment) {
47-
const targetElement = document.querySelector(fragment);
48-
if (targetElement) {
49-
targetElement.scrollIntoView({ behavior: 'smooth' });
50-
}
51-
}
52-
});
53-
});
54-
</script>
55-
5630
<style>
5731
.wrapper {
58-
opacity: 0;
59-
visibility: hidden;
60-
transition: opacity 2.2s ease-in-out, visibility 2.2s ease-in-out, height 2.2s ease-in-out;
61-
height: 0;
62-
overflow: hidden;
63-
}
64-
65-
.wrapper.visible {
6632
opacity: 1;
6733
visibility: visible;
68-
height: auto;
34+
transition: opacity 2.2s ease-in-out, visibility 2.2s ease-in-out, height 2.2s ease-in-out;
35+
overflow: hidden;
6936
max-width: 1200px;
7037
min-width: 380px;
71-
position: relative;
38+
height: auto;
7239
margin: 0 auto;
73-
}
74-
75-
.loader {
76-
opacity: 1;
77-
visibility: visible;
78-
transition: opacity 2s ease-in-out, visibility 2s ease-in-out;
79-
}
80-
81-
.loader.hidden {
82-
opacity: 0;
83-
visibility: hidden;
84-
transition: opacity 2s ease-in-out, visibility 2s ease-in-out;
40+
position: relative;
8541
}
8642

8743
.content {

0 commit comments

Comments
 (0)