ZAKAI LAB
ANIMATION LIBRARY

IDEAS
DESIGN
TECHNOLOGY
PEOPLE

MOTION
FOR A
BRIGHTER WEB

01.004

Depth Typography Reveal

AI flows. Ideas connect.
Scroll
GSAP
Backgrounds

IMAGINE

IMAGINE

				
					סקריפט 1: Depth IN

מתאים למבנה:

Container
class: liora-depth-in
│
└── Text
    class: liora-depth-target

הסקריפט המלא:

<script>
window.addEventListener('load', function () {

	/* =======================
	   LIORA MOTION LIBRARY
	   01.004 - DEPTH TYPOGRAPHY REVEAL
	   VARIANT: DEPTH IN
	   ======================== */

	if (
		typeof gsap === 'undefined' ||
		typeof ScrollTrigger === 'undefined'
	) {
		console.error(
			'01.004 Depth In: GSAP or ScrollTrigger is missing.'
		);

		return;
	}


	gsap.registerPlugin(ScrollTrigger);


	const scenes =
		document.querySelectorAll(
			'.liora-depth-in'
		);


	if (!scenes.length) return;


	scenes.forEach(function (scene) {

		const target =
			scene.querySelector(
				'.liora-depth-target'
			);


		if (!target) {

			console.warn(
				'01.004 Depth In: .liora-depth-target not found.',
				scene
			);

			return;
		}


		/* START:
		   HUGE + BLURRED
		==================== */

		gsap.set(target, {

			scale: 4.5,

			z: 500,

			opacity: 0.35,

			filter: 'blur(18px)',

			transformOrigin:
				'center center'

		});


		/* REVEAL:
		   NORMAL + SHARP
		================*/

		gsap.to(target, {

			scale: 1,

			z: 0,

			opacity: 1,

			filter: 'blur(0px)',

			ease: 'none',


			scrollTrigger: {

				trigger: scene,

				start: 'top 85%',

				end: 'center 45%',

				scrub: 1,

				invalidateOnRefresh: true

			}

		});

	});


	requestAnimationFrame(function () {

		ScrollTrigger.refresh();

	});

});
</script>

סקריפט 2: Depth OUT

מתאים למבנה:

Container
class: liora-depth-out
│
└── Text
    class: liora-depth-target

הסקריפט המלא:

<script>
window.addEventListener('load', function () {

	/* =========================
	   LIORA MOTION LIBRARY
	   01.004 - DEPTH TYPOGRAPHY REVEAL
	   VARIANT: DEPTH OUT
	   ===================== */

	if (
		typeof gsap === 'undefined' ||
		typeof ScrollTrigger === 'undefined'
	) {
		console.error(
			'01.004 Depth Out: GSAP or ScrollTrigger is missing.'
		);

		return;
	}


	gsap.registerPlugin(ScrollTrigger);


	const scenes =
		document.querySelectorAll(
			'.liora-depth-out'
		);


	if (!scenes.length) return;


	scenes.forEach(function (scene) {

		const target =
			scene.querySelector(
				'.liora-depth-target'
			);


		if (!target) {

			console.warn(
				'01.004 Depth Out: .liora-depth-target not found.',
				scene
			);

			return;
		}


		/* START:
		   NORMAL + SHARP
		=================== */

		gsap.set(target, {

			scale: 1,

			z: 0,

			opacity: 1,

			filter: 'blur(0px)',

			transformOrigin:
				'center center'

		});


		/* EXIT:
		   HUGE + BLURRED
		=================== */

		gsap.to(target, {

			scale: 5,

			z: 600,

			opacity: 0.18,

			filter: 'blur(20px)',

			ease: 'none',


			scrollTrigger: {

				trigger: scene,

				start: 'top 70%',

				end: 'bottom 20%',

				scrub: 1,

				invalidateOnRefresh: true

			}

		});

	});


	requestAnimationFrame(function () {

		ScrollTrigger.refresh();

	});

});
</script>
				
			
				
					/* ======================
   LIORA MOTION LIBRARY
   01.004 - DEPTH TYPOGRAPHY REVEAL
   SHARED STYLE
   ======================= */

.liora-depth-in,
.liora-depth-out {
	position: relative;

	min-height: 420px;

	display: flex;
	align-items: center;
	justify-content: center;

	overflow: hidden;

	perspective: 1000px;
}


/* ANIMATION TARGET
========================== */

.liora-depth-in .liora-depth-target,
.liora-depth-out .liora-depth-target {
	position: relative;

	z-index: 2;

	transform-origin: center center;

	will-change:
		transform,
		opacity,
		filter;

	backface-visibility: hidden;
}


/* ACCESSIBILITY
====================== */

@media (prefers-reduced-motion: reduce) {

	.liora-depth-in .liora-depth-target,
	.liora-depth-out .liora-depth-target {
		transform: none !important;
		filter: none !important;
		opacity: 1 !important;
	}
}
				
			
				
					המבנה
LIVE DEMO
│
└── Container
    class: liora-depth-in
    │
    └── Text / Paragraph
        class: liora-depth-target
Classes באתר

על הקונטיינר הראשי:

liora-depth-in

על אלמנט הטקסט:

liora-depth-target

התוצאה:

ענק + מטושטש → רגיל + חד

01.004 - Depth Typography Reveal OUT
המבנה
LIVE DEMO
│
└── Container
    class: liora-depth-out
    │
    └── Text / Paragraph
        class: liora-depth-target
Classes באתר

על הקונטיינר הראשי:

liora-depth-out

על אלמנט הטקסט:

liora-depth-target

התוצאה:

רגיל + חד → ענק + מטושטש

וככה אני מעדיפה את זה גם לספרייה. הרבה יותר ברור מאשר:

liora-depth-text depth-in
liora-depth-text depth-out

יש לנו פשוט:

liora-depth-in
liora-depth-out

וה־target המשותף לשניהם:

liora-depth-target

רק חשוב: אם אנחנו משנות לזה עכשיו את ה־classes באתר, צריך להתאים גם את ה־CSS וה־JS שכבר עובדים לשמות החדשים.
				
			

מה אפשר לשנות.. ואיך ⚙️

EXPLORE / LEARN / REUSE / CREATE

.Costomize to fit your vision

 

בסקריפט Depth IN אפשר לשנות:

 
scale: 4.5
 

קובע כמה גדול הטקסט בתחילת האנימציה. ערך גבוה יותר = הטקסט מתחיל גדול וקרוב יותר.

 
z: 500
 

קובע את תחושת העומק ההתחלתית. ערך גבוה יותר = אפקט עומק חזק יותר.

 
opacity: 0.35
 

קובע כמה הטקסט נראה בתחילת האנימציה. 0 שקוף, 1 אטום לחלוטין.

 
filter: 'blur(18px)'
 

קובע את הטשטוש ההתחלתי. ערך גבוה יותר = טשטוש חזק יותר.

 
start: 'top 85%',
end: 'center 45%',
 

קובעים מתי האנימציה מתחילה ומתי היא מגיעה למצב הסופי.

 
scrub: 1
 

קובע את הרכות שבה האנימציה עוקבת אחרי הגלילה. ערך גבוה יותר יוצר תגובה רכה ואיטית יותר.


 

Depth OUT

בסקריפט Depth OUT אפשר לשנות:

 
scale: 5
 

קובע כמה הטקסט יגדל במהלך הגלילה. לדוגמה 7 ייצור יציאה הרבה יותר גדולה ודרמטית.

 
z: 600
 

קובע כמה הטקסט מתקדם לעבר הצופה.

 
opacity: 0.18
 

קובע כמה מהטקסט נשאר גלוי בסוף. 0 יגרום לו להיעלם לחלוטין.

 
filter: 'blur(20px)'
 

קובע כמה הטקסט מיטשטש כשהוא מתקרב לצופה.

 
start: 'top 70%',
end: 'bottom 20%',
 

קובעים את טווח הגלילה של האנימציה. הגדלת הטווח תפרוס את האפקט על פני גלילה ארוכה יותר.

 
scrub: 1
 

קובע את מידת ההחלקה בין הגלילה לתנועה.

פרספקטיבה, משותפת לשניהם

ב־CSS:

 
perspective: 1000px;
 

משפיעה על תחושת העומק של שתי הווריאציות.

ערך נמוך יותר, למשל 700px, יוצר פרספקטיבה חזקה ודרמטית יותר.

ערך גבוה יותר, למשל 1400px, יוצר תחושת עומק עדינה יותר.

כך המשתמש יכול לכוון את האפקט בלי לשנות את המבנה או את ה־classes.

 
 
 

הערה חשובה  🚩  

STYLE: קוד CSS אחד משותף.

SCRIPT 01 – DEPTH IN: מי שמשתמש ב־liora-depth-in לוקח את הסקריפט הראשון.

SCRIPT 02 – DEPTH OUT: מי שמשתמש ב־liora-depth-out לוקח את הסקריפט השני.

האנימציה   בשניהם מבוססת על GSAP + ScrollTrigger. יש לוודא ששתי הספריות נטענות באתר לפני קוד ה־JavaScript של האנימציה.

 

<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js"></script>

מתלבט? בוא/י לדבר איתי בווטסאפ?