forked from amaanabbasi/amaanabbasi.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
100 lines (89 loc) · 3.01 KB
/
script.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
let animateName = "animated pulse";
let animationend = "webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd";
let animatedClass = ".title";
$(animatedClass).mouseenter(function(event){
$(this).addClass(animateName);
});
$(animatedClass).on(animationend, function(event) {
$(this).removeClass(animateName);
});
function toggleActive(newActiveTab) {
$(".navbar-nav > li > a").removeClass("active");
$(`#${newActiveTab}`).addClass("active");
$(".hero-body").hide();
$(`#hero-${newActiveTab}`).empty();
$(`#hero-${newActiveTab}`).show();
}
function getHome() {
$("#hero-home").append(
`<div class="container has-text-centered">
<h1 id="animated-title" class="title is-1 animated pulse" style="font-size:3em;">
Hi, I am Amaan.
</h1>
<h2 class="subtitle">
I am a blogger, programmer and designer.
</h2>
</div>`);
}
function getAbout() {
$("#hero-about").append(
`<section style="padding-left:0;padding-right:0" class="section">
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child notification is-primary">
<p class="title">Vertical...</p>
<p class="subtitle">Top tile</p>
</article>
<article class="tile is-child notification is-warning">
<p class="title">...tiles</p>
<p class="subtitle">Bottom tile</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-info">
<p class="title">Middle tile</p>
<p class="subtitle">With an image</p>
<figure class="image is-4by3">
<img src="https://bulma.io/images/placeholders/640x480.png">
</figure>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-danger">
<p class="title">Wide tile</p>
<p class="subtitle">Aligned with the right tile</p>
<div class="content">
<!-- Content -->
</div>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-success">
<div class="content">
<p class="title">Tall tile</p>
<p class="subtitle">With even more content</p>
<div class="content">
<!-- Content -->
</div>
</div>
</article>
</div>
</div>
</section>`);
}
$(function() {
toggleActive("home");
getHome();
$("#home").click(() => {
toggleActive("home");
getHome();
});
$("#about").click(() => {
toggleActive("about");
getAbout();
});
});