Compare commits

...

3 Commits

1 changed files with 27 additions and 3 deletions

View File

@ -6,7 +6,7 @@
// Params // Params
let mouseMoveScale: number = 0.25; let mouseMoveScale: number = 0.25;
let targetTextLenght: number = 70; let targetTextLenght: number = 80;
// Site variables // Site variables
let mousePos: Vector2; let mousePos: Vector2;
@ -51,9 +51,25 @@
windowRef.addEventListener("resize", updateDimensions); windowRef.addEventListener("resize", updateDimensions);
const RevertToOrigin = () => {
if(navigator.userAgent.search(/gecko/i)>0){
StartPageAnimated.classList.add('FirefoxSmoothTranition');
}
updateAnimation(new Vector2(windowWidth/2, windowHeight/2));
};
document.documentElement.addEventListener('mouseleave', RevertToOrigin)
const RemoveFirefoxSmoothTranition = () => {
if(navigator.userAgent.search(/gecko/i)>0){
StartPageAnimated.classList.remove('FirefoxSmoothTranition');
}
};
document.documentElement.addEventListener('mouseenter', RemoveFirefoxSmoothTranition)
return () => { return () => {
windowRef.removeEventListener("resize", updateDimensions); windowRef.removeEventListener("resize", updateDimensions);
}; };
}); });
const programmingLanguages: string[] = [ const programmingLanguages: string[] = [
@ -93,7 +109,7 @@
<div <div
class="StartPageAnimated" class="StartPageAnimated"
bind:this={StartPageAnimated} bind:this={StartPageAnimated}
style="transform: translate({mouseRelativeScaled.x}px, {mouseRelativeScaled.y}px);" style="transform: translate({mouseRelativeScaled.x}px, {mouseRelativeScaled.y}px) translateZ(0) rotate(0.001deg);"
> >
{#each {length: 100} as _, i} {#each {length: 100} as _, i}
@ -107,6 +123,8 @@
</div> </div>
</div> </div>
<div id="DummyDiv" class="FirefoxSmoothTranition"/>
<style> <style>
.StartPageContainer { .StartPageContainer {
height: 40vh; height: 40vh;
@ -131,13 +149,19 @@
padding: 0; padding: 0;
transition: all 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99); transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99);
-moz-transition: none;
justify-content: center; justify-content: center;
vertical-align: middle; vertical-align: middle;
display: flex; display: flex;
} }
.FirefoxSmoothTranition{
transition: none;
-moz-transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99) !important;
}
.SkillsText{ .SkillsText{
font-family: 'CozetteVector'; font-family: 'CozetteVector';