kobotoolbox / kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
130 stars 175 forks source link

Loading spinner is rotating off center #1952

Open magicznyleszek opened 6 years ago

magicznyleszek commented 6 years ago

Description

The spinner spins around a point that is a tiny bit off-center: kapture 2018-08-19 at 9 37 00

We could design a square one, that doesn't rely on rotating.

Sidenote: performance-wise CSS spinners are ok: https://github.com/h5bp/lazyweb-requests/issues/103

joshuaberetta commented 2 years ago

@magicznyleszek is this still an issue with the new spinner?

magicznyleszek commented 2 years ago

I was wrong and this is still an issue. The things I found out during debugging:

  1. I thought this has to do with the source size of svg icons (these changed and are now 280px, with older version of webfonts-generator we had to keep it over 1000px as glyphs were corrupted during conversion), but I tried resizing all icons and it didn't change anything
  2. The thing that helped with spinning issue was changing the size of the spinner icon itself (so spinner.svg was 1000x1000px and other icons stay 280x280px), but this is not acceptable as all the other icons are renderer off center and smaller (proportionally).
  3. I tried very simple designs based on simple circle, but this only proved that the issue is not with the icon design itself.

If you add some styles to generated icons, it is clear that SVG design that is perfectly in center is rendered a bit lower than it should:

Screenshot 2022-12-12 at 17 02 07
magicznyleszek commented 2 years ago

The solution would be one of:

  1. drop icon font and use all icons as svgs, without webfonts-generator the issue will be gone
  2. move spinner outside the k-icons flow and make it a completely separate thing

I lean towards 1. as it should and will happen eventually, and with 2. we need to update all the places that use spinner icon currently.

magicznyleszek commented 2 years ago

There is also a bit separate idea to not use the regular spinning spinner, but use another loading animation inspired by our new logo, e.g.:

kobo-loading-small

kobo-loading