Javascript reflecting text - Possible?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Javascript reflecting text - Possible?

Post by RobertGonzalez »

Ok, this may sounds a little weird, but is there a way to use Javascript to reflect text? I know it can be done with images (I have found reflection.js many times over) and I know the IE only filters (flipV() and flipH()) but I was hoping for a pure JS implementation of this effect.

Google is not my friend today. Does anyone know if it can be/has been done, and if so, where I might be able to locate resources on it? If not, does anyone have a clue as to what else I could search for other than:

Code: Select all

Javascript text reflection -photoshop
As always, all help is appreciated.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

js canvas
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Do any of those examples show reflection of text? I couldn't find any that did, but I could have looked wrong. I am not looking for image reflection, I am looking to take text content and reflect it.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

I'd think that, if it was possible, we'd see a lot of amateur websites utilizing the effect.

I've played around with the idea before and came up with nothing. The best was to do it through GD libarry, and that idea got thown away quickly due to it's wastefulness.

I would imagine that if you were able to create an upside-down font, load it onto your server, and then access it through JS... (the last part is where I'm clueless :P)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Man, this makes me want to try to learn how to do this now.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Umm... You could do it in Flash, easily. :P
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

It needs to be something that can degrade peacefully. For what I want to do with it, if JS is not enabled, it should not really affect anyone's view of it. Not having flash enabled (like I don't) would jack it up pretty strong.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Everah wrote:It needs to be something that can degrade peacefully. For what I want to do with it, if JS is not enabled, it should not really affect anyone's view of it. Not having flash enabled (like I don't) would jack it up pretty strong.
Use jQuery to remove the text and replace it with the flash alternative...
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Remember that the whole point of doing this dynamically is so that the font styling can be changed without having to change any code. If it were to be done in Flash, you'd need some JavaScript to pass the necessary font family, size (this is not considering any browser scaling either), etc. parameters so it would know what to do.

Since JavaScript doesn't natively supported the rotation of text, I think canvas is the way to go. See transformations. Get back to us if you build something working!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Well, let the research begin. I am somewhat discouraged by this, but there has to be a way to get at what I want. So I will see what I can mess with to get at what I want to get at.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Hell yes, I will be looking at the in just a little while. That is interesting weirdan. Thanks.
Post Reply