-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
81 lines (79 loc) · 2.75 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
function countdown(){
var current=new Date();
var month=current.getMonth();
var day=current.getDate();
if(month+1>4) year=current.getFullYear()+1;
else if(month+1==4&&day>23) year=current.getFullYear()+1;
else year=current.getFullYear();
var birthday=new Date(year, 04, 23);
birthday.setMonth(birthday.getMonth()-1) //month in 0-11 format
var time1=current.getTime();
var time2=birthday.getTime();
var days=Math.floor((time2-time1)/(1000*60*60*24));
var hour=current.getHours();
hours=24-hour-1;
var minute=current.getMinutes();
minutes=60-minute-1;
var second=current.getSeconds();
seconds=60-second;
if(day==23&&month==3) document.getElementById("bday_reminder").innerHTML="Today is my birthday..!!"
else document.getElementById("bday_reminder").innerHTML=days+" days "+hours+" hours "+minutes+" minutes "+seconds+" seconds for my birthday!!"
setTimeout("countdown()",1000);
}
var heading = null;
function moveText(milliseconds) {
window.setInterval("changePosition()", milliseconds);
}
parity=1;
function changePosition(parity) {
if(parity!=0){
var x = event.clientX;
var y = event.clientY;
}
else {
var x=-10;
var y=10;
}
heading = document.getElementById("bday_reminder");
if(heading != null) {
heading.style.left = x+10;
heading.style.top = y-10;
}
}
function set(){
if(parity!=0){
document.getElementById("tog").innerHTML="stick";
parity=0;}
else{
document.getElementById("tog").innerHTML="unstick";
parity=1;
}
}
function show1()
{
document.getElementById("about_me").style.visibility='visible';
document.getElementById("what_do").style.visibility='hidden';
document.getElementById("contact_me").style.visibility='hidden';
document.getElementById("nav1").style.background="rgba(2,200,200,0.6)";
document.getElementById("nav2").style.background="rgba(200,200,200,0.4)";
document.getElementById("nav3").style.background="rgba(200,200,200,0.4)";
}
function show2()
{
document.getElementById("about_me").style.visibility='hidden';
document.getElementById("what_do").style.visibility='visible';
document.getElementById("contact_me").style.visibility='hidden';
document.getElementById("nav2").style.background="rgba(2,200,200,0.6)";
document.getElementById("nav1").style.background="rgba(200,200,200,0.4)";
document.getElementById("nav3").style.background="rgba(200,200,200,0.4)";
document.getElementById("nav3").style.background.hover="rgba(2,200,200,0.6)";
}
function show3()
{
document.getElementById("what_do").style.visibility='hidden';
document.getElementById("about_me").style.visibility='hidden';
document.getElementById("contact_me").style.visibility='visible';
document.getElementById("nav3").style.background="rgba(2,200,200,0.6)";
document.getElementById("nav1").style.background="rgba(200,200,200,0.4)";
document.getElementById("nav2").style.background="rgba(200,200,200,0.4)";
}