Revert "Progress sync"

This reverts commit 359018746c.
This commit is contained in:
BOTAlex 2024-03-31 21:49:37 +02:00
parent 359018746c
commit 041e2935c7
3 changed files with 22 additions and 77 deletions

View file

@ -4,8 +4,6 @@
import TopNameTextPlate from "./TopNameTextPlate.svelte";
//import { throttle } from "./../Utils/Throttle";
import { Parallax, ParallaxLayer, StickyLayer } from "svelte-parallax";
// Params
let mouseMoveScale: number = 0.25;
let targetTextLenght: number = 100;
@ -54,32 +52,24 @@
windowRef.addEventListener("resize", updateDimensions);
const RevertToOrigin = () => {
if (
navigator.userAgent.search(/gecko/i) > 0 &&
StartPageAnimated !== null
) {
StartPageAnimated.classList.add("FirefoxSmoothTranition");
if(navigator.userAgent.search(/gecko/i)>0 && StartPageAnimated !== null){
StartPageAnimated.classList.add('FirefoxSmoothTranition');
}
updateAnimation(new Vector2(windowWidth / 2, windowHeight / 2));
updateAnimation(new Vector2(windowWidth/2, windowHeight/2));
};
document.documentElement.addEventListener("mouseleave", RevertToOrigin);
document.documentElement.addEventListener('mouseleave', RevertToOrigin)
const RemoveFirefoxSmoothTranition = () => {
if (
navigator.userAgent.search(/gecko/i) > 0 &&
StartPageAnimated !== null
) {
StartPageAnimated.classList.remove("FirefoxSmoothTranition");
if(navigator.userAgent.search(/gecko/i)>0 && StartPageAnimated !== null){
StartPageAnimated.classList.remove('FirefoxSmoothTranition');
}
};
document.documentElement.addEventListener(
"mouseenter",
RemoveFirefoxSmoothTranition,
);
document.documentElement.addEventListener('mouseenter', RemoveFirefoxSmoothTranition)
return () => {
windowRef.removeEventListener("resize", updateDimensions);
};
});
const programmingLanguages: string[] = [
@ -91,52 +81,27 @@
"JAVASCRIPT",
"TYPESCRIPT",
"HTML",
"CSS",
"CSS"
];
function getRandomInt(max: number) {
return Math.floor(Math.random() * max);
}
function GrabRandomString() {
function GrabRandomString(){
let outString: string = "";
while (outString.length < targetTextLenght) {
outString +=
programmingLanguages[
getRandomInt(programmingLanguages.length)
] + " ";
outString += programmingLanguages[getRandomInt(programmingLanguages.length)] + " ";
}
return outString; // At about target size
}
</script>
<svelte:window on:mousemove={onMouseMoved} />
<Parallax sections={2} config={{ stiffness: 0.2, damping: 0.3 }}>
<ParallaxLayer class="StartPageContainer" rate={0.25} offset={0} span={0}>
<div
class="StartPageAnimated"
bind:this={StartPageAnimated}
style="transform: translate({mouseRelativeScaled.x}px, {mouseRelativeScaled.y}px) translateZ(0) rotate(0.001deg);"
>
{#each { length: 100 } as _, i}
<span class="rotate45 SkillsText">
{GrabRandomString()}
</span>
{/each}
</div>
</ParallaxLayer>
<ParallaxLayer rate={0} offset={0.25} span={0}>
<TopNameTextPlate />
</ParallaxLayer>
<ParallaxLayer rate={0.5} offset={0.5} style="background-color: darkblue;">
</ParallaxLayer>
</Parallax>
<!-- <div class="StartPageContainer">
<div class="StartPageContainer">
<div class="TopOverlay">
<TopNameTextPlate/>
</div>
@ -157,13 +122,13 @@
>
{/each}
</div>
</div> -->
</div>
<div id="DummyDiv" class="FirefoxSmoothTranition StartPageContainer TopOverlay" style="display: none !important;" />
<div id="DummyDiv" class="FirefoxSmoothTranition"/>
<style>
.StartPageContainer {
/* height: 40vh; */
height: 40vh;
background-color: burlywood;
overflow: hidden;
@ -188,28 +153,25 @@
transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99);
-moz-transition: none;
left: -25vw;
top: -25vh;
justify-content: center;
vertical-align: middle;
display: flex;
}
.FirefoxSmoothTranition {
.FirefoxSmoothTranition{
transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99);
-moz-transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99) !important;
}
.SkillsText {
font-family: "CozetteVector";
.SkillsText{
font-family: 'CozetteVector';
text-align: start;
font-size: x-large;
display: flex;
justify-content: center;
display: flex;
justify-content: center;
align-items: center;
white-space: nowrap;
white-space:nowrap;
width: 2rem;