Page 1 of 2

[BBCode] Neonlights

Posted: 16 Dec 2011, 01:08
by Terr0r
Neonlights BBCode
Written by Terr0r

BBCode usage
[hide]

Code: Select all

[neonlights]{TEXT}[/neonlights]
[/hide]
HTML replacement
[hide]

Code: Select all

<h2><script language="JavaScript1.2">

var message="{TEXT}"
var neonbasecolor="black"
var neontextcolor="red"
var neontextcolor2="#darkred"
var flashspeed=100						// speed of flashing in milliseconds
var flashingletters=3						// number of letters flashing in neontextcolor
var flashingletters2=1						// number of letters flashing in neontextcolor2 (0 to disable)
var flashpause=0						// the pause between flash-cycles in milliseconds

///No need to edit below this line/////

var n=0
if (document.all||document.getElementById){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
document.write('</font>')
}
else
document.write(message)

function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
crossref(m).style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
crossref(n).style.color=neontextcolor

if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2 
if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor


if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",flashpause)
return
}
}

function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval("neon()",flashspeed)
}
beginneon()


</script></h2>
[/hide]
Help line
[hide]

Code: Select all

Neonlights :[neonlights]Your text here[/neonlights]
[/hide]
Example
[hide]

Code: Select all

[neonlights]Your text here[/neonlights]
[/hide]
Demo
Screenshot
demoneolights.png
demoneolights.png (4.01 KiB) Viewed 3870 times
Live Demo
Live Demo Neonlights

Note
The original file comes from Dynamicdrive.com and I have just tweaked it to work with phpbb.

Enjoy! Image

Greets Terr0r

[BBCode] Neonlights

Posted: 16 Dec 2011, 13:15
by slash
great! thank you! terr0r

[BBCode] Neonlights

Posted: 16 Dec 2011, 13:43
by Galandas

[BBCode] Neonlights

Posted: 16 Dec 2011, 15:11
by Terr0r
No it is not the same take a look to my bbcode and to the Color Slide BBCode it is not the same

Greets Terr0r

[BBCode] Neonlights

Posted: 16 Dec 2011, 15:31
by darkonia
looks good, thx

[BBCode] Neonlights

Posted: 16 Dec 2011, 17:13
by Galandas
Terr0r wrote:No it is not the same take a look to my bbcode and to the Color Slide BBCode it is not the same

Greets Terr0r
okay it was only a question

thanks :thumb:

[BBCode] Neonlights

Posted: 19 Dec 2011, 18:37
by juango
is there any way you can make that xhtml strict? if you use that bbcode on your forum you get validation errors!

[BBCode] Neonlights

Posted: 19 Dec 2011, 21:17
by doktornotor
Sure, once you have replaced nonsensical junk such as language="JavaScript1.2" with valid code... :lol:

[BBCode] Neonlights

Posted: 19 Dec 2011, 21:46
by juango
dok i know what the correct code is, i was just trying to let terr0r know if he could fix it so that his posted code here is valid that is all!

[BBCode] Neonlights

Posted: 19 Dec 2011, 21:53
by FTH
try to replace with :

Code: Select all

<script language="Javascript1.2" type="text/javascript">
or just :

Code: Select all

<script type="text/javascript">