Reply
Discussion on: Possible Dynamic CCS, using PHP and JS
Old 01-09-2009, 07:09 AM Discussion on: Possible Dynamic CCS, using PHP and JS
Novice Talker

Posts: 10
Name: Tim
Trades: 0
Hey,

First off, hopefully this is in the right section, as it combines CSS, PHP and JS. However most of the code would be PHP, so I thought I'd put it in here.

Secondly:
You know how flash sites have all their fancy, fluid actions, but use up a lot of processor and take awhile to download?
What if we used the power of Dynamic CCS with PHP and JavaScript to make such websites, without the disgusting mess of flash?

My idea for my website (Idea is pantented):
Center box depecting title of website, with boxes on parts of a ring around the center box and the outside boxes equal degrees apart.
This allows for websites to be displayed nicely, or even for servers to be displayed very nicely as follows:
Box background goes between
Green - Server up and running fine
Yellow - Maintenance due soon, or buggy but server still running
Pink - Server closed for maintanence
Red - Server down until further notice
Or whatever I decide
But then the servers that are up are displayed up the top, then yellow, then pink, then red at the bottom, with buttons on the side to change the ordering.

I understand this isn't very economical of space (As a circle would take up a lot of room, and horozontal text around a ring would take up space on the ring if you didn't want it to overlap), but if you had only a few things that change status often, such things would be good no?

Also could AJAX be included so the page doesn't have to be refreshed?

Please, discuss my idea, and tell me if it's possible!

~Tim
Crystalmyst is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 01-09-2009, 12:16 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
chrishirst's Avatar
Super Moderator

Posts: 26,496
Location: Blackpool. UK
Trades: 0
And this website would be doing what exactly?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-09-2009, 04:27 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
Novice Talker

Posts: 10
Name: Tim
Trades: 0
Well it'd be my splash page to link to my other sites, as well as the server display for my upcoming game.
Could also be lots of stuff. Dynamic CSS is really powerful, but can it be combined with AJAX to make it so the content is fluid?

~Tim

Last edited by Crystalmyst; 01-09-2009 at 04:28 PM.. Reason: Never realised that was a curse xD edited it out.
Crystalmyst is offline
Reply With Quote
View Public Profile
 
Old 01-09-2009, 04:41 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
chrishirst's Avatar
Super Moderator

Posts: 26,496
Location: Blackpool. UK
Trades: 0
Right, sounds like it could be something to sit and watch for ages

A little OTT for a "splash" page I feel, but heyho each to their own.

and what is this "dynamic CSS" that you speak of? because CSS is pretty static unless you are using javascript to change properties "on the fly"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-09-2009, 04:46 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
AD7863's Avatar
15 Year Old Tech Blogger

Posts: 427
Name: Artful Dodger
Location: England, UK
Trades: 0
Sounds pretty cool if you can do it that is...
AD7863 is offline
Reply With Quote
View Public Profile Visit AD7863's homepage!
 
Old 01-10-2009, 07:12 AM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
Novice Talker

Posts: 10
Name: Tim
Trades: 0
@Chrishirst: http://www.codewalkers.com/c/a/Misce...-CSS-with-PHP/
Basic Dynamic CSS. Very, very basic. But something like that. I hate how CSS isn't dynamic, it pisses me off to no end...

@AD7863: Thanks. I may actually give it a shot this year after I finish my other project!

~Tim
Crystalmyst is offline
Reply With Quote
View Public Profile
 
Old 01-10-2009, 07:14 AM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
AD7863's Avatar
15 Year Old Tech Blogger

Posts: 427
Name: Artful Dodger
Location: England, UK
Trades: 0
Cool.
AD7863 is offline
Reply With Quote
View Public Profile Visit AD7863's homepage!
 
Old 01-10-2009, 07:39 AM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
chrishirst's Avatar
Super Moderator

Posts: 26,496
Location: Blackpool. UK
Trades: 0
Right then! So something I've been doing for a few years without it having a "cool" name.

CSS CANNOT be "dynamic" at all it is NOT a scripting language.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-10-2009, 05:47 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
NullPointer's Avatar
Will Code for Food

Latest Blog Post:
Apparatus Update Preview
Posts: 1,172
Name: Matt
Location: Irvine, CA
Trades: 0
CSS itself is static, however it can be used in conjunction with php to achieve something more dynamic. All you really have to do is change your style.css to style.php and declare the doc type as css using the php header function
PHP Code:
<?php
header
("Content-Type: text/css");
?>
__________________
Tinsology | How to Post Code | RosettaCodex
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 01-10-2009, 05:54 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
wayfarer07's Avatar
I like pie

Posts: 3,362
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Unfortunately you lose caching when you do that, so it's not typically a good idea to do all of a site's CSS that way..
__________________
Wayfarer | jQuery Tooltip | Mapbox: the jQuery Map
Latest Project: Houston Movers
If Google is the Coca-Cola of Web search, Bing is RC Cola
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-10-2009, 09:18 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
caching essentially consists of telling the browser that the content they are requesting hasn't changed since the last time they requested it, so you could technically do that here too. It would just take more work.
__________________
Will Anderson
It's An Anderson | Twitter | Anderson Web Solutions
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Old 01-10-2009, 09:52 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
NullPointer's Avatar
Will Code for Food

Latest Blog Post:
Apparatus Update Preview
Posts: 1,172
Name: Matt
Location: Irvine, CA
Trades: 0
Telling php to parse .css files as well as .php would solve the caching problem I think, but depending on the likelyhood of the file being the same at two different points in time (considering that it is dynamic) it might not be worth the trouble.

This is one of those optimization issues that you probably shouldn't spend more than 2 seconds worrying about unless your resources are spread very thin.
__________________
Tinsology | How to Post Code | RosettaCodex
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 01-11-2009, 06:09 AM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
Novice Talker

Posts: 10
Name: Tim
Trades: 0
CSS is static, yes. But the variables can be changed through PHP, depending on the status of the server (Going with my example here).
And as for the caching problem, it wouldn't be an issue unless the file was massive. Or (as NullPointer said), you have very little resources.

AJAX would be used to refresh the PHP file without the whole page reloading and the PHP would be used to give the dynamic variables inside the CSS.

Relatively simple, no?
Well, depending on how complex you want your CSS :3

~Tim
Crystalmyst is offline
Reply With Quote
View Public Profile
 
Old 01-11-2009, 08:42 PM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
Quote:
Originally Posted by Crystalmyst View Post
CSS is static, yes. But the variables can be changed through PHP, depending on the status of the server (Going with my example here).
And as for the caching problem, it wouldn't be an issue unless the file was massive. Or (as NullPointer said), you have very little resources.

AJAX would be used to refresh the PHP file without the whole page reloading and the PHP would be used to give the dynamic variables inside the CSS.

Relatively simple, no?
Well, depending on how complex you want your CSS :3

~Tim
Lies

PHP Code:
h3 {font-size:<?php print $_GET['size'];?>;color:<?php print $_GET['color']; ?>;}
__________________
Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Old 01-12-2009, 12:49 AM Re: Discussion on: Possible Dynamic CCS, using PHP and JS
Novice Talker

Posts: 10
Name: Tim
Trades: 0
...What's not simple about that?
But yeh, that's what I'm talking about: "Possible Dynamic CCS, using PHP and JS".



~Tim
Crystalmyst is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Discussion on: Possible Dynamic CCS, using PHP and JS
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12776 seconds with 13 queries