Page MenuHomePhabricator

Briefly change color of section header selected by user in the menu (implement yellow fade effect)
Closed, DeclinedPublic

Description

When the article has a lot of sections, it sometimes requires some effort to visually identify the section after it is scrolled to from the menu.

This is particularly true for Wiktionary, where sections are abundant, usually short, and lacking pictures and other visually distinguishing signs.

Suggested behavior:
After the page is scrolled to the section, its header, or the whole section should briefly change color. This will save brain "CPU cycles" that can be used for better things.

This site http://english.stackexchange.com , among others, employs such behavior.

Event Timeline

Yurivict raised the priority of this task from to Needs Triage.
Yurivict updated the task description. (Show Details)
Yurivict subscribed.

I know this isn't too difficult to do with JavaScript. This behavior can be made optional.

Hi @Yurivict. Please associate at least one project with this tasks that you file, otherwise nobody can find this task when searching in the corresponding project(s). Thanks.

Aklapper renamed this task from [Feature suggestion] Header of section selected by user in the menu should briefly change color to show user where it is. to Briefly change color of section header selected by user in the menu (to show user where it is).Aug 21 2015, 1:42 PM
Aklapper set Security to None.

What is the project corresponding to basic Wiki software (php/html/js/etc)? This is what should be assigned here, but I don't find anything like that in the list.

Glaisher renamed this task from Briefly change color of section header selected by user in the menu (to show user where it is) to Briefly change color of section header selected by user in the menu (implement yellow fade effect).Aug 21 2015, 5:54 PM
Glaisher updated the task description. (Show Details)

Will it be better if a "global gadget" is written for this instead of implementing it in core?

Actually, no JavaScript is needed to achieve this effect, only CSS:

@keyframes highlight {
    from {
        background-color: yellow;
    }
    to {
        background-color: transparent;
    }
}
.mw-headline:target {
    animation-name: highlight;
    animation-duration: 2s;
}

(plus some browser prefixes to support older browsers, too).

I've been testing this for a while now, and it's really nice. Not a fan of the color scheme, but worth considering in general.

@alexhollender might be of interest for table of contents

ovasileva subscribed.

Declining this for now as we will be introducing section tracking in our new table of contents: https://di-toc-phase2.web.app/Hydrogen