Update 1.js
This commit is contained in:
+19
-4
@@ -42,13 +42,25 @@ function switchPhoto() {
|
|||||||
images[currentIndex].classList.add('visible');
|
images[currentIndex].classList.add('visible');
|
||||||
|
|
||||||
|
|
||||||
|
/*GET TIME*/
|
||||||
|
async function getCurrentYear() {
|
||||||
|
return new Date().getFullYear();
|
||||||
|
}
|
||||||
|
|
||||||
|
getCurrentYear().then(year => {
|
||||||
|
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.`;
|
||||||
|
|
||||||
|
|
||||||
/*SCROLL REVEALING*/
|
/*SCROLL REVEALING*/
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const textContainer = document.getElementById('animatedTextContainer');
|
const textContainer = document.getElementById('animatedTextContainer');
|
||||||
const text = "18 yaşında Bilgisayar Mühendisliği okuyan bir üniversite öğrencisiyim. 2020 yılından bu yana kendimi en çok Robotik Kodlama, Mobil Uygulama Geliştirme, 2D/3D Oyun Yapımı, Web Sitesi Oluşturma, Siber Güvenlik ve Yapay Zeka Komut İstemi Mühendisliği başta olmak üzere back-end departmanlarında geliştirdim. Teknofest Yarışmalarına ve TÜBİTAK projelerine de katıldım. Şu anda yapay zeka ve IoT ile ilgili projeler üzerinde çalışıyorum. İnsanların yaşamlarını olumlu yönde etkileyebilecek ve topluma katkıda bulunabilecek yenilikçi çözümler yaratma konusunda tutkuluyum ve insanlığa hizmet eden yeni fikirleri keşfetmeye her zaman açığım.";
|
|
||||||
|
// 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 = text.split(' ').map(word => {
|
const words = text2.split(' ').map(word => {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.textContent = word;
|
span.textContent = word;
|
||||||
span.className = 'word';
|
span.className = 'word';
|
||||||
@@ -57,15 +69,18 @@ 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;
|
||||||
|
|||||||
Reference in New Issue
Block a user