starting swiss layout

This commit is contained in:
T-A-H-prog
2026-05-09 10:11:37 +02:00
parent 0c91356320
commit 4978670fc4
2 changed files with 136 additions and 94 deletions

View File

@@ -11,53 +11,29 @@ const section = ref(null);
let ctx;
let split;
let animation;
const date = ref("--:--");
const time = ref("");
let interval;
function createTween() {
split = SplitText.create(".text", { type: "words" });
animation?.kill();
split = SplitText.create(".text", {
type: "words",
});
animation = gsap.from(split.words, {
y: 30,
opacity: 0,
duration: 0.9,
ease: "power2.out",
stagger: 0.05,
const tl = gsap.timeline({
scrollTrigger: {
trigger: ".text",
start: "top 75%",
trigger: section.value,
start: "top 10%",
toggleActions: "play none none none",
},
});
tl.set(".block", {
borderColor: "#fff",
boxShadow: "0 0 0px #fff",
opacity: 0.3,
});
// Flicker
tl.to(".block", {
opacity: 1,
duration: 0.05,
stagger: 0.1,
})
.to(".block", { opacity: 0.4, duration: 0.05, stagger: 0.1 })
.to(".block", { opacity: 1, duration: 0.1 })
.to(".block", { opacity: 0.6, duration: 0.05 })
.to(".block", { opacity: 1, duration: 0.2 });
// Glow aufbauen
tl.to(
".block",
{
boxShadow: "0 0 20px #fff, 0 0 10px #fff",
duration: 0.6,
ease: "power2.out",
},
"-=0.3",
);
tl.from(split.words, {
y: 30, // kleine Bewegung statt Rotation
opacity: 0,
duration: 0.8,
ease: "power2.out", // weicher als power3
stagger: 0.05, // subtiler
});
}
onMounted(() => {
@@ -70,86 +46,151 @@ onMounted(() => {
requestAnimationFrame(() => {
ScrollTrigger.refresh();
});
getTimeDate();
interval = setInterval(() => {
getTimeDate();
}, 1000);
console.log(date.value);
});
function handleResize() {
split && split.revert();
createTween();
split = SplitText.create(".text", {
type: "words",
});
ScrollTrigger.refresh();
}
onUnmounted(() => {
window.removeEventListener("resize", handleResize);
ctx?.revert();
clearInterval(interval);
});
function getTimeDate() {
const now = new Date();
time.value = now.toLocaleTimeString("de-DE", {
timeZone: "Europe/Berlin",
hour: "2-digit",
minute: "2-digit",
});
date.value = now.toLocaleDateString("de-DE", {
timeZone: "Europe/Berlin",
weekday: "long",
day: "2-digit",
month: "long",
year: "numeric",
});
}
</script>
<template>
<div class="container">
<div class="grid">
<div class="block header text">
Welcome to my page!<br />
This site is currently under construction, and Ill be adding new things
over time.
</div>
<div class="poster">
<div class="b-one"></div>
<div class="b-two"></div>
<div class="b-three"></div>
<div class="b-four"></div>
<div class="b-five"></div>
<div class="block mid text">
Im a full-stack developer who wants to improve in design and front-end
development.<br />
</div>
<div class="textblock text">
<h4 class="textblock__subheader text">Tom Alexander Herpel</h4>
<div class="block sidebar text">
This space is where Ill build projects, experiment, and share what I
create along the way.
</div>
<h1 class="textblock__header text">
Welcome to my page. <br />
This space is currently under construction.
</h1>
<!-- <div class="block footer">Footer</div> -->
<h4 class="textblock__subheader text">
Here youll find creative projects and ideas that inspire me at the
moment.
</h4>
<p class="textblock__caption">Oldenburg, Germany <br /></p>
</div>
</div>
</template>
<style scoped>
.container {
width: 100vw;
min-height: 1vh;
padding: 20px;
box-sizing: border-box;
}
.grid {
.poster {
display: grid;
grid-template-columns: 1fr 2fr;
grid-template-rows: auto 1fr auto;
gap: 40px;
height: 100%;
grid-template-columns: repeat(33, 1fr);
grid-template-rows: repeat(16, 1fr);
width: 100%;
height: 100vh;
background: var(--bg-clr);
overflow: hidden;
position: relative;
padding: 2rem;
}
.block {
border: 2px solid #fff;
padding: 20px;
border-radius: 8px;
color: white;
/* Schwarze Blöcke */
.b-one,
.b-two,
.b-three,
.b-four,
.b-five {
background: var(--black-clr);
}
.b-one {
grid-column: 1 / 4;
grid-row: 11 / 15;
}
.b-two {
grid-column: 4 / 12;
grid-row: 6 / 8;
}
.b-three {
grid-column: 16 / 18;
grid-row: 8 / 11;
}
.b-four {
grid-column: 11 / 30;
grid-row: 15 / 17;
}
.b-five {
grid-column: 30 / 34;
grid-row: 1 / 11;
}
/* Textbereich */
.textblock {
grid-column: 6 / 28;
grid-row-end: 14;
align-self: center;
color: var(--black-clr);
}
.textblock__subheader {
font-size: 1rem;
font-weight: 500;
margin-bottom: 1rem;
text-transform: uppercase;
letter-spacing: 1px;
}
.textblock__header {
font-size: 4rem;
line-height: 1;
font-weight: 700;
margin-bottom: 2rem;
max-width: 900px;
}
.textblock__caption {
font-size: 0.85rem;
line-height: 1.7;
max-width: 600px;
}
.text {
font-family: Courier New;
font-size: clamp(1.5rem, 3vw, 5rem);
}
.header {
grid-column: 1 / -1;
perspective: 500px;
}
.mid {
grid-column: 2;
line-height: 1.2;
perspective: 500px;
}
.sidebar {
grid-column: 1/ -1;
perspective: 500px;
}
.footer {
grid-column: 1 / -1;
}
</style>

View File

@@ -167,7 +167,7 @@ onUnmounted(() => {
.parallax__content {
justify-content: center;
align-items: center;
min-height: 100svh;
min-height: 50svh;
display: flex;
position: relative;
}
@@ -229,6 +229,7 @@ onUnmounted(() => {
font-weight: 800;
line-height: 1;
position: relative;
/* color: #e84b3d; 633a34 */
}
.parallax__radial-gradient {