![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
smart-avatar
Advanced tools
Render avatars with dynamic, defined fallback
Live demo: smart-avatar-demo.live
import smartAvatar from 'smart-avatar';
const targetElement = document.querySelector(.topbar-user);
smartAvatar(targetElement, {
"email": "jared.gorski@liferay.com",
"initials": "JG",
"src": "./user-imgs/jared.jpg",
"icon": "identicon"
"round": true,
"size": 48,
"color": "#00AE55",
"textColor": "#FFF",
"cssClass": "we-user",
});
import smartAvatar from 'smart-avatar';
// define target element to append with smart-avatar
const targetElement = document.querySelector(.topbar-user);
// run smartAvatar function, passing target element and desired configuration
smartAvatar(targetElement, {
// fallback priority definition
"priority": [
"gravatar",
"src",
"smart"
],
// general settings
"cssClass": "site-avatar", // user-defined CSS classes
"round": true, // shape of asset (square if false)
"size": 80, // size of asset (width in px)
"timestamp": true // adds timestamp attribute (for unique id)
// gravatar settings
"email": "jared.gorski@liferay.com", // gravatar email address
"format": "png", // gravatar image format (jpg, png, or tiff)
"hash": "93a5c828f0da09f0af10d2ac238724b5", // md5 hash of gravatar email address
"protocol": "secure", // protocol of gravatar request (secure, unsecure, or agnostic)
"resolution": 120, // resolution of gravatar (width in px)
// user-defined src
"src": "./img/src.jpg", // path to custom fallback asset, relative or absolute
// initials settings
"initials": "J", // 1 or 2 letters
"color": "#777777", // color of background (affects both initials and built-in icon)
"textColor": "#FFFFFF", // color of initials font
// built-in icon
"icon": "smartfox", // see below for available icon styles
});
npm i
(write code)
npm run test
navigate to http://127.0.0.1:7878/ to manually test changes
FAQs
Render avatars with dynamic, defined fallback
The npm package smart-avatar receives a total of 0 weekly downloads. As such, smart-avatar popularity was classified as not popular.
We found that smart-avatar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.