-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
57 lines (52 loc) · 1.94 KB
/
script.js
File metadata and controls
57 lines (52 loc) · 1.94 KB
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
const btnVoltarTopo = document.getElementById("back-to-top");
window.onscroll = function () {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
btnVoltarTopo.style.display = "block";
} else {
btnVoltarTopo.style.display = "none";
}
};
btnVoltarTopo.onclick = function () {
window.scrollTo({
top: 0,
behavior: "smooth"
});
};
const translations = {
'en': {
greeting: "hey, I'm Luan 👋",
skillsHeading: "Skills",
toolsHeading: "Tools",
projectsHeading: "Projects",
contactHeading: "Contact",
},
'pt-BR': {
greeting: 'Olá, sou o Luan 👋',
skillsHeading: 'Habilidades',
toolsHeading: 'Ferramentas',
projectsHeading: 'Projetos',
contactHeading: 'Contato',
}
};
function changeLanguage(language) {
const elements = document.querySelectorAll('[id]');
elements.forEach((element) => {
const translation = translations[language][element.id];
if (translation) {
element.textContent = translation;
}
});
const message = document.getElementById('message');
if (language === 'en') {
message.src = "https://readme-typing-svg.herokuapp.com/?color=8727a8&size=33¢er=true&vCenter=true&width=1000&lines=I'm+21+years+old;I+am+from+São+José+do+Rio+Preto,+SP;I+study+Computer+Science+at+Estácio;Be+Welcome!+:%29";
} else if (language === 'pt-BR') {
message.src = "https://readme-typing-svg.herokuapp.com/?color=8727a8&size=33¢er=true&vCenter=true&width=1000&lines=Eu+tenho+21+anos;Eu+sou+de+São+José+do+Rio+Preto,+SP;Eu+estudo+Ciência+da+Computação+na+Estácio;Seja+Bem-vindo!+:%29";
}
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
}
const copyButton = document.querySelector('.copy');
copyButton.addEventListener('click', () => {
copyToClipboard('luan.rezende.contato@gmail.com');
});