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

svelte-transitions

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-transitions - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

CHANGELOG.md
# svelte-transitions changelog
## 1.1.0
* Add `fly` and `slide` transitions
## 1.0.0
* First release

@@ -20,3 +20,64 @@ (function (global, factory) {

function cubicOut(t) {
var f = t - 1.0;
return f * f * f + 1.0
}
function fade$2(
node,
ref
) {
var delay = ref.delay; if ( delay === void 0 ) delay = 0;
var duration = ref.duration; if ( duration === void 0 ) duration = 400;
var easing = ref.easing; if ( easing === void 0 ) easing = cubicOut;
var x = ref.x; if ( x === void 0 ) x = 0;
var y = ref.y; if ( y === void 0 ) y = 0;
var o = +getComputedStyle(node).opacity;
return {
delay: delay,
duration: duration,
easing: easing,
css: function (t) { return ("transform: translate(" + ((1 - t) * x) + "px, " + ((1 - t) * y) + "px); opacity: " + (t * o)); }
};
}
function slide(
node,
ref
) {
var delay = ref.delay; if ( delay === void 0 ) delay = 0;
var duration = ref.duration; if ( duration === void 0 ) duration = 400;
var easing = ref.easing; if ( easing === void 0 ) easing = cubicOut;
var style = getComputedStyle(node);
var opacity = +style.opacity;
var height = parseFloat(style.height);
var paddingTop = parseFloat(style.paddingTop);
var paddingBottom = parseFloat(style.paddingBottom);
var marginTop = parseFloat(style.marginTop);
var marginBottom = parseFloat(style.marginBottom);
var borderTopWidth = parseFloat(style.borderTopWidth);
var borderBottomWidth = parseFloat(style.borderBottomWidth);
return {
delay: delay,
duration: duration,
easing: easing,
css: function (t) { return "overflow: hidden;" +
"opacity: " + (Math.min(t * 20, 1) * opacity) + ";" +
"height: " + (t * height) + "px;" +
"padding-top: " + (t * paddingTop) + "px;" +
"padding-bottom: " + (t * paddingBottom) + "px;" +
"margin-top: " + (t * marginTop) + "px;" +
"margin-bottom: " + (t * marginBottom) + "px;" +
"border-top-width: " + (t * borderTopWidth) + "px;" +
"border-bottom-width: " + (t * borderBottomWidth) + "px;"; }
};
}
exports.fade = fade;
exports.fly = fade$2;
exports.slide = slide;

@@ -23,0 +84,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -18,2 +18,63 @@ 'use strict';

function cubicOut(t) {
var f = t - 1.0;
return f * f * f + 1.0
}
function fade$2(
node,
ref
) {
var delay = ref.delay; if ( delay === void 0 ) delay = 0;
var duration = ref.duration; if ( duration === void 0 ) duration = 400;
var easing = ref.easing; if ( easing === void 0 ) easing = cubicOut;
var x = ref.x; if ( x === void 0 ) x = 0;
var y = ref.y; if ( y === void 0 ) y = 0;
var o = +getComputedStyle(node).opacity;
return {
delay: delay,
duration: duration,
easing: easing,
css: function (t) { return ("transform: translate(" + ((1 - t) * x) + "px, " + ((1 - t) * y) + "px); opacity: " + (t * o)); }
};
}
function slide(
node,
ref
) {
var delay = ref.delay; if ( delay === void 0 ) delay = 0;
var duration = ref.duration; if ( duration === void 0 ) duration = 400;
var easing = ref.easing; if ( easing === void 0 ) easing = cubicOut;
var style = getComputedStyle(node);
var opacity = +style.opacity;
var height = parseFloat(style.height);
var paddingTop = parseFloat(style.paddingTop);
var paddingBottom = parseFloat(style.paddingBottom);
var marginTop = parseFloat(style.marginTop);
var marginBottom = parseFloat(style.marginBottom);
var borderTopWidth = parseFloat(style.borderTopWidth);
var borderBottomWidth = parseFloat(style.borderBottomWidth);
return {
delay: delay,
duration: duration,
easing: easing,
css: function (t) { return "overflow: hidden;" +
"opacity: " + (Math.min(t * 20, 1) * opacity) + ";" +
"height: " + (t * height) + "px;" +
"padding-top: " + (t * paddingTop) + "px;" +
"padding-bottom: " + (t * paddingBottom) + "px;" +
"margin-top: " + (t * marginTop) + "px;" +
"margin-bottom: " + (t * marginBottom) + "px;" +
"border-top-width: " + (t * borderTopWidth) + "px;" +
"border-bottom-width: " + (t * borderBottomWidth) + "px;"; }
};
}
exports.fade = fade;
exports.fly = fade$2;
exports.slide = slide;

4

module.js

@@ -1,1 +0,3 @@

export { default as fade } from 'svelte-transitions-fade';
export { default as fade } from 'svelte-transitions-fade';
export { default as fly } from 'svelte-transitions-fly';
export { default as slide } from 'svelte-transitions-slide';
{
"name": "svelte-transitions",
"version": "1.0.0",
"version": "1.1.0",
"description": "Officially supported transition plugins for Svelte",

@@ -41,4 +41,6 @@ "main": "index.js",

"dependencies": {
"svelte-transitions-fade": "^1.0.0"
"svelte-transitions-fade": "^1.0.0",
"svelte-transitions-fly": "^1.0.1",
"svelte-transitions-slide": "^1.0.0"
}
}
# svelte-transitions
Officially supported transition plugin for [Svelte](https://svelte.technology). Includes the following:
Officially supported transitions plugin for [Svelte](https://svelte.technology). Includes the following:
* [fade](https://github.com/sveltejs/svelte-transitions-fade)
* [fly](https://github.com/sveltejs/svelte-transitions-fly)
* [slide](https://github.com/sveltejs/svelte-transitions-slide)

@@ -7,0 +9,0 @@ ## Usage

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