Jump to content

Looking For A Sparkly Script


daring_du

Recommended Posts

Hi there,I'm making a space themed site and I'm looking for a script that will display sparkling stars against a black background (i.e. very small white dots speckled throughout the background which either continuously sparkle/shimmer or slowly fade in and out etc..). The background is fixed, as well, so that only the foreground content scrolls. Any suggestions on where I can find such a script? I tried going to the google home page to find what I wanted, but all I could see there was a search box; nothing at all about sparklies. Weird...Haha (slapping knee). Seriously, though, I did find one website advertising sparkles on the mouse, without using an image. It turns out the "sparkle" was the "*" sign. Two or three of them appear in various colors as the mouse is moved around the page. I wonder if something similar could be done with the "." (period, fullstop) symbol of various font sizes speckled around the background of a page so that an image would not be necessary. They could then fade in and out at various intervals thus giving the appearance of sparkling stars. If anyone feels like writing a script for me like that real quick I'd be so grateful. :)Actually, come to think of it, that won't do in this situation (though I am still curious if it could still be done in that way) cause I'm doing this as a zengarden submission so I can't change the html by inserting the periods, which means it would need to be a javascript image effect. Of course, some kind of css solution that could achieve the desired effect would be even BETTER! Anyway, thanks for any advice offered.(makes like a tree and leafs)

Link to comment
Share on other sites

From what I see on the zengarden site, you can't use Javascript either. It's supposed to be purely CSS, and what's more, only CSS1 properties.Anyways, you don't expect us to make a script for you just so that you get the credit for the submission, do you? We're only try to teach people how to do it themselves.If you don't know a single bit of Javascript, first read the W3Schools Javascript tutorial and get familiar with it. If you do know Javascript then I'll give you some suggestions:You can make things blink by alternating between the default display property and "none," fading would be done with opacity, or by gradually changing between the main color and the background color. One might go as far as creating a "Star()" class and then go through a loop to create a certain number of stars and place them in random positions on the page.

Link to comment
Share on other sites

Why not just an animated GIF?
I ain't knowing what that is, but since you've mentioned it now I'll try looking for it on google. However, if you already know of a helpful link then posting it for me would be...helpful.
If you don't know a single bit of Javascript, first read the W3Schools Javascript tutorial and get familiar with it. If you do know Javascript then I'll give you some suggestions:You can make things blink by alternating between the default display property and "none," fading would be done with opacity, or by gradually changing between the main color and the background color. One might go as far as creating a "Star()" class and then go through a loop to create a certain number of stars and place them in random positions on the page.
I know a bit of javascript (thanks for being kind by using the word bit!!!) but I hope you won't mind if I probe you a bit more on this. You start by saying that you will give some suggestions in the context of knowing at least a bit of javascript, but then you finish by talking about creating a "star()" class which does not sound like javascript. Could you please clarify this for me?Also, I didn't understand the stuff about alternating, opacity, and looping(which does sounds like javascript). I don't mind studying up on this stuff for myself, but I really hate wasting my time wading through 16million hits on a google search. Perhaps you already know of some links specific to those options. BTW, your options sound quite interesting; thanks for offering them.
Link to comment
Share on other sites

I ain't knowing what that is, but since you've mentioned it now I'll try looking for it on google. However, if you already know of a helpful link then posting it for me would be...helpful.I know a bit of javascript (thanks for being kind by using the word bit!!!) but I hope you won't mind if I probe you a bit more on this. You start by saying that you will give some suggestions in the context of knowing at least a bit of javascript, but then you finish by talking about creating a "star()" class which does not sound like javascript. Could you please clarify this for me?Also, I didn't understand the stuff about alternating, opacity, and looping(which does sounds like javascript). I don't mind studying up on this stuff for myself, but I really hate wasting my time wading through 16million hits on a google search. Perhaps you already know of some links specific to those options. BTW, your options sound quite interesting; thanks for offering them.
BTW, I forgot to mention...
Anyways, you don't expect us to make a script for you just so that you get the credit for the submission, do you? We're only try to teach people how to do it themselves.
No, I didn't actually EXPECT anyone to write a script for me; that's why I sarcastically said "real quick". But if you are worried about credit, I don't really care about that kind of stuff. If you want you can write the script for me and I'll agree to put a big banner right smack in the middle of the sun which shines brightly in a fixed position in the middle of the screen declaring your contribution and a link to your homepage or whatever! Ha you can even include a little picture of tales if you want! :)Hmm, actually I doubt if I'd even care if someone used my idea and submitted some kind of fantastic space theme before I could finish mine; at least I'd be able to look at the code for how they did it and get some ideas about where I was going wrong!BTW, are you still bored?
Link to comment
Share on other sites

An "animated GIF" is an image that's animated. It's called a "GIF" because the only image files that can be animated are the ones that are in GIF format (they end with .gif)To "alternate" means to switch from one state to another. It's not just a programming word, but can apply to anything in the real world. For example: a traffic light can alternate between red and green."Looping" is a general programming term, it means to repeat a set of instructions many times. Looping is covered in the following chapters:http://w3schools.com/js/js_loop_for.asphttp://w3schools.com/js/js_loop_while.asphttp://w3schools.com/js/js_break.asphttp://w3schools.com/js/js_loop_for_in.asphttp://w3schools.com/php/php_looping.asphttp://w3schools.com/php/php_looping_for.aspWhen you want an HTML element to blink, you can alternate the style property's display between "none" and "block". In order to access the style property of an element you have to access it through the DOM.To set the display property you would do it something like this:

el.style.display = "none";

If you want an HTML object to fade you will have to work with opacity.W3Schools covers everything about opacity in this chapter: http://w3schools.com/css/css_image_transparency.aspFor the two previous methods I've shown you, you'll need either setInterval() or setTimeout()setTimeout() is covered in this chapter:http://w3schools.com/js/js_timing.aspsetInterval() is just like setTimeout() except that it keeps on repeating the function until clearInterval() is called.My last statement was referring to advanced Javascript. It's Javascript's somewhat simplistic form of object-oriented programming. In programming, a "class" is a definition of an object that can be used. A "Star()" class would be a class that you created that would basically create a star on the page for you. But it's quite abstract. You need to define, through methods and properties, what a star is and what it does.Here's a little example of a class in java script:

// This is the classfunction myClass() {  var num = 0;  this.add1 = function() {	num++;  }  this.toString = function() {	return num;  }}// Here is how it's used:var obj = new myClass();alert(obj); // returns 0obj.add1();alert(obj); // returns 1

Link to comment
Share on other sites

To "alternate" means to switch from one state to another. It's not just a programming word, but can apply to anything in the real world. For example: a traffic light can alternate between red and green.
I'll see what I can do about figuring out the actual mechanism of switching back and forth, since that was obviously the context of what I was asking about but hey that stuff about traffic lights was brilliant. I was rofl'ing. Keep up the good work. :)Anyway, I do appreciate your attempts to explain some things to me so I'll make some time to study up on what you've written here.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...