Advertisement:

Author Topic: Curve2 Color Changer  (Read 704 times)

Offline SMF Customization Team

  • Customizer
  • Semi-Newbie
  • *
  • Posts: 69
    • SMF Customization Site
Curve2 Color Changer
« on: April 16, 2019, 06:00:27 PM »
Link to Mod

Curve2 Color Changer


Supported Languages: English
Link To Mod | Mod Discussion | Other SMF Customization Team Mods


Compatibility
For SMF 2.1.x

Introduction
Adds color settings for the the SMF 2.1 default theme

Installation
Any previous versions of this mod MUST be uninstalled BEFORE installing this version.
This mod is mainly for the default theme, custom themes might be compatible depending on the author of the custom theme.

Usage in custom themes (for theme authors)
If you wish to make use of the mod and allow admins to change colors in your theme, add an array with the following format to template_init()

Code: [Select]
<?php
$settings
['color_changes'] = array(
'COLOR_TYPE' => array(
array(
'elements' => '.ELEMENT, #ANOTHER_ELEMENT',
'properties' => array('PROPERTY_NAME''ANOTHER_PROPERTY' => '{color}')
)
array(...)
),
...
);

You can use one of the already declared color types :

'background', 'foreground', 'primary_color', 'secondary_color', 'top_section', 'footer', 'links', 'gradient_end', 'gradient_start', 'blocks_color', 'blocks_alternate_color', 'borders_color', 'buttons_text_color', 'buttons_bg', 'buttons_border', 'special_titles_color'

or you can use a new color type, but you'll have to give it a text string in this format
Code: [Select]
$txt['cc_COLOR_TYPE'] = 'STRING';Properties will be given the value of the color, and you can also use {color} and it will be replaced with the color's value.

example from the default theme:
Code: [Select]
<?php
$settings
['color_changes'] = array(
'background' => array(
array(
'elements' => 'body',
'properties' => array('background')
)
),
'primary_color' => array(
array(
'elements' => 'div.cat_bar, .amt, .dropmenu li a:hover, .dropmenu li:hover a, .dropmenu li a:focus,
#top_info > li > a:hover, #top_info > li:hover > a, #top_info > li > a.open, .button.active, .button.active:hover'
,
'properties' => array('background''border-color')
),
array(
'elements' => '#footer',
'properties' => array('background')
),
array(
'elements' => '.button.active, .button.active:hover',
'properties' => array('color' => '#fff')
)
),
'gradient_start' => array(
array(
'elements' => '.dropmenu li ul, .top_menu, .dropmenu li li:hover, .button, .dropmenu li li:hover > a, .dropmenu li li a:focus,
.dropmenu li li a:hover, #top_section, #search_form .button, .quickbuttons li, .quickbuttons li ul, .quickbuttons li ul li:hover,
.quickbuttons ul li a:focus, .popup_window, #inner_section'
,
'properties' => array('background-image' => 'linear-gradient(to bottom, {color} 0%, transparent 70%)')
),
array(
'elements' => '.button:hover, .quickbuttons li:hover, .navigate_section ul, .popup_content, .up_contain,
.button:hover, #search_form .button:hover, .quickbuttons li:hover'
,
'properties' => array('background-image' => 'linear-gradient(to bottom, transparent 0%, {color} 70%)')
)
),
);

Support
Please use the modification thread for support with this modification.

Changelog
Version 1.0 - April 2019
  Initial Release



Copyright (c) 2019, Simple Machines, under BSD 3-Clause License.
All rights reserved.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,946
  • Gender: Male
    • Macedonian electronics forum
Re: Curve2 Color Changer
« Reply #1 on: April 16, 2019, 06:19:05 PM »
Nice 8).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,519
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Curve2 Color Changer
« Reply #2 on: April 16, 2019, 07:20:40 PM »
Great job!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline skb

  • Jr. Member
  • **
  • Posts: 333
    • Metabolically Challenged
Re: Curve2 Color Changer
« Reply #3 on: April 17, 2019, 04:28:22 AM »
Can this be board specific ?
Learning, every day.
Forum - The Diabetic Pub
Because every diabetic needs help
SMF 2.1 RC2 (default theme) / TP 1.6.2

Online SychO

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,184
  • Gender: Male
    • SychO9 on GitHub
    • SychO
Re: Curve2 Color Changer
« Reply #4 on: April 17, 2019, 05:01:54 AM »
Can this be board specific ?

nope, it cannot

Imazighen

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 348
  • Low pressure
    • @pocttopus on Twitter
Re: Curve2 Color Changer
« Reply #5 on: April 17, 2019, 07:28:47 AM »
А very useful idea.
Amazing!  :)

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,244
  • Master of BBC Abuse
Re: Curve2 Color Changer
« Reply #6 on: April 17, 2019, 08:40:06 AM »
Haven't checked out the guts of it yet, but I'm guessing this adds a range of user-specific theme settings to deal with all the possible options.

Has anyone done some checking on the performance implications for large and/or busy sites?

Online SychO

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,184
  • Gender: Male
    • SychO9 on GitHub
    • SychO
Re: Curve2 Color Changer
« Reply #7 on: April 17, 2019, 09:14:45 AM »
Haven't checked out the guts of it yet, but I'm guessing this adds a range of user-specific theme settings to deal with all the possible options.

Has anyone done some checking on the performance implications for large and/or busy sites?

Not user-specific, that would be too much :/

The settings are admin-specific.

Imazighen

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,244
  • Master of BBC Abuse
Re: Curve2 Color Changer
« Reply #8 on: April 17, 2019, 05:20:23 PM »
Then why does it say "allow users to change colors"?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,933
    • StoryBB/StoryBB on GitHub
Re: Curve2 Color Changer
« Reply #9 on: April 17, 2019, 05:28:34 PM »
The admin is a user?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,244
  • Master of BBC Abuse
Re: Curve2 Color Changer
« Reply #10 on: April 17, 2019, 06:23:31 PM »
A tad ambiguous, as SychO's post demonstrates, but ok.

Online SychO

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,184
  • Gender: Male
    • SychO9 on GitHub
    • SychO
Re: Curve2 Color Changer
« Reply #11 on: April 17, 2019, 06:27:16 PM »
edited to avoid confusion

Imazighen