comparison awesome_js/robert.js @ 51:95fa4bcc5d67 laserkard

[svn r52] implemented SVG backend
author rlm
date Wed, 03 Feb 2010 03:14:09 -0500
parents 5eb11cf654de
children 2ca94aa58033
comparison
equal deleted inserted replaced
50:1b5417799713 51:95fa4bcc5d67
15 "<h1>The Arrow Kard.</h1>Precise and Straightforward. For those that seek to make a statement while being clear and concise. Straight as an arrow."; 15 "<h1>The Arrow Kard.</h1>Precise and Straightforward. For those that seek to make a statement while being clear and concise. Straight as an arrow.";
16 16
17 descHash.lines_acrylic_clear = 17 descHash.lines_acrylic_clear =
18 "<h1>The Direct Kard.</h1>Thorough and Distinct. For those that aim to demonstrate their professionalism with style. Push the envelope. Be Direct."; 18 "<h1>The Direct Kard.</h1>Thorough and Distinct. For those that aim to demonstrate their professionalism with style. Push the envelope. Be Direct.";
19 19
20 20 color = 'fefefe';
21 21
22 22
23 23
24 24
25 function pokedex(target) 25 function pokedex(target)
72 } 72 }
73 73
74 74
75 } 75 }
76 76
77 77 //~ function smallRedraw(style,field)
78 //~ {
79 //~ //smallRedraw(style,field,"fefefe");
80 //~ sRedraw(style,field,'fefefe');
81 //~ }
78 82
79 83
80 function smallRedraw(style,field) 84 function smallRedraw(style,field)
81 { 85 {
82 86
83
84
85 var JSONtext = document.getElementById('formValues').innerHTML; 87 var JSONtext = document.getElementById('formValues').innerHTML;
86 var hash = new Object(); 88 var hash = new Object();
87 hash = eval('(' + JSONtext + ')'); 89 hash = eval('(' + JSONtext + ')');
88 90
89 var content = eval("hash."+field); 91 var content = eval("hash."+field);
90 92
91 content = unescape(content); 93 content = unescape(content);
92 94
93 if (prevVal == content){return;} 95 //if (prevVal == content){return;}
96
97 contentRedraw(style,field, content);
98
99
100 }
101
102
103
104 function contentRedraw(style,field, content)
105 {
106
107 //var color = color;
108
109
110
94 111
95 posx = 10; 112 posx = 10;
96 posy = 10; 113 posy = 10;
97 center = 0; 114 center = 0;
98 font = 10; 115 font = 10;
156 173
157 var sizzle = eval(target+".getBBox().width;"); 174 var sizzle = eval(target+".getBBox().width;");
158 175
159 document.getElementById('output').innerHTML = sizzle; 176 document.getElementById('output').innerHTML = sizzle;
160 177
161 eval ( target +".attr('stroke', '#fefefe');"); 178 eval ( target +".attr('stroke', '#" + color + "');");
162 //eval ( target +".attr('stroke', '#fbafcd');"); 179 //eval ( target +".attr('stroke', '#fbafcd');");
163 180
164 eval ( target +".attr('fill', 'none');"); 181 eval ( target +".attr('fill', 'none');");
165 182
166 183
198 if(typeof d_Website != 'undefined' ){d_Website.remove();} 215 if(typeof d_Website != 'undefined' ){d_Website.remove();}
199 216
200 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} 217 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
201 } 218 }
202 219
220
221 function lineDraw(style, color)
222 {
223
224
225
226
227
228 if (style == "bold")
229 {return;}
230
231
232
233 if (style == "arrow")
234 {
235 d_lineArt = raphe.path("M 4 272 L 258 272");
236 d_lineArt.attr('stroke', "#" + color);
237 return;
238 }
239
240
241 if (style == "classic")
242 {return;}
243
244
245 if (style == "direct")
246 {
247 d_lineArt = raphe.path("M 350 165 L 512 165 M 350 173 L 512 173 M 350 181 L 512 181 M 350 189 L 512 189 M 350 197 L 512 197 M 350 213 L 512 213 M 350 205 L 512 205 M 350 221 L 512 221");
248 d_lineArt.attr('stroke', "#" + color);
249 return;
250 }
251
252 }
253
254
255
203 function redraw(style) 256 function redraw(style)
204 { 257 {
205 258
206 259
207 260
226 smallRedraw("arrow","Name"); 279 smallRedraw("arrow","Name");
227 smallRedraw("arrow","Email"); 280 smallRedraw("arrow","Email");
228 smallRedraw("arrow","Occupation"); 281 smallRedraw("arrow","Occupation");
229 smallRedraw("arrow","Company"); 282 smallRedraw("arrow","Company");
230 283
231
232 d_lineArt = raphe.path("M 4 272 L 258 272");
233 d_lineArt.attr('stroke', '#fefefe');
234 284
235 } 285 }
236 286
237 287
238 if (style == "classic") 288 if (style == "classic")
259 smallRedraw("direct","Occupation"); 309 smallRedraw("direct","Occupation");
260 smallRedraw("direct","Company"); 310 smallRedraw("direct","Company");
261 smallRedraw("direct","Phone"); 311 smallRedraw("direct","Phone");
262 smallRedraw("direct","Website"); 312 smallRedraw("direct","Website");
263 313
264 d_lineArt = raphe.path("M 350 165 L 512 165 M 350 173 L 512 173 M 350 181 L 512 181 M 350 189 L 512 189 M 350 197 L 512 197 M 350 213 L 512 213 M 350 205 L 512 205 M 350 221 L 512 221"); 314
265 d_lineArt.attr('stroke', '#fefefe'); 315 }
266 316
267 317 lineDraw(style, "fefefe");
268 318
269 } 319
270 320
271 321 }
272 322
273 323
274
275 }
276
277