GithubHelp home page GithubHelp logo

thetarnav / vue-gooey-background Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 333 KB

Gooey Background Component for Vue 3

Home Page: https://npmjs.com/package/vue-gooey-background

License: MIT License

JavaScript 25.80% TypeScript 48.32% Vue 25.88%
vue vue3 sfc gooey component

vue-gooey-background's Introduction

Vue Gooey Background

Gooey Background Component for Vue 3.

See the DEMO on StackBlitz.

Install

npm i vue-gooey-background

Register the component

import GooeyBackground from 'vue-gooey-background'

// register globally
app.component('GooeyBackground', GooeyBackground)

// or locally
export default {
	components: { GooeyBackground },
	// ...
}

Usage

<!-- simple -->
<GooeyBackground>
	<a>Your gooey link.</a>
</GooeyBackground>

<!-- available props -->
<GooeyBackground disabled ellipse> ... </GooeyBackground>

Props

disabled

  • Optional
  • Type: Boolean
  • Disables the animation of the moving ball. Making the background static.

ellipse

  • Optional
  • Type: Boolean
  • Enable it if the shape of your element is round.

CSS Variables

Some css properties can be easily changed by setting css variables.

/* the defaults: */
.gooey-background {
	/* color of the gooey background  */
	--bg-color: #42b883;
	/* border radius (will be much increased by svg filter) */
	--bg-radius: 12px;
	/* size of the ball that's following the mouse */
	/* keep the number higher than you want, because of the svg filter */
	--ball-size: 52px;
	/* duration of the background color transition */
	--duration: 300ms;
	/* timing function of the background color transition */
	--ease: cubic-bezier(0.51, 0.06, 0.56, 1.37);
}

vue-gooey-background's People

Contributors

thetarnav avatar

Watchers

 avatar  avatar  avatar

vue-gooey-background's Issues

Background color transition

The background should have a basic background color transition set.
With a CSS variable o easily control it.

Detect mobile device

Instead of relying on media queries to hide the moving ball, detect the device type on the component load using js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.