# HG changeset patch # User Eugen Sawin # Date 1324346510 -3600 # Node ID 9c443a61358c00a73e7aba5be0ef51e8232194f1 # Parent 681b1d7dc3a9c88f533452b0be37507dae8f03a7 Smaller logo. diff -r 681b1d7dc3a9 -r 9c443a61358c books.html --- a/books.html Sun Dec 18 19:15:59 2011 +0100 +++ b/books.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
diff -r 681b1d7dc3a9 -r 9c443a61358c dark.css --- a/dark.css Sun Dec 18 19:15:59 2011 +0100 +++ b/dark.css Tue Dec 20 03:01:50 2011 +0100 @@ -110,7 +110,7 @@ color: #F8F8F8; /* change the values of top and left to adjust the position of the logo*/ top: 40px; left: 25px; - height: 120px; + height: 100px; width: 670px; } @@ -225,7 +225,7 @@ #header { position: relative; width: 1020px; - height: 170px; + height: 150px; margin: 0; padding: 0; } diff -r 681b1d7dc3a9 -r 9c443a61358c experiments.html --- a/experiments.html Sun Dec 18 19:15:59 2011 +0100 +++ b/experiments.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
diff -r 681b1d7dc3a9 -r 9c443a61358c factory/raw_images/logobase.xcf Binary file factory/raw_images/logobase.xcf has changed diff -r 681b1d7dc3a9 -r 9c443a61358c factory/v2012/dark.css --- a/factory/v2012/dark.css Sun Dec 18 19:15:59 2011 +0100 +++ b/factory/v2012/dark.css Tue Dec 20 03:01:50 2011 +0100 @@ -110,7 +110,7 @@ color: #F8F8F8; /* change the values of top and left to adjust the position of the logo*/ top: 40px; left: 25px; - height: 120px; + height: 100px; width: 670px; } @@ -225,7 +225,7 @@ #header { position: relative; width: 1020px; - height: 170px; + height: 150px; margin: 0; padding: 0; } diff -r 681b1d7dc3a9 -r 9c443a61358c factory/v2012/frame.html --- a/factory/v2012/frame.html Sun Dec 18 19:15:59 2011 +0100 +++ b/factory/v2012/frame.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
diff -r 681b1d7dc3a9 -r 9c443a61358c factory/v2012/links.html --- a/factory/v2012/links.html Sun Dec 18 19:15:59 2011 +0100 +++ b/factory/v2012/links.html Tue Dec 20 03:01:50 2011 +0100 @@ -13,7 +13,7 @@

The Bad

-

The People and their Sites

+

People and their Sites

  • Christian König

    An ex-fellow student and companion in the quest for world domination. diff -r 681b1d7dc3a9 -r 9c443a61358c factory/v2012/linksend.html --- a/factory/v2012/linksend.html Sun Dec 18 19:15:59 2011 +0100 +++ b/factory/v2012/linksend.html Tue Dec 20 03:01:50 2011 +0100 @@ -13,7 +13,7 @@

    The Bad

    -

    The People and their Sites

    +

    People and their Sites

    • Christian König

      An ex-fellow student and companion in the quest for world domination. diff -r 681b1d7dc3a9 -r 9c443a61358c factory/v2012/script.js --- a/factory/v2012/script.js Sun Dec 18 19:15:59 2011 +0100 +++ b/factory/v2012/script.js Tue Dec 20 03:01:50 2011 +0100 @@ -11,7 +11,7 @@ $(this).css("cursor", "pointer"); }, function() { $(this).css("cursor", "auto"); - }); + }); }); $(document).keypress( function(event) { @@ -22,8 +22,8 @@ }); var menu_width = 670; -var menu_height = 120; -var menu_splits = new Array(150, 350, 545); +var menu_height = 100; +var menu_splits = new Array(180, 350, 505); var click_events = new Array(); click_events["logo"] = new Array(); @@ -56,15 +56,21 @@ click_events["logo"][3]["func"] = switch_page; click_events["logo"][3]["args"] = new Array("links.html", "linksend.html"); -function handle_click(e) { - var offset = $("#logo").offset(); - var x = e.pageX - offset.left; - var y = e.pageY - offset.top; - for (var i in click_events[e.target.id]) { - var ces = click_events[e.target.id][i]; +function mouse_pos(event) { + var offset = $("#logo").offset(); + return new Array(event.pageX - offset.left, + event.pageY - offset.top); +} + +function handle_click(event) { + var xy = mouse_pos(event); + var x = xy[0]; + var y = xy[1]; + for (var i in click_events[event.target.id]) { + var ces = click_events[event.target.id][i]; if (ces && x >= ces["min_x"] && x <= ces["max_x"] && y >= ces["min_y"] && y <= ces["max_y"]) { - ces["func"](e.target.id, ces); + ces["func"](event.target.id, ces); break; } } @@ -76,10 +82,7 @@ document.location.href = page; } -function color_area(id, min_x, max_x, min_y, max_y, colour) { - var canvas = document.getElementById(id); - var context = canvas.getContext("2d"); - var image = context.getImageData(0, 0, menu_width, menu_height); +function colour_area(image, min_x, max_x, min_y, max_y, colour) { var pixels = image.data; for (var y = min_y; y <= max_y; y += 1) { for (var x = min_x; x <= max_x; x += 1) { @@ -89,34 +92,46 @@ setPixel(image, x, y, colour); } } - } - context.putImageData(image, 0, 0); + } } function init_logo(event) { var canvas = document.getElementById("logo"); - var context = canvas.getContext("2d"); - var image = context.getImageData(0, 0, menu_width, menu_height); + var context = canvas.getContext("2d"); canvas.width = menu_width; canvas.height = menu_height; context.drawImage(event.target, 0, 0); + var image = context.getImageData(0, 0, menu_width, menu_height); var white = new Colour(255, 255, 255); + var black = new Colour(0, 0, 0); + var orange = new Colour(201, 87, 35); + var green = new Colour(90, 215, 21); + var found = false; for (var i in click_events["logo"]) { - var p = click_events["logo"][i]; + var p = click_events["logo"][i]; + var min_x = p["min_x"]; + var max_x = p["max_x"]; + var min_y = p["min_y"]; + var max_y = p["max_y"]; var pos = document.location.href.lastIndexOf("/") + 1; - var page = document.location.href.substr(pos); - var found = false; + var page = document.location.href.substr(pos); for (var j in p["args"]) { if (page == p["args"][j]) { - color_area("logo", p["min_x"], p["max_x"], 70, p["max_y"], white); - found = true; + colour_area(image, min_x, max_x, 0, 60, orange); + colour_area(image, min_x, max_x, 60, max_y, white); + found = p; break; } } if (!found) { - color_area("logo", p["min_x"], p["max_x"], 0, 70, white); + colour_area(image, min_x, max_x, 0, 60, white); + colour_area(image, min_x, max_x, 60, max_y, orange); } - } + } + context.putImageData(image, 0, 0); + // context.fillStyle = green.str(); + // console.log((found["max_x"] - found["min_x"]) / 2 + found["min_x"] - 2); + // context.fillRect((found["max_x"]-found["min_x"])/2+found["min_x"]-1, 95, 2, 5); drawMenuLines(); } @@ -216,7 +231,7 @@ this.r = r; this.g = g; this.b = b; - this.a = a == undefined ? 1 : a; + this.a = a == undefined ? 255 : a; } Colour.prototype.equals = function(rhs) { for (p in this) { @@ -231,12 +246,12 @@ return "rgba(" + this.r + "," + this.g + "," + this.b + "," + this.a + ")"; } -function setPixel(image, x, y, color) { +function setPixel(image, x, y, colour) { var index = 4 * (x + y * image.width); - image.data[index] = color.r; - image.data[index + 1] = color.g; - image.data[index + 2] = color.b; - image.data[index + 3] = color.a; + image.data[index] = colour.r; + image.data[index + 1] = colour.g; + image.data[index + 2] = colour.b; + image.data[index + 3] = colour.a; } function getPixel(image, x, y) { diff -r 681b1d7dc3a9 -r 9c443a61358c howiwork.html --- a/howiwork.html Sun Dec 18 19:15:59 2011 +0100 +++ b/howiwork.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
      diff -r 681b1d7dc3a9 -r 9c443a61358c images/logobase.png Binary file images/logobase.png has changed diff -r 681b1d7dc3a9 -r 9c443a61358c index.html --- a/index.html Sun Dec 18 19:15:59 2011 +0100 +++ b/index.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
      diff -r 681b1d7dc3a9 -r 9c443a61358c links.html --- a/links.html Sun Dec 18 19:15:59 2011 +0100 +++ b/links.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
      @@ -48,7 +47,7 @@

      The Bad

      -

      The People and their Sites

      +

      People and their Sites

      • Christian König

        An ex-fellow student and companion in the quest for world domination. diff -r 681b1d7dc3a9 -r 9c443a61358c linksend.html --- a/linksend.html Sun Dec 18 19:15:59 2011 +0100 +++ b/linksend.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
        @@ -48,7 +47,7 @@

        The Bad

        -

        The People and their Sites

        +

        People and their Sites

        • Christian König

          An ex-fellow student and companion in the quest for world domination. diff -r 681b1d7dc3a9 -r 9c443a61358c personalwork.html --- a/personalwork.html Sun Dec 18 19:15:59 2011 +0100 +++ b/personalwork.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
          diff -r 681b1d7dc3a9 -r 9c443a61358c resume.html --- a/resume.html Sun Dec 18 19:15:59 2011 +0100 +++ b/resume.html Tue Dec 20 03:01:50 2011 +0100 @@ -28,8 +28,7 @@
          diff -r 681b1d7dc3a9 -r 9c443a61358c script.js --- a/script.js Sun Dec 18 19:15:59 2011 +0100 +++ b/script.js Tue Dec 20 03:01:50 2011 +0100 @@ -11,7 +11,7 @@ $(this).css("cursor", "pointer"); }, function() { $(this).css("cursor", "auto"); - }); + }); }); $(document).keypress( function(event) { @@ -22,8 +22,8 @@ }); var menu_width = 670; -var menu_height = 120; -var menu_splits = new Array(150, 350, 545); +var menu_height = 100; +var menu_splits = new Array(180, 350, 505); var click_events = new Array(); click_events["logo"] = new Array(); @@ -56,15 +56,21 @@ click_events["logo"][3]["func"] = switch_page; click_events["logo"][3]["args"] = new Array("links.html", "linksend.html"); -function handle_click(e) { - var offset = $("#logo").offset(); - var x = e.pageX - offset.left; - var y = e.pageY - offset.top; - for (var i in click_events[e.target.id]) { - var ces = click_events[e.target.id][i]; +function mouse_pos(event) { + var offset = $("#logo").offset(); + return new Array(event.pageX - offset.left, + event.pageY - offset.top); +} + +function handle_click(event) { + var xy = mouse_pos(event); + var x = xy[0]; + var y = xy[1]; + for (var i in click_events[event.target.id]) { + var ces = click_events[event.target.id][i]; if (ces && x >= ces["min_x"] && x <= ces["max_x"] && y >= ces["min_y"] && y <= ces["max_y"]) { - ces["func"](e.target.id, ces); + ces["func"](event.target.id, ces); break; } } @@ -76,10 +82,7 @@ document.location.href = page; } -function color_area(id, min_x, max_x, min_y, max_y, colour) { - var canvas = document.getElementById(id); - var context = canvas.getContext("2d"); - var image = context.getImageData(0, 0, menu_width, menu_height); +function colour_area(image, min_x, max_x, min_y, max_y, colour) { var pixels = image.data; for (var y = min_y; y <= max_y; y += 1) { for (var x = min_x; x <= max_x; x += 1) { @@ -89,34 +92,46 @@ setPixel(image, x, y, colour); } } - } - context.putImageData(image, 0, 0); + } } function init_logo(event) { var canvas = document.getElementById("logo"); - var context = canvas.getContext("2d"); - var image = context.getImageData(0, 0, menu_width, menu_height); + var context = canvas.getContext("2d"); canvas.width = menu_width; canvas.height = menu_height; context.drawImage(event.target, 0, 0); + var image = context.getImageData(0, 0, menu_width, menu_height); var white = new Colour(255, 255, 255); + var black = new Colour(0, 0, 0); + var orange = new Colour(201, 87, 35); + var green = new Colour(90, 215, 21); + var found = false; for (var i in click_events["logo"]) { - var p = click_events["logo"][i]; + var p = click_events["logo"][i]; + var min_x = p["min_x"]; + var max_x = p["max_x"]; + var min_y = p["min_y"]; + var max_y = p["max_y"]; var pos = document.location.href.lastIndexOf("/") + 1; - var page = document.location.href.substr(pos); - var found = false; + var page = document.location.href.substr(pos); for (var j in p["args"]) { if (page == p["args"][j]) { - color_area("logo", p["min_x"], p["max_x"], 70, p["max_y"], white); - found = true; + colour_area(image, min_x, max_x, 0, 60, orange); + colour_area(image, min_x, max_x, 60, max_y, white); + found = p; break; } } if (!found) { - color_area("logo", p["min_x"], p["max_x"], 0, 70, white); + colour_area(image, min_x, max_x, 0, 60, white); + colour_area(image, min_x, max_x, 60, max_y, orange); } - } + } + context.putImageData(image, 0, 0); + // context.fillStyle = green.str(); + // console.log((found["max_x"] - found["min_x"]) / 2 + found["min_x"] - 2); + // context.fillRect((found["max_x"]-found["min_x"])/2+found["min_x"]-1, 95, 2, 5); drawMenuLines(); } @@ -216,7 +231,7 @@ this.r = r; this.g = g; this.b = b; - this.a = a == undefined ? 1 : a; + this.a = a == undefined ? 255 : a; } Colour.prototype.equals = function(rhs) { for (p in this) { @@ -231,12 +246,12 @@ return "rgba(" + this.r + "," + this.g + "," + this.b + "," + this.a + ")"; } -function setPixel(image, x, y, color) { +function setPixel(image, x, y, colour) { var index = 4 * (x + y * image.width); - image.data[index] = color.r; - image.data[index + 1] = color.g; - image.data[index + 2] = color.b; - image.data[index + 3] = color.a; + image.data[index] = colour.r; + image.data[index + 1] = colour.g; + image.data[index + 2] = colour.b; + image.data[index + 3] = colour.a; } function getPixel(image, x, y) {