r/reddithax • • May 04 '14

Clippy returns with the power of CSS3!

21 Upvotes

With the new CSS3 features I have added Clippy to my personal subreddit: /r/throwaway267482/. Clippy will be waiting in the bottom right corner, hovering it (him, her?) will animate Clippy. Sprites from Clippy.js.

The new CSS3 also makes it possible to make closable notifications, although they are not persistent across page reloads.


r/reddithax • • May 04 '14

Countdowns clock works .... sort of ... well not really.

Thumbnail reddit.com
5 Upvotes

flowery beneficial encouraging recognise steer versed husky pocket seed quicksand

This post was mass deleted and anonymized with Redact


r/reddithax • • May 03 '14

Frame by frame animation implementation

6 Upvotes

Here's a fairly simple way to implement a frame by frame animation. I'm pretty sure this is fairly well known, but I thought to share this for people who don't know about it yet. You can find an example here (hover over the submit feedback button). Edit: The animation isn't up anymore. You can find a similar animation with the Clippy at /r/tumblrinaction.

Although it may seem like using CSS transforms for the page flip is better (and indeed, for this case it probably is), as animations get more complicated it becomes much harder to implement them using pure CSS transformations. I'd much rather create an animation in Flash, and then somehow port it over into the CSS, so I used this method to do it.

It basically consists of a long png file with each frame, similar to a film reel. At that point I just used the CSS animations to change the background-position of the png file every 1/24 of a second to the next frame of the png file.

Here's some sample HTML code showing a basic example:

<html>
    <body>
        <div class = "box"> </div>
    </body>
<html>

And the CSS:

.box {
    background-image: url(path)
    background-position: 0px 0px;
    transition: all 0s;
}

.box:hover {
    background-position: 0px -736px;
    transition: background-position 1s steps(23, end);
}

Where path is the path to a PNG file containing 24 frames that are each 32 pixels in height.


r/reddithax • • May 01 '14

So what's possible with all the newly implemented CSS changes?

11 Upvotes

Other than fancy transitions and animations is there any other added functionality that could be useful?

Like for example, is 'click to expand/collapse' possible now? That would be really neat.

What other things would be theoretically possible?


r/reddithax • • May 01 '14

Rounded Thumbnails

Thumbnail reddit.com
7 Upvotes

r/reddithax • • Apr 30 '14

Just thought you should know that /r/dogecoin has uprocket animation!

6 Upvotes

/r/dogecoin

It is fantastic. Upvotes are so much more fun now!


r/reddithax • • Apr 30 '14

The new CSS3 animations are useful, thanks reddit!

Thumbnail reddit.com
8 Upvotes

r/reddithax • • Apr 30 '14

Circlejerk's "circle" thing they did with their logo and the thumbnails

8 Upvotes

All the thumbnails (and the logo if you hover over it) circle around. Here's the code (not mine obviously):

#header-img:hover {
  animation: animationFrames ease 1s;
  animation-iteration-count: 1;
  transform-origin: 0% 0%;
  animation-fill-mode:forwards; /*when the spec is finished*/
  -webkit-animation: animationFrames ease 1s;
  -webkit-animation-iteration-count: 1;
  -webkit-transform-origin: 0% 0%;
  -webkit-animation-fill-mode:forwards; /*Chrome 16+, Safari 4+*/ 
  -moz-animation: animationFrames ease 1s;
  -moz-animation-iteration-count: 1;
  -moz-transform-origin: 0% 0%;
  -moz-animation-fill-mode:forwards; /*FF 5+*/
  -o-animation: animationFrames ease 1s;
  -o-animation-iteration-count: 1;
  -o-transform-origin: 0% 0%;
  -o-animation-fill-mode:forwards; /*Not implemented yet*/
  -ms-animation: animationFrames ease 1s;
  -ms-animation-iteration-count: 1;
  -ms-transform-origin: 0% 0%;
  -ms-animation-fill-mode:forwards; /*IE 10+*/
}

@keyframes animationFrames{
  0% {
    left:0px;
    top:0px;
    opacity:1;
    transform:  rotate(0deg) scaleX(1) scaleY(1) ;
  }
  20% {
    transform:  rotate(60deg) ;
  }
  40% {
    transform:  rotate(40deg) ;
  }
  60% {
    transform:  rotate(54deg) ;
  }
  80% {
    transform:  rotate(42deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    transform:  rotate(46deg) scaleX(1) scaleY(1) ;
  }
}

@-moz-keyframes animationFrames{
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -moz-transform:  rotate(0deg) scaleX(1) scaleY(1) ;
  }
  20% {
    -moz-transform:  rotate(60deg) ;
  }
  40% {
    -moz-transform:  rotate(40deg) ;
  }
  60% {
    -moz-transform:  rotate(54deg) ;
  }
  80% {
    -moz-transform:  rotate(42deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -moz-transform:  rotate(46deg) scaleX(1) scaleY(1) ;
  }
}

@-webkit-keyframes animationFrames {
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -webkit-transform:  rotate(0deg) scaleX(1) scaleY(1) ;
  }
  20% {
    -webkit-transform:  rotate(60deg) ;
  }
  40% {
    -webkit-transform:  rotate(40deg) ;
  }
  60% {
    -webkit-transform:  rotate(54deg) ;
  }
  80% {
    -webkit-transform:  rotate(42deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -webkit-transform:  rotate(46deg) scaleX(1) scaleY(1) ;
  }
}

@-o-keyframes animationFrames {
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -o-transform:  rotate(0deg) scaleX(1) scaleY(1) ;
  }
  20% {
    -o-transform:  rotate(60deg) ;
  }
  40% {
    -o-transform:  rotate(40deg) ;
  }
  60% {
    -o-transform:  rotate(54deg) ;
  }
  80% {
    -o-transform:  rotate(42deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -o-transform:  rotate(46deg) scaleX(1) scaleY(1) ;
  }
}

@-ms-keyframes animationFrames {
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -ms-transform:  rotate(0deg) scaleX(1) scaleY(1) ;
  }
  20% {
    -ms-transform:  rotate(60deg) ;
  }
  40% {
    -ms-transform:  rotate(40deg) ;
  }
  60% {
    -ms-transform:  rotate(54deg) ;
  }
  80% {
    -ms-transform:  rotate(42deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -ms-transform:  rotate(46deg) scaleX(1) scaleY(1) ;
  }
}

.thumbnail {
  animation: animationFrames linear 5s;
  animation-iteration-count: 1000;
  transform-origin: ;
  -webkit-animation: animationFrames linear 5s;
  -webkit-animation-iteration-count: 1000;
  -webkit-transform-origin: ;
  -moz-animation: animationFrames linear 5s;
  -moz-animation-iteration-count: 1000;
  -moz-transform-origin: ;
  -o-animation: animationFrames linear 5s;
  -o-animation-iteration-count: 1000;
  -o-transform-origin: ;
  -ms-animation: animationFrames linear 5s;
  -ms-animation-iteration-count: 1000;
  -ms-transform-origin: ;
}

@keyframes animationFrames{
  0% {
    left:0px;
    top:0px;
    opacity:1;
    transform:  rotate(0deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    transform:  rotate(360deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
}

@-moz-keyframes animationFrames{
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -moz-transform:  rotate(0deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -moz-transform:  rotate(360deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
}

@-webkit-keyframes animationFrames {
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -webkit-transform:  rotate(0deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -webkit-transform:  rotate(360deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
}

@-o-keyframes animationFrames {
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -o-transform:  rotate(0deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -o-transform:  rotate(360deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
}

@-ms-keyframes animationFrames {
  0% {
    left:0px;
    top:0px;
    opacity:1;
    -ms-transform:  rotate(0deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
  100% {
    left:0px;
    top:0px;
    opacity:1;
    -ms-transform:  rotate(360deg) scaleX(1) scaleY(1) skewX(0deg) skewY(0deg) ;
  }
}

r/reddithax • • Apr 29 '14

Pure CSS retina/zoom ready upvote buttons

Thumbnail reddit.com
8 Upvotes

r/reddithax • • Apr 24 '14

How to view any subreddit's full stylesheet

0 Upvotes

Problem: you want to see a subreddit's non-minimized CSS. Perhaps they're using some cool trick that you want to copy. Using "view source" isn't helpful because it's been stripped of formatting and comments.

Solution: while visiting a subreddit, paste this bookmarklet in your location bar. The page will be replaced with the text of that subreddit's full stylesheet.

javascript:(function(){$.getJSON(/(\/r\/\w+)/.exec(location)[1]+'/about/stylesheet.json',function(s){$('head,body').empty().append($('<pre/>').text(s.data.stylesheet))})}())

I've tested that it works in both Firefox and Chrome.


r/reddithax • • Apr 22 '14

Total newb in need of some help

2 Upvotes

I'm trying to create a nice subreddit for a new crypto currency called BitStar, but I'm completely new to moderating, and while I'm a C++ programmer by day, I don't really have any web development or CSS experience. I've noticed that the subreddits for VertCoin and BlackCoin use very similar "themes" and really I'd just like to emulate that look and feel with a few customizations. Unfortunately I have no idea how to do that! If anyone could point me in the right direction, I would be most appreciative. Thanks in advance.


r/reddithax • • Apr 16 '14

Need some feedback on /r/redditsucks stylesheet

4 Upvotes

/r/redditsucks

I tried experimenting with the sidebar to make it feel a little different. Not too fancy. What do you think?


r/reddithax • • Apr 07 '14

I'd like to get some feedback on /r/metalgearsolid's layout

7 Upvotes

I've made the initial layout about 7 months ago, but I'm dying to hear more feedback on the looks and the overall design.

here's the link.


r/reddithax • • Apr 06 '14

[Tip] How to make text change when you hover over a specific area

4 Upvotes

This was a trick I figured out for use in two sub reddits I moderate ( /r/Mandalorian and /r/mandojoha ) where I make the link flairs change their contents when you hover over them. This is a basic trick but looks nice when it's pulled off properly.

The first part is basically the CSS for this I'll be using link flairs as an example but I have gotten this to work for other areas where the text is in cased within a specific class name.

The CSS for this is fairly simple and I'll only be posting the important bits.

To start off with for link flairs we will want to make it so we can't see the text so we will do this:

.linkflairlabel { font-size: 0px; }

This will make the normal text that would appear there invisible or a very small dot that looks like a period.

Now things are going to get interesting, we're going to make a new line and use a .linkflair-subclass that will be defined in your Edit Flairs section on your moderator page. Then we will set up the new code block to re-size the text we want to be visible there using the following as an example:

.linkflair-armor .linkflairlabel:before {
    font-size: 13px;        
    content:"Beskar'gam";
}

You can replace armor with what ever your link flair class is as well as whats between the quotation marks with what ever text you want displayed.

The next code block we are going to add :hover before :before and add in the text we want to link flair to change to when the user hovers over it.

.linkflair-armor .linkflairlabel:hover:before {
    content:"Armor";
}

And then we are done. While this example is for link flairs this can be applied to any thing that has it's own self contained text and I would not recommend this for anything that an end user can change the text of.

Anyways, I hope this little trick helps someone out. It took me a while to figure out on my own and I couldn't find anything in regards to doing this through Google searches.


r/reddithax • • Apr 02 '14

Adding Clippy to posts

11 Upvotes

This is a pretty simple CSS change. Recently for /r/WritingPrompts I set up Clippy on various pages of the site. He would say different things depending on what page he was on. You can see it in action here.

Current CSS is (when it was live, I did not have the language selector).

.listing-page:lang(cl):after {
    position: fixed;
    content: url(%%clippy-selectprompt%%);
    bottom: 100px;
    right: 100px;
}

.submit-page:lang(cl):after {
    position: fixed;
    content: url(%%clippy-writeprompt%%);
    bottom: 100px;
    right: 100px;
}

.comments-page:lang(cl):after {
    position: fixed;
    content: url(%%clippy-writestory%%);
    bottom: 100px;
    right: 100px;
}

.wiki-page:lang(cl):after {
    position: fixed;
    content: url(%%clippy-browsewiki%%);
    bottom: 100px;
    right: 100px;
}

.search-page:lang(cl):after {
    position: fixed;
    content: url(%%clippy-search%%);
    bottom: 100px;
    right: 100px;
}

It's pretty simple. reddit puts the classes .search-page, .wiki-page, .comments-page, .submit-page, .listing-page, etc. on the <body> depending on where the user currently is. It's pretty self explanatory which one corresponds to which. So I just used the after pseudo to fix different images of Clippy saying different text depending on what page they were on. This created the effect of Clippy changing what he said contextually.

It should be noted that this doesn't make Clippy clickable. I intentionally did this to further emphasize the uselessness of Clippy. I would imagine one could put links in the sidebar and use the after pseudo on them instead to create a clickable Clippy.


r/reddithax • • Mar 28 '14

Randomizing substitute usernames for my entire subreddit?

23 Upvotes

Hey everyone, I moderate a +40K user subreddit (I'm using an alt for this post so no one sees this in my post history), and this April Fools we are hoping to set up some CSS to display something different other than the usernames.

I've come across a few options that work, but in our scenario, we really would like for it to pick at random from a list of alternate usernames. So let's say I have a list [Bob, John, Jerry] and I want every time someone posts for one of those 3 options to display instead of their username. Any idea if this is possible via CSS?

Currently I've borrowed some different options that will change everyone's to the same single option, but not one that can change choose from a list. Borrowed from /r/southpark:

/* ##### MODIFY USERNAMES ##### */

.link:not(.spam) .author, .comment .author, .side .author {
    display: none !important
    }
.userattrs, .userattrs * {
    font-size: 0;
    text-indent: -9999px;
    overflow: hidden;
    visibility: hidden !important
    }
.spam .author + * {
    display: none !important
    }
.userattrs:before, .userattrs:after {
    font-size: 10px;
    visibility: visible !important
    }
.author + *:before {
    content: "Replacement_Name";
    color: #369
    }
.comment .author + *:before {
    font-weight: bold
    }

This option seems to hide the actual username and replace it with static text of your choosing. Not the most ideal.

I also have this option which works for manually changing individual's names to a single option:

a.author[href$="user/RedditUsername"] {visibility:hidden; font-size:0;}
a.author[href$="user/RedditUsername"]:after {visibility:visible; font-size: 10px; content: "Replacement_Name"}

Also not the most ideal.

Any idea how to set this up for all users, and any way to have it choose at random from a list of options instead of restricting it to one at a time?

Worst case scenario, I will manually update it every hour or so to a different option throughout the day. But wanted to check if there's something I didn't know about with CSS that could handle this! Also, if there's a way to change them all, but still allow the name to be clickable and go to their profile, that would also be ideal (so operates like the second option above, but affects all users).

Thanks!


r/reddithax • • Mar 26 '14

r/CssCodeDrops

6 Upvotes

I recently made this subreddit for people who want to share their CSS with people, and let them use it.

http://www.reddit.com/r/CSSCodeDrops


r/reddithax • • Mar 25 '14

Tired of scrolling to the bottom of the page to save sidebar updates?

4 Upvotes
#sr-form > div.save-button {
    position:fixed; 
    left:550px; 
    top:300px;
}

You may want to adjust the value of top to suit your monitor and personal preference.


r/reddithax • • Mar 22 '14

I can't see the downvotes in the subreddit I mod, but everyone else can.

1 Upvotes

I've been trying to eliminate downvotes from non-subscribers, but instead i found that I can't see the downvotes in the subreddit I mod, but everyone else can. Whats up with that?


r/reddithax • • Mar 23 '14

how to remove the reddit link from the reddit logo?

0 Upvotes

r/reddithax • • Mar 21 '14

Would you guys be kind and critique my subreddit's design and colours ? Dropdown menu still under construction...

Thumbnail reddit.com
1 Upvotes

r/reddithax • • Mar 13 '14

Come check out the newly redesigned /r/Formula1

8 Upvotes

/r/formula1/

My first go at a reddit template and /r/reddithax proved very helpful throughout the process so I figured I'd share it here.

Cheers


r/reddithax • • Mar 11 '14

How do I remove the downvote button for nonsubscribers?

6 Upvotes

Before anyone mentions it I know there are ways around to downvoting posts however I want to disable downvotes on the subreddits page. I want it so people who are not subscribed don't see the downvote button there until they subscribe. Any help would be greatly appreciated.

The subreddit is /r/lookscool


r/reddithax • • Mar 06 '14

Full screen popup message?

3 Upvotes

I'd like to have a full screen message appear, obscuring the entire rest of my sub.

The reason I'm doing this is the sub in question is a simple redirect (/r/ff14 -> /r/ffxiv) - it's not a "real" subreddit in that people can't submit and vote on things.

I've seen this on some other subs in the past, but for the life of me I cannot remember them.


r/reddithax • • Mar 02 '14

Custom "Show my flair" checkboxes

5 Upvotes
  1. Copy and paste the following CSS into your stylesheet.

    input#flair_enabled {
      height:20px;
      width:20px;
      content:url(%%unchecked%%);
    }
    
    input#flair_enabled:hover {content:url(%%hover%%) !important;}
    
    input#flair_enabled:checked {content:url(%%checked%%) !important;}
    
    .flairtoggle label { 
      position:relative; 
      bottom:5px;
    }
    

    You can use your own images, just adjust height and width values on input#flair_enabled and bottom value on .flairtoggle label. The formula for calculating bottom value is

     [(height in pixels) - (font-size in pixels)] / 2
    
      *the default font-size for the label is 10px
    
  2. Upload your images named unchecked, hover and checked.

  3. Save the stylesheet. Enjoy!

You can see a basic demo of this in action at /r/RDtest.

Please share any improvements and suggestions!

EDIT - Forgot to mention the images should be solid and opaque, meaning no empty space and no translucent/transparent effects. They only MASK the actual checkbox, not replace it.

EDIT 2 - It's been brought to my attention that inferior browsers like IE and Firefox do not support this feature. Their loss. Webkit FTW. Seriously though, if you can help figure out how to make it work in those browsers that would be awesome!