updating textsection

This commit is contained in:
T-A-H-prog
2026-03-15 16:16:47 +01:00
parent c45c80fc47
commit 5b3ac4fb89
10 changed files with 145 additions and 74 deletions

7
src/assets/bird-claw.svg Normal file
View File

@@ -0,0 +1,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg fill="#ffffff" width="800px" height="800px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,9 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill="#000000">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier">

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1024 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -4,70 +4,104 @@ import { ref, onMounted, onUnmounted } from "vue"
import gsap from "gsap"
import ScrollTrigger from "gsap/ScrollTrigger"
import Flip from 'gsap/dist/Flip'
import { checkCompatEnabled } from "@vue/compiler-core"
gsap.registerPlugin(Flip, ScrollTrigger)
let flipCtx;
const createTimeline = () => {
flipCtx && flipCtx.revert(); // alte Flip-Timeline zurücksetzen
flipCtx = gsap.context(() => {
const flipConfig = { ease: "none", duration: 1 };
// Flip-States der Marker holen
const secondState = Flip.getState(".second .marker");
const thirdState = Flip.getState(".third .marker");
// Timeline mit ScrollTrigger
const tl = gsap.timeline({
scrollTrigger: {
trigger: ".container.initial",
start: "clamp(top center)",
endTrigger: ".final",
end: "clamp(bottom center)",
scrub: 1,
}
});
// initial -> second
tl.add(Flip.fit(".circle", secondState, flipConfig))
.add(() => {
gsap.set(".second-btn", { opacity: 1, pointerEvents: "auto" , zIndex: 1000});
}, "+=0.1");
// second -> third
tl.add(Flip.fit(".circle", thirdState, flipConfig))
.add(() => {
gsap.set(".third-btn", { opacity: 1, pointerEvents: "auto" });
}, "+=0.01");
});
};
gsap.registerPlugin(Flip, ScrollTrigger);
let ctx, renderer, scene, camera, mesh, canvasEl;
function initThree(canvas) {
renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
renderer.outputColorSpace = THREE.SRGBColorSpace;
onMounted(() => {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(45, 1, 0.1, 100);
camera.position.set(0, 0, 3);
createTimeline();
const mat = new THREE.MeshBasicMaterial({ map: makeGradientNoiseTexture() });
mesh = new THREE.Mesh(new THREE.BoxGeometry(1, 1, 1), mat);
scene.add(mesh);
window.addEventListener("resize", createTween)
ScrollTrigger.refresh()
gsap.ticker.add(render);
onResize();
})
buildTimeline();
}
onUnmounted(() => {
flipCtx?.revert()
window.removeEventListener("resize", createTween);
gsap.ticker.remove(updateMorph)
})
window.addEventListener("resize", createTimeline)
</script>
<template>
<div class="spacer">scroll down</div>
<div class="main">
<div class="container initial">
<h2 class="fade-text">
Do you want to see where I used to study?
<!-- A blog that <span class="highlight">moves with you</span> -->
</h2>
<p class="fade-text">
</p>
<div class="circle"></div>
</div>
<div class="container second">
<div class="experience-text">
<h2>Do you want to see where I used to study?</h2>
</div>
<div class="marker"></div>
<router-link to="/experience">
<button class="btn">Zur Experience</button>
</router-link>
<button class="btn second-btn">Zur Experience</button>
</router-link>
</div>
<div class="container second">
<div class="marker"></div>
<div class="container third">
<div class="experience-text">
<h2>Here is the final step!</h2>
</div>
<div class="container third">
<div class="marker"></div>
<div class="marker"></div>
<button class="btn third-btn">Next</button>
</div>
</div>
</div>
<div class="spacer final"></div>
</template>
<style scoped>
.text-section {
min-height: 100vh;
background: #111;
color: white;
display: flex;
flex-direction: column;
justify-content: center;
padding: 6rem 10%;
}
h2 {
font-size: 1.2rem;
@@ -81,6 +115,8 @@ h2 {
background-position: left;
padding: 0 0.3rem;
}
.btn {
background-color: white;
color: #1a1a2e; /* dunkler Text */
@@ -91,6 +127,7 @@ h2 {
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
opacity: 0;
}
.btn:hover {
@@ -104,10 +141,8 @@ h2 {
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
:root {
--grid-line: rgba(255, 255, 255, 0.08);
--box-border: rgba(255, 255, 255, 0.25);
}
body {
@@ -131,38 +166,69 @@ body {
.spacer {
width: 100%;
height: 20vh;
display: grid;
place-items: center;
font-weight: 600;
letter-spacing: 0.02em;
opacity: 0.8;
display: flex;
align-items: center;
justify-content: center;
}
.main {
position: relative;
height: 200vh;
min-height: 800px;
--grid-line: rgba(255, 255, 255, 0.08);
--box-border: rgba(255, 255, 255, 0.25);
}
.container {
position: absolute;
width: 200px;
height: 200px;
display: grid;
place-items: center;
border: 2px dashed var(--box-border);
border-radius: 12px;
display: flex;
flex-direction: column; /* Items untereinander */
align-items: center; /* horizontal zentrieren */
justify-content: center; /* vertikal zentrieren, kann auch flex-start sein */
}
.experience-text {
width: 200px;
text-align: center;
}
.experience-text h2 {
font-size: 1.2rem;
color: white;
margin: 0;
}
.initial {
left: 60%;
top: 10%;
top: 0%;
}
.container.second {
left: 10%;
top: 50%;
.circle {
width: 100px;
height: 100px;
position: relative;
z-index: 10;
border-radius: 10px;
background-size: contain;
background-repeat: no-repeat;
background-color: transparent;
background-image: url("../../assets/bird-claw.svg");
}
.second {
left: 10%;
top: 50%;
}
.marker {
border-radius: 10px;
}
.second .marker {
@@ -175,24 +241,13 @@ body {
bottom: 3rem;
}
.marker {
width: 200px;
height: 200px;
border-radius: 10px;
outline: 1px dashed var(--grid-line);
outline-offset: -6px;
opacity: 0.6;
.third .marker {
width: 100px;
height: 100px;
}
canvas.box {
width: 200px;
height: 200px;
border: dashed 1px #d2ceff;
display: block;
border-radius: 10px;
background: transparent;
z-index: 2;
}
</style>