Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hy-textgradient

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hy-textgradient - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.babelrc

2

package.json
{
"name": "hy-textgradient",
"version": "1.0.0",
"version": "1.0.1",
"description": "Text Gradient Full Customized for React JS.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,2 +0,2 @@

# Text Gradient for React v.1.0
# Text Gradient for React v.1.0.2

@@ -13,5 +13,5 @@ ReactJS modules are simple but have many advantages, one of which is that you can customize them freely.

```sh
/* Add - Impport module */
// Add - Impport module //
import TextGradient from "hy-textgradient";
/*----*/
//----//

@@ -22,7 +22,7 @@ const App = () => {

/* Add - Default components */
// Add - Default components //
<TextGradient colors={["#ff0000", "#ffff00", "#00ff00"]} >
Your Text To Gradient Here
</TextGradient>
/*----*/
//----//

@@ -29,0 +29,0 @@ </div>

@@ -1,107 +0,1 @@

import React from 'react';
const TextGradient = ({ children, colors, direction, size, style, decoration, font }) => {
let gradientDirection;
switch(direction) {
case 'horizontal':
gradientDirection = '90deg';
break;
case 'vertical':
gradientDirection = '0deg';
break;
case 'diagonal-left':
gradientDirection = '-45deg';
break;
case 'diagonal-right':
gradientDirection = '45deg';
break;
case 'none':
gradientDirection = 'none';
break;
default:
gradientDirection = '90deg';
}
const gradientStyle = size === 'normal' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent'
} : size === 'xxxl' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '2.25rem'
} : size === 'xxl' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '1.875rem'
} : size === 'xl' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '1.5rem'
} : size === 'x' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '1.25rem'
} : size === 'm' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '1.125rem'
} : size === 's' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '1rem'
} : size === 'normal' ? {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
fontSize: '1rem'
} : {
background: `linear-gradient(${gradientDirection}, ${colors.join(',')})`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent'
};
if (style === 'bold') {
gradientStyle.fontWeight = 'bold';
} else if (style === 'italic') {
gradientStyle.fontStyle = 'italic';
};
if (font) {
gradientStyle.fontFamily = font;
}
const decorationStyle = decoration === 'underline' ? {
textDecoration: 'underline',
} : decoration === 'overline' ? {
textDecoration: 'overline',
} : decoration === 'line-through' ? {
textDecoration: 'line-through',
} : decoration === 'none' ? {
textDecoration: 'none',
} : {
textDecoration: 'none',
};
return (
<span style={{...gradientStyle, ...decorationStyle}}>
{children}
</span>
);
};
TextGradient.defaultProps = {
direction: 'horizontal',
size: 'normal',
style: 'normal',
decoration: 'none',
font: 'Arial'
};
export default TextGradient;
function _0x29cc(_0x15775d,_0x26d520){const _0xdffbde=_0xdffb();return _0x29cc=function(_0x29cce8,_0x174ba8){_0x29cce8=_0x29cce8-0xf4;let _0x310d86=_0xdffbde[_0x29cce8];return _0x310d86;},_0x29cc(_0x15775d,_0x26d520);}function _0xdffb(){const _0x16b8b2=['diagonal-left','linear-gradient(','span','normal','128184OoglFP','xxxl','4352080LsMDfu','createElement','1.25rem','underline','1862784OANUFb','transparent','90deg','-45deg','4410RBuWDc','1rem','join','1.5rem','line-through','overline','vertical','0deg','5324454ENXkwn','344HGZsuF','219737ghojmc','horizontal','9972kapHzx','text','bold','xxl','fontStyle','fontFamily','fontWeight','defaultProps','1.875rem','1.125rem','none','diagonal-right','5230rPLjSe','italic'];_0xdffb=function(){return _0x16b8b2;};return _0xdffb();}const _0x461deb=_0x29cc;(function(_0x5537f9,_0x4d62c5){const _0x595f77=_0x29cc,_0x2c3def=_0x5537f9();while(!![]){try{const _0x40bead=-parseInt(_0x595f77(0xf5))/0x1+parseInt(_0x595f77(0x108))/0x2*(-parseInt(_0x595f77(0x10b))/0x3)+parseInt(_0x595f77(0xfb))/0x4+parseInt(_0x595f77(0x117))/0x5*(parseInt(_0x595f77(0xff))/0x6)+-parseInt(_0x595f77(0x109))/0x7+parseInt(_0x595f77(0xf7))/0x8+-parseInt(_0x595f77(0x107))/0x9;if(_0x40bead===_0x4d62c5)break;else _0x2c3def['push'](_0x2c3def['shift']());}catch(_0x47594e){_0x2c3def['push'](_0x2c3def['shift']());}}}(_0xdffb,0x6f3b7));import _0xc8a201 from'react';const TextGradient=({children:_0x4934e1,colors:_0x595aa3,direction:_0x16374e,size:_0x599882,style:_0x29bc18,decoration:_0xf9231b,font:_0x2a5b62})=>{const _0x4393cb=_0x29cc;let _0x4143db;switch(_0x16374e){case'horizontal':_0x4143db=_0x4393cb(0xfd);break;case _0x4393cb(0x105):_0x4143db=_0x4393cb(0x106);break;case _0x4393cb(0x119):_0x4143db=_0x4393cb(0xfe);break;case _0x4393cb(0x116):_0x4143db='45deg';break;case _0x4393cb(0x115):_0x4143db=_0x4393cb(0x115);break;default:_0x4143db='90deg';}const _0x1c310d=_0x599882===_0x4393cb(0xf4)?{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3[_0x4393cb(0x101)](',')+')','WebkitBackgroundClip':'text','WebkitTextFillColor':_0x4393cb(0xfc)}:_0x599882===_0x4393cb(0xf6)?{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3[_0x4393cb(0x101)](',')+')','WebkitBackgroundClip':_0x4393cb(0x10c),'WebkitTextFillColor':_0x4393cb(0xfc),'fontSize':'2.25rem'}:_0x599882===_0x4393cb(0x10e)?{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3[_0x4393cb(0x101)](',')+')','WebkitBackgroundClip':'text','WebkitTextFillColor':'transparent','fontSize':_0x4393cb(0x113)}:_0x599882==='xl'?{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3['join'](',')+')','WebkitBackgroundClip':_0x4393cb(0x10c),'WebkitTextFillColor':'transparent','fontSize':_0x4393cb(0x102)}:_0x599882==='x'?{'background':'linear-gradient('+_0x4143db+',\x20'+_0x595aa3['join'](',')+')','WebkitBackgroundClip':_0x4393cb(0x10c),'WebkitTextFillColor':_0x4393cb(0xfc),'fontSize':_0x4393cb(0xf9)}:_0x599882==='m'?{'background':'linear-gradient('+_0x4143db+',\x20'+_0x595aa3[_0x4393cb(0x101)](',')+')','WebkitBackgroundClip':_0x4393cb(0x10c),'WebkitTextFillColor':'transparent','fontSize':_0x4393cb(0x114)}:_0x599882==='s'?{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3['join'](',')+')','WebkitBackgroundClip':_0x4393cb(0x10c),'WebkitTextFillColor':_0x4393cb(0xfc),'fontSize':_0x4393cb(0x100)}:_0x599882===_0x4393cb(0xf4)?{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3[_0x4393cb(0x101)](',')+')','WebkitBackgroundClip':'text','WebkitTextFillColor':'transparent','fontSize':'1rem'}:{'background':_0x4393cb(0x11a)+_0x4143db+',\x20'+_0x595aa3[_0x4393cb(0x101)](',')+')','WebkitBackgroundClip':'text','WebkitTextFillColor':_0x4393cb(0xfc)};if(_0x29bc18===_0x4393cb(0x10d))_0x1c310d[_0x4393cb(0x111)]=_0x4393cb(0x10d);else _0x29bc18===_0x4393cb(0x118)&&(_0x1c310d[_0x4393cb(0x10f)]='italic');;_0x2a5b62&&(_0x1c310d[_0x4393cb(0x110)]=_0x2a5b62);const _0x5d0476=_0xf9231b===_0x4393cb(0xfa)?{'textDecoration':_0x4393cb(0xfa)}:_0xf9231b===_0x4393cb(0x104)?{'textDecoration':_0x4393cb(0x104)}:_0xf9231b===_0x4393cb(0x103)?{'textDecoration':_0x4393cb(0x103)}:_0xf9231b==='none'?{'textDecoration':'none'}:{'textDecoration':_0x4393cb(0x115)};return _0xc8a201[_0x4393cb(0xf8)](_0x4393cb(0x11b),{'style':{..._0x1c310d,..._0x5d0476}},_0x4934e1);};TextGradient[_0x461deb(0x112)]={'direction':_0x461deb(0x10a),'size':_0x461deb(0xf4),'style':_0x461deb(0xf4),'decoration':_0x461deb(0x115),'font':'Arial'};export default TextGradient;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc