webdevRefinery Forum: How to make this in html - webdevRefinery Forum

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline Renegade 

  • 418 I'm a teapot
  • Group: Members
  • Posts: 748
  • Joined: 08-March 10
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL,Graphics

Posted 10 March 2012 - 08:51 PM (#21)

Same with me unfortunately. I actually completely forgot to create the author (and in doing so, shifting the alignment blame :P) of the gradient. The great Lea Verou created it.
http://adriancooney.ieGithubTwitterDribbbleForrst
We all die. The goal isn't to live forever. The goal is to create something that will.

Array(16).join({}-{}) + " Batman!";
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 10 March 2012 - 11:53 PM (#22)

View PostThatRailsGuy, on 10 March 2012 - 12:55 PM, said:

$('#bar1').width('5%');

Function $(id) { return document.getElementById(id); }

$('bar1').style.width = '5%'

That's just inline CSS anyways. It's just setting it via JavaScript. If the percentage was set server-side, setting it via inline CSS is fine. why use JS for that?
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 11 March 2012 - 12:15 AM (#23)

View PostDaniel15, on 10 March 2012 - 11:53 PM, said:

Function $(id) { return document.getElementById(id); }

$('bar1').style.width = '5%'

That's just inline CSS anyways. It's just setting it via JavaScript. If the percentage was set server-side, setting it via inline CSS is fine. why use JS for that?

If he's making a game, probably want to use AJAX and thus JS to update.
Reserved.
0


User is offline gibbonweb 

  • 兄ヨハネス
  • Group: Members
  • Posts: 2062
  • Joined: 23-June 10
  • LocationMunich(DE)
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL,Graphics

Posted 11 March 2012 - 04:16 AM (#24)

View PostThatRailsGuy, on 10 March 2012 - 06:50 PM, said:

I've never worked with an app that didn't have jQuery in it. It would be just as easy to do that in basic JS too.

hint: it's even easier to just write that single inline css expression :P
0


User is offline iCyan 

  • Group: Members
  • Posts: 204
  • Joined: 15-May 11
  • Expertise:HTML,CSS,Graphics,Flash

Posted 11 March 2012 - 09:13 AM (#25)

View PostRenegade, on 10 March 2012 - 08:17 PM, said:

Even more stylized version: http://tinkerbin.com/6eZsZfe6

Warning: It is extremely painful watching that moving progress bar.


The moving stripes slowly speed up :P
iCyan Allias
0


User is online Sole_Wolf 

  • Group: Members
  • Posts: 303
  • Joined: 24-March 10
  • Expertise:HTML,PHP,Java,SQL

Posted 12 March 2012 - 02:57 PM (#26)

Wow thanks for the replies everyone. Sorry that it too me so long to reply. My laptop power cable broke and I wasn't able to get on WdR.

Thank you for all of the code examples; They were basically what I was looking for.

I am planning on using AJAX and JS for my fan made Pokemon Game. Right now I am working on the battle code which is proving to be the most arduous part of the whole game.

Since I have never really used javascript, I am hard at work learning it so that I can make the battles have real time updates and effects rather than using server side PHP alone.

The Battle System will take a lot of work, but this was a good first step towards completing it.
--Sole_Wolf
0


User is offline gibbonweb 

  • 兄ヨハネス
  • Group: Members
  • Posts: 2062
  • Joined: 23-June 10
  • LocationMunich(DE)
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL,Graphics

Posted 12 March 2012 - 03:04 PM (#27)

View PostSole_Wolf, on 12 March 2012 - 02:57 PM, said:

Wow thanks for the replies everyone. Sorry that it too me so long to reply. My laptop power cable broke and I wasn't able to get on WdR.

Thank you for all of the code examples; They were basically what I was looking for.

I am planning on using AJAX and JS for my fan made Pokemon Game. Right now I am working on the battle code which is proving to be the most arduous part of the whole game.

Since I have never really used javascript, I am hard at work learning it so that I can make the battles have real time updates and effects rather than using server side PHP alone.

The Battle System will take a lot of work, but this was a good first step towards completing it.

Before you put any huge effort in it: don't code the actual game logic in JavaScript, as players will be able to cheat (they can see the JS code and write variables via the Console...)... Always make sure your business logic is synchronized with the server, I'd very well UPDATE the screen in real time via javascript, but calculate the game mechanics in PHP (or whatever - SERVER SIDE) and just distribute the results to every client.
0


User is online Sole_Wolf 

  • Group: Members
  • Posts: 303
  • Joined: 24-March 10
  • Expertise:HTML,PHP,Java,SQL

Posted 13 March 2012 - 03:15 PM (#28)

View Postgibbonweb, on 12 March 2012 - 03:04 PM, said:

Before you put any huge effort in it: don't code the actual game logic in JavaScript, as players will be able to cheat (they can see the JS code and write variables via the Console...)... Always make sure your business logic is synchronized with the server, I'd very well UPDATE the screen in real time via javascript, but calculate the game mechanics in PHP (or whatever - SERVER SIDE) and just distribute the results to every client.

I have all of the game mechanics programmed in PHP. Currently, I am planning on just using AJAX to call my PHP functions to get damage calculations and other things like that for the battle system.

Anyone know a good place to start with AJAX? RIght now I am reading up on javascript from w3schools.
--Sole_Wolf
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 13 March 2012 - 03:28 PM (#29)

Checkout backbone.js
Reserved.
0


User is offline gibbonweb 

  • 兄ヨハネス
  • Group: Members
  • Posts: 2062
  • Joined: 23-June 10
  • LocationMunich(DE)
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL,Graphics

Posted 13 March 2012 - 03:32 PM (#30)

View PostSole_Wolf, on 13 March 2012 - 03:15 PM, said:

I have all of the game mechanics programmed in PHP. Currently, I am planning on just using AJAX to call my PHP functions to get damage calculations and other things like that for the battle system.

Anyone know a good place to start with AJAX? RIght now I am reading up on javascript from w3schools.

in that case, spare yourself some pain and use a good ajax capable framework.
0


User is online Sole_Wolf 

  • Group: Members
  • Posts: 303
  • Joined: 24-March 10
  • Expertise:HTML,PHP,Java,SQL

Posted 14 March 2012 - 02:14 AM (#31)

View Postgibbonweb, on 13 March 2012 - 03:32 PM, said:

in that case, spare yourself some pain and use a good ajax capable framework.

I'll probably end up using an ajax framework but I also need some javascript experience.

After modifying everyone else's code to my liking, this is my 1st draft for a Pokemon Party View.
Posted Image
--Sole_Wolf
0


User is offline gibbonweb 

  • 兄ヨハネス
  • Group: Members
  • Posts: 2062
  • Joined: 23-June 10
  • LocationMunich(DE)
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL,Graphics

Posted 14 March 2012 - 02:33 AM (#32)

View PostSole_Wolf, on 14 March 2012 - 02:14 AM, said:

I'll probably end up using an ajax framework but I also need some javascript experience.

After modifying everyone else's code to my liking, this is my 1st draft for a Pokemon Party View.
Posted Image

cool! But what's with the last pokemon's health... doping?
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 14 March 2012 - 02:39 AM (#33)

Missing number!
Reserved.
0


User is online Sole_Wolf 

  • Group: Members
  • Posts: 303
  • Joined: 24-March 10
  • Expertise:HTML,PHP,Java,SQL

Posted 14 March 2012 - 02:46 AM (#34)

View Postgibbonweb, on 14 March 2012 - 02:33 AM, said:

cool! But what's with the last pokemon's health... doping?

I was just playing around with numbers to see what the effect of having negative health and more than max health would have on my hp bar function.

View PostThatRailsGuy, on 14 March 2012 - 02:39 AM, said:

Missing number!

Yes correct! I am adding glitches to the game :D

Did anyone notice the Magikarp named Lugia?
--Sole_Wolf
1


User is offline gibbonweb 

  • 兄ヨハネス
  • Group: Members
  • Posts: 2062
  • Joined: 23-June 10
  • LocationMunich(DE)
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL,Graphics

Posted 14 March 2012 - 03:02 AM (#35)

View PostSole_Wolf, on 14 March 2012 - 02:46 AM, said:

Did anyone notice the Magikarp named Lugia?

to be honest, Pikachu is the only Pokémon I would recognize by name, and that's quite alright with me ;)
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 14 March 2012 - 11:24 AM (#36)

View PostSole_Wolf, on 14 March 2012 - 02:46 AM, said:

Did anyone notice the Magikarp named Lugia?

I did, but didn't get it.
Reserved.
0


User is offline arronhunt 

  • I'm a httpster
  • Group: Moderators
  • Posts: 3398
  • Joined: 09-March 10
  • LocationLos Angeles, CA
  • Expertise:HTML,CSS,Javascript,Graphics,Flash

Posted 14 March 2012 - 12:08 PM (#37)

Add
overflow: hidden;
to the parent div to fix that health bug
DO NOT OPEN THIS

Spoiler
1


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 15 March 2012 - 10:29 PM (#38)

Posted Image
Reserved.
2


Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services