Added text at background

This commit is contained in:
BOTAlex 2024-03-31 05:24:19 +02:00
parent e75b6358ef
commit 8738a77a4e
1 changed files with 54 additions and 6 deletions

View File

@ -5,6 +5,7 @@
// Params // Params
let mouseMoveScale: number = 0.25; let mouseMoveScale: number = 0.25;
let targetTextLenght: number = 70;
// Site variables // Site variables
let mousePos: Vector2; let mousePos: Vector2;
@ -53,22 +54,53 @@
windowRef.removeEventListener("resize", updateDimensions); windowRef.removeEventListener("resize", updateDimensions);
}; };
}); });
const programmingLanguages: string[] = [
"C++",
"C#",
"ARDUINO",
"PYTHON",
"JAVA",
"JAVASCRIPT",
"TYPESCRIPT",
"HTML",
"CSS"
];
function getRandomInt(max: number) {
return Math.floor(Math.random() * max);
}
function GrabRandomString(){
let outString: string = "";
while (outString.length < targetTextLenght) {
outString += programmingLanguages[getRandomInt(programmingLanguages.length)] + " ";
}
return outString; // At about target size
}
</script> </script>
<svelte:window on:mousemove={onMouseMoved} /> <svelte:window on:mousemove={onMouseMoved} />
<div class="StartPageContainer"> <div class="StartPageContainer">
<div class="TopOverlay"/>
<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);"
> >
{#each {length: 100} as _, i}
<span <span
class="rotate45" class="rotate45 SkillsText"
style="display: flex; justify-content: center; align-items: center;" >
>TEXT!!!</span {GrabRandomString()}
</span
> >
{/each}
</div> </div>
</div> </div>
@ -88,8 +120,8 @@
} }
.StartPageAnimated { .StartPageAnimated {
background: url("https://i1.adis.ws/i/canon/future_of_forests_header_16x9_dc14bbe1e35040f79bf566eedaf5c8f7?$hero-header-half-16by9-dt$"); /* background: url("https://i1.adis.ws/i/canon/future_of_forests_header_16x9_dc14bbe1e35040f79bf566eedaf5c8f7?$hero-header-half-16by9-dt$"); */
background-color: aqua; background-color: #131313;
position: absolute; position: absolute;
height: 150vh; height: 150vh;
width: 150vw; width: 150vw;
@ -103,6 +135,22 @@
display: flex; display: flex;
} }
.SkillsText{
font-size: x-large;
display: flex;
justify-content: center;
align-items: center;
text-wrap: nowrap;
width: 2rem;
color: rgb(66, 66, 66);
}
.TopOverlay {
position: absolute;
}
.rotate45 { .rotate45 {
transform: rotate(-45deg); /* Rotate the element by 45 degrees */ transform: rotate(-45deg); /* Rotate the element by 45 degrees */
} }