Update 1.js
This commit is contained in:
+8
-5
@@ -49,16 +49,16 @@ async function getCurrentYear() {
|
|||||||
|
|
||||||
getCurrentYear().then(year => {
|
getCurrentYear().then(year => {
|
||||||
const text1 = `an ${year - 2006} years old`;
|
const text1 = `an ${year - 2006} years old`;
|
||||||
const text2 = `I am ${text1} university student studying Computer Engineering. Since 2020, I have mostly improved myself in back-end departments, particularly in Robotic Coding, Mobile Application Development, 2D/3D Game Development, Website Creation, Cyber Security, and AI Prompt Engineering. I have also participated in Teknofest Competitions and TUBITAK projects. Right now, I am working on projects related to AI and IoT. I am passionate about creating innovative solutions that can positively impact people’s lives and contribute to society, and I am always open to exploring new ideas that serve humanity.`;
|
const text2 = `I am ${text1} university student.`;
|
||||||
console.log(text2);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
console.log(text2);
|
||||||
|
|
||||||
/* SCROLL REVEALING */
|
/* SCROLL REVEALING */
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const textContainer = document.getElementById('animatedTextContainer');
|
const textContainer = document.getElementById('animatedTextContainer');
|
||||||
|
|
||||||
//const text = "I am an 18-year-old university student studying Computer Engineering. Since 2020, I have mostly improved myself in back-end departments, particularly in Robotic Coding, Mobile Application Development, 2D/3D Game Development, Website Creation, Cyber Security, and AI Prompt Engineering. I have also participated in Teknofest Competitions and TUBITAK projects. Right now, I am working on projects related to AI and IoT. I am passionate about creating innovative solutions that can positively impact people’s lives and contribute to society, and I am always open to exploring new ideas that serve humanity.";
|
// Eğer container yoksa hata almamak için kontrol et
|
||||||
|
if (!textContainer) return;
|
||||||
|
|
||||||
// Split text into words and wrap each word in a span
|
// Split text into words and wrap each word in a span
|
||||||
const words = text2.split(' ').map(word => {
|
const words = text2.split(' ').map(word => {
|
||||||
@@ -71,14 +71,16 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
// Append words to the text container
|
// Append words to the text container
|
||||||
words.forEach(word => textContainer.appendChild(word));
|
words.forEach(word => textContainer.appendChild(word));
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/* SCROLL EFFECT */
|
||||||
document.addEventListener('scroll', () => {
|
document.addEventListener('scroll', () => {
|
||||||
const words = document.querySelectorAll('.word');
|
const words = document.querySelectorAll('.word');
|
||||||
const scrollPosition = window.scrollY;
|
const scrollPosition = window.scrollY;
|
||||||
const windowHeight = window.innerHeight;
|
const windowHeight = window.innerHeight;
|
||||||
const totalHeight = document.body.scrollHeight;
|
const totalHeight = document.body.scrollHeight;
|
||||||
|
|
||||||
const scrollPercent = scrollPosition*4.7 / (totalHeight - windowHeight);
|
const scrollPercent = (scrollPosition * 4.7) / (totalHeight - windowHeight);
|
||||||
|
|
||||||
words.forEach((word, index) => {
|
words.forEach((word, index) => {
|
||||||
const wordOffset = index / words.length;
|
const wordOffset = index / words.length;
|
||||||
@@ -88,6 +90,7 @@ document.addEventListener('scroll', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*LAZY LOADING*/
|
/*LAZY LOADING*/
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const lazyLoadImages = document.querySelectorAll("img.lazy-load");
|
const lazyLoadImages = document.querySelectorAll("img.lazy-load");
|
||||||
|
|||||||
Reference in New Issue
Block a user