-
Notifications
You must be signed in to change notification settings - Fork 151
Added <avatar> object #196
base: dev
Are you sure you want to change the base?
Conversation
Has src for image, text for text and size for size.
I don't know why there's 25 removed lines, I don't remember doing that. They didn't impact me during testing though. |
This is very cool, is there a way for the avatars to not be a perfect circle? maybe like a rounded square or just a square |
napture/src/b9/html.rs
Outdated
"Couldn't find head. Invalid HTML?".to_owned(), | ||
"Couetch_imageldn't find head. Invalid HTML?".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidentally triggered a paste here, idk. Will fix.
I gotta disable middle click to paste.
@inventionpro unfortunately not currently. Since I'm using libadwaitas built in Avatar Object, it's limited to a circle. Maybe in the future, I can try to rework it to use a regular image, so it can be a rounded square. |
(Ignore the first five commits)
Let me introduce the newest technology in webx: Avatars!
Utilizing the libadwaita avatar object, you can now add avatars directly to your webpage using the tag. Here's how it works.
<avatar size="caseoh" text="Case Oh" src="path/to/caseoh.png"/>
Size
This attribute controls the size of the avatar object. There are a select few pre-set sizes.
Additionally, if a number is entered, the size will be set to that. If not defined, it will default to 48.
Text
This attribute is used to show initials on the avatar. This is only really useful if you don't apply an image to the avatar. If not defined, an avatar icon will be shown.
Src
This attribute defines the image set in the avatar. If not defined, the default icon/initials will be used. If the image is unable to load, the avatar will simply turn invisible, which is not intentional but I'm too lazy to fix it.