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
let mouseMoveScale: number = 0.25;
let targetTextLenght: number = 70;
// Site variables
let mousePos: Vector2;
@ -53,22 +54,53 @@
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>
<svelte:window on:mousemove={onMouseMoved} />
<div class="StartPageContainer">
<div class="TopOverlay"/>
<div
class="StartPageAnimated"
bind:this={StartPageAnimated}
style="transform: translate({mouseRelativeScaled.x}px, {mouseRelativeScaled.y}px);"
>
{#each {length: 100} as _, i}
<span
class="rotate45"
style="display: flex; justify-content: center; align-items: center;"
>TEXT!!!</span
<span
class="rotate45 SkillsText"
>
{GrabRandomString()}
</span
>
{/each}
</div>
</div>
@ -88,8 +120,8 @@
}
.StartPageAnimated {
background: url("https://i1.adis.ws/i/canon/future_of_forests_header_16x9_dc14bbe1e35040f79bf566eedaf5c8f7?$hero-header-half-16by9-dt$");
background-color: aqua;
/* background: url("https://i1.adis.ws/i/canon/future_of_forests_header_16x9_dc14bbe1e35040f79bf566eedaf5c8f7?$hero-header-half-16by9-dt$"); */
background-color: #131313;
position: absolute;
height: 150vh;
width: 150vw;
@ -103,6 +135,22 @@
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 {
transform: rotate(-45deg); /* Rotate the element by 45 degrees */
}