حجم وشكل الصورة الرمزية

:discourse2: ملخص حجم وشكل الصور الرمزية يتيح لك تغيير حجم وشكل الصور الرمزية على موقعك بسهولة.
:eyeglasses: معاينة معاينة على منشئ سمة Discourse
:hammer_and_wrench: رابط المستودع https://github.com/discourse/discourse-avatar-component
:open_book: جديد في سِمات Discourse؟ دليل المبتدئين لاستخدام سِمات Discourse

تثبيت مكون السمة هذا

الميزات

يتيح لك حجم وشكل الصور الرمزية تخصيص حجم وشكل الصور الرمزية على موقعك بسهولة في مواقع مختلفة.

الإعدادات

الاسم الوصف
حجم الصورة الرمزية الأحدث اختر حجم الصورة الرمزية في صفحة الأحدث. القيمة الافتراضية هي صغيرة (25 بكسل). لعرض التغييرات المطبقة، قم بتحديث الصفحة باستخدام Ctrl+F5 أو Cmd+Shift+R.
حجم الصور الرمزية في المواضيع اختر حجم الصورة الرمزية في المواضيع. القيمة الافتراضية هي 45 بكسل. لعرض التغييرات المطبقة، قم بتحديث الصفحة باستخدام Ctrl+F5 أو Cmd+Shift+R.
حجم الصور الرمزية في الرأس اختر حجم الصورة الرمزية في الرأس. القيمة الافتراضية هي 32 بكسل. لعرض التغييرات المطبقة، قم بتحديث الصفحة باستخدام Ctrl+F5 أو Cmd+Shift+R.
ارتفاع الرأس اختر ارتفاع الرأس. يجب أن يتم الاختيار بناءً على حجم الصور الرمزية في الرأس + 10 بكسل. على سبيل المثال، إذا كان حجم الصور الرمزية في الرأس مضبوطًا على 90 بكسل، فيجب أن يكون ارتفاع الرأس 100 بكسل. القيمة الافتراضية هي 60 بكسل.
الهامش العلوي اختر المسافة بالبكسل من الرأس. القيمة الافتراضية هي 0 بكسل.
نصف قطر حدود الصور الرمزية اختر نصف قطر حدود الصور الرمزية على الموقع. سيتم تطبيق الإعداد على جميع الصور الرمزية، بما في ذلك تلك الموجودة في الرأس وتلك الموجودة في بطاقة المستخدم. 0% تتوافق مع شكل مربع، و50% مع شكل دائري. القيمة الافتراضية هي 50%.
حجم الصور الرمزية على الجوال اختر حجم الصورة الرمزية في المواضيع على الجوال. الحد الأدنى للقيمة هو 45 بكسل (الافتراضي)، والحد الأقصى هو 80 بكسل. لعرض التغييرات المطبقة، قم بتحديث الصفحة باستخدام Ctrl+F5 أو Cmd+Shift+R.

تفاصيل إضافية:

  • يغير حجم الصورة الرمزية الأحدث حجم الصورة الرمزية في صفحة /الأحدث. ستكون جميع الصور الرمزية مرئية حتى الحجم متوسط. من الحجم كبير فصاعدًا، سيتم عرض صورة رمزية للمستخدم الأخير الذي كتب في الموضوع فقط.
  • يعمل حجم الصورة الرمزية في الرأس بشكل جيد حتى حجم 60 بكسل. بالنسبة للصور الرمزية ذات الأحجام الأكبر، يجب زيادة ارتفاع الرأس (ارتفاع الرأس)، وبالتالي يجب زيادة الهامش العلوي الذي يفصل الرأس عن عناصر الصفحة الأخرى (الهامش العلوي).

ظلت موضع فقاعة الإشعارات (المواضيع والرسائل الخاصة) دون تغيير. ستتحرك هذه الفقاعات أفقيًا فقط تبعًا لحجم الصورة الرمزية.

تاريخ التطوير

تم كتابة مكون السمة هذا مستوحى من الأدلة

:discourse2: مُستضاف لدينا؟ تتوفر مكونات السمة للاستخدام في خططنا القياسية، والأعمال، والمؤسسات.

46 إعجابًا

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 إعجابات

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)

Did you find a solution for the mobile version?

No, never found a way to do it unfortunately.

إعجاب واحد (1)

I will take a look this week if I have time

6 إعجابات

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 إعجابات

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)

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 إعجابات

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)

@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)

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 إعجابات

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)

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)

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)