-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
164 lines (146 loc) · 4.5 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// const observer = new IntersectionObserver((entries) => {
// entries.forEach((element) => {
// if (element.isIntersecting) {
// element.target.classList.add("show");
// } else {
// element.target.classList.remove("show");
// }
// });
// });
// const hiddenElements = document.querySelectorAll(".hidden");
// hiddenElements.forEach((element) => observer.observe(element));
//typing animation
var typed = new Typed('.auto-type', {
strings: ['Software Engineer', 'Fullstack Developer', 'Backend Engineer'],
typeSpeed: 100,
backSpeed: 100,
loop: true,
});
// blob animation
const tween = KUTE.fromTo('#blob1', { path: '#blob1' }, { path: '#blob2' }, { repeat: 999, duration: 3000, yoyo: true });
const tween2 = KUTE.fromTo('#blobshadow1', { path: '#blobshadow1' }, { path: '#blobshadow2' }, { repeat: 999, duration: 3000, yoyo: true });
tween.start();
tween2.start();
// mouse animation
const magiclight = document.querySelector('#magiclight-blurry');
document.body.onpointermove = (event) => {
const { x, y } = event;
magiclight.animate(
{
left: `${x}px`,
top: `${y}px`,
},
{ duration: 3000, fill: 'forwards' }
);
};
const colorChange = document.querySelectorAll('.html, .css, .javascript, .java, .react');
colorChange.forEach((element) => {
const defaultColor = magiclight.style.background;
element.addEventListener('mouseover', () => {
const color = element.dataset.color;
magiclight.style.background = color;
});
element.addEventListener('mouseout', () => {
magiclight.style.background = defaultColor;
});
});
// slider image caraousel
var swiper = new Swiper('.mySwiper', {
effect: 'coverflow',
grabCursor: true,
centeredSlides: true,
slidesPerView: 3,
loop: true,
freeMode: {
enabled: true,
momentumRatio: 0.2,
momentumVelocityRatio: 0.4,
sticky: true,
},
coverflowEffect: {
rotate: 20,
stretch: 0,
depth: 1,
modifier: 1,
},
});
// card render
const portfolio = [
{
title: 'Kelar.in',
year: 2023,
description: "Designed to take your team's productivity to the next level",
backgroundClass: 'kelar-in',
frontendStack: ['react', 'tailwind'],
backendStack: ['java'],
dbStack: ['mysql', 'firestore'],
},
{
title: '-',
year: 2023,
description: 'Discover the magic of experimental artistry with every project we undertake!',
backgroundClass: 'experiment',
frontendStack: [],
backendStack: [],
dbStack: [],
},
{
title: '-',
year: 2023,
description: 'It is like a radiant flower, glowing with the brilliance of creativity..',
backgroundClass: 'flower',
frontendStack: [],
backendStack: [],
dbStack: [],
},
{
title: '-',
year: 2023,
description: 'This will forever be celebrated as a masterpiece of its time.',
backgroundClass: 'timeless',
frontendStack: [],
backendStack: [],
dbStack: [],
},
{
title: '-',
year: 2023,
description: 'I am a masterclass in minimalism, where each stroke and line serves a purpose in the greater composition.',
backgroundClass: 'room',
frontendStack: [],
backendStack: [],
dbStack: [],
},
{
title: '-',
year: 2023,
description: 'My persistence and determination are evident in my tireless work ethic.',
backgroundClass: 'tower',
frontendStack: [],
backendStack: [],
dbStack: [],
},
];
const swiperContainer = document.querySelector('.swiper-wrapper');
function cardPortfolio(card) {
const frontend = card.frontendStack.map((stack) => `<div class="icon ${stack}-icon"></div>`).join('');
const backend = card.backendStack.map((stack) => `<div class="icon ${stack}-icon"></div>`).join('');
const db = card.dbStack.map((stack) => `<div class="icon ${stack}-icon"></div>`).join('');
return `<div class="swiper-slide slide-background ${card.backgroundClass}">
<div class="slide-tech-stack">
<div class="slide-tech-stack-frontend">
${frontend}
</div>
<div class="slide-tech-stack-backend">
${backend}
</div>
<div class="slide-tech-stack-db">
${db}
</div>
</div>
<p class="slide-info-brief">${card.description}</p>
<p class="slide-info-footer">${card.title === '-' ? 'Future Project' : card.title} <span>·</span> ${card.year}</p>
</div>`;
}
const listPort = portfolio.map(cardPortfolio).join('');
swiperContainer.innerHTML = listPort;