yakovlevga / letterpic Goto Github PK
View Code? Open in Web Editor NEWLetterPic is a small jQuery plugin that converts user's name to userpic, using it's initials.
License: MIT License
LetterPic is a small jQuery plugin that converts user's name to userpic, using it's initials.
License: MIT License
Using default options on a webpage that has more than 19 unique users, I encountered a "TypeError: Cannot read property '0' of undefined". This error caused only the first 19 icons to be generated and everything after was an unrendered invisible DIV. If I disable the gradient option and use fill: 'color'
, no error is throw, but all users over the count of 19 appear on a black background.
Is this a bug or are developers required to identify the maximum unique users being displayed and specify an array of colors that meets or exceeds that amount? (I was under the impression that additional icon colors would start over at the beginning of the array of colors.)
Thanks.
Are you able to make the plugin "chainable" or add an event?
For example, I tried to add a class after calling letterpic and get a Cannot read property 'addClass' of undefined
error.
$(".letterpic").letterpic().addClass('pointer');
Am I doing this wrong? I tried using deferred.then()
, but it didn't work either.
My use case is: I'd like to identify elements that have a successfully loaded images (identified by an undefined "width" attribute) and add a click event to use MagnificPopUp to display a larger version of the image (or launch a upload tool, editor, crop-tool, etc.)
NOTE: I'll probably work around this by changing my trigger to use img.letterpic
.
It's a nice plugin.
Found one critical issue. It's overriding the window.self variable, and thus my other js libraries (or any other plugin which depends on window.self object) are not working correctly.
Please check line no. 36 in jquery.letterpic.js.
It should be "var self = this; "
[FEATURE REQUEST] The avatar images on many of my projects are displayed using square shapes and occasionally have slightly rounded corners. In some UIs, the profile image may appear as a top-hanging tab w/rounded corners only on the bottom. (I noticed GitHub uses square avatars w/slightly rounded corners.) Would it be difficult to add square and corner-rounding options? Thanks.
Hi, this is great and really useful. I'm using the HTML method, but the pics won't display in an initially hidden element; in my case a Bootstrap tab. I have tried to initialize the letterpic plugin after the tab is shown, but they still won't display. Any ideas what I can do to get them to show up?
Hi,
First of all, thank you for this great plugin!
Is it possible to 'dynamically' load images depending on a data-attribute (for example) for certain users and the solid/gradient colors for all others?
Not all users have supplied images/their photo. But I would love to show their photo when it is there, and solid/gradient background for the others.
Thank you in advance for your reply.
Maurice.
Hi there,
Great library, I was wondering is there any way to have all names with the first letter the same color?
Example
Andrew - Green
Adam - Green
Harry - Red
Tom - Blue
Tim - Blue
The issue I face currently is that if I have an avatar on a layout page at the top, (similar to how githbu shows your avatar on the top of the page) then the avatar is always displayed as the first colour in the array. So if I login as Andrew it will be red, if I login as Harry it will be red.
But if I have a page that shows a list of people, then my avatar colour at the top of the page and my avatar colour in the list could be different
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.