Skip to content

Color gradient for files age #5081

@slavaGanzin

Description

@slavaGanzin

Description

Hi

I'm constantly looking for new GitHub projects and one thing that I care the most is maintenance activity (e.g. date of last commit).
So, I created a little extension, which runs only on GitHub pages. So fresh commits would become green and old — red.

Array.from(document.querySelectorAll('[datetime]')).map(x => 
  x.innerHTML = `<span style='filter: sepia(1) saturate(80) hue-rotate(${100 - 25 * (new Date() - new Date(x.getAttribute('datetime')))/(365 * 24 * 60 * 60 * 1000)}deg);'>${x.innerText}</span>`
) 

You can paste this in console on any repository page

Maybe it would be interesting for you to merge if I would create a PR?

Screenshot

2021-11-17_15-49

Example URL

https://github.com/refined-github/refined-github

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions