[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

can you use css to color code posts that have (you)s in them?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 103
Thread images: 17

can you use css to color code posts that have (you)s in them? i can't figure it out with my rudimentary css knowledge

pls help anon-san
>>
>>58326750
Yes.
>>
I don't know if you can do it with pure CSS but it's definitely possible with JavaScript (Greasemonkey).
>>
Just wait until hiroshimoot implements Likes into 4chan. Don't worry, everything will be just like facbook soon.
>>
>>58326771
would you be aware of something like that being out there? i know there's a bunch of scripts and extensions for 4chan but none i know of have that
>>
>>58326809
No, I'd just make it myself.
>>
>>58326829
i can't code, really, but i'm a (mediocre) drawfag.

i'll draw you something of your choosing in exchange, if you feel like making a greasemonkey script
>>
>>58326750
I believe so. also brotip for improving your css skills, go to the stylish website and download some styles you like then open them in whatever notepad program you prefer to see how the did shit
>>
>>58326848
>>58326848
>can't code, then what you want is stylish plain and simple, there's tons of userstyles already out there for 4chan
>>
>>58326881
>>58326901
thx guis
>>
install
>>
>>58326919
gentoo
>>
File: poop.jpg (18KB, 472x207px) Image search: [Google]
poop.jpg
18KB, 472x207px
.ql-tracked{
background-color: #2E2E2E;
}
>>
i'm gunna need a (You) to test my implementation...
>>
>>58327138
(You)
>>
File: Screen Shot 2017-01-05 at 01-21.png (109KB, 588x254px) Image search: [Google]
Screen Shot 2017-01-05 at 01-21.png
109KB, 588x254px
>>58327096
nah i mean the whole post, like pic related

>>58327138
there you go
>>
>>58327163
(me)
>>
>>58327171
Can I get a reply for testing purposes?
>>
File: ascii-you.png (24KB, 820x700px) Image search: [Google]
ascii-you.png
24KB, 820x700px
>>58328684
ur mum lmao
>>
>>58328721
lmao
>>
>>58328721
Well, a quick search on google makes one thing obvious. CSS can not in any way make interacting with an element affect its parent element. So while >>58327096 can do whatever he wants to the tiny (you) text, the post box itself is off limits. With that said, each post box has a unique identifier which looks like "pc####" where #### is your get. A little JS that 1) looks up the get of any post with a (you) and 2) effect the background color of the div box with that ID could do the trick. I'm somewhere between rock and caveman as far as JS goes and it's not important enough for me to lose sleep to build so I recommend google and good luck anon.
>>
Make a j query thing that selects the first child of all ql-tracked elements and sets style
>>
>>58329046
>>58328835
alright so can someone make a userscript for this already
>>
So while I'm here, how can I implement a (you) counter?
>>
>>58329559
there's gotta be a chrome extension for shills that does this go ask on pol
>>
>>58326848
lo/g/os in action
>>
File: 1458594906236.png (1KB, 180x100px) Image search: [Google]
1458594906236.png
1KB, 180x100px
What is the purpose of this "feature"? Are we really pandering to autists that can't even tell their own posts apart?

Not to mention it's brought in the worst type of attentionwhoring cancer that do nothing but derail the thread.

Remove (You).
>>
>>58330362
>>
File: screen.1483588019.png (47KB, 1265x504px) Image search: [Google]
screen.1483588019.png
47KB, 1265x504px
>>58330362
What is the purpose of this "feature"?
Make it easier to find people who replied to you. Instead of Scrolling through the whole thread looking for (You's), you can just see the giant highlighted post.

I don't know javascript, but im sure as hell going to try and make a userscript to do it.
>>
this is the best i could get

a.quotelink.ql-tracked {
background-color: #F5F5F5 !important;
font-size: 45px !important;
}

found this but it don't seem to do anything
.hasYouReplies
>>
File: (you).jpg (106KB, 1444x510px) Image search: [Google]
(you).jpg
106KB, 1444x510px
>>58331014
.ql-tracked { padding-right: 900px; padding-bottom: 9000px;background-color:rgb(255, 187, 205); }
>>
>>58331133

nice
>>
>>58331133
.quotelink.ql-tracked {
font-size:12em;
color:#080;
background:#eee;
transition:all 1s;
}

.quotelink.ql-tracked:hover {
font-size:24em;
color:$2f2;
background:#444;
}
>>
.quotesYou * {
background: #ff0000 !important;
}

noobs
>>
Dear god, pure CSS is definitely the wrong implementation

Imma reply to myself and get a tampermonkey script running, one sec
>>
>>58331373
be right back
>>
>>58331372

didn't do anything for me. can you post a screen?
>>
someone reply to me
>>
>>58331441
>tfw replying to myself
>>
File: screen.1483592347.png (11KB, 1212x228px) Image search: [Google]
screen.1483592347.png
11KB, 1212x228px
>>58331402
it works.
damn im a noob.

oh well
>>
>>58331380
// ==UserScript==
// @name 4Chan (you) highlight
// @description Highlight (you)s
// @match *://boards.4chan.org/*
// @grant none
// ==/UserScript==

changeColorTo = '#FF0000';

function recolorYou() {
yous = document.getElementsByClassName('ql-tracked');
for (i=0; i<yous.length; i++) {
yous[i].parentElement.parentElement.style.backgroundColor = changeColorTo;
}
}

recolorYou();
setInterval(recolorYou, 5*1000);
>>
>>58331475
thanks, i'd rather have a userscript instead of installing stylish just to use css on this site.
>>
>>58331475
i love you
>>
File: 4chanxxxxxxxxxxx.png (5KB, 445x65px) Image search: [Google]
4chanxxxxxxxxxxx.png
5KB, 445x65px
Just use 4chan X.
>>
>>58331541
That doesn't highlight the background of the message though, just the text.

>>58331475
Also this doesn't work with 4chan X.
>>
>>58331475
>>58331561

Alright, replying to myself with 4chan x enabled
Strange that it took away my (you)s
>>
>>58331579
And again?
>>
File: 4chanxxxpost.png (15KB, 485x236px) Image search: [Google]
4chanxxxpost.png
15KB, 485x236px
>>58331561
It adds a line to the edge of a post. It's far less intrusive and ugly than changing the entire background of a post.
>>
>>58331465
It doesn't work for me.

Why wasn't it working initially?
>>
future me please reply
>>
>>58331475
Thanks m8
>>
>>58331617
you
>>
Is greasemonkey botnet? Is installing it safe?
>>
>>58331598
What's that theme you're using, dad?
>>
>>58331561
// ==UserScript==
// @name 4Chan (you) highlight 4chanx version
// @description Highlight (you)s
// @match *://boards.4chan.org/*
// @grant none
// ==/UserScript==

changeColorTo = '#EEEEEE';

function recolorYou() {
yous = document.getElementsByClassName('qmark-you');
for (i=0; i<yous.length; i++) {
elem = yous[i].parentElement.parentElement.parentElement;
if (elem.classList.contains("reply")) {
elem.style.backgroundColor = changeColorTo;
}
}
}

recolorYou();
setInterval(recolorYou, 5*1000);
>>
>>58331680
Oneechan.
>>
need more 'you'
>>
>>58331706
me
>>
>>58331700
dumb tripcode poster
>>
>>58331684
sorry not working.
where are you getting the "reply" from in elem.classList.contains?
>>
>>58331684
ty i think
>>
>>58331786
test
>>
File: 1469383709769.png (27KB, 463x269px) Image search: [Google]
1469383709769.png
27KB, 463x269px
>>58331733
Worked for me senpai
>>
>>58331733
4chanx uses the same (you) class for the one that appears in the post text, and the one that appears in the list of replies to a post.

That if statement was just trying to limit it to posts instead of the list of replies.
>>
File: screen.1483595183.png (76KB, 1755x987px) Image search: [Google]
screen.1483595183.png
76KB, 1755x987px
>>58331814
>>58331804
I'm using OneeChan's userscript(theme) on top of 4chan X, so I'm guessing it was overriding something.

Anyway, I fixed it by modifying one line.
elem.style.cssText = 'background: '+changeColorTo+' !important';


again,thanks for the userscript
>>
Tampermonkey vs. Greasemonkey?
>>
>>58332141
monkeydick
>>
>>58326771
css doesn't have ifs, you need js
>>
>>58331723
>not using tripcode
>>
>>58333036
>>
>>58332429
most helpful
>>
>>58332141
>>58333558
Greasemonkey.
>>
File: mon visage lorsque.png (42KB, 582x184px) Image search: [Google]
mon visage lorsque.png
42KB, 582x184px
>>58331541
This desu fampai.
>>
Is there any way to make the background of the postboxes with (You) the same color as the highlight you get when hovering over a post link (purple on blue boards, pink on red boards depending on which board you're on)?
>>
>>58329559
Pick your poison:
https://github.com/WhatIsThisImNotGoodWithComputers/All-time-You-count
http://pastebin.com/zBhR5yTJ
>>
File: screen.1483626497.png (15KB, 1113x525px) Image search: [Google]
screen.1483626497.png
15KB, 1113x525px
>>58331541
Actually I just realized this >>58331372 works with 4chan X custom CSS too.

It's also faster than using a userscript.
>>
>>58331475
>setInterval(recolorYou, 5*1000);
delete this
>>
Yes.
>>
>>58337049
>It's also faster than using a userscript.
Browsers are highly optimized for applying styling rules. This is trivial as fuck for a browser to do.

Using javascript for this is the wrong approach.
>>
>>58337146
>Using javascript for this is the wrong approach.
Not exactly.
You'll probably need to go the userscript route if you needed to do something more involved like >>58335405
>>
>>58337183
Javascript works better there but for something like OP just CSS is more than sufficient. Javascript would be a waste of time and resources.
>>
What's next for /g/?
>>
File: firefox_2017-01-05_14-52-05.png (758B, 110x20px) Image search: [Google]
firefox_2017-01-05_14-52-05.png
758B, 110x20px
can someone tell me how to put the date in the correct order? why the fuck did it change?
>>
>>58337320
Death
>>
File: Capture.png (13KB, 668x224px) Image search: [Google]
Capture.png
13KB, 668x224px
My reply counter thing still works. Neat.
>>
>>58337325
whats the correct order?
>>
>>58337536
Day/Date/Month/Year for reading, Year/Month/Date/Day for alphabetical sorting.

Not Pebbles/Fingers/Laddles/Cups.
>>
>>58337078

It's for the thread updater. I didn't want to bother hijacking the update function
>>
>>58330362
I only make threads for the (You)s. Thank God 4chan X gave me my (You)s back that dotted line shit was killing me.
>>
>>58337646
>Day/Date/Month/Year for reading, Year/Month/Date/Day for alphabetical sorting.

Both of those are infinitely recursive, anon.
>>
>>58338124
Fucking your mom is infinitely recursive and I see no condition for stopping.
>>
(you)
>>
>>58338846
i dont get it what changed
>>
>>58337226
In this case 4chan's vanilla extension doesn't have a special class for posts that respond to you (though 4chanX does, apparently).

Also, CSS doesn't have a parent selector.

Combine the two and that means you have to use JS to get the post itself. If you've got a pure-CSS way of handling it, I'd love to see the code.
>>
don't mind me just testing my (you)'s :^)
>>
>>58339555
here's a response
>>
>>58326750
>i can't figure it out with my rudimentary css knowledge

That's weird because it only requires rudimentary css knowledge to implement.
>>
>>58339716
Except it doesn't, retard.
>>
>>58339765
a.ql-tracked{color: blue !important;}
>>
can someone (you) me please? I want to try it out.
>>
>>58339860
I guess I could (you) myself.
>>
>>58339787
he wants to target the parent anon. not possible.
>>
>>58340005
Oh I see.
Thread posts: 103
Thread images: 17


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.