flashlike javascript framework or simple html5 solution - javascript

I am kind of new to javascript/html5. normally I would do that kind of stuff inside flash/as3. but since the iPad doesn't support that I need to switch the horse...
I want to build a website where words are floating in position and size and if the mouse comes over one word it should draw some lines to all the other words. are there any frameworks one could use? the whole should look like a tag cloud with lines between the tags.

Raphael is a good JS replacement for Flash. It's a vector graphics based library.

Take a look at EaselJs from Grant Skinner. The approach he used is similar to Flash display list and timeline.
Here are some example:
https://github.com/mikechambers/ExamplesByMesh/tree/master/HTML5/EaselJS/follow
http://www.mikechambers.com/blog/2011/01/24/easeljs-example-follow-drone/
http://gskinner.com/blog/archives/2010/12/easel-js-simplifies-working-with-canvas-in-html5.html
A game Grant did:
http://www.pirateslovedaisies.com/

Related

Which chart library is used in the kickstarter dashboard?

I am trying to find the chart library used in the kickstarter dashboard:
(source: alexgpr.com)
Why?
Because I need some functionality not available in many of the libraries I have found.
Money in one side, percentage in the opossite side.
An horizontal line parallel to the axis (like the green one in the image)
Look nice and professional
I can't say which library they use but it looks like it could be raphael.js or similar.
You can also do some great animations with http://raphaeljs.com/ It creates SVG graphics and is great on all browsers including IE6
Also for graphs specifically check out http://g.raphaeljs.com/
the library that it is used looks like http://www.chartjs.org/

Uses for canvas | Practical examples

I'm trying to understand what people use canvas for?
I see it on job postings I read about it in Definitive JavaScript, but I don't quite get what it is used for.
I understand that you can draw 2d or 3d ( usually 2d ) objects but why no just use Gimp or Photoshop and upload the image.
Is it so you can create dynamic images based on say...user-specific data?
What is a practical example or perhaps a link to a professional implementation of canvas ( Definite JavaScript show basis stuff like drawing circles ).
MDN Tutorial
I have used a canvas to draw a graph, and it falls back to requesting a PHP-generated image if the browser doesn't support <canvas>. It's always a good idea to delegate processing from the server to the client, as this places less load on the server. In other words, instead of the server going "here's the stuff", it's more like "here's the data and the instructions to show it".
Another use I've seen is to highlight areas of an imagemap when moused over.
<canvas> is central in HTML5 game development, since it is used to draw the entire game viewport. Without it, there is no game.
Is it so you can create dynamic images based on say...user-specific data?
Yes
We used <canvas> to build interactive design editor for apparel in our e-commerce store — http://printio.ru/tees/new
The kind of interactivity we provide was only possible with Flash until recently.
Even on back end, we use Node.js and <canvas>-based image processing+generation to take data from online editor and create designs that are later used in store. These canvas-generated designs are eventually printed out on tshirts, mugs, caps, bags, and so on.
I think that's a pretty practical example :)
This is all done via Fabric.js canvas library (developed by us as well).
<canvas> is used for better Performance. <canvas> is much more faster and dynamic than jpeg or anything else. Example: http://www.profistart.com/internetseiten.html here was <canvas> used for Background.

replicate the javascript glow around the giant cloud on MobileMe Login Page?

If you access your mobile me account online with Safari, you can select an icon and login directly to selected service, great feature btw.
But if you access the same page using other browser like firefox or Chrome, you will see a gorgeous login page with a big, no huge cloud in the middle (the MobileMe logo) and interesting lighballs comming out of it.
Here's the link:
https://auth.me.com/authenticate?service=mail&ssoNamespace=appleid&formID=loginForm&returnURL=aHR0cHM6Ly9tZS5jb20vbWFpbC8=
And the greatest thing is that you can mouse over those little light balls and they follow your mouse movement.
Its just beautiful and i have never seen anything like that in Javascript. And i couldnt understand by looking at their code, how they did it. Of course their javascript is compressed so i couldn't look at it, but in the markup those shiny lights are just a bunch of canvas tags.
Does any one have an idea of how to make something like that? Its probably way beyond my javascript skills but it would be great to add such an effect to one of my projects.
Thanks in advance for all your suggestions ;)
that takes a lot of skills. I believe its achievable with processing.js
http://processingjs.org/
Take a look at this [quote]:
So, how is this eye candy accomplished? Through over 6000 lines of
(unminified) JS. MobileMe usually uses SproutCore for its
applications, but after looking through the source code, I didn’t find
a single reference to it. There did appear to be some resemblance of
a library being used in the login page, however, but I think it is
pretty custom. There appeared to be a class for each of the visual
components on the screen, at least one if not two separate animation
libraries (one 2d and one 3d), a particle rendering library, and
libraries for dealing with canvas drawing and DOM manipulation.
So it looks like it was custom made. You can read more here: http://badassjs.com/post/1649735994/the-new-mobileme-login-page-has-some-badass-js
I hope this helps.

Where can I find a Javascript drawing canvas?

I want to build a drawing program in JS. (jQuery preferred but not mandatory).
Anyway, my vision is a big, blank, white canvas with a simple grid. The user could drag "layers" to the grid (such as icons, pictures, etc). Also, it would support drawing curves, lines, boxes, etc.
Think of Adobe Illustrator but much simpler. Honestly, it will be used to do database diagrams more than art (unless database diagrams are art to you...lol)
Is there anything out there like that?
Thanks
I'm sorry to inform you you won't be first with the idea.
Check out these
- diagramo.com (html5/canvas)
- lucidchart.com (html5/canvas)
- gliffy.com (flash)
There are few more in the wild, though new addition is always good for competition!
For vector graphics I would suggest using inline SVG rather than something like canvas.
To get you started here is something I wrote a long time back (before I knew about jslint, so it's not as neat as it should be) http://jsfiddle.net/ctrlfrk/mZzVD/
Here is a jquery svg library (I had it bookmarked, but haven't tried it): http://keith-wood.name/svgRef.html
The mozilla reference: https://developer.mozilla.org/en/SVG_Reference
And the actual spec: http://www.w3.org/TR/SVG11/index.html

animated board game for web - not Flash - what is possible?

What is the best cross-browser way to get a flat mouse coordinate input data and simple callback for mouse events for my rectangular game area on my web page, even when it has loads of larger and smaller images and text string overlaid haphazard onto it?
And what is the best way to insert or remove a text string or semi-transparent image overlay at an arbitrary location (and Z order, specified relative to existing objects) in a board game rectangle with cross-browser DHTML?
And how can I stop the user selecting part or all of my montage of images (I just want them to interact with it as if it was Flash), and can I stop the right click menus coming up in IE, FF etc?
I want to do this without Flash because I want something that will work both on desktops and on iPhone and potentially other mobile platforms too.
I appreciate there are serious limitations (eg less image scaling capabilities, not vector, no rotation capability) to what I can do if I'm not using Flash but I'm very interested to know what capabilities are available.
Are there perhaps any frameworks available to make it easier than coding from scratch?
Would J/Query be a good match for some of the requirements? What else do I need?
I would recommend Google Web Toolkit. It lets you program in Java, which gives you all the type-safety and nice IDE functionality that Java entails, but compiles to Javascript so that you can just run it in a browser. It also does a ton of optimization and supports tons of features.
jQuery is excellent at doing this. I used jQuery's UI and Ajax functionality to implement the frontend for a game of chess.
I made it a little easier by creating an 8-by-8 table with unique div names for each tile, so Javascript can access them by getting the elements by id. If you can't create something like that, you do have the option of placing elements anywhere on the page (either absolute or relative to a given element). You can also easily change the z-index, including when the use is dragging a piece or when they have dropped it.
As far as disable right click and item selection goes, that's something that I didn't figure out how to do. You might want to take a look at some other Ajax games like Grand Strategy, which are much more polished than my experiment and may have figured out how to do this.
There are two main APIs for working with arbitrary drawing and positioning on the web, Canvas and SVG.
Take a look at Chrome Canvas Experiments and the Raphael Javascript toolkit to see some examples and Javascript abstractions.
The key is element.style.position = 'absolute'. To illustrate just what's possible here's how far I've managed to push javascript (and from scratch at that!):
http://slebetman.110mb.com/tank3.html - RTS in DOM! Click on units/squads then click somewhere else to tell them where to go. You can control both sides.

Categories

Resources