Mercurial > laserkard
changeset 98:388344355ebf laserkard
figured out how to scale down main display
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 27 Jul 2010 05:14:22 -0400 |
parents | 8a3615df4c18 |
children | 9649b14f3b38 |
files | buy3.html js-lib/buy3.js |
diffstat | 2 files changed, 27 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/buy3.html Tue Jul 27 03:51:01 2010 -0400 1.2 +++ b/buy3.html Tue Jul 27 05:14:22 2010 -0400 1.3 @@ -12,7 +12,9 @@ 1.4 </head> 1.5 <body> 1.6 <div id="color-select"></div> 1.7 - <div id="style-select"></div> 1.8 + <div id="style-select"> 1.9 + <div id="bold"></div> 1.10 + </div> 1.11 <div id="card-display"></div> 1.12 <div id="pokedex"></div> 1.13 <div id="debug"></div>
2.1 --- a/js-lib/buy3.js Tue Jul 27 03:51:01 2010 -0400 2.2 +++ b/js-lib/buy3.js Tue Jul 27 05:14:22 2010 -0400 2.3 @@ -1,24 +1,3 @@ 2.4 -// Cards = (function (){ 2.5 - 2.6 - 2.7 -// (function (info paper){ 2.8 -// info.name 2.9 -// info.occupation 2.10 -// info.email 2.11 -// info.phone 2.12 - 2.13 - 2.14 - 2.15 - 2.16 - 2.17 - 2.18 -// }); 2.19 - 2.20 - 2.21 - 2.22 - 2.23 - 2.24 - 2.25 2.26 Buy = (function (){ 2.27 2.28 @@ -27,7 +6,7 @@ 2.29 var Cards = 2.30 {"bold" : { 2.31 "name" :(function (text, display){ 2.32 - return display.print(10,10,text,helvetica, 25).attr( 2.33 + return display.print(10,20,text,helvetica, 25).attr( 2.34 {"fill" : "#0F0"});}), 2.35 "email" : (function (text, paper){ 2.36 return paper.print(50,50,text,helvetica_I,40).attr( 2.37 @@ -90,12 +69,14 @@ 2.38 2.39 var display; 2.40 var color; 2.41 - var style; 2.42 + var style = {}; 2.43 var helvetica; 2.44 var helvetica_I; 2.45 2.46 var state_map = { 2.47 - green : {ref : null, 2.48 + bold : {ref : null}, 2.49 + 2.50 + green : {ref : null, 2.51 offState : {"fill" : "#030", "scale": 1} , 2.52 onState : {"fill" : "#0F0", "scale": 1}}, 2.53 red : {ref : null, 2.54 @@ -143,23 +124,39 @@ 2.55 if ($(this).val() == $(this).attr('title')){ 2.56 $(this).val('');}})})}); 2.57 2.58 + 2.59 2.60 - 2.61 + 2.62 + var style_init = (function (){ 2.63 + state_map["bold"] = style.bold.set(); 2.64 + //var yyy = Cards.bold.name("Ru", style.bold); 2.65 + 2.66 + //for each (var item in yyy.items) {item.scale(0.5, 0.5);} 2.67 +// for (var letter in yyy) { 2.68 +// letter.scale(0.5,0.5);} 2.69 + 2.70 + state_map["bold"].push(Cards.bold.name("Robert", style.bold)); 2.71 + state_map["bold"].attr({"fill" : "red"}); //.scale(0.5, 0.5, 0, 0); 2.72 + state_map["bold"].scale(0.03, 0.03, 0 , 0); 2.73 + 2.74 + }); 2.75 + 2.76 2.77 2.78 2.79 var init = (function () { 2.80 display = Raphael("card-display", 340 ,215); 2.81 color = Raphael("color-select", 300, 100); 2.82 - style = Raphael("style-select", 200, 70); 2.83 + style.bold = Raphael("bold", 100, 100); 2.84 + //style = Raphael("style-select", 200, 70); 2.85 helvetica = display.getFont('HelveticaNeue', 700); 2.86 helvetica_I = display.getFont('HelveticaNeue', 800); 2.87 - 2.88 color_select_init(); 2.89 display_init(); 2.90 card_init(); 2.91 text_entry_init(); 2.92 key_handling(); 2.93 + style_init(); 2.94 update(); 2.95 }); 2.96