├── .gitignore
├── 4otakus.html
├── Bankers-Algo-Simulator.html
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Fireworks.html
├── Flappy.html
├── LICENSE
├── README.md
├── bubble.html
├── canoi.html
├── cheese.html
├── colorgame.html
├── contributors.html
├── css
├── 4otakus.css
├── Bankers-Algo-Simulator.css
├── cheese.css
├── colorgame.css
├── contributors.css
├── drop.css
├── dry.css
├── explosion.css
├── footer.css
├── foxy.css
├── gifheaven.css
├── helpful-material.css
├── index.css
├── navbar.css
├── potato.css
├── rpg.css
├── sidebar.css
├── snek.css
├── spooky-bat.css
├── terminal.css
├── tools.css
└── trylearnhowtoprogram.css
├── dry.html
├── foxy.html
├── gifheaven.html
├── helpful-material.html
├── humans.txt
├── images
├── Fire_Emoji-min.png
├── NinjaDuck_min.jpg
├── ani.jpg
├── bats
│ ├── batcat.jpg
│ ├── batman.jpg
│ ├── darkbat.jpg
│ └── sleepy-bat.jpg
├── browserconfig.xml
├── deku.gif
├── disappointed.jpg
├── favicon
│ ├── android-chrome-192x192.png
│ ├── android-chrome-256x256.png
│ ├── android-chrome-512x512.png
│ ├── apple-touch-icon.png
│ ├── browserconfig.xml
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── favicon.ico
│ ├── mstile-150x150.png
│ ├── safari-pinned-tab.svg
│ └── site.webmanifest
├── forkme.png
├── git_logo.png
├── git_logo_min.png
├── gouda.jpg
├── gouda_min.jpg
├── hacktoberfest-logo-min.png
├── hacktoberfest.JPG
├── hacktoberfest_min.JPG
├── iconAni.png
├── insta_logo.jpg
├── insta_logo_min.jpg
├── katrin-leinfellner-571533-unsplash.jpg
├── lingon-saft.png
├── lingon-saft_min.png
├── logo.png
├── logo3.jpg
├── manifest.json
├── monster.jpg
├── monster_min.jpg
├── naruto.gif
├── paneer.jpg
├── paneer_min.jpg
├── riko2.gif
├── roquefort.jpg
├── roquefort_min.jpg
├── sh_icon.png
├── sh_icon_min.png
├── svg
│ ├── github.svg
│ ├── instagram.svg
│ ├── twitter.svg
│ └── youtube.svg
├── twi_logo.png
├── twi_logo_min.png
├── you_logo.png
├── you_logo_min.png
├── you_logo_transparent.png
└── yt-img
│ ├── how-to-pull-request.jpg
│ ├── how-to-solve-merge-conflicts.jpg
│ └── intro.jpg
├── index.html
├── kotlinconfkeynote.html
├── now.json
├── plain_page.html
├── potato.html
├── register.js
├── robots.txt
├── rpg.html
├── scripts
├── Bankers-Algo-Simulator.js
├── canoi.js
├── cheese.js
├── colorgame.js
├── contributors.js
├── countdown.js
├── drop.js
├── dry.js
├── easter_egg.js
├── explosion.js
├── fireworks.js
├── gifheaven.js
├── hacktoberPest
│ ├── hacktoberPest.css
│ ├── hacktoberPest.html
│ └── spookyBoi.png
├── helpful-material.js
├── iframe.js
├── index.js
├── indices.js
├── konami.js
├── menu.js
├── pokemon.js
├── rpg.js
├── scroll.js
├── snek.js
├── stats.js
├── trylearnhowtoprogram.js
└── wow.js
├── snek.html
├── spooky-bat.html
├── spooky.html
├── styles.css
├── sw.js
├── tools.html
├── trylearnhowtoprogram.html
├── values.html
└── wow.html
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/workspace.xml
2 | .idea/vcs.xml
3 | .idea/hacktoberfest.iml
4 | .idea/modules.xml
5 | .idea/misc.xml
6 | *.sublime-workspace
7 |
--------------------------------------------------------------------------------
/4otakus.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
55 |
59 |
Trending GIFs For You!
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
Click Me!
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/humans.txt:
--------------------------------------------------------------------------------
1 | /* TEAM */
2 | Owner: Lingonsaft.
3 | Site:- https://hacktoberfest.lingonsaft.com/
4 | Twitter:- https://twitter.com/lingonsaft1
5 | Instagram:- https://www.instagram.com/lingonsaftofficial/
6 |
7 | /* THANKS */
8 | To all contributors!
9 |
--------------------------------------------------------------------------------
/images/Fire_Emoji-min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/Fire_Emoji-min.png
--------------------------------------------------------------------------------
/images/NinjaDuck_min.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/NinjaDuck_min.jpg
--------------------------------------------------------------------------------
/images/ani.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/ani.jpg
--------------------------------------------------------------------------------
/images/bats/batcat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/bats/batcat.jpg
--------------------------------------------------------------------------------
/images/bats/batman.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/bats/batman.jpg
--------------------------------------------------------------------------------
/images/bats/darkbat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/bats/darkbat.jpg
--------------------------------------------------------------------------------
/images/bats/sleepy-bat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/bats/sleepy-bat.jpg
--------------------------------------------------------------------------------
/images/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
#ffffff
--------------------------------------------------------------------------------
/images/deku.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/deku.gif
--------------------------------------------------------------------------------
/images/disappointed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/disappointed.jpg
--------------------------------------------------------------------------------
/images/favicon/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/android-chrome-192x192.png
--------------------------------------------------------------------------------
/images/favicon/android-chrome-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/android-chrome-256x256.png
--------------------------------------------------------------------------------
/images/favicon/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/android-chrome-512x512.png
--------------------------------------------------------------------------------
/images/favicon/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/apple-touch-icon.png
--------------------------------------------------------------------------------
/images/favicon/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #da532c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/images/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/images/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/images/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/favicon.ico
--------------------------------------------------------------------------------
/images/favicon/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/favicon/mstile-150x150.png
--------------------------------------------------------------------------------
/images/favicon/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 | Created by potrace 1.11, written by Peter Selinger 2001-2013
9 |
10 |
12 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/images/favicon/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "!!HACKTOBERFEST!!",
3 | "short_name": "Hacktoberfest",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/android-chrome-256x256.png",
12 | "sizes": "256x256",
13 | "type": "image/png"
14 | },
15 | {
16 | "src": "/android-chrome-512x512.png",
17 | "sizes": "512x512",
18 | "type": "image/png"
19 | }
20 | ],
21 | "theme_color": "#ffffff",
22 | "background_color": "#ffffff",
23 | "display": "standalone"
24 | }
25 |
--------------------------------------------------------------------------------
/images/forkme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/forkme.png
--------------------------------------------------------------------------------
/images/git_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/git_logo.png
--------------------------------------------------------------------------------
/images/git_logo_min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/git_logo_min.png
--------------------------------------------------------------------------------
/images/gouda.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/gouda.jpg
--------------------------------------------------------------------------------
/images/gouda_min.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/gouda_min.jpg
--------------------------------------------------------------------------------
/images/hacktoberfest-logo-min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/hacktoberfest-logo-min.png
--------------------------------------------------------------------------------
/images/hacktoberfest.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/hacktoberfest.JPG
--------------------------------------------------------------------------------
/images/hacktoberfest_min.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/hacktoberfest_min.JPG
--------------------------------------------------------------------------------
/images/iconAni.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/iconAni.png
--------------------------------------------------------------------------------
/images/insta_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/insta_logo.jpg
--------------------------------------------------------------------------------
/images/insta_logo_min.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/insta_logo_min.jpg
--------------------------------------------------------------------------------
/images/katrin-leinfellner-571533-unsplash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/katrin-leinfellner-571533-unsplash.jpg
--------------------------------------------------------------------------------
/images/lingon-saft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/lingon-saft.png
--------------------------------------------------------------------------------
/images/lingon-saft_min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/lingon-saft_min.png
--------------------------------------------------------------------------------
/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/logo.png
--------------------------------------------------------------------------------
/images/logo3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/logo3.jpg
--------------------------------------------------------------------------------
/images/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "App",
3 | "icons": [
4 | {
5 | "src": "\/android-icon-36x36.png",
6 | "sizes": "36x36",
7 | "type": "image\/png",
8 | "density": "0.75"
9 | },
10 | {
11 | "src": "\/android-icon-48x48.png",
12 | "sizes": "48x48",
13 | "type": "image\/png",
14 | "density": "1.0"
15 | },
16 | {
17 | "src": "\/android-icon-72x72.png",
18 | "sizes": "72x72",
19 | "type": "image\/png",
20 | "density": "1.5"
21 | },
22 | {
23 | "src": "\/android-icon-96x96.png",
24 | "sizes": "96x96",
25 | "type": "image\/png",
26 | "density": "2.0"
27 | },
28 | {
29 | "src": "\/android-icon-144x144.png",
30 | "sizes": "144x144",
31 | "type": "image\/png",
32 | "density": "3.0"
33 | },
34 | {
35 | "src": "\/android-icon-192x192.png",
36 | "sizes": "192x192",
37 | "type": "image\/png",
38 | "density": "4.0"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/images/monster.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/monster.jpg
--------------------------------------------------------------------------------
/images/monster_min.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/monster_min.jpg
--------------------------------------------------------------------------------
/images/naruto.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/naruto.gif
--------------------------------------------------------------------------------
/images/paneer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/paneer.jpg
--------------------------------------------------------------------------------
/images/paneer_min.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/paneer_min.jpg
--------------------------------------------------------------------------------
/images/riko2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/riko2.gif
--------------------------------------------------------------------------------
/images/roquefort.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/roquefort.jpg
--------------------------------------------------------------------------------
/images/roquefort_min.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/roquefort_min.jpg
--------------------------------------------------------------------------------
/images/sh_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/sh_icon.png
--------------------------------------------------------------------------------
/images/sh_icon_min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/sh_icon_min.png
--------------------------------------------------------------------------------
/images/svg/github.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 | github
4 |
5 |
6 |
--------------------------------------------------------------------------------
/images/svg/instagram.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 | instagram
4 |
5 |
6 |
--------------------------------------------------------------------------------
/images/svg/twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 | twitter
4 |
5 |
6 |
--------------------------------------------------------------------------------
/images/svg/youtube.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 | youtube
4 |
5 |
6 |
--------------------------------------------------------------------------------
/images/twi_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/twi_logo.png
--------------------------------------------------------------------------------
/images/twi_logo_min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/twi_logo_min.png
--------------------------------------------------------------------------------
/images/you_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/you_logo.png
--------------------------------------------------------------------------------
/images/you_logo_min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/you_logo_min.png
--------------------------------------------------------------------------------
/images/you_logo_transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/you_logo_transparent.png
--------------------------------------------------------------------------------
/images/yt-img/how-to-pull-request.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/yt-img/how-to-pull-request.jpg
--------------------------------------------------------------------------------
/images/yt-img/how-to-solve-merge-conflicts.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/yt-img/how-to-solve-merge-conflicts.jpg
--------------------------------------------------------------------------------
/images/yt-img/intro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/images/yt-img/intro.jpg
--------------------------------------------------------------------------------
/kotlinconfkeynote.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
KotlinConf 2018 Keynote
5 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/now.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lingonsaft-hacktober",
3 | "alias": "hacktoberfest.lingonsaft.com"
4 | }
5 |
--------------------------------------------------------------------------------
/plain_page.html:
--------------------------------------------------------------------------------
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 |
!!HACKTOBERFEST!!
36 |
37 |
38 |
39 |
40 |
41 |
48 |
49 |
51 |
52 | Hacktoberfest
53 |
54 |
56 |
57 |
58 |
59 |
93 |
94 |
95 |
96 |
97 |
98 |
HERE IS YOUR CONTENT
99 |
100 |
101 |
102 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
144 |
145 |
146 |
147 |
148 |
149 |
152 |
153 |
154 |
155 |
156 |
--------------------------------------------------------------------------------
/register.js:
--------------------------------------------------------------------------------
1 | if ('serviceWorker' in navigator) {
2 | window.addEventListener('load', () => {
3 | navigator.serviceWorker.register('/sw.js', {scope: '/'}).then((registration) => {
4 | console.log('Service Worker -Registered- With scope: ', registration.scope);
5 | }, (err) => {
6 | // registration failed
7 | console.log('Service Worker -Failed to Register-', err);
8 | });
9 | });
10 | }
--------------------------------------------------------------------------------
/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /
3 |
--------------------------------------------------------------------------------
/rpg.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
RPG
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/scripts/Bankers-Algo-Simulator.js:
--------------------------------------------------------------------------------
1 | function reset(){
2 | document.getElementById('resourceA').value = '';
3 | document.getElementById('resourceB').value = '';
4 | document.getElementById('resourceC').value = '';
5 | for(var i=1; i<=5; i++){
6 | for(var j=1; j<=3; j++){
7 | document.getElementById('a'+i+j).value='';
8 | document.getElementById('m'+i+j).value='';
9 | document.getElementById('n'+i+j).value='';
10 | }
11 | document.getElementById('p'+i).value = ''
12 | document.getElementById('calc'+i).innerHTML = '';
13 | }
14 | document.getElementById('av11').value = '';
15 | document.getElementById('av12').value = '';
16 | document.getElementById('av13').value = '';
17 | document.getElementById('calc0').innerHTML = '';
18 | }
19 |
20 | function sample(){
21 | sam = [[0,1,0],
22 | [2,0,0],
23 | [3,0,2],
24 | [2,1,1],
25 | [0,0,2]];
26 |
27 | max = [[7,5,3],
28 | [3,2,2],
29 | [9,0,2],
30 | [2,2,2],
31 | [4,3,3]];
32 | for(var i=1; i<=5; i++){
33 | for(var j=1; j<=3; j++){
34 | document.getElementById('a'+i+j).value = sam[i-1][j-1];
35 | document.getElementById('m'+i+j).value = max[i-1][j-1];
36 | }
37 | }
38 | document.getElementById('resourceA').value = 10;
39 | document.getElementById('resourceB').value = 5;
40 | document.getElementById('resourceC').value = 7;
41 | document.getElementById('calc0').innerHTML = ' Sample Loaded...';
42 | }
43 |
44 | function find_avai(){
45 | var a = document.getElementById('resourceA').value;
46 | var b = document.getElementById('resourceB').value;
47 | var c = document.getElementById('resourceC').value;
48 | var x = 0;
49 | var y = 0;
50 | var z = 0;
51 | document.getElementById('calc1').innerHTML = '  Calculating the Available Matrix....'+'
'+'Available[n] = Total no. of instances - (Allocation[0][n] + Allocation[1][n] + Allocation[2][n] + Allocation[3][n] + Allocation[4][n])'+'
';
52 | document.getElementById('calc1').innerHTML += 'Available[0] = '+a+' - ';
53 | document.getElementById('calc2').innerHTML = 'Available[1] = '+b+' - ';
54 | document.getElementById('calc3').innerHTML = 'Available[2] = '+c+' - ';
55 | for(var i=1; i<=5; i++){
56 | var x = x + parseInt(document.getElementById('a'+i+'1').value);
57 | document.getElementById('calc1').innerHTML += parseInt(document.getElementById('a'+i+'1').value); if(i<5){document.getElementById('calc1').innerHTML += '+';}else{document.getElementById('calc1').innerHTML += ' = '}
58 | var y = y + parseInt(document.getElementById('a'+i+'2').value);
59 | document.getElementById('calc2').innerHTML += parseInt(document.getElementById('a'+i+'1').value); if(i<5){document.getElementById('calc2').innerHTML += '+';}else{document.getElementById('calc2').innerHTML += ' = '}
60 | var z = z + parseInt(document.getElementById('a'+i+'3').value);
61 | document.getElementById('calc3').innerHTML += parseInt(document.getElementById('a'+i+'1').value); if(i<5){document.getElementById('calc3').innerHTML += '+';}else{document.getElementById('calc3').innerHTML += ' = '}
62 | }
63 | document.getElementById('av11').value = a-x;
64 | document.getElementById('calc1').innerHTML += a-x;
65 | document.getElementById('av12').value = b-y;
66 | document.getElementById('calc2').innerHTML += b-y;
67 | document.getElementById('av13').value = c-z;
68 | document.getElementById('calc3').innerHTML += c-z;
69 | document.getElementById('calc4').innerHTML = '';
70 | document.getElementById('calc5').innerHTML = '';
71 | document.getElementById('calc0').innerHTML = '';
72 | }
73 |
74 | function find_need(){
75 | find_avai();
76 | document.getElementById('calc1').innerHTML = '  Calculating the Need Matrix....'+'
'+'Need[n][n] = Max[n][n] - Allocation[n][n]'+'
';
77 | document.getElementById('calc2').innerHTML = '';
78 | document.getElementById('calc3').innerHTML = '';
79 | document.getElementById('calc4').innerHTML = '';
80 | document.getElementById('calc5').innerHTML = '';
81 | document.getElementById('calc0').innerHTML = '';
82 | for(var i=1; i<=5; i++){
83 | for(var j=1; j<=3; j++){
84 | document.getElementById('n'+i+j).value = parseInt(document.getElementById('m'+i+j).value) - parseInt(document.getElementById('a'+i+j).value);
85 | document.getElementById('calc'+i).innerHTML += 'Need['+(i-1)+']'+'['+(j-1)+']'+' = '+document.getElementById('m'+i+j).value + ' - ' + document.getElementById('a'+i+j).value+' = '+document.getElementById('n'+i+j).value+'      ';
86 | }
87 | }
88 | }
89 |
90 |
91 | function find_sequence(){
92 | find_avai();
93 | find_need();
94 | var k=1;
95 | var checker = 0;
96 | var q = 1;
97 | document.getElementById('calc0').innerHTML = '  Calculating the Final Order....'+'
';
98 | for(var j=1; j<=5; j++){
99 | x1 = parseInt(document.getElementById('av11').value);
100 | x2 = parseInt(document.getElementById('av12').value);
101 | x3 = parseInt(document.getElementById('av13').value);
102 | document.getElementById('calc'+j).innerHTML = 'Step'+j+':  '+'Available Matrix = '+x1+', '+x2+', '+x3;
103 | for(var i=k; i<=5; i++){
104 | var ex1 = parseInt(document.getElementById('a'+i+'1').value);
105 | var ex2 = parseInt(document.getElementById('a'+i+'2').value);
106 | var ex3 = parseInt(document.getElementById('a'+i+'3').value);
107 | if(ex1!= 0 || ex2!= 0 || ex3!= 0){
108 | if(x1 >= parseInt(document.getElementById('n'+i+'1').value) && x2 >= parseInt(document.getElementById('n'+i+'2').value) && x3 >= parseInt(document.getElementById('n'+i+'3').value)){
109 | document.getElementById('p'+q).value = 'P'+i;
110 | document.getElementById('calc'+j).innerHTML += '   As Need['+(j-1)+']['+(i-1)+'] '+'( '+document.getElementById('n'+i+'1').value+', '+document.getElementById('n'+i+'2').value+', '
111 | +document.getElementById('n'+i+'3').value+' ) < Available ( '+x1+', '+x2+', '+x3
112 | +' ) => Process '+i+' is selected. And New Available Matrix is ( '+document.getElementById('av11').value+', '+document.getElementById('av12').value+', '+document.getElementById('av13').value+' ) + ( '+document.getElementById('a'+i+'1').value+', '+document.getElementById('a'+i+'2').value+', '
113 | +document.getElementById('a'+i+'3').value+' ) = ';
114 | document.getElementById('av11').value = parseInt(document.getElementById('av11').value) + parseInt(document.getElementById('a'+i+'1').value);
115 | document.getElementById('av12').value = parseInt(document.getElementById('av12').value) + parseInt(document.getElementById('a'+i+'2').value);
116 | document.getElementById('av13').value = parseInt(document.getElementById('av13').value) + parseInt(document.getElementById('a'+i+'3').value);
117 | document.getElementById('calc'+j).innerHTML += '( '+document.getElementById('av11').value+', '+document.getElementById('av12').value+', '+document.getElementById('av13').value+' )';
118 | document.getElementById('a'+i+'1').value = '0';
119 | document.getElementById('a'+i+'2').value = '0';
120 | document.getElementById('a'+i+'3').value = '0';
121 | k=i+1;
122 | if (k==6){
123 | k=1;
124 | }
125 | q = q + 1;
126 | checker = checker + 1;
127 | break;
128 | }
129 | }
130 | }
131 | }
132 | if(checker == 0){
133 | alert("Deadlock!!");
134 | reset();
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/scripts/canoi.js:
--------------------------------------------------------------------------------
1 | $("#invert").change((e)=>{
2 | var txt = $("#invert").val();
3 | var invtxt = "";
4 |
5 | for (var i = txt.length-1; i>= 0; i--) {
6 | invtxt += txt[i];
7 | }
8 |
9 | $("#inv-text").html(invtxt);
10 | });
--------------------------------------------------------------------------------
/scripts/cheese.js:
--------------------------------------------------------------------------------
1 | let t = document.getElementById('twist').addEventListener('click', () => {
2 | let cards = document.querySelectorAll('.spin')
3 | cards.forEach(card => {
4 | card.classList.toggle('spinCard');
5 | })
6 | }, false)
7 |
8 | // function to change the background of the
part of cheese.html when the user clicks 'click for cheese' btn
9 | function cheeseAppearance(){
10 | var jumbotron = document.getElementById("cheesetron");
11 | var randomNum = Math.floor((Math.random() * 3) + 1);
12 |
13 | switch (randomNum) {
14 | case 1:
15 | jumbotron.className = 'cheesetron-1';
16 | break;
17 | case 2:
18 | jumbotron.className = 'cheesetron-2';
19 | break;
20 | default:
21 | jumbotron.className = 'cheesetron-3';
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/scripts/colorgame.js:
--------------------------------------------------------------------------------
1 | const squares = document.querySelectorAll('.square');
2 | let colors = [];
3 | let pickedColor = undefined;
4 | const messageDisplay = document.querySelector('#message');
5 | const resetButton = document.querySelector('#reset');
6 | const easyBtn = document.querySelector('#easyBtn');
7 | const hardBtn = document.querySelector('#hardBtn');
8 | let numSquares = 6
9 |
10 | genPickColors(numSquares);
11 |
12 | easyBtn.addEventListener("click", function() {
13 | resetBackgroundColors();
14 | this.classList.add("selected");
15 | hardBtn.classList.remove("selected");
16 | numSquares = 3;
17 | genPickColors(numSquares);
18 | for (let i = numSquares; i < squares.length; i++) {
19 | squares[i].style.display = "none";
20 | }
21 | })
22 |
23 | hardBtn.addEventListener("click", function() {
24 | resetBackgroundColors();
25 | this.classList.add("selected");
26 | easyBtn.classList.remove("selected");
27 | numSquares = 6;
28 | genPickColors(numSquares);
29 | for (let i = 3; i < squares.length; i++) {
30 | squares[i].style.display = "block";
31 | }
32 | })
33 |
34 | document.getElementById("colorDisplay").textContent = pickedColor;
35 |
36 | resetButton.addEventListener("click", function() {
37 | resetBackgroundColors();
38 | document.querySelector(".selected").style.backgroundColor = "steelblue";
39 | genPickColors(numSquares);
40 | })
41 |
42 | for (let i = 0; i < colors.length; i++) {
43 | squares[i].style.backgroundColor = colors[i];
44 |
45 | squares[i].addEventListener("click", function() {
46 | const clickedColor = this.style.backgroundColor
47 | if (clickedColor === pickedColor) {
48 | messageDisplay.textContent = "Correct";
49 | changeColors(pickedColor);
50 | resetButton.textContent = "Play Again!";
51 |
52 | } else {
53 | this.style.backgroundColor = "#232323"
54 | messageDisplay.textContent = "Wrong";
55 | }
56 | })
57 | }
58 |
59 | function changeColors(color) {
60 | for (let i = 0; i < squares.length; i++) {
61 | squares[i].style.backgroundColor = color;
62 | }
63 | document.querySelector("h1").style.backgroundColor = pickedColor;
64 | document.querySelector(".selected").style.backgroundColor = pickedColor;
65 | }
66 |
67 | function pickColor() {
68 | return colors[giveRandNumUpto(colors.length)];
69 | }
70 |
71 | function generateRandomColors(num) {
72 | const colors = [];
73 | for (let i = 0; i < num; i++) {
74 | colors[i] = "rgb(" + giveRandNumUpto(256) + ", " + giveRandNumUpto(256) + ", " + giveRandNumUpto(256) + ")";
75 | }
76 | for (let i = 0; i < colors.length; i++) {
77 | squares[i].style.backgroundColor = colors[i];
78 | }
79 | return colors;
80 | }
81 |
82 | function giveRandNumUpto(num) {
83 | return Math.floor(Math.random() * num);
84 | }
85 |
86 |
87 | function genPickColors(num) {
88 | colors = generateRandomColors(num);
89 | pickedColor = pickColor();
90 | document.getElementById("colorDisplay").textContent = pickedColor;
91 | }
92 |
93 | function resetBackgroundColors() {
94 | document.querySelector(".selected").style.backgroundColor = "white";
95 | document.querySelector("h1").style.backgroundColor = "steelblue";
96 | messageDisplay.textContent = "";
97 | // document.querySelector(".selected").style.backgroundColor = "steelblue";
98 | }
--------------------------------------------------------------------------------
/scripts/contributors.js:
--------------------------------------------------------------------------------
1 | let contributors = document.querySelectorAll('.card-text a')
2 | contributors.forEach(con => {
3 | console.log(con.href)
4 | con.innerHTML += ' '
5 | })
--------------------------------------------------------------------------------
/scripts/countdown.js:
--------------------------------------------------------------------------------
1 | const endOfHackathon = new Date('Oct 31, 2018 23:59:59').getTime()
2 | const second = 1000
3 | const minute = second * 60
4 | const hour = minute * 60
5 | const day = hour * 24
6 |
7 | setInterval(() => {
8 | let dateNow = new Date().getTime()
9 | let timeLeft = endOfHackathon - dateNow
10 |
11 | document.getElementById('days').innerText = Math.floor(timeLeft / (day))
12 | document.getElementById('hours').innerText = Math.floor((timeLeft % (day)) / (hour))
13 | document.getElementById('minutes').innerText = Math.floor((timeLeft % (hour)) / (minute))
14 | document.getElementById('seconds').innerText = Math.floor((timeLeft % (minute)) / second)
15 | }, second)
16 |
--------------------------------------------------------------------------------
/scripts/drop.js:
--------------------------------------------------------------------------------
1 | // number of drops created.
2 | var nbDrop = 10;
3 |
4 | // function to generate a random number range.
5 | function randRange( minNum, maxNum) {
6 | return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
7 | }
8 |
9 | // function to generate drops
10 | function createRain() {
11 | var i;
12 | var drop_number = 0;
13 | for (i = 0; i < 10; i++) {
14 | var num_drops = randRange(3,6);
15 | for (x = 0; x <= num_drops; x++) {
16 | var dropLeft = randRange(i*10,i*10+10);
17 | var dropTop = randRange(-1000,1400);
18 | $('.rain').append('🥚
');
19 | $('#drop'+drop_number).css('left',dropLeft+"%");
20 | $('#drop'+drop_number).css('top',dropTop);
21 | drop_number++;
22 | }
23 | }
24 | }
25 | // Make it rain
26 | createRain();
--------------------------------------------------------------------------------
/scripts/dry.js:
--------------------------------------------------------------------------------
1 | class Rain {
2 | constructor(ctx, {width, height}) {
3 | this.width = width
4 | this.height = height
5 | this.ctx = ctx
6 | this.size = Math.floor(Math.random() * 6) + 5
7 | this.x = Math.floor(Math.random() * this.width)
8 | this.y = -this.size
9 | this.vx = 0
10 | this.vy = 0
11 | this.gravity = 0.1
12 | this.maxSpeed = 4
13 | this.color = '#174fd5'
14 | }
15 |
16 | updateVelocity() {
17 | this.vy += this.gravity
18 | }
19 | updatePosition() {
20 | this.y += this.vy
21 | }
22 |
23 | update() {
24 | this.updateVelocity()
25 | this.updatePosition()
26 | this.ctx.fillStyle = this.color
27 | this.ctx.fillRect(this.x, this.y, this.size, this.size)
28 | cc.checkCollission({x: this.x, y: this.y, size: this.size})
29 | }
30 | }
31 |
32 | class Actor {
33 | constructor(ctx, {width, height}) {
34 | this.width = width
35 | this.height = height
36 | this.ctx = ctx
37 | this.size = 10
38 | this.x = this.width/2 - this.size / 2
39 | this.y = this.height/2 - this.size
40 | this.vx = 0
41 | this.vy = 0
42 | this.jumping = true
43 | this.gravity = 0.2
44 | this.friction = 0.8
45 | this.maxSpeed = 4
46 | this.color = '#ffffff'
47 | this.keys = []
48 | this.initializeControls()
49 | }
50 |
51 | initializeControls() {
52 | addEventListener('keydown', ({keyCode}) => {
53 | this.keys[keyCode] = true
54 | })
55 | addEventListener('keyup', ({keyCode}) => {
56 | this.keys[keyCode] = false
57 | })
58 | }
59 |
60 | move() {
61 | if (this.keys[38] && !this.jumping) {
62 | this.jumping = true
63 | this.vy = -this.maxSpeed * 2
64 | }
65 |
66 | if (this.keys[37] && this.vx < this.maxSpeed) {
67 | this.vx -= 0.9
68 | }
69 |
70 | if (this.keys[39] && this.vx > -this.maxSpeed) {
71 | this.vx += 0.9
72 | }
73 | }
74 |
75 | updateVelocity() {
76 | this.vx *= this.friction
77 | this.vy += this.gravity
78 | }
79 |
80 | updatePosition() {
81 | this.y += this.vy
82 | this.x += this.vx
83 | }
84 |
85 | checkBoundries() {
86 | if (this.x >= this.width - this.size) {
87 | this.x = this.width - this.size
88 | } else if (this.x < 0) {
89 | this.x = 0
90 | }
91 |
92 | if (this.y >= this.height - this.size) {
93 | this.jumping = false
94 | this.y = this.height - this.size
95 | }
96 |
97 | cc.updateActor({x: this.x, y: this.y, size: this.size})
98 | }
99 |
100 | update() {
101 | this.updateVelocity()
102 | this.move()
103 | this.updatePosition()
104 | this.checkBoundries()
105 | this.ctx.fillStyle = this.color
106 | this.ctx.fillRect(this.x, this.y, this.size, this.size)
107 | }
108 | }
109 |
110 | class Timer {
111 | constructor(ctx, {width, height}) {
112 | this.ctx = ctx
113 | this.width = width
114 | this.height = height
115 | this.time = 0
116 | this.startTimer()
117 | }
118 |
119 | startTimer() {
120 | setInterval(() => {
121 | this.time += 0.1
122 | }, 100)
123 | }
124 |
125 | update() {
126 | this.ctx.fillStyle = '#ffffff'
127 | this.ctx.font = '15px sans-serif'
128 | this.ctx.textAlign = 'center'
129 | this.ctx.fillText(this.time.toFixed(1), this.width - 25, 25)
130 | cc.setTime(this.time)
131 | }
132 |
133 | getTime() {
134 | return this.time
135 | }
136 | }
137 |
138 | class CollissionControl {
139 | constructor() {
140 | this.actor = {}
141 | this.hasCollided = false
142 | this.time = 0
143 | }
144 |
145 | updateActor({x, y, size}) {
146 | this.actor = {x, y, size}
147 | }
148 |
149 | checkCollission({x, y, size}) {
150 | if (
151 | this.actor.x < x + size &&
152 | this.actor.x + this.actor.size > x &&
153 | this.actor.y < y + size &&
154 | this.actor.size + this.actor.y > y
155 | ) {
156 | this.hasCollided = true
157 | }
158 | }
159 |
160 | isColliding() {
161 | return this.hasCollided
162 | }
163 |
164 | setTime(time) {
165 | this.time = time
166 | }
167 |
168 | getTime() {
169 | return this.time
170 | }
171 | }
172 |
173 | class Scene {
174 | constructor() {
175 | const canvas = document.querySelector('.dry-game')
176 | this.ctx = canvas.getContext('2d')
177 | const {width, height} = canvas
178 | this.width = width
179 | this.height = height
180 | this.objects = []
181 | this.showMenu = true
182 | this.game = true
183 | this.gameOver = false
184 | this.restart = false
185 | this.rainInterval = null
186 | this.initializeMenuControls()
187 | }
188 |
189 | initialize() {
190 | if (this.game) {
191 | this.addObject(
192 | new Actor(this.ctx, {height: this.height, width: this.width}),
193 | )
194 | this.addObject(
195 | new Timer(this.ctx, {height: this.height, width: this.width}),
196 | )
197 | this.rainInterval = setInterval(() => {
198 | this.addObject(
199 | new Rain(this.ctx, {height: this.height, width: this.width}),
200 | )
201 | }, 25)
202 | this.game = false
203 | }
204 | }
205 |
206 | background() {
207 | const gradient = this.ctx.createLinearGradient(0, 0, 170, 0)
208 | gradient.addColorStop(0, '#ff5974')
209 | gradient.addColorStop(1, '#ff0844')
210 | this.ctx.fillStyle = gradient
211 | this.ctx.fillRect(0, 0, this.height, this.width)
212 | }
213 |
214 | addObject(object) {
215 | this.objects.push(object)
216 | }
217 |
218 | beginGame() {
219 | this.objects.forEach(object => object.update())
220 | }
221 |
222 | initializeMenuControls() {
223 | document.querySelector('.dry-game').addEventListener('click', () => {
224 | this.showMenu = false
225 | if (this.gameOver) {
226 | this.restart = true
227 | }
228 | })
229 | }
230 |
231 | menu() {
232 | this.ctx.fillStyle = 'rgba(255, 255, 255, 0.8)'
233 | this.ctx.font = '32px sans-serif'
234 | this.ctx.textAlign = 'center'
235 | this.ctx.fillText('STAY DRY', this.width / 2, this.height / 2 - 10)
236 |
237 | this.ctx.fillStyle = '#ffffff'
238 | this.ctx.font = '50px sans-serif'
239 | this.ctx.textAlign = 'center'
240 | this.ctx.fillText('START', this.width / 2, this.height / 2 + 40)
241 | }
242 |
243 | update() {
244 | this.ctx.clearRect(0, 0, this.width, this.height)
245 | this.background()
246 | this.gameOver = cc.isColliding()
247 | if (this.gameOver) {
248 | clearInterval(this.rainInterval)
249 | this.objects = []
250 | this.ctx.font = '32px sans-serif'
251 | this.ctx.textAlign = 'center'
252 | this.ctx.fillStyle = '#ffffff'
253 | this.ctx.fillText(
254 | `${cc.getTime().toFixed(1)}s`,
255 | this.width / 2,
256 | this.height / 2 - 50,
257 | )
258 | this.ctx.font = '32px sans-serif'
259 | this.ctx.fillStyle = 'rgba(255, 255, 255, 0.8)'
260 | this.ctx.fillText('YOU ARE WET', this.width / 2, this.height / 2 - 10)
261 | this.ctx.fillStyle = '#ffffff'
262 | this.ctx.font = '50px sans-serif'
263 | this.ctx.fillText('RESTART?', this.width / 2, this.height / 2 + 40)
264 | if (this.restart) {
265 | this.game = true
266 | this.gameOver = false
267 | this.restart = false
268 | cc.hasCollided = false
269 | }
270 | }
271 |
272 | if (this.showMenu) {
273 | this.menu()
274 | } else {
275 | this.initialize()
276 | this.beginGame()
277 | }
278 | }
279 | }
280 |
281 | class Hopper {
282 | constructor() {
283 | this.scene = new Scene()
284 | this.render()
285 | }
286 |
287 | render() {
288 | requestAnimationFrame(this.render.bind(this))
289 | this.scene.update()
290 | }
291 | }
292 |
293 | // As dirty as a popsicle that has been in mud for 3 decades. Super dirty. Unsaveable. But it worksish.
294 | const cc = new CollissionControl()
295 | new Hopper()
296 |
--------------------------------------------------------------------------------
/scripts/easter_egg.js:
--------------------------------------------------------------------------------
1 | document.addEventListener('keydown', function(event) {
2 | if(event.keyCode == 192) {
3 | console.log("Äru svensk?");
4 | }
5 |
6 | if(event.keyCode == 84) {
7 | if (document.body.classList.contains('terminal')) {
8 | document.body.classList.remove('terminal');
9 | }
10 | else {
11 | document.body.classList.add('terminal');
12 | }
13 | }
14 | });
15 |
16 |
17 | document.getElementById('invert-btn').onclick = (e) => {
18 | e.preventDefault();
19 |
20 | const mainContainer = document.getElementById("main-container");
21 |
22 | if (document.body.classList.contains('inverted')) {
23 | document.getElementById('footer').style.filter = 'invert(0)';
24 | document.getElementById('navbar').style.filter = 'invert(0)';
25 |
26 | if (!!mainContainer) {
27 | mainContainer.style.filter = "invert(0)";
28 | }
29 |
30 | document.body.classList.remove('inverted');
31 | }
32 | else {
33 | document.getElementById('footer').style.filter = 'invert(1)';
34 | document.getElementById('navbar').style.filter = 'invert(1)';
35 |
36 | if (!!mainContainer) {
37 | mainContainer.style.filter = "invert(1)";
38 | }
39 |
40 | document.body.classList.add('inverted');
41 | console.log('If you\'re using IE or Opera, you don\'t know what you are missing!');
42 | }
43 | }
44 |
45 | /*
46 | * Konami code
47 | *
48 | */
49 | var allowedKeys = {
50 | 37: 'left',
51 | 38: 'up',
52 | 39: 'right',
53 | 40: 'down',
54 | 65: 'a',
55 | 66: 'b'
56 | };
57 |
58 | var konamiCode = ['up', 'up', 'down', 'down', 'left', 'right', 'left', 'right', 'b', 'a'];
59 | var codePosition = 0;
60 |
61 | document.addEventListener('keydown', function(e) {
62 | var key = allowedKeys[e.keyCode];
63 | var requiredKey = konamiCode[codePosition];
64 |
65 | if (key === requiredKey) {
66 | codePosition++;
67 |
68 | if (codePosition === konamiCode.length) {
69 | executeEasterEgg();
70 | codePosition = 0;
71 | }
72 | } else {
73 | codePosition = 0;
74 | }
75 | });
76 |
77 | function executeEasterEgg() {
78 | var html = document.createElement('div');
79 | var image = 'You´re such a nerd!!! '
80 |
81 | html.innerHTML = image;
82 | document.body.appendChild(html);
83 | }
84 |
--------------------------------------------------------------------------------
/scripts/explosion.js:
--------------------------------------------------------------------------------
1 | // click event listener
2 | $('body').on('click', function(e) {
3 | explode(e.pageX, e.pageY);
4 | })
5 |
6 | // explosion construction
7 | function explode(x, y) {
8 | var particles = 15,
9 | // explosion container and its reference to be able to delete it on animation end
10 | explosion = $('
');
11 |
12 | // put the explosion container into the body to be able to get it's size
13 | $('body').append(explosion);
14 |
15 | // position the container to be centered on click
16 | explosion.css('left', x - explosion.width() / 2);
17 | explosion.css('top', y - explosion.height() / 2);
18 |
19 | for (var i = 0; i < particles; i++) {
20 | // positioning x,y of the particle on the circle (little randomized radius)
21 | var x = (explosion.width() / 2) + rand(80, 150) * Math.cos(2 * Math.PI * i / rand(particles - 10, particles + 10)),
22 | y = (explosion.height() / 2) + rand(80, 150) * Math.sin(2 * Math.PI * i / rand(particles - 10, particles + 10)),
23 | color = rand(0, 255) + ', ' + rand(0, 255) + ', ' + rand(0, 255), // randomize the color rgb
24 | // particle element creation (could be anything other than div)
25 | elm = $('
');
29 |
30 | if (i == 0) { // no need to add the listener on all generated elements
31 | // css3 animation end detection
32 | elm.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(e) {
33 | explosion.remove(); // remove this explosion container when animation ended
34 | });
35 | }
36 | explosion.append(elm);
37 | }
38 | }
39 |
40 | // get random number between min and max value
41 | function rand(min, max) {
42 | return Math.floor(Math.random() * (max + 1)) + min;
43 | }
--------------------------------------------------------------------------------
/scripts/fireworks.js:
--------------------------------------------------------------------------------
1 | // when animating on canvas, it is best to use requestAnimationFrame instead of setTimeout or setInterval
2 | // not supported in all browsers though and sometimes needs a prefix, so we need a shim
3 | window.requestAnimFrame = (function() {
4 | return (
5 | window.requestAnimationFrame ||
6 | window.webkitRequestAnimationFrame ||
7 | window.mozRequestAnimationFrame ||
8 | function(callback) {
9 | window.setTimeout(callback, 1000 / 60);
10 | }
11 | );
12 | })();
13 |
14 | // now we will setup our basic variables for the demo
15 | var canvas = document.getElementById("canvas"),
16 | ctx = canvas.getContext("2d"),
17 | // full screen dimensions
18 | cw = window.innerWidth,
19 | ch = window.innerHeight,
20 | // firework collection
21 | fireworks = [],
22 | // particle collection
23 | particles = [],
24 | // starting hue
25 | hue = 120,
26 | // when launching fireworks with a click, too many get launched at once without a limiter, one launch per 5 loop ticks
27 | limiterTotal = 5,
28 | limiterTick = 0,
29 | // this will time the auto launches of fireworks, one launch per 80 loop ticks
30 | timerTotal = 80,
31 | timerTick = 0,
32 | mousedown = false,
33 | // mouse x coordinate,
34 | mx,
35 | // mouse y coordinate
36 | my;
37 |
38 | // set canvas dimensions
39 | canvas.width = cw;
40 | canvas.height = ch;
41 |
42 | // now we are going to setup our function placeholders for the entire demo
43 |
44 | // get a random number within a range
45 | function random(min, max) {
46 | return Math.random() * (max - min) + min;
47 | }
48 |
49 | // calculate the distance between two points
50 | function calculateDistance(p1x, p1y, p2x, p2y) {
51 | var xDistance = p1x - p2x,
52 | yDistance = p1y - p2y;
53 | return Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));
54 | }
55 |
56 | // create firework
57 | function Firework(sx, sy, tx, ty) {
58 | // actual coordinates
59 | this.x = sx;
60 | this.y = sy;
61 | // starting coordinates
62 | this.sx = sx;
63 | this.sy = sy;
64 | // target coordinates
65 | this.tx = tx;
66 | this.ty = ty;
67 | // distance from starting point to target
68 | this.distanceToTarget = calculateDistance(sx, sy, tx, ty);
69 | this.distanceTraveled = 0;
70 | // track the past coordinates of each firework to create a trail effect, increase the coordinate count to create more prominent trails
71 | this.coordinates = [];
72 | this.coordinateCount = 3;
73 | // populate initial coordinate collection with the current coordinates
74 | while (this.coordinateCount--) {
75 | this.coordinates.push([this.x, this.y]);
76 | }
77 | this.angle = Math.atan2(ty - sy, tx - sx);
78 | this.speed = 2;
79 | this.acceleration = 1.05;
80 | this.brightness = random(50, 70);
81 | // circle target indicator radius
82 | this.targetRadius = 1;
83 | }
84 |
85 | // update firework
86 | Firework.prototype.update = function(index) {
87 | // remove last item in coordinates array
88 | this.coordinates.pop();
89 | // add current coordinates to the start of the array
90 | this.coordinates.unshift([this.x, this.y]);
91 |
92 | // cycle the circle target indicator radius
93 | if (this.targetRadius < 8) {
94 | this.targetRadius += 0.3;
95 | } else {
96 | this.targetRadius = 1;
97 | }
98 |
99 | // speed up the firework
100 | this.speed *= this.acceleration;
101 |
102 | // get the current velocities based on angle and speed
103 | var vx = Math.cos(this.angle) * this.speed,
104 | vy = Math.sin(this.angle) * this.speed;
105 | // how far will the firework have traveled with velocities applied?
106 | this.distanceTraveled = calculateDistance(
107 | this.sx,
108 | this.sy,
109 | this.x + vx,
110 | this.y + vy
111 | );
112 |
113 | // if the distance traveled, including velocities, is greater than the initial distance to the target, then the target has been reached
114 | if (this.distanceTraveled>= this.distanceToTarget) {
115 | createParticles(this.tx, this.ty);
116 | // remove the firework, use the index passed into the update function to determine which to remove
117 | fireworks.splice(index, 1);
118 | } else {
119 | // target not reached, keep traveling
120 | this.x += vx;
121 | this.y += vy;
122 | }
123 | };
124 |
125 | // draw firework
126 | Firework.prototype.draw = function() {
127 | ctx.beginPath();
128 | // move to the last tracked coordinate in the set, then draw a line to the current x and y
129 | ctx.moveTo(
130 | this.coordinates[this.coordinates.length - 1][0],
131 | this.coordinates[this.coordinates.length - 1][1]
132 | );
133 | ctx.lineTo(this.x, this.y);
134 | ctx.strokeStyle = "hsl(" + hue + ", 100%, " + this.brightness + "%)";
135 | ctx.stroke();
136 |
137 | ctx.beginPath();
138 | // draw the target for this firework with a pulsing circle
139 | ctx.arc(this.tx, this.ty, this.targetRadius, 0, Math.PI * 2);
140 | ctx.stroke();
141 | };
142 |
143 | // create particle
144 | function Particle(x, y) {
145 | this.x = x;
146 | this.y = y;
147 | // track the past coordinates of each particle to create a trail effect, increase the coordinate count to create more prominent trails
148 | this.coordinates = [];
149 | this.coordinateCount = 5;
150 | while (this.coordinateCount--) {
151 | this.coordinates.push([this.x, this.y]);
152 | }
153 | // set a random angle in all possible directions, in radians
154 | this.angle = random(0, Math.PI * 2);
155 | this.speed = random(1, 10);
156 | // friction will slow the particle down
157 | this.friction = 0.95;
158 | // gravity will be applied and pull the particle down
159 | this.gravity = 1;
160 | // set the hue to a random number +-50 of the overall hue variable
161 | this.hue = random(hue - 50, hue + 50);
162 | this.brightness = random(50, 80);
163 | this.alpha = 1;
164 | // set how fast the particle fades out
165 | this.decay = random(0.015, 0.03);
166 | }
167 |
168 | // update particle
169 | Particle.prototype.update = function(index) {
170 | // remove last item in coordinates array
171 | this.coordinates.pop();
172 | // add current coordinates to the start of the array
173 | this.coordinates.unshift([this.x, this.y]);
174 | // slow down the particle
175 | this.speed *= this.friction;
176 | // apply velocity
177 | this.x += Math.cos(this.angle) * this.speed;
178 | this.y += Math.sin(this.angle) * this.speed + this.gravity;
179 | // fade out the particle
180 | this.alpha -= this.decay;
181 |
182 | // remove the particle once the alpha is low enough, based on the passed in index
183 | if (this.alpha <= this.decay) {
184 | particles.splice(index, 1);
185 | }
186 | };
187 |
188 | // draw particle
189 | Particle.prototype.draw = function() {
190 | ctx.beginPath();
191 | // move to the last tracked coordinates in the set, then draw a line to the current x and y
192 | ctx.moveTo(
193 | this.coordinates[this.coordinates.length - 1][0],
194 | this.coordinates[this.coordinates.length - 1][1]
195 | );
196 | ctx.lineTo(this.x, this.y);
197 | ctx.strokeStyle =
198 | "hsla(" +
199 | this.hue +
200 | ", 100%, " +
201 | this.brightness +
202 | "%, " +
203 | this.alpha +
204 | ")";
205 | ctx.stroke();
206 | };
207 |
208 | // create particle group/explosion
209 | function createParticles(x, y) {
210 | // increase the particle count for a bigger explosion, beware of the canvas performance hit with the increased particles though
211 | var particleCount = 30;
212 | while (particleCount--) {
213 | particles.push(new Particle(x, y));
214 | }
215 | }
216 |
217 | // main demo loop
218 | function loop() {
219 | // this function will run endlessly with requestAnimationFrame
220 | requestAnimFrame(loop);
221 |
222 | // increase the hue to get different colored fireworks over time
223 | //hue += 0.5;
224 |
225 | // create random color
226 | hue = random(0, 360);
227 |
228 | // normally, clearRect() would be used to clear the canvas
229 | // we want to create a trailing effect though
230 | // setting the composite operation to destination-out will allow us to clear the canvas at a specific opacity, rather than wiping it entirely
231 | ctx.globalCompositeOperation = "destination-out";
232 | // decrease the alpha property to create more prominent trails
233 | ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
234 | ctx.fillRect(0, 0, cw, ch);
235 | // change the composite operation back to our main mode
236 | // lighter creates bright highlight points as the fireworks and particles overlap each other
237 | ctx.globalCompositeOperation = "lighter";
238 |
239 | // loop over each firework, draw it, update it
240 | var i = fireworks.length;
241 | while (i--) {
242 | fireworks[i].draw();
243 | fireworks[i].update(i);
244 | }
245 |
246 | // loop over each particle, draw it, update it
247 | var i = particles.length;
248 | while (i--) {
249 | particles[i].draw();
250 | particles[i].update(i);
251 | }
252 |
253 | // launch fireworks automatically to random coordinates, when the mouse isn't down
254 | if (timerTick>= timerTotal) {
255 | if (!mousedown) {
256 | // start the firework at the bottom middle of the screen, then set the random target coordinates, the random y coordinates will be set within the range of the top half of the screen
257 | fireworks.push(
258 | new Firework(cw / 2, ch, random(0, cw), random(0, ch / 2))
259 | );
260 | timerTick = 0;
261 | }
262 | } else {
263 | timerTick++;
264 | }
265 |
266 | // limit the rate at which fireworks get launched when mouse is down
267 | if (limiterTick>= limiterTotal) {
268 | if (mousedown) {
269 | // start the firework at the bottom middle of the screen, then set the current mouse coordinates as the target
270 | fireworks.push(new Firework(cw / 2, ch, mx, my));
271 | limiterTick = 0;
272 | }
273 | } else {
274 | limiterTick++;
275 | }
276 | }
277 |
278 | // mouse event bindings
279 | // update the mouse coordinates on mousemove
280 | canvas.addEventListener("mousemove", function(e) {
281 | mx = e.pageX - canvas.offsetLeft;
282 | my = e.pageY - canvas.offsetTop;
283 | });
284 |
285 | // toggle mousedown state and prevent canvas from being selected
286 | canvas.addEventListener("mousedown", function(e) {
287 | e.preventDefault();
288 | mousedown = true;
289 | });
290 |
291 | canvas.addEventListener("mouseup", function(e) {
292 | e.preventDefault();
293 | mousedown = false;
294 | });
295 |
296 | // once the window loads, we are ready for some fireworks!
297 | window.onload = loop;
298 |
--------------------------------------------------------------------------------
/scripts/gifheaven.js:
--------------------------------------------------------------------------------
1 | function expandDoggo(){
2 | let doggoElement = document.getElementById("doggo");
3 | if(doggoElement.style.height === "400px"){
4 | doggoElement.style.height = "0px";
5 | }
6 | else{
7 | doggoElement.style.height = "400px";
8 | }
9 | }
--------------------------------------------------------------------------------
/scripts/hacktoberPest/hacktoberPest.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css?family=Eater');
2 |
3 | html,
4 | body {
5 | background-color: #CC5500;
6 | font-family: Eater;
7 | }
8 |
9 | h1 {
10 | text-align: center;
11 | }
12 |
13 | div{
14 | opacity: .2;
15 | display: block;
16 | width: 300px;
17 | margin: auto;
18 | }
19 |
20 | #spooky {
21 | width: 300px;
22 | margin: auto;
23 | }
24 |
--------------------------------------------------------------------------------
/scripts/hacktoberPest/hacktoberPest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Hacktoberfest Ghoul
6 |
7 |
8 |
9 |
10 | You've Been Visited By The Hacktoberfest Ghoul!
11 |
12 |
13 |
14 |
15 |
16 | Fork This Repository Now For Instant Hackathon Luck.
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/scripts/hacktoberPest/spookyBoi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitrish/hacktoberfest/fecf59d3414a027d60a5fda8ea2a1bde71454602/scripts/hacktoberPest/spookyBoi.png
--------------------------------------------------------------------------------
/scripts/helpful-material.js:
--------------------------------------------------------------------------------
1 | //Sort by difficulty number 1 easy, 2 hard...
2 | function sortProject(containerClassName, projectClassName) {
3 | var items = $(containerClassName);
4 |
5 | items.sort(function(a, b){
6 | return + $(a).data('difficulty') - + $(b).data('difficulty');
7 | });
8 |
9 | items.appendTo(projectClassName);
10 | }
11 |
12 | sortProject('li>.projectItem', 'li>.otherProjects');
13 | sortProject('li>.easyProjectItem', 'li>.beginnerProjects');
14 |
15 | console.log('Script Triggered')
16 |
--------------------------------------------------------------------------------
/scripts/iframe.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | $(".video").click(function () {
3 | var theModal = $(this).data("target"),
4 | videoSRC = $(this).attr("data-video"),
5 | videoSRCauto = videoSRC + "?modestbranding=1&rel=0&controls=0&showinfo=0&html5=1&autoplay=1";
6 | $(theModal + ' iframe').attr('src', videoSRCauto);
7 | $(theModal + ' button.close').click(function () {
8 | $(theModal + ' iframe').attr('src', videoSRC);
9 | });
10 | });
11 | });
--------------------------------------------------------------------------------
/scripts/index.js:
--------------------------------------------------------------------------------
1 | let t = document.getElementById('twist').addEventListener('click', () => {
2 | let cards = document.querySelectorAll('.card')
3 | cards.forEach(card => {
4 | card.classList.toggle('spinCard');
5 | })
6 | }, false)
7 |
8 | let l = document.getElementById('love').addEventListener('click', () => {
9 | let body = document.querySelector('body');
10 | document.querySelector("#header h1").innerHTML = "Broccoli Egg";
11 | body.classList.toggle("broccoli-green");
12 | }, false)
13 |
--------------------------------------------------------------------------------
/scripts/indices.js:
--------------------------------------------------------------------------------
1 | let t = document.getElementById('twist').addEventListener('click', () => {
2 | let cards = document.querySelectorAll('.card')
3 | cards.forEach(card => {
4 | card.classList.toggle('spinCard');
5 | })
6 | }, false)
7 |
8 | let l = document.getElementById('love').addEventListener('click', () => {
9 | let body = document.querySelector('body');
10 | document.querySelector("#header h1").innerHTML = "Broccoli Egg";
11 | body.classList.toggle("broccoli-green");
12 | }, false)
13 |
--------------------------------------------------------------------------------
/scripts/konami.js:
--------------------------------------------------------------------------------
1 | const relevantKeys = {
2 | 37: 'left',
3 | 38: 'up',
4 | 39: 'right',
5 | 40: 'down',
6 | 65: 'a',
7 | 66: 'b',
8 | }
9 |
10 | const keySequence = ['up', 'up', 'down', 'down', 'left', 'right', 'left', 'right', 'b', 'a'];
11 | let positionInSequence = 0;
12 |
13 | document.addEventListener('keydown', function(e) {
14 | let keyPressed = relevantKeys[e.keyCode];
15 |
16 | if (keyPressed === keySequence[positionInSequence]) {
17 | positionInSequence++;
18 | if (positionInSequence === keySequence.length) {
19 | activateResult();
20 | positionInSequence = 0;
21 | }
22 | } else {
23 | positionInSequence = 0;
24 | }
25 | })
26 |
27 | function activateResult() {
28 | let canvas = document.createElement('canvas');
29 |
30 | canvas.setAttribute('width', '400');
31 | canvas.setAttribute('height', '400');
32 | canvas.setAttribute('class', 'center');
33 | canvas.setAttribute('style', 'position: fixed; left: 30%; top: 20%;')
34 |
35 | ctx = canvas.getContext("2d");
36 |
37 | let w = 200, h = 200;
38 |
39 | ctx.strokeStyle = "#000000";
40 | ctx.strokeWeight = 3;
41 | ctx.shadowOffsetX = 4.0;
42 | ctx.shadowOffsetY = 4.0;
43 | ctx.lineWidth = 10.0;
44 | ctx.fillStyle = "#FF0000";
45 |
46 | const d = Math.min(w, h);
47 | const k = 120;
48 |
49 | ctx.moveTo(k, k + d / 4);
50 | ctx.quadraticCurveTo(k, k, k + d / 4, k);
51 | ctx.quadraticCurveTo(k + d / 2, k, k + d / 2, k + d / 4);
52 | ctx.quadraticCurveTo(k + d / 2, k, k + d * 3/4, k);
53 | ctx.quadraticCurveTo(k + d, k, k + d, k + d / 4);
54 | ctx.quadraticCurveTo(k + d, k + d / 2, k + d * 3/4, k + d * 3/4);
55 | ctx.lineTo(k + d / 2, k + d);
56 | ctx.lineTo(k + d / 4, k + d * 3/4);
57 | ctx.quadraticCurveTo(k, k + d / 2, k, k + d / 4);
58 | ctx.stroke();
59 | ctx.fill();
60 |
61 | let target = document.querySelector("#header")
62 |
63 | target.appendChild(canvas)
64 | }
65 |
--------------------------------------------------------------------------------
/scripts/menu.js:
--------------------------------------------------------------------------------
1 | const menu = {
2 | 'Home': {
3 | 'text': 'Home',
4 | 'href': 'index.html'
5 | },
6 | 'Helpful-Material': {
7 | 'text': 'Helpful Material',
8 | 'href': 'helpful-material.html'
9 | },
10 | 'Contributors': {
11 | 'text': 'Contributors',
12 | 'href': 'contributors.html'
13 | },
14 | 'Others': {
15 | 'Potato': {
16 | 'text': 'Potato',
17 | 'href': 'potato.html'
18 | },
19 | 'Cheese': {
20 | 'text': 'Cheese!',
21 | 'href': 'cheese.html'
22 | },
23 | 'Tools': {
24 | 'text': 'Tools',
25 | 'href': 'tools.html',
26 | 'id': 'tools'
27 | },
28 | 'Invert': {
29 | 'text': 'Invert',
30 | 'href': '#',
31 | 'id': 'invert-btn'
32 | },
33 | 'Fireworks': {
34 | 'text': 'Fireworks',
35 | 'href': 'Fireworks.html',
36 | 'id': 'fireworks'
37 | },
38 | 'Learn': {
39 | 'text': 'Learn!',
40 | 'href': 'wow.html',
41 | 'id': 'learn'
42 | },
43 | '4otakus': {
44 | 'text': '4otakus',
45 | 'href': '4otakus.html',
46 | 'id': '4otakus'
47 | },
48 | 'Bubble': {
49 | 'text': 'Bubble',
50 | 'href': 'bubble.html',
51 | 'id': 'Bubble'
52 | },
53 | 'Canoi': {
54 | 'text': 'Canoi',
55 | 'href': 'canoi.html',
56 | 'id': 'Canoi'
57 | },
58 | 'Colorgame': {
59 | 'text': 'Colorgame',
60 | 'href': 'colorgame.html',
61 | 'id': 'Colorgame'
62 | },
63 | 'Foxy': {
64 | 'text': 'Foxy',
65 | 'href': 'foxy.html',
66 | 'id': 'Foxy'
67 | },
68 | 'Gifheaven': {
69 | 'text': 'Gif Heaven',
70 | 'href': 'gifheaven.html',
71 | 'id': 'Gifheaven'
72 | },
73 | 'Plainpage': {
74 | 'text': 'Plain Page',
75 | 'href': 'plain_page.html',
76 | 'id': 'Plainpage'
77 | },
78 | 'Snek': {
79 | 'text': 'Snek',
80 | 'href': 'snek.html',
81 | 'id': 'Snek'
82 | },
83 | 'Spooky': {
84 | 'text': 'Spooky',
85 | 'href': 'spooky.html',
86 | 'id': 'Spooky'
87 | },
88 | 'Values': {
89 | 'text': 'Values',
90 | 'href': 'values.html',
91 | 'id': 'Values'
92 | },
93 | 'Wow': {
94 | 'text': 'Wow',
95 | 'href': 'wow.html',
96 | 'id': 'Wow'
97 | },
98 | 'Flappy': {
99 | 'text': 'Flappy Game',
100 | 'href': 'Flappy.html',
101 | 'id': 'Flappy'
102 | },
103 | 'Stay Dry': {
104 | 'text': 'Stay Dry',
105 | 'href': '/dry',
106 | 'id': 'dry'
107 | }
108 | }
109 | }
110 |
111 | function buildMenuHTML (obj = {}) {
112 | var html = ''
113 | var path = window.location.pathname.split('/')
114 | var currentPage = path[path.length - 1] === '' ? '/' : path[path.length - 1]
115 |
116 | Object.entries(obj).forEach(([key, item]) => {
117 | if (key == 'Others') {
118 | html += ''
119 | html += ' Others '
120 | html += ''
121 | Object.entries(item).forEach(([key, item]) => {
122 | let isCurrent = (currentPage === item.href)
123 |
124 | html += '
'
127 | })
128 | html += '
'
129 | } else {
130 | let isCurrent = (currentPage === item.href)
131 |
132 | html += ' '
133 | html += '' + item.text + ' '
134 | html += ' '
135 | }
136 | })
137 | document.getElementById('menu').innerHTML = html
138 | }
139 |
140 | function buildMenu () {
141 | return buildMenuHTML(menu)
142 | }
143 |
144 | buildMenu()
145 |
--------------------------------------------------------------------------------
/scripts/pokemon.js:
--------------------------------------------------------------------------------
1 | //Pokemon
2 |
3 | function DigitalPal(hungry, sleepy, bored, age){
4 | this.hungry = hungry;
5 | this.sleepy = sleepy;
6 | this.bored = bored;
7 | this.age = age;
8 | this.feed = function(){
9 | if(this.hungry){
10 | console.log('That was tasty!');
11 | this.sleepy = true;
12 | }
13 | else{
14 | console.log("No thanks!");
15 | }
16 | }
17 | this.sleep = function(){
18 | if(this.sleepy){
19 | console.log("ZZzzzzzzzzz");
20 | this.sleepy = false;
21 | age++;
22 | console.log("I am awake and one day older!");
23 | }
24 | else{
25 | console.log("No thanks, not sleepy!");
26 | }
27 | }
28 | this.play = function(){
29 | if(this.bored){
30 | console.log("Let's play!");
31 | this.bored = false;
32 | this.hungry = true;
33 | }
34 | else{
35 | console.log("Not now, maybe later!");
36 | }
37 | }
38 | }
39 |
40 | DigitalPal.doMore = function(){
41 | console.log('FUCK');
42 | }
43 |
44 | let dog = new DigitalPal(false, false, true, 0);
45 | console.log(dog);
46 | dog.outside = false;
47 | dog.bark = function(){console.log("Woof!")};
48 | dog.bark();
--------------------------------------------------------------------------------
/scripts/rpg.js:
--------------------------------------------------------------------------------
1 | function Character(name, profession, gender, age, strength, hp) {
2 | this.name = name;
3 | this.profession = profession;
4 | this.gender = gender;
5 | this.age = age;
6 | this.strength = strength;
7 | this.hp = hp;
8 | this.isAlive = function(){
9 | if(this.hp> 0){
10 | console.log("Alive");
11 | }
12 | else{
13 | console.log("Terminated");
14 | }
15 | };
16 | this.attack = function(victim){
17 | victim.hp = victim.hp - this.strength;
18 | };
19 |
20 | this.levelUp = function(){
21 | this.age++;
22 | this.strength +=5;
23 | this.hp +=25;
24 | }
25 | }
26 |
27 | function printStats(char){
28 | console.log(char);
29 | }
30 |
31 | let bigTony = new Character("Tony", "Waste Management", "Male", 55, 100, 100);
32 | let uncleJunior = new Character("Junior", "Construction", "Male", 75, 50, 180);
33 | let artie = new Character("Artie", "Restaurant", "Male", 40, 100, 100);
34 | let chris = new Character("Christopher", "Film", "Male", 30, 120, 80);
35 |
36 | bigTony.mount = "Suburban";
37 | printStats(bigTony);
38 |
39 | var arr = [bigTony, uncleJunior, artie, chris];
40 |
41 | for(var i=0; i"
45 | + "" + arr[i].gender + ", " + arr[i].age + ", " + arr[i].profession + " "
46 | + " Strength: " + arr[i].strength + "
Health: " + arr[i].hp + "
" + arr[i].gender + "
";
47 | document.getElementById('rpg').appendChild(e.firstChild);
48 | }
49 |
--------------------------------------------------------------------------------
/scripts/scroll.js:
--------------------------------------------------------------------------------
1 | window.onscroll = function() {scrollFunc()};
2 | var scrollButton = document.getElementById('backToTop');
3 |
4 | function scrollFunc() {
5 | if (document.body.scrollTop> 150 || document.documentElement.scrollTop> 150) {
6 | scrollButton.style.display = "block";
7 | } else {
8 | scrollButton.style.display = "none";
9 | }
10 | }
11 | scrollButton.onclick = function() {
12 | scrollButton.classList.add('startscrolling');
13 | scrollTo(document.documentElement, 0, 1250, function(){
14 | scrollButton.classList.remove('startscrolling');
15 | });
16 | }
17 | scrollButton.onmousedown = function(){
18 | scrollButton.classList.add("mousedown");
19 | }
20 | scrollButton.onmouseup = function(){
21 | scrollButton.classList.remove("mousedown");
22 | }
23 | function scrollTo(element, to, duration, callback) {
24 | var start = element.scrollTop,
25 | change = to - start,
26 | currentTime = 0,
27 | increment = 20;
28 | var animateScroll = function() {
29 | currentTime += increment;
30 | var val = Math.easeInOutQuad(currentTime, start, change, duration);
31 | element.scrollTop = val;
32 | if (currentTime < duration) {
33 | setTimeout(animateScroll,increment);
34 | } else {
35 | if(callback && typeof callback === 'function'){
36 | callback();
37 | }
38 | }
39 | };
40 | animateScroll();
41 | }
42 | Math.easeInOutQuad = function(t,b,c,d) {
43 | t /= d/2;
44 | if (t < 1) return c/2*t*t + b;
45 | t--;
46 | return -c/2 * (t*(t-2) - 1) + b;
47 | };
--------------------------------------------------------------------------------
/scripts/snek.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @type {HTMLCanvasElement}
3 | */
4 | const canvas = document.querySelector('.snek')
5 | canvas.width = 400
6 | canvas.height = 300
7 | canvas.style.border = '2px solid #FF0844'
8 | canvas.style.width = '800px'
9 | canvas.style.height = '600px'
10 | canvas.style.margin = '0 auto'
11 |
12 | /**
13 | * @type {HTMLDivElement}
14 | */
15 | const container = document.querySelector('.snek-container')
16 | container.style.display = 'flex'
17 | container.style.justifyContent = 'center'
18 | container.style.textAlign = 'center'
19 | container.style.flexDirection = 'column'
20 |
21 | /**
22 | * @type {HTMLButtonElement}
23 | */
24 | const button = document.querySelector('.snek-play')
25 | button.style.width = '200px'
26 | button.style.background = 'green'
27 | button.style.alignSelf = 'center'
28 | button.style.display = 'none'
29 |
30 | /**
31 | * @type {HTMLDivElement}
32 | */
33 | const points = document.querySelector('.snek-points')
34 | points.style.fontSize = '50px'
35 | points.style.color = '#FF0844'
36 |
37 | points.innerHTML = 0
38 |
39 | button.addEventListener('click', () => {
40 | state = getInitialState()
41 | button.style.display = 'none'
42 | })
43 |
44 | const ctx = canvas.getContext('2d')
45 |
46 | const GRID_SIZE = 10
47 |
48 | const Directions = {
49 | Left: 'LEFT',
50 | Up: 'UP',
51 | Right: 'RIGHT',
52 | Down: 'DOWN',
53 | }
54 |
55 | const Keys = {
56 | Left: 37,
57 | Up: 38,
58 | Right: 39,
59 | Down: 40,
60 | }
61 |
62 | const DirectionKeys = {
63 | [Keys.Left]: Directions.Left,
64 | [Keys.Up]: Directions.Up,
65 | [Keys.Right]: Directions.Right,
66 | [Keys.Down]: Directions.Down,
67 | }
68 |
69 | const initialBodyLength = 3
70 |
71 | const getInitialState = () => {
72 | const initialState = {
73 | x: canvas.width / 2,
74 | y: canvas.height / 2,
75 | direction: Directions.Up,
76 | alive: true,
77 | body: [],
78 | bodyLength: 3,
79 | currentFoodPosition: getFoodPosition(),
80 | }
81 |
82 | return initialState
83 | }
84 |
85 | let state = getInitialState()
86 |
87 | function getFoodPosition() {
88 | return {
89 | x: Math.floor(Math.random() * (canvas.width / GRID_SIZE)) * GRID_SIZE,
90 | y: Math.floor(Math.random() * (canvas.height / GRID_SIZE)) * GRID_SIZE,
91 | }
92 | }
93 |
94 | const Movements = {
95 | [Directions.Left]: () => {
96 | const nextPos = leftPosition()
97 | if (nextPos>= 0) {
98 | state.x = nextPos
99 | } else {
100 | state.alive = false
101 | }
102 | },
103 | [Directions.Up]: () => {
104 | const nextPos = upPosition()
105 | if (nextPos>= 0) {
106 | state.y = nextPos
107 | } else {
108 | state.alive = false
109 | }
110 | },
111 | [Directions.Right]: () => {
112 | const nextPos = rightPosition()
113 | if (nextPos < canvas.width) {
114 | state.x = nextPos
115 | } else {
116 | state.alive = false
117 | }
118 | },
119 | [Directions.Down]: () => {
120 | const nextPos = downPosition()
121 | if (nextPos < canvas.height) {
122 | state.y = nextPos
123 | } else {
124 | state.alive = false
125 | }
126 | },
127 | }
128 |
129 | function leftPosition() {
130 | return state.x - GRID_SIZE
131 | }
132 |
133 | function rightPosition() {
134 | return state.x + GRID_SIZE
135 | }
136 |
137 | function upPosition() {
138 | return state.y - GRID_SIZE
139 | }
140 |
141 | function downPosition() {
142 | return state.y + GRID_SIZE
143 | }
144 |
145 | function drawSnake() {
146 | const {x, y, direction, alive, body, currentFoodPosition, bodyLength} = state
147 | if (alive) {
148 | // Snek is hungry
149 | if (x === currentFoodPosition.x && y === currentFoodPosition.y) {
150 | state.bodyLength++
151 | state.currentFoodPosition = getFoodPosition()
152 | points.innerHTML = state.bodyLength - initialBodyLength
153 | }
154 |
155 | // To hungry, eat self
156 | if (body.some(b => b.x === x && b.y === y)) {
157 | // dead
158 | state.alive = false
159 | }
160 | const movement = Movements[direction]
161 | movement && movement()
162 |
163 |
164 | ctx.clearRect(0, 0, canvas.width, canvas.height)
165 | } else {
166 | ctx.font = '20px Georgia'
167 | ctx.textBaseline = 'middle'
168 | ctx.textAlign = 'center'
169 | ctx.fillText('Game over', canvas.width / 2, canvas.height / 2)
170 | button.style.display = 'block'
171 | }
172 |
173 | body.push({x, y})
174 | if (body.length> bodyLength) {
175 | var itemToRemove = body.shift()
176 | ctx.clearRect(itemToRemove.x, itemToRemove.x, GRID_SIZE, GRID_SIZE)
177 | }
178 | ctx.fillStyle = 'green'
179 | body.forEach(({x, y}) => ctx.fillRect(x, y, GRID_SIZE, GRID_SIZE))
180 | ctx.fillRect(x, y, GRID_SIZE, GRID_SIZE)
181 |
182 | ctx.fillStyle = 'red'
183 | ctx.fillRect(
184 | currentFoodPosition.x,
185 | currentFoodPosition.y,
186 | GRID_SIZE,
187 | GRID_SIZE,
188 | )
189 | }
190 |
191 | /**
192 | *
193 | * @param {KeyboardEvent} e
194 | */
195 | function changeDirection(e) {
196 | if (DirectionKeys[e.keyCode]) {
197 | const currentDirection = state.direction
198 | const nextDirection = DirectionKeys[e.keyCode]
199 |
200 | if (canMove(currentDirection, nextDirection)) {
201 | state.direction = DirectionKeys[e.keyCode]
202 | }
203 | }
204 | }
205 |
206 | /**
207 | *
208 | * @param {String} currentDirection
209 | * @param {String} nextDirection
210 | */
211 | function canMove(currentDirection, nextDirection) {
212 | if (currentDirection === Directions.Up) {
213 | return nextDirection !== Directions.Down
214 | }
215 | if (currentDirection === Directions.Left) {
216 | return nextDirection !== Directions.Right
217 | }
218 | if (currentDirection === Directions.Right) {
219 | return nextDirection !== Directions.Left
220 | }
221 | if (currentDirection === Directions.Down) {
222 | return nextDirection !== Directions.Up
223 | }
224 | }
225 |
226 | window.setInterval(drawSnake, 100)
227 | window.addEventListener('keydown', changeDirection)
228 |
--------------------------------------------------------------------------------
/scripts/stats.js:
--------------------------------------------------------------------------------
1 | let statsObj = {
2 | commits: 0,
3 | forks: 0,
4 | pr: 0,
5 | stars: 0,
6 | issues:0,
7 | contribut:0
8 | }
9 |
10 | const reqObj = [
11 | ['https://api.github.com/repos/lingonsaft/hacktoberfest/commits', 'commits'],
12 | ['https://api.github.com/repos/lingonsaft/hacktoberfest/forks', 'forks'],
13 | ['https://api.github.com/repos/lingonsaft/hacktoberfest/pulls', 'pr'],
14 | ['https://api.github.com/repos/lingonsaft/hacktoberfest/issues', 'issues'],
15 | ['https://api.github.com/repos/lingonsaft/hacktoberfest/stargazers', 'stars'],
16 | ['https://api.github.com/repos/lingonsaft/hacktoberfest/stats/contributors', 'contribut'],
17 | ]
18 |
19 | const getData = (url, key) => {
20 | fetch(url)
21 | .then(r => {
22 | if(r.ok) {
23 | if (r.headers.get('Link')) {
24 | r.headers.get('Link').split(',').forEach(link => {
25 | if (link.includes('next')) {
26 | link = link.split('<')
27 | link = link[1].split('>')
28 | getData(link[0], key)
29 | }
30 | })
31 | }
32 | return r.json()
33 | }
34 | else {
35 | throw new Error('Api limit exceeded');
36 | }
37 | })
38 | .then(json => {
39 | statsObj[key] += json.length
40 | document.getElementById('stats').innerHTML = 'Commits: ' + statsObj.commits + ' Forks: ' + statsObj.forks + ' Pull Requests: ' + statsObj.pr + ' Issues: ' + statsObj.issues + ' Stars: ' + statsObj.stars + ' Contributors: ' + statsObj.contribut
41 | }).catch(() => {
42 | console.log('This catched 403');
43 | document.getElementById('stats').innerHTML = 'You guys are awesome, we have passed the github rate again this hour.