Skip to content

Commit 6021f27

Browse files
committed
string changes
1 parent 9479bbc commit 6021f27

File tree

5 files changed

+234
-101
lines changed

5 files changed

+234
-101
lines changed

index.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<meta name="keywords" content="dheeraj, dheeraj kumar rao, rao123dk, dheerajrao80" />
1313
<meta name="author" content="Dheeraj Kumar Rao" />
1414

15-
15+
1616

1717
<!-- Facebook and Twitter integration -->
1818
<meta property="og:title" content=""/>
@@ -29,7 +29,7 @@
2929
<link rel="shortcut icon" href="favicon.ico">
3030
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
3131
<link href='https://fonts.googleapis.com/css?family=Work+Sans:400,300,600,400italic,700' rel='stylesheet' type='text/css'>
32-
32+
3333
<!-- Animate.css -->
3434
<link rel="stylesheet" href="./v1.1/css/animate.css">
3535
<!-- Icomoon Icon Fonts-->
@@ -41,7 +41,7 @@
4141

4242
<!-- Modernizr JS -->
4343
<script src="./v1.1/js/modernizr-2.6.2.min.js"></script>
44-
44+
4545

4646
</head>
4747
<body style="background-image: url(./v1.1/images/bg_img.jpg);">
@@ -117,10 +117,10 @@ <h2>Matriculation</h2>
117117
</div>
118118
</div>
119119

120-
120+
121121

122122
</div>
123-
123+
124124
</div>
125125
</div>
126126
</div>
@@ -142,7 +142,7 @@ <h3>Ballistic Learning Pvt. Ltd.</h3>
142142
</div>
143143
</div>
144144
</div>
145-
145+
146146
</div>
147147
</div>
148148
</div>
@@ -183,6 +183,9 @@ <h3>Ballistic Learning Pvt. Ltd.</h3>
183183
<div class="col-md-4 col-sm-6 col-xs-12 text-center">
184184
<div class="chart" data-percent="70"><span><strong>Ionic</strong>70%</span></div>
185185
</div>
186+
<div class="col-md-4 col-sm-6 col-xs-12 text-center">
187+
<div class="chart" data-percent="70" title="Google Apps Script"><span><strong>GAS</strong>70%</span></div>
188+
</div>
186189

187190
</div>
188191
</div>
@@ -222,7 +225,7 @@ <h3>A light weight plugin for validate the input fields of HTML registration for
222225
</div>
223226
</div>
224227
</div>
225-
228+
226229
</div>
227230
</div>
228231
</div>
@@ -238,7 +241,7 @@ <h3>A light weight plugin for validate the input fields of HTML registration for
238241
</div>
239242
</footer>
240243
</div>
241-
244+
242245
<!-- jQuery -->
243246
<script src="./v1.1/js/jquery.min.js"></script>
244247
<!-- jQuery Easing -->

keycode/action.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
2+
function html_template(keynum){
3+
return temp_html =
4+
`<p><i class="em em-cool"></i> Already Disabled by this code! <i class="em em-cool"></i> </p>
5+
6+
<code>
7+
if(e.ctrlKey && e.keyCode === ${keynum} ){
8+
e.preventDefault();
9+
return false;
10+
}
11+
</code>
12+
`;
13+
}
14+
function trackUserAction(e, keynum){
15+
//for ctrl + S
16+
if(e.ctrlKey && keynum ){
17+
rao('#track_code').html(html_template(keynum));
18+
copyToClipBoard();
19+
e.preventDefault();
20+
return false;
21+
}
22+
//for ctrl + W
23+
if(e.ctrlKey && keynum === 87 ){
24+
temp_html =
25+
`<p><i class="em em-cool"></i> Already Disabled by this code! <i class="em em-cool"></i> </p>
26+
27+
<code>
28+
window.onbeforeunload = function () {
29+
return "Really want to quit ?";
30+
};
31+
</code>
32+
`;
33+
rao('#track_code').html(temp_html);
34+
copyToClipBoard();
35+
e.preventDefault();
36+
return false;
37+
}
38+
// ctrl + t
39+
if(e.ctrlKey && keynum === 84) {
40+
e.preventDefault();
41+
return false;
42+
}
43+
}
44+
45+
//for right click
46+
document.addEventListener("contextmenu", function (e) {
47+
var temp_html =
48+
`<p><i class="em em-cool"></i> Already Disabled by this code! <i class="em em-cool"></i> </p>
49+
50+
<code>
51+
document.addEventListener("contextmenu", function (e) {
52+
e.preventDefault();
53+
}, false);
54+
</code>
55+
`;
56+
rao('#track_code').html(temp_html);
57+
e.preventDefault();
58+
}, false);
59+
60+
61+
//for drag and drop
62+
document.addEventListener("dragstart", function(e){
63+
var temp_html =
64+
`<p><i class="em em-cool"></i> Already Disabled by this code! <i class="em em-cool"></i> </p>
65+
<code>
66+
document.addEventListener("dragstart", function(e){
67+
e.preventDefault();
68+
return false;
69+
});
70+
</code>
71+
`;
72+
rao('#track_code').html(temp_html);
73+
e.preventDefault();
74+
return false;
75+
});
76+
77+
document.addEventListener("drop", function(e){
78+
var temp_html =
79+
`<p><i class="em em-cool"></i> Already Disabled by this code! <i class="em em-cool"></i> </p>
80+
<code>
81+
document.addEventListener("drop", function(e){
82+
e.preventDefault();
83+
return false;
84+
});
85+
</code>
86+
`;
87+
rao('#track_code').html(temp_html);
88+
e.preventDefault();
89+
return false;
90+
});
91+
92+
93+
function copyToClipBoard(){
94+
var $temp ='<input type="hidden" id="hiden" value="">';
95+
rao("#body").append($temp);
96+
//document.getElementById(hiden).value = rao('#track_code').text();
97+
rao('#hiden').val(rao('#track_code').text());
98+
document.getElementById('hiden').select();
99+
document.execCommand("copy");
100+
//$temp.remove();
101+
102+
}

keycode/app.js

Lines changed: 95 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,103 +5,116 @@
55

66
"use strict"
77
var key_code_value = {
8-
"112" : "F1",
9-
"113" : "F2",
10-
"114" : "F3",
11-
"115" : "F4",
12-
"116" : "F5",
13-
"117" : "F6",
14-
"118" : "F7",
15-
"119" : "F8",
16-
"120" : "F9",
17-
"121" : "F10",
18-
"122" : "F11",
19-
"123" : "F12",
20-
"91" : "Windows",
21-
"32" : "Space",
22-
"27" : "Esc",
23-
"8" : "Backspace",
24-
"189" : "Dash",
25-
"187" : "Equal",
26-
"220" : "Back slash",
27-
"13" : "Enter",
28-
"222" : "single quote",
29-
"186" : "Semi colon",
30-
"190" : "Period/Dot",
31-
"191" : "Forward slash",
32-
"188" : "Comma",
33-
"16" : "Shift",
34-
"20" : "caps lock",
35-
"9" : "Tab",
36-
"192" : "grave accent",
37-
"17" : "ctrl",
38-
"18" : "alt",
39-
"93" : "Windows menu",
40-
"37" : "Left Arrow",
41-
"38" : "Up Arrow",
42-
"39" : "Right Arrow",
43-
"40" : "Down Arrow",
44-
"45" : "Insert",
45-
"46" : "Delete",
46-
"33" : "Page Up",
47-
"34" : "Page Down",
48-
"35" : "End",
49-
"36" : "Home",
50-
"144" : "Num lock",
51-
"111" : "Divide",
52-
"106" : "Multiply",
53-
"109" : "Subtract",
54-
"107" : "add",
55-
"12" : "Clear",
56-
"219" : "Open bracket ",
57-
"221" : "Close bracket"
58-
59-
60-
8+
"112": "F1",
9+
"113": "F2",
10+
"114": "F3",
11+
"115": "F4",
12+
"116": "F5",
13+
"117": "F6",
14+
"118": "F7",
15+
"119": "F8",
16+
"120": "F9",
17+
"121": "F10",
18+
"122": "F11",
19+
"123": "F12",
20+
"91": "Windows",
21+
"32": "Space",
22+
"27": "Esc",
23+
"8": "Backspace",
24+
"189": "Dash",
25+
"187": "Equal",
26+
"220": "Back slash",
27+
"13": "Enter",
28+
"222": "single quote",
29+
"186": "Semi colon",
30+
"190": "Period/Dot",
31+
"191": "Forward slash",
32+
"188": "Comma",
33+
"16": "Shift",
34+
"20": "caps lock",
35+
"9": "Tab",
36+
"192": "grave accent",
37+
"17": "ctrl",
38+
"18": "alt",
39+
"93": "Windows menu",
40+
"37": "Left Arrow",
41+
"38": "Up Arrow",
42+
"39": "Right Arrow",
43+
"40": "Down Arrow",
44+
"45": "Insert",
45+
"46": "Delete",
46+
"33": "Page Up",
47+
"34": "Page Down",
48+
"35": "End",
49+
"36": "Home",
50+
"144": "Num lock",
51+
"111": "Divide",
52+
"106": "Multiply",
53+
"109": "Subtract",
54+
"107": "add",
55+
"12": "Clear",
56+
"219": "Open bracket ",
57+
"221": "Close bracket"
6158
};
59+
6260
var displaykeycode = rao('#keycode');
6361
var displaykeychar = rao('#keychar');
64-
document.addEventListener("keydown",function(e){
62+
document.addEventListener("keydown", function (e) {
6563
var keynum;
6664
if (window.event) {
67-
keynum = e.keyCode;
68-
} else if(e.which) {
69-
keynum = e.which;
70-
}
71-
var keychar = String.fromCharCode(keynum);
72-
if(key_code_value[keynum]){
73-
keychar = key_code_value[keynum];
74-
e.preventDefault();
75-
}
65+
keynum = e.keyCode;
66+
} else if (e.which) {
67+
keynum = e.which;
68+
}
69+
var keychar = String.fromCharCode(keynum);
70+
if (key_code_value[keynum]) {
71+
keychar = key_code_value[keynum];
72+
e.preventDefault();
73+
}
7674
displaykeycode.text(keynum);
7775
displaykeychar.text(keychar);
7876

79-
if(keynum =>65 && keynum <=90){
80-
displaykeycode.attri("class"," ");
81-
displaykeycode.attri("class","redcolor");
82-
}else{
83-
displaykeycode.attri("class"," ");
84-
displaykeycode.attri("class","greencolor");
77+
if (keynum => 65 && keynum <= 90) {
78+
displaykeycode.attri("class", " ");
79+
displaykeycode.attri("class", "redcolor");
80+
} else {
81+
displaykeycode.attri("class", " ");
82+
displaykeycode.attri("class", "greencolor");
8583
}
8684

87-
88-
// prevent
89-
if((keynum ===83 ||keynum ===68 ||keynum ===65 )&& e.ctrlKey){
90-
e.preventDefault();
91-
return false;
85+
trackUserAction(e, keynum);
86+
// prevent
87+
if ( e.ctrlKey && (keynum === 83 || keynum === 68 || keynum === 65) ) {
88+
//e.preventDefault();
89+
//return false;
9290
}
9391
});
9492

9593
// for ticker
96-
var initial_width=10;
97-
var docwidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
94+
// var initial_width = 10;
95+
// var docwidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
96+
97+
// function increment() {
98+
// initial_width += 2;
99+
// if (initial_width + 50 >= docwidth) {
100+
// clearInterval(d);
101+
// }
102+
// document.getElementById("myprofile").style.width = initial_width + "px";
103+
// }
104+
105+
// var d = setInterval("increment()", 10);
106+
98107

99-
function increment(){
100-
initial_width+=2;
101-
if(initial_width+50>=docwidth) {
102-
clearInterval(d);
108+
var str_arr = 'Press Any key →'.split('');
109+
var str_index = 0;
110+
var temp_str='';
111+
function typing() {
112+
if(str_index === str_arr.length-1){
113+
clearInterval(kk);
103114
}
104-
document.getElementById("myprofile").style.width =initial_width+"px";
115+
temp_str +=str_arr[str_index];
116+
rao('#welcome').text(temp_str + "|");
117+
str_index++;
105118
}
106119

107-
var d= setInterval("increment()",10);
120+
var kk = setInterval("typing()", 500);

0 commit comments

Comments
 (0)