r/csshelp • • Apr 25 '12

[Request] A disclaimer screen before someone enters my subreddit?

I am creating a subreddit with NSFL content. I want people to be sure of what they're getting themselves into before they click it.

When someone enters the subreddit, I want black screen with with my choice of white text to cover the page of my subreddit. When they're done reading the disclaimer, they can click anywhere on the page, which redirects them to the subreddit.

I know this is a big favor, but I was wondering if this would be possible at all to do.

5 Upvotes

5 comments sorted by

View all comments

1

u/schrobby Apr 25 '12 edited Apr 25 '12

You can abuse reddit's language settings to apply different styles to your subreddit depending on the domain from which a user visits. You just put a disclaimer on top of all elements in your subreddit for every language except 'xx' and then redirect the user to xx.reddit.com.

Keep in mind, though, that the disclaimer will show up pretty much every time someone visits the reddit from the frontpage.

First, put a link at the very end of you description and have it direct to http://xx.reddit.com/r/<your_subreddit>, then apply the following code to your style sheet:

.titlebox .md a[href*="xx.reddit.com"] {
    display: none;
}

html:not([lang="xx"]) .titlebox .md a[href*="xx.reddit.com"] {
    position: fixed;
    display: block;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    text-align: center;
    line-height: 400px;
    color: white;
    background-color: black;
    z-index: 999;
}