
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.
@giphy/svelte-components
Advanced tools
Try it out on Codesandbox
This package provides components that help you display gifs on a website. It works in tandem with @giphy/js-fetch-api and @giphy/js-types packages
There are three main components: Gif, Grid, and Carousel described below. Feel free to poke around the src/routes
dir for working examples
This SDK sends analytics events back to GIPHY in the form of pingbacks to help us improve the quality of search results for your users.
<Gif {gif} width={300} />
The Gif component takes a IGif object. You can use the @giphy/js-fetch-api to easily fetch data. Then pass the Gif to result.data
to the gif component.
It is required to specify a width
so the correct rendition is selected.
If you want to display something over the gif you can use a slot. You can use position:absolute
to position it.
<Gif {gif} width={300}>
<div slot="overlay" class="overlay" let:gif let:hovered>
{#if hovered}
<div>{gif.title}</div>
{/if}
</div>
</Gif>
Other props:
cover
)<Grid
initialGifs={gifs}
on:click={(e) => {
// do something with the gif
console.log(`on:click gif:`, e.detail.gif)
}}
width={600}
fetchGifs={(offset) => gf.trending({ offset })}
gifProps={{ borderRadius: 0 }}
/>
<Carousel initialGifs={gifs} gifHeight={100} fetchGifs={(offset) => gf.trending({ offset })} />
Grid/Carousel props:
Refresh the grid based on a search term
<script lang="ts">
import { Grid } from '@giphy/svelte-components'
import { GiphyFetch } from '@giphy/js-fetch-api'
import type { PageData } from './$types.js'
const gf = new GiphyFetch('sXpGFDGZs0Dv1mmNFvYaGUvYwKX0PWIh')
export let data: PageData
let term = data.term // the initial term on page load
let initialGifs = data.gifs // the initial gifs for ssr
</script>
<p>
Search for gifs:
<input bind:value={term} />
</p>
<!-- use the term as a key to reset the Grid-->
{#key term}
<Grid
initialGifs={data.term === term ? initialGifs : []}
on:click={(e) => {
console.log(`on:click gif:`, e.detail.gif)
}}
width={600}
fetchGifs={(offset) => gf.search(term, { offset, limit: 10 })}
gifProps={{ borderRadius: 0 }}
/>
{/key}
FAQs
GIPHY components for Svelte
We found that @giphy/svelte-components 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.