Avatar-Größe und -Form

:discourse2: Zusammenfassung Avatar-Größe und -Form ermöglicht es Ihnen, die Größe und Form der Avatare auf Ihrer Website einfach zu ändern.
:eyeglasses: Vorschau Vorschau im Discourse Theme Creator
:hammer_and_wrench: Link zum Repository https://github.com/discourse/discourse-avatar-component
:open_book: Neu bei Discourse-Themen? Anfängerleitfaden zur Verwendung von Discourse-Themen

Dieses Theme-Modul installieren

Funktionen

Avatar Size and Shape ermöglicht es Ihnen, die Größe und Form der Avatare auf Ihrer Website an verschiedenen Stellen einfach anzupassen.

Einstellungen

Name Beschreibung
latest avatar size Wählen Sie die Avatar-Größe auf der Seite „Neueste". Der Standardwert ist „klein" (25px). Um die Änderungen zu sehen, aktualisieren Sie die Seite mit Strg+F5 oder Cmd+Shift+R.
topic avatars size Wählen Sie die Avatar-Größe in Themen. Der Standardwert ist 45px. Um die Änderungen zu sehen, aktualisieren Sie die Seite mit Strg+F5 oder Cmd+Shift+R.
header avatars size Wählen Sie die Avatar-Größe in der Kopfzeile. Der Standardwert ist 32px. Um die Änderungen zu sehen, aktualisieren Sie die Seite mit Strg+F5 oder Cmd+Shift+R.
header height Wählen Sie die Höhe der Kopfzeile. Die Wahl muss auf Basis von header_avatars_size + 10px getroffen werden. Wenn beispielsweise header_avatars_size auf 90px eingestellt ist, sollte die Kopfzeile 100px hoch sein. Der Standardwert ist 60px.
margin top Wählen Sie den Abstand in Pixeln von der Kopfzeile. Der Standardwert ist 0px.
avatars border radius Wählen Sie den Border-Radius der Avatare auf der Website. Die Einstellung wird auf alle Avatare angewendet, einschließlich des Avatars in der Kopfzeile und des Avatars in der Benutzerkarte. 0% entspricht einer quadratischen Form, 50% einer abgerundeten Form. Der Standardwert beträgt 50%.
mobile avatars size Wählen Sie die Avatar-Größe in Themen auf Mobilgeräten. Der Mindestwert ist 45px (Standard), der Höchstwert ist 80px. Um die Änderungen zu sehen, aktualisieren Sie die Seite mit Strg+F5 oder Cmd+Shift+R.

Zusätzliche Details:

  • latest avatar size ändert die Avatar-Größe auf der Seite /latest. Alle Avatare sind bis zur Größe „medium" sichtbar. Ab „large" wird nur der Avatar des letzten Benutzers angezeigt, der im Thema geschrieben hat.
  • header avatar size funktioniert gut bis zur Größe 60px. Für Avatare größerer Größe muss die Höhe der Kopfzeile erhöht werden (header height), und folglich muss auch der margin top erhöht werden, der die Kopfzeile von den anderen Elementen der Seite entfernt.

Die Position (in der Höhe) der Benachrichtigungsblase (Themen und PN) bleibt unverändert. Diese Blasen bewegen sich nur horizontal entsprechend der Avatar-Größe.

Entwicklungshistorie

Dieses Theme-Modul wurde inspiriert von den folgenden Leitfäden erstellt:

:discourse2: Von uns gehostet? Theme-Module stehen in unseren Plänen Standard, Business und Enterprise zur Verfügung.

46 „Gefällt mir“

How would I go about changing the size of the topic avatar on mobile with this? 80px looks pretty good on desktop, but obnoxious on mobile. I tried changing .topic-avatar width but it just shifts the text and the avatar stays the same.

3 „Gefällt mir“

Great component, we were looking for it.

But it would be great to change the avatar flair size too, if you are using them in your site (as we do).

Thank you.

very cool
wish I could set the topic avatar size to 53 though :frowning:

Also does this apply to avatars in the topic-poster div found on some front page category arrangments? It doesn’t seem to but it would be cool if it did.

Did you found a way of doing this?

@dax I found a small issue which collides with the Quick Messages plugin.
The following CSS comes targets the badge notification of the quick messages plugin as well:

.d-header-icons .unread-private-messages {
    right: auto;
    left: -10%; /* <--- this is the culprit*/
}

May be add some #… element to the CSS selector

1 „Gefällt mir“

Did you find a solution for the mobile version?

No, never found a way to do it unfortunately.

1 „Gefällt mir“

I will take a look this week if I have time

6 „Gefällt mir“

There is a new setting to configure the size on mobile from 45px (default) to 80px.

Update the component to see the new setting.

6 „Gefällt mir“

Thank you Daniela, I have one more suggestion. It would be great if there was an option to either leave the reply avatars on for large or extra_large so I can reduce the size via css. Or an option to reduce the size of the reply avatars in the plugin. I’m trying to achieve this, but of course the larger avatar is blurry from upsizing the medium size avatar.

image

2 „Gefällt mir“

Great plugin! Thank you!

@Dax Only problem I’m seeing right now is in the header which is a darker color. The hover is set to white which works fine on the search button and on the hamburger menu, but when the avatar is set to a slightly larger size, the size of the hover is smaller than the avatar. How would I go about fixing that?

Screen Shot 2020-04-06 at 11.01.39 PM

This component does not change the colors of the site in any way, it must be some other theme that you are using to overwrite the background colors.

3 „Gefällt mir“

Great component.
It makes it easy to control the size and aspecto of your avatar without changing CSS of you theme (that may give problems upgrading the theme).

No, there is no change in colors.

We are using it and are happy with it.

2 „Gefällt mir“

@dax Maybe I did not explain myself very well. It’s not about the color, it’s about the size of the container. If you hover over your own avatar icon in the upper right corner of the page here on meta, you get a colored square with a :hover property, and the square is bigger than the avatar.

Screen Shot 2020-04-09 at 7.51.04 AM

However, if I enlarge the avatar with this plugin, the size of the :hover square is now smaller than the avatar and looks a little wonky.

Screen Shot 2020-04-06 at 11.01.39 PM

1 „Gefällt mir“

By changing the height of that div, the other two icons must also be repositioned. For this reason I had preferred not to. For now I only make the color of the div on hover transparent.

3 „Gefällt mir“

Would it not be possible to simply target

.header-dropdown-toggle #current-user

with CSS?

No, it’s not so simple.

I will take a look in the next hours

2 „Gefällt mir“

I’m trying to achieve this in CSS but since all header icons use the same class:

<li class="header-dropdown-toggle">

it seems like they are either all on or all off. How were you able to just get the avatar one to not activate on :hover?

1 „Gefällt mir“

As a side note, I was able to get a pretty good looking effect in CSS in terms of having a :hover state on the avatar (white border). Now if I could just get the background of the li element to not highlight with the rest of it…

Screen Shot 2020-04-09 at 6.45.24 PM

Screen Shot 2020-04-09 at 6.44.16 PM

1 „Gefällt mir“