
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
react-animated-weather
Advanced tools
Animated weather component for React inspired by Skycons http://darkskyapp.github.io/skycons/
Animated weather component for React inspired by Skycons http://darkskyapp.github.io/skycons/ :sunny:
React Animated Weather is available as a node package. Get it via yarn
or npm
:
yarn add react-animated-weather
-or-
npm install react-animated-weather
If using npm
< 5, you might want to save to your package.json
:
npm install --save react-animated-weather
react-animated-weather
also has peer dependencies on react
, react-dom
and prop-types
.
Import the ReactAnimatedWeather component:
import ReactAnimatedWeather from 'react-animated-weather';
Sample usage:
import React from 'react';
import ReactAnimatedWeather from 'react-animated-weather';
const defaults = {
icon: 'CLEAR_DAY',
color: 'goldenrod',
size: 512,
animate: true
};
const App = () => (
<ReactAnimatedWeather
icon={defaults.icon}
color={defaults.color}
size={defaults.size}
animate={defaults.animate}
/>
);
export default App;
Props:
icon: Takes a string to display the corresponding icon out of the following
color: Pass a color value or hex code to color the weather component, if not passed, by default black is picked
size: Pass a number to size the weather component in pixels, if not passed, by default 64 is set as the size
animate: Pass a boolean value, if true (by default), the weather component will animate and if false, the weather component will remain static without any animation
Here are the default props used by ReactAnimatedWeather component:
ReactAnimatedWeather.defaultProps = {
animate: true,
size: 64,
color: 'black'
};
ReactAnimatedWeather.propTypes = {
icon: PropTypes.oneOf([
'CLEAR_DAY',
'CLEAR_NIGHT',
'PARTLY_CLOUDY_DAY',
'PARTLY_CLOUDY_NIGHT',
'CLOUDY',
'RAIN',
'SLEET',
'SNOW',
'WIND',
'FOG'
]).isRequired,
animate: PropTypes.bool,
size: PropTypes.number,
color: PropTypes.string
};
I've added a storybook
for the component since it has a small number of props and the storybook
interface is quite good for testing out
the component. You can fire up the storybook
by running:
yarn storybook
-or-
npm run storybook
I got inspired to write this component from darkskyapp's Skycons. It makes use of the <canvas>
element to render beautiful animated weather components.
Working with <canvas>
in virtual DOM is a bit tricky. ReactAnimatedWeather uses a ref
to refer to the DOM holding the <canvas>
element and render the weather component on componentDidMount()
.
If you've found any bugs, please open an issue on github.
FAQs
Animated weather component for React inspired by Skycons http://darkskyapp.github.io/skycons/
The npm package react-animated-weather receives a total of 2,229 weekly downloads. As such, react-animated-weather popularity was classified as popular.
We found that react-animated-weather 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.