-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacting.js
60 lines (47 loc) · 1.35 KB
/
acting.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
/// <reference path="typings/globals/jquery/index.d.ts" />
homePageTyping();
$(document).ready(function () {
var lastClickedBtn = 'homeBtn';
$('#left-sideBar > ul > li').on('click', function () {
if ($(this).attr('id') != lastClickedBtn) {
btnDecoloration(lastClickedBtn);
lastClickedBtn = $(this).attr('id');
$(this).css('color', '#3EB84E');
var completedDelay = 500,
widthDelay = 600,
className_4display = '#' + $(this).attr('id');
$('.fading_divs > div').each(function () {
$(this).animate({ width: '101%' }, widthDelay).delay(completedDelay).animate({ width: '0' }, widthDelay);
});
setTimeout(function () {
setDisplay(className_4display);
}, widthDelay);
}
})
function setDisplay(className) {
// $(`div[data-type=${JSON.stringify(className)}]`).show();
$("div[data-type^='#']").each(function () {
if ($(this).attr('data-type') != className) {
$(this).hide();
}
else if ($(this).attr('data-type') == className) {
$(this).show();
}
});
}
function btnDecoloration(idName) {
let id = '#' + idName;
$(id).css('color', '#869BA0');
}
});
function homePageTyping() {
var speed = 35;
new Typed("#subtitle #typed", {
strings: ["Freelancer.", "photographer.", 'web developer.', 'blogger.'],
typeSpeed: speed,
backSpeed: speed,
backDelay: 5000,
loop: true,
startDelay: 1000,
});
}