This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-03 09:02:21

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Custom Scratch forum skins!

Here's what it looks like so far:
http://www.imgpaste.com/ZzqK.png
Almost everything works perfectly, and the topic selector, main menu, and post menu are all perfectly highlighted. Except for the following:

If you notice, below the poster's name and details but above the online/offline stamp on the left of the post, there is an uncolored region. I can't seem to find that particular region's parent <div>'s class so that I can paint it green.

Other than that, I would like somebody to host this code at some point.

What do you think?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#2 2012-01-03 09:11:14

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Custom Scratch forum skins!

Pretty cool  smile  I've been thinking about doing something like this for a while now so well done! I was thinking this sort of thing would work well for the new forum development.

I just had a quick look with firebug, I can't see the div for that grey region either... perhaps it is the background colour of that entire box?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#3 2012-01-03 09:13:06

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Custom Scratch forum skins!

sparks wrote:

Pretty cool  smile  I've been thinking about doing something like this for a while now so well done! I was thinking this sort of thing would work well for the new forum development.

I just had a quick look with firebug, I can't see the div for that grey region either... perhaps it is the background colour of that entire box?

No luck there...  sad


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#4 2012-01-03 09:16:33

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Custom Scratch forum skins!

the postright div, isn't it?

firefox 12 is sooo cool  smile

Offline

 

#5 2012-01-03 09:44:23

nickbrickmaster
Scratcher
Registered: 2010-02-02
Posts: 500+

Re: Custom Scratch forum skins!

Search through the stylesheets.

Google chrome 16 is soooooooo cool  tongue

Last edited by nickbrickmaster (2012-01-03 09:44:54)


Ask me what I'm doing, wait an hour than roll a die, if it's 4-6, I'm playing Skyrim, if it's 1, I'm eating, if it's 2-3 I'm programming.
Steam: nickbrickmaster | RotMG: PwnThemAll | Minecraft: nickbrickmaster | League Of Legends: BaneOfTitans

Offline

 

#6 2012-01-03 10:08:29

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Custom Scratch forum skins!

you can't do that in google chrome  tongue

Offline

 

#7 2012-01-03 10:13:35

zippynk
Scratcher
Registered: 2011-07-23
Posts: 500+

Re: Custom Scratch forum skins!

roijac wrote:

you can't do that in google chrome  tongue

What web browser is that? The 3D is cool!


https://dl.dropbox.com/u/60598636/trifocal_interlude_soundcloud_button.png

Offline

 

#8 2012-01-03 10:16:26

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Custom Scratch forum skins!

firefox nightly build^^ (aka ff12)

Offline

 

#9 2012-01-03 10:22:08

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Custom Scratch forum skins!

roijac wrote:

firefox nightly build^^ (aka ff12)

Nah, you just need the addon called tilt.


http://i.imgur.com/zeIZW.png

Offline

 

#10 2012-01-03 10:47:02

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Custom Scratch forum skins!

yes, you can, but on aurora n nightly it's built in

[/offtopic]

Offline

 

#11 2012-01-03 11:51:36

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Custom Scratch forum skins!

it's the post wrapper with the class blockpost.


nXIII

Offline

 

#12 2012-01-03 12:29:01

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Custom Scratch forum skins!

roijac wrote:

Firefox 12 is sooo cool  smile

It sure is.  big_smile  Actually, I use 11. ♥ the 3D.

Offline

 

#13 2012-01-03 12:38:45

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: Custom Scratch forum skins!

Coolio!


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#14 2012-01-03 15:29:06

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Custom Scratch forum skins!

Oh, sorry, it's actually the left border of the .postright element.


nXIII

Offline

 

#15 2012-01-03 19:46:24

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Custom Scratch forum skins!

is the online/offline thing postfootleft?


Fork Clamor on GitHub!

Offline

 

#16 2012-01-03 20:09:00

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Custom Scratch forum skins!

ohaiderstudios wrote:

is the online/offline thing postfootleft?

Yep


nXIII

Offline

 

#17 2012-01-04 07:46:27

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Custom Scratch forum skins!

nXIII wrote:

Oh, sorry, it's actually the left border of the .postright element.

Thank you so much!


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#18 2012-01-04 08:28:51

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Custom Scratch forum skins!

Almost done. nXIII, can you figure out the last bit (//help! commenton the for loop)? I want to get the links to have a green pattern, with a dark green hover color.

Code:

// ==UserScript==
// @name           New CSS
// @namespace      CSS
// @description    Creates a new CSS
// @include        http://scratch.mit.edu/forums*
// ==/UserScript==

if (document.getElementsByClassName == undefined) {//Get element by class name definition
    document.getElementsByClassName = function(className)
    {
        var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
        var allElements = document.getElementsByTagName("*");
        var results = [];

        var element;
        for (var i = 0; (element = allElements[i]) != null; i++) {
            var elementClass = element.className;
            if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
                results.push(element);
        }

        return results;
    }
}
injectAttribForClass("postleft", "backgroundColor", "#60D4AE");//info

injectAttribForClass("box", "backgroundColor", "#25F4C5");//Big boxes
injectAttribForClass("box", "borderStyle", "solid");
injectAttribForClass("box", "borderWidth", "1px");
injectAttribForClass("box", "borderColor", "#006E4A");

injectAttribForClass("conr", "borderStyle", "solid");//Corner
injectAttribForClass("conr", "borderWidth", "1px");
injectAttribForClass("conr", "borderColor", "#006E4A");
injectAttribForClass("conr", "backgroundColor", "#60D4AE");
injectAttribForClass("conr", "color", "#006E4A");

injectAttribForClass("blockpost rowodd", "backgroundColor", "#60D4AE");//?

injectAttribForClass("postright", "borderLeftColor", "#60D4AE");//?
injectAttribForClass("postright", "backgroundColor", "#25F4C5");//?

injectAttribForClass("postfootleft", "backgroundColor", "#60D4AE");//FootLT

injectAttribForClass("postfootright", "backgroundColor", "#25F4C5");//FootRT

injectAttribForClass("codebox", "backgroundColor", "#60D4AE");//FootRT

injectAttribForClass("postreport", "color", "#006E4A");//Lighttext

injectAttribForTag("blockquote", "backgroundColor", "#80E6CC");//incq box

injectAttribForTag("h2", "backgroundColor", "#006E4A");

injectAttribForTag("td", "backgroundColor", "#25F4C5");
injectAttribForTag("td", "borderColor", "#006E4A");

injectAttribForTag("th", "backgroundColor", "#60D4AE");
injectAttribForTag("th", "borderColor", "#006E4A");

document.getElementsByTagName("h2")[0].style.backgroundColor="#FFFFFF";

document.getElementById("brdmenu").style.backgroundColor="#006E4A";

function injectAttribForClass(className, attrib, setting) {//Attribute injector
    var pstlts = document.getElementsByClassName(className);
    var i;
    for (i=0; i<=pstlts.length-1;i++)
    {
        pstlts[i].style[attrib]=setting;
    }
}

function injectAttribForTag(className, attrib, setting) {//Attribute injector
    var pstlts = document.getElementsByTagName(className);
    var i;
    for (i=0; i<=pstlts.length-1;i++)
    {
        pstlts[i].style[attrib]=setting;
    }
}

var pstlts = document.getElementsByTagName("a");
for (i=0; i<=pstlts.length-1;i++) {// Help!
    pstlts[i].onmouseover=function(evt) {
        this.style.color="green";
    };
    pstlts[i].onmouseout=function(evt) {
        this.style.color="darkGreen"
    };
}

Last edited by Hardmath123 (2012-01-04 08:35:42)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#19 2012-01-04 08:32:52

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Custom Scratch forum skins!

http://www.imgpaste.com/txgz.png
http://www.imgpaste.com/Q9g1.png
http://www.imgpaste.com/6hVP.png


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#20 2012-01-04 08:36:36

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Custom Scratch forum skins!

Nice. Why do you do this with JS and not CSS?  tongue

Offline

 

#21 2012-01-04 08:37:06

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Custom Scratch forum skins!

Nice!


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#22 2012-01-04 10:38:46

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Custom Scratch forum skins!

scimonster wrote:

Nice. Why do you do this with JS and not CSS?  tongue

How would I, with CSS?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#23 2012-01-04 10:40:15

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Custom Scratch forum skins!

Hardmath123 wrote:

Almost done. nXIII, can you figure out the last bit (//help! commenton the for loop)? I want to get the links to have a green pattern, with a dark green hover color.

Code:

// ==UserScript==
// @name           New CSS
// @namespace      CSS
// @description    Creates a new CSS
// @include        http://scratch.mit.edu/forums*
// ==/UserScript==

if (document.getElementsByClassName == undefined) {//Get element by class name definition
    document.getElementsByClassName = function(className)
    {
        var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
        var allElements = document.getElementsByTagName("*");
        var results = [];

        var element;
        for (var i = 0; (element = allElements[i]) != null; i++) {
            var elementClass = element.className;
            if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
                results.push(element);
        }

        return results;
    }
}
injectAttribForClass("postleft", "backgroundColor", "#60D4AE");//info

injectAttribForClass("box", "backgroundColor", "#25F4C5");//Big boxes
injectAttribForClass("box", "borderStyle", "solid");
injectAttribForClass("box", "borderWidth", "1px");
injectAttribForClass("box", "borderColor", "#006E4A");

injectAttribForClass("conr", "borderStyle", "solid");//Corner
injectAttribForClass("conr", "borderWidth", "1px");
injectAttribForClass("conr", "borderColor", "#006E4A");
injectAttribForClass("conr", "backgroundColor", "#60D4AE");
injectAttribForClass("conr", "color", "#006E4A");

injectAttribForClass("blockpost rowodd", "backgroundColor", "#60D4AE");//?

injectAttribForClass("postright", "borderLeftColor", "#60D4AE");//?
injectAttribForClass("postright", "backgroundColor", "#25F4C5");//?

injectAttribForClass("postfootleft", "backgroundColor", "#60D4AE");//FootLT

injectAttribForClass("postfootright", "backgroundColor", "#25F4C5");//FootRT

injectAttribForClass("codebox", "backgroundColor", "#60D4AE");//FootRT

injectAttribForClass("postreport", "color", "#006E4A");//Lighttext

injectAttribForTag("blockquote", "backgroundColor", "#80E6CC");//incq box

injectAttribForTag("h2", "backgroundColor", "#006E4A");

injectAttribForTag("td", "backgroundColor", "#25F4C5");
injectAttribForTag("td", "borderColor", "#006E4A");

injectAttribForTag("th", "backgroundColor", "#60D4AE");
injectAttribForTag("th", "borderColor", "#006E4A");

document.getElementsByTagName("h2")[0].style.backgroundColor="#FFFFFF";

document.getElementById("brdmenu").style.backgroundColor="#006E4A";

function injectAttribForClass(className, attrib, setting) {//Attribute injector
    var pstlts = document.getElementsByClassName(className);
    var i;
    for (i=0; i<=pstlts.length-1;i++)
    {
        pstlts[i].style[attrib]=setting;
    }
}

function injectAttribForTag(className, attrib, setting) {//Attribute injector
    var pstlts = document.getElementsByTagName(className);
    var i;
    for (i=0; i<=pstlts.length-1;i++)
    {
        pstlts[i].style[attrib]=setting;
    }
}

var pstlts = document.getElementsByTagName("a");
for (i=0; i<=pstlts.length-1;i++) {// Help!
    pstlts[i].onmouseover=function(evt) {
        this.style.color="green";
    };
    pstlts[i].onmouseout=function(evt) {
        this.style.color="darkGreen"
    };
}

Just add an injectAttribForTag("a", "color", "darkGreen"); to set their color initially

scimonster wrote:

Nice. Why do you do this with JS and not CSS?  tongue

I was wondering that too...


nXIII

Offline

 

#24 2012-01-04 11:32:06

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Custom Scratch forum skins!

Hardmath123 wrote:

scimonster wrote:

Nice. Why do you do this with JS and not CSS?  tongue

How would I, with CSS?

If you're just restyling it...
Do you know CSS?

Offline

 

#25 2012-01-04 11:40:33

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Custom Scratch forum skins!

Hardmath123 wrote:

scimonster wrote:

Nice. Why do you do this with JS and not CSS?  tongue

How would I, with CSS?

In a userscript, just inject your stylesheet (hosted on dropbox or something) into the page.


nXIII

Offline

 

Board footer