Skip to content

Conversation

progfay
Copy link
Contributor

@progfay progfay commented Mar 3, 2022

Description

It seems that the rank text of "GitHub Stats Card" is not centering.

Before

const circle = document.querySelector(".rank-circle").getBoundingClientRect()
const text = document.querySelector(".rank-text").getBoundingClientRect()

console.log(circle.x + circle.width / 2, circle.y + circle.height / 2) // => 390 110.5
console.log(text.x + text.width / 2, text.y + text.height / 2)         // => 391 107.5

After applying the changes

// at https://github-readme-stats.vercel.app/api?username=anuraghazra
const circle = document.querySelector(".rank-circle").getBoundingClientRect()
const text = document.querySelector(".rank-text").getBoundingClientRect()

console.log(circle.x + circle.width / 2, circle.y + circle.height / 2) // => 390 110.5
console.log(text.x + text.width / 2, text.y + text.height / 2)         // => 390 110.5

Compare

length 1 length 2 length 3
before length 1 (before) length 2 (before) length 3 (before)
after length 1 (after) length 2 (after) length 3 (after)

@vercel
Copy link

vercel bot commented Mar 3, 2022

@progfay is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@rickstaa rickstaa linked an issue Mar 9, 2022 that may be closed by this pull request
@jgphilpott
Copy link

I like it! 👌

@rickstaa
Copy link
Collaborator

rickstaa commented Mar 9, 2022

Great! We are in the middle of a big code cleanup but after that is done we will merge normal PR again.

@anuraghazra anuraghazra merged commit d7d0ba5 into anuraghazra:master Mar 12, 2022
Kab1r pushed a commit to Kab1r/github-readme-stats that referenced this pull request Apr 4, 2022
lencx pushed a commit to lencx/github-readme-stats that referenced this pull request May 16, 2022
necofuryai added a commit to necofuryai/github-readme-stats that referenced this pull request May 19, 2025
xhayper pushed a commit to xhayper/github-readme-stats that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Centre Text Inside Circle
4 participants