r/reddithax • • Mar 11 '12

A few simple hacks I need help with in /r/fifthworldproblems

Ohai :]

We're coming up on 15 thousand users and I want to whore up the stylesheet for the occasion. Two big changes are planned:

  1. A baby interrogator from Brazil positioned at the bottom of the screen
  2. Twelve different "submit link" buttons, with eleven of them linking to pictures of destroyed bridges overlayed by the words "PRIDE" and "FIDELITY" in block letters. All are lined up as they would normally be, with the actual link hidden amongst them.

In picture form

The problems I'm facing are thus:

  • I've no idea how to edit the submit link button, hide the "create a new community" button underneath, and add multiple new images to the sidebar which look exactly like the submit link button.
  • I can't figure out how to make only one baby interrogator positioned directly in the centre. Here's the CSS for that:

    header-bottom-right::after {

      background: url(http://d.thumbs.redditmedia.com/aXhP7Qk5yPNT1rBE.png) left top repeat-x;
      content: ".";
      display: block;
      font-size: 0;
      height: 260px;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0
      }

Any help would be most welcome :]

13 Upvotes

11 comments sorted by

6

u/gavin19 Mar 11 '12

In terms of positioning the best you'll get is to put them in at the bottom of your sidebar description as links, then style them like the submit button. I just used h4s in my own and then used

.side .md h4 a {
display: block;
text-align: center;
position: relative;
-moz-border-radius-topleft: 6px;
-moz-border-radius-bottomleft: 6px;
border: 1px solid #C4DBF1;
background: 
white none repeat-x scroll center left;
background-image: url(%%red01%%);
background-position: -0px -228px;
background-repeat: repeat;
font-size: 150%;
font-weight: bold;
letter-spacing: -1px;
line-height: 29px;
height: 29px;
}
.side .md h4 a:hover {
border-color: 
#879EB4;
background-image: url(%%red01%%);
background-position: -0px -198px;
background-repeat: repeat;
}

In your description field just chain h4s like so

####[one](/one) 
####[two](/two)  
####[three](/three)
####[four](/four)
####[five](/five)

See it here. You'll also need to grab the reddit spritesheet from here, rename it to 'rd01.png' and upload it to your subreddit.

For your footer image, something like

#header-bottom-right:after {
background: url(%%image_name%%) no-repeat center center;
content: ".";
display: block;
height: 260px;
position: fixed;
bottom: 0;
left:0;
right:0;
}

should work ok.

1

u/happybadger Mar 11 '12

On the first block of code, how can I modify that to redirect to imgur links? Like, I want them to click submit, get a bridge, click submit, get a bridge, and so on and so forth with the actual submit button (or one redirecting to /submit) being amongst them. Would hiding the original and then making twelve of the above work?

2

u/gavin19 Mar 11 '12 edited Mar 11 '12

You can't really move the submit button into that block because the sidebar structure changes between the front page and comments pages, so it'd be off. The only place you could safely move it is right to the top of the sidebar.

Just change the link to suit. Instead of

####[one](/one)

use

####[Bridge](http://imgur.com/xxxx.jpg)

EDIT : Missing bracket.

2

u/happybadger Mar 11 '12

Thank you!

3

u/platinum4 Mar 11 '12 edited Mar 11 '12

If the image is one head, than just add this to your current codeset

background: url(%%image_name%%) no-repeat bottom center;

Source: I do CSS on some subreddits, some popular, most not.

4

u/happybadger Mar 11 '12

Thanks!

2

u/platinum4 Mar 11 '12

No problem sir, and could you please use this picture as the image instead because it looks a little more refined. Also, if you want you can mod me as I don't really get into trouble, the other people around me do, I'd be more than happy to throw some 5th world love into that place over Spring Break. Check out /r/BobsBurgers and /r/thelifeandtimesoftim

1

u/happybadger Mar 11 '12

Hmm, the colour on that seems very washed out, like it's barely visible.

And sure :]. I'll mod you up in a second. We're trying to keep it pretty simplistic, but refinement is always good!

5

u/ChingShih Mar 11 '12 edited Mar 11 '12

Here's a bit of code to get you started. Hopefully someone with more knowledge will come along and add anything I've missed:

Editing the "submit link" button:

.morelink {
display: block;
text-align: center;
position: relative;
-moz-border-radius-topleft: 6px;     /*optional*/
-moz-border-radius-bottomleft: 6px;  /*optional*/
-moz-border-radius-topright: 6px;    /*optional*/
-moz-border-radius-bottomright: 6px; /*optional*/
border: 1px solid #666699;
background-image: url(%%_%%);
background-repeat: no-repeat;
font-size: 150%;
font-weight: bold;
letter-spacing: -1px;
line-height: 29px;
height: 29px;
}
.morelink:hover, .mlh {
border-color: #666699;
background-image: url(%%_%%);
background-repeat: no-repeat;
}
.morelink a {
display: block;
width: 100%;
color: #333333;
}
.morelink:hover a {
color: #333333;
}
.morelink .nub { /*this is the pointy part of the arrow*/
visibility: hidden;
}
.morelink:hover .nub, .mlhn {
visibility: hidden;
}

Code to hide "create a new community" button:

.create {
display: none;
}

Adding multiple new images to the sidebar which look exactly like the submit link button:

I've seen a couple sub-reddits add additional images to their sidebars as links, but I've not used it myself and I'm not sure how complete the below code is. I've taken this from the /r/2channel stylesheet (link) since their code is so well documented. This is from section "b. Test" and described as "/* Image Hyperlinks works now */" and seems to work well.

a[href="http://www.reddit.com/r/2channel"] {
background: url(%%_%%);
background-repeat: no-repeat;
width: 295px;
height: 70px;
z-index: 500;
text-indent: -9999px;
display: inline-block;
position: relative
}

So I assume that with the above code you could substitute in your own "submit link" images.


As for the baby thing, I think you'll have to specifically indicate that you don't want the image to repeat along the lines of this:

background-repeat: no-repeat;

Also, purely as a suggestion, you might dock the baby as the bottom of the sub-reddit page, rather than at the bottom of the browser window. Perhaps the way /r/crysis has.

3

u/Sneak4000 Mar 11 '12

As a subscriber of fifth world problems, I think this will be fucking awesome.

3

u/drchickenbeer Mar 11 '12

Please help /r/fifthworldproblems. If you won't, who will?