terrain-map
ARCHIVED - repo for blog post http://www.vogt.world/writing/procedural-terrain-generation/
git clone https://git.vogt.world/terrain-map.git
Log | Files | README.md
← Commit log
commit
message
using spinner
author
Ben Vogt <[email protected]>
date
2016-05-14 05:03:08
stats
1 file(s) changed, 7 insertions(+), 0 deletions(-)
files
main.js
 1diff --git a/main.js b/main.js
 2index 7397451..ccd8e92 100644
 3--- a/main.js
 4+++ b/main.js
 5@@ -2,10 +2,12 @@ var worker;
 6 $(document).ready(function() {
 7 
 8   function spinner(id) {
 9-    
10+    var spinner = '<img class="spinner" width="24" height="24" src="data:image/gif;base64,R0lGODlhGAAYAKUAAAwODJSSlMzKzExOTKyurOTm5GxubCwuLLy+vKSipNza3GRmZPT29Dw+PFRWVLS2tHx+fDQ2NCQmJJyanNTW1Ozu7MTGxKyqrOTi5Pz+/BwaHMzOzFRSVLSytHx6fDQyNMTCxKSmpNze3GxqbPz6/ExKTFxaXLy6vISGhDw6PJyenPTy9P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBQAsACwAAAAAGAAYAAAG/kCWcEjMeCDEpJK1Oq2EDIeDJKwknkshYjERkjhToedzyVZHCwUrGt58GhWz8LFAkb7TjOmjWjIEWAweCxYkIwYkBB8DVCwFKnEsIBAoIFQCHhtEJwMgawESGl1rFxAQARQZDEoMJA8RGhoLkUIiE6erSysfGiUWSyQCFHIdIY1DGSQZyXJQJK2rHSrTKgTNLAcA2gAl0gkqCWXN2dslLHd3GdfPJCvHQxgFchgYWRUgBAjvRCQIHSC0zgno0AGBvH3nHJ0guKGRiA4PFKgrYJAIxYMUHnQQAUVELhILMWQAgSADhoKNGIhAyELBv3MPHlAB0UGNHAYa47g6QaUCHQGZch5qYpEhpjoWGzbKIaGgkasHR5myNGNBQLMgACH5BAkFADAALAAAAAAYABgAhQQCBISChMTCxERCROTi5KSipGRmZ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GLaAiQAUFbCImgKDTYlYhNAgRZtZBMOGCEJnRXqAoVUcECkg9VSStQKElNg7o6gQBACH5BAkFADAALAAAAAAYABgAhQQCBISChMTCxERGROTi5KSipGRmZCQiJNTS1PTy9LSytJSSlHRydDQ2NMzKzFRWVOzq7KyqrNza3Pz6/Ly6vJyanBwaHIyOjGxubDw+PAwODISGhMTGxExOTOTm5KSmpGxqbCQmJNTW1PT29LS2tJSWlHx6fDw6PMzOzFxeXOzu7KyurNze3Pz+/Ly+vJyenP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb+QJhwSGyBQMSkEpZYJYSjU2YihJRUy+Gqc4FKqTCD5ZUVqh4dESw6hQksIUhZGOkwJqPMadIaWBZLCS5PTAYdFBMPDxMFFg0jQh4LWDAUBiAkVAIGHEQkDRRrARoAXUwlBgYmKHhKCS0RIQAAKXJDEgGqkIEWAA0uSxMCKHMRLy1JE8p8c0J8zzAFARvTJc1uJNkkDi/U1NbNAiQUCtsweMrIzcstYEMtIixzBARZHhEVH+7JLgoClFBcVCjxgUU7JVQ89FPASgiCEi8QJKTggYjCihNEkFAgbw0CQhPIEWghwEULAgpcgBnBYt+tlDBaZNOkQEKzERuxTBhHBcIdikxzWDAUIhMoDBQc50yQAGYnImcSdl0TwqHTnCAAOw==" />';
11+    this.document.getElementById(id).innerHTML = spinner;
12   }
13 
14   $("#standard").click(function() {
15+    spinner("container-1");
16     var worker = new Worker('worker.js');
17     worker.postMessage("standard");
18     worker.addEventListener('message', function(e) {
19@@ -15,6 +17,7 @@ $(document).ready(function() {
20   });
21 
22   $("#combined").click(function() {
23+    spinner("container-2");
24     var worker = new Worker('worker.js');
25     worker.postMessage("combined");
26     worker.addEventListener('message', function(e) {
27@@ -24,6 +27,7 @@ $(document).ready(function() {
28   });
29 
30   $("#grd").click(function() {
31+    spinner("container-3");
32     var worker = new Worker('worker.js');
33     worker.postMessage("grd");
34     worker.addEventListener('message', function(e) {
35@@ -34,6 +38,7 @@ $(document).ready(function() {
36 
37 
38   $("#simpleErosion").click(function() {
39+    spinner("container-4");
40     var worker = new Worker('worker.js');
41     worker.postMessage("simpleErosion");
42     worker.addEventListener('message', function(e) {
43@@ -43,6 +48,7 @@ $(document).ready(function() {
44   });
45 
46   $("#complexErosion").click(function() {
47+    spinner("container-5");
48     var worker = new Worker('worker.js');
49     worker.postMessage("complexErosion");
50     worker.addEventListener('message', function(e) {