Showing posts with label heart. Show all posts

Last month, I used HC to draw a heart. Now, I am using Google Chart API to do the same thing and having a prettier heart!

http://chart.apis.google.com/chart?cht=lxy:nda&chd=t:-1%7C-1&chs=157x157&chfd=0,t,0,6.283,0.001,%282-2*sin%28t%29%2Bsin%28t%29*sqrt%28abs%28cos%28t%29%29%29%2F%28sin%28t%29%2B1.4%29%29*cos%28t%29%7C1,t,0,6.283,0.001,%282-2*sin%28t%29%2Bsin%28t%29*sqrt%28abs%28cos%28t%29%29%29%2F%28sin%28t%29%2B1.4%29%29*sin%28t%29&chds=-3,3,-4.5,1.5&chm=D,FF0000,0,0,1%7CB,FF0000,0,0,0
http://chart.apis.google.com/chart?cht=tx&chl=r%28t%29%3D2-2%5Csin%28t%29%2B%5Csin%28t%29%5Cfrac%7B%5Csqrt%7B%5Cleft%7C%5Ccos%28t%29%5Cright%7C%7D%7D%7B%5Csin%28t%29%2B1.4%7D

Image source url:

http://chart.apis.google.com/chart?cht=lxy:nda&chd=t:-1|-1&chs=157x157&chfd=0,t,0,6.283,0.001,(2-2*sin(t)%2Bsin(t)*sqrt(abs(cos(t)))%2F(sin(t)%2B1.4))*cos(t)|1,t,0,6.283,0.001,(2-2*sin(t)%2Bsin(t)*sqrt(abs(cos(t)))%2F(sin(t)%2B1.4))*sin(t)&chds=-3,3,-4.5,1.5&chm=D,FF0000,0,0,1|B,FF0000,0,0,0

And you can play with Live Chart Playground1:

cht=lxy:nda
chd=t:-1|-1
chs=157x157
chfd=0,t,0,6.283,0.001,(2-2*sin(t)%2Bsin(t)*sqrt(abs(cos(t)))%2F(sin(t)%2B1.4))*cos(t)|1,t,0,6.283,0.001,(2-2*sin(t)%2Bsin(t)*sqrt(abs(cos(t)))%2F(sin(t)%2B1.4))*sin(t)
chds=-3,3,-4.5,1.5
chm=D,FF0000,0,0,1|B,FF0000,0,0,0

Have hearty!

[1]http://code.google.com/apis/chart/docs/chart_playground.html is gone.

        _________________________________________
       /.                 / /                   /
      / .                / /                   /|
     /  .               / /   \_|_/           / |
    /   .              / /   ( . . )         /  |
   /    .             / /     \___/         /   |
  /     .            / /     ___I___       /    |
 /      .           / /     /       \     /     |
/__________________/ /____/=|  /\/\ |=\__/      |
|       .          | |    | |  \  / | |  |      |
|       .          | |    | |   \/  | |  |      |
|       .           ~     | |       | |  |      |
|       .                 m \-------/ m  |      |
|       .                     || ||      |      |
|       ......................||.||......|......|
|      .                      || ||      |      /
|     .                       || ||      |     /
|    .                        || ||      |    /
|   .                        /--v--\     |   /
|  .                                     |  /  /\/\
| .                                      | /   \\//   (c) 2010
|________________________________________|/     \/  Yu-Jie Lin

If you are a terminal user, you might want to check out "Time to have Falling Hearts screensaver for geek's terminal ."
I saw someone asked in discussion group, so I decided to write on my own. Here is all you need:
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://yjl.googlecode.com/svn/trunk/JavaScript/falling_hearts.js"></script>

Put these two lines to an HTML/JavaScript gadget without setting the title of widget. You should now have falling hearts! <3

You can see them in this demo page. The code is released under the modified BSD.

There will be 40 hearts, flying around, fading at bottom, then starting falling over again. They also slightly change font size and change colors. Those hearts are text, actually just HTML entity &hearts;.

The script currently doesn't let you customize easily. If you want to, you need to download the script, change variables and upload to somewhere else.

Feel free to provide ideas if you need to fit your needs.

Hope you would <3 it!