Post-head colour based on group colour of user
4 posters
Page 1 of 1
Post-head colour based on group colour of user
Hello again!
I would like to know if there's a CSS code and JS script to what I'm looking for.
I'm still customizing appearance of my forum and I want to have a background-color from group colour in the post-details info.
For example:
Group 1 have a teal colour, so the post details info have a background in teal colour. Group 2 have a yellow colour, so the post details info have a background in yellow colour. And so on, so on.
I know already that there is possibility to change strong colour from the colour of the group.
Here's the screenshot of specific area in topic to show you what I want to change.
I have forum on #ModernBB version.
I would like to know if there's a CSS code and JS script to what I'm looking for.
I'm still customizing appearance of my forum and I want to have a background-color from group colour in the post-details info.
For example:
Group 1 have a teal colour, so the post details info have a background in teal colour. Group 2 have a yellow colour, so the post details info have a background in yellow colour. And so on, so on.
I know already that there is possibility to change strong colour from the colour of the group.
Here's the screenshot of specific area in topic to show you what I want to change.
I have forum on #ModernBB version.
Last edited by kirkwall on June 22nd 2022, 8:51 pm; edited 1 time in total (Reason for editing : Add the screenshot.)
Re: Post-head colour based on group colour of user
@kirkwall
Title * : as you like
Placement : In the topics
code
Title * : as you like
Placement : In the topics
code
- Code:
(function($) {
'use strict';
$(function() {
$('.post').each(function() {
var $post = $(this);
var color = $post.find('.postprofile-name span').css('color');
if (!color.length) return;
$post
.find('.post-head')
.css('background-color', color)
.end()
.find('.post-head .topic-date, .post h2.topic-title a, .post-head .profile-icons a, .post-head .profile-icons span ')
.css({
'color': '#fff',
'border-color': color
});
});
});
})(jQuery);
TonnyKamper and kirkwall like this post
Re: Post-head colour based on group colour of user
Topic starter: it is a JavaScript.كونان2000 wrote: @kirkwall
Title * : as you like
Placement : In the topics
code
- Code:
(function($) {
'use strict';
$(function() {
$('.post').each(function() {
var $post = $(this);
var color = $post.find('.postprofile-name span').css('color');
if (!color.length) return;
$post
.find('.post-head')
.css('background-color', color)
.end()
.find('.post-head .topic-date, .post h2.topic-title a, .post-head .profile-icons a, .post-head .profile-icons span ')
.css({
'color': '#fff',
'border-color': color
});
});
});
})(jQuery);
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
kirkwall likes this post
Re: Post-head colour based on group colour of user
كونان2000 wrote: @kirkwall
Title * : as you like
Placement : In the topics
code
- Code:
(function($) {
'use strict';
$(function() {
$('.post').each(function() {
var $post = $(this);
var color = $post.find('.postprofile-name span').css('color');
if (!color.length) return;
$post
.find('.post-head')
.css('background-color', color)
.end()
.find('.post-head .topic-date, .post h2.topic-title a, .post-head .profile-icons a, .post-head .profile-icons span ')
.css({
'color': '#fff',
'border-color': color
});
});
});
})(jQuery);
Thank you, @كونان2000 and @SLGray
That's exactly what I wanted to change. However, I see in the JS that post details, topic title are changed to colour white. What can I remove from JS - if it's even possible - to affect only background with group colour and the rest leave in other colours?
Also can I add to this specific JS script to change strong also to group colour automatically or should I add another JS script?
Moreover, which goes slightly off topic. Please, remind me if I should create new topic for question below.
I would like to know which code is responsible for changing colours above. On hover they change to blue, red or black. Buttons with reply to topic have blue background and on hover - they're red. I think that reply buttons have a code .button so I can change it, but it doesn't affect all of them.
Have a nice day!
Last edited by kirkwall on June 23rd 2022, 12:43 pm; edited 2 times in total (Reason for editing : another question - about strong text in posts)
Re: Post-head colour based on group colour of user
@kirkwall
Yes, you can by code CSS
I suggest you open a new topic so that we can help you easily
Try replacing the script you installed in the tutorial with this one :topic title are changed to colour white. What can I remove from JS - if it's even possible - to affect only background
- Code:
(function($) {
'use strict';
$(function() {
$('.post').each(function() {
var $post = $(this);
var color = $post.find('.postprofile-name span').css('color');
if (!color.length) return;
$post
.find('.post-head')
.css('background-color', color)
.end()
});
});
})(jQuery);
I would like to know which code is responsible for changing colours above. On hover they change to blue, red or black. Buttons with reply to topic have blue background and on hover - they're red. I think that reply buttons have a code .button so I can change it, but it doesn't affect all of them.
Yes, you can by code CSS
I suggest you open a new topic so that we can help you easily
TonnyKamper and kirkwall like this post
Re: Post-head colour based on group colour of user
rudesingh56 wrote:I remove from JS - if it's even possible - to affect only background with group colour and the rest leave in other colours?
Please don't hijack another member’s topic's. Please open your own thread if you having a problem with your forum.
|
Similar topics
» How do I add a colored bar based on group?
» Controlling the Chatbox: Group based access.
» I add a user into a group. but he didnt receive any email notification about been invited into group..
» Changing a link based on a user's language setting
» User Name Prefixes for entire User Group
» Controlling the Chatbox: Group based access.
» I add a user into a group. but he didnt receive any email notification about been invited into group..
» Changing a link based on a user's language setting
» User Name Prefixes for entire User Group
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum