Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v7.0.1
+ Small fix for Next.js 15.

## v7.0.1
+ Updated README.

Expand Down
2 changes: 0 additions & 2 deletions dist/defaultParams.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions dist/getDefaultParams.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { SnowflakesInnerParams } from './types';
export declare function getDefaultParams(): SnowflakesInnerParams;
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class Snowflakes {
static gid: number;
static instanceCounter: number;
static hasSupport(): boolean;
static defaultParams: SnowflakesInnerParams;
static get defaultParams(): SnowflakesInnerParams;
constructor(params?: SnowflakesParams);
/**
* Start CSS animation.
Expand Down
49 changes: 29 additions & 20 deletions dist/snowflakes.auto.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
/*! Snowflakes | © 2024 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
/*! Snowflakes | © 2025 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
(function () {
'use strict';

var defaultParams = {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
function getDefaultParams() {
return {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
}

/**
* Set inline style.
Expand Down Expand Up @@ -255,6 +257,13 @@
Snowflakes.hasSupport = function () {
return Boolean('onanimationend' in document);
};
Object.defineProperty(Snowflakes, "defaultParams", {
get: function () {
return getDefaultParams();
},
enumerable: false,
configurable: true
});
/**
* Start CSS animation.
*/
Expand Down Expand Up @@ -373,6 +382,7 @@
Snowflakes.prototype.setParams = function (rawParams) {
var params = rawParams || {};
var result = {};
var defaultParams = getDefaultParams();
Object.keys(defaultParams).forEach(function (name) {
result[name] = typeof params[name] === 'undefined' ?
defaultParams[name] :
Expand Down Expand Up @@ -415,7 +425,6 @@
};
Snowflakes.gid = 0;
Snowflakes.instanceCounter = 0;
Snowflakes.defaultParams = defaultParams;
return Snowflakes;
}());

Expand Down
4 changes: 2 additions & 2 deletions dist/snowflakes.auto.min.js

Large diffs are not rendered by default.

45 changes: 25 additions & 20 deletions dist/snowflakes.esm.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/*! Snowflakes | © 2024 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
const defaultParams = {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
/*! Snowflakes | © 2025 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
function getDefaultParams() {
return {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
}

/**
* Set inline style.
Expand Down Expand Up @@ -210,6 +212,9 @@ class Snowflakes {
static hasSupport() {
return Boolean('onanimationend' in document);
}
static get defaultParams() {
return getDefaultParams();
}
constructor(params) {
this.destroyed = false;
this.flakes = [];
Expand Down Expand Up @@ -356,6 +361,7 @@ class Snowflakes {
setParams(rawParams) {
const params = rawParams || {};
const result = {};
const defaultParams = getDefaultParams();
Object.keys(defaultParams).forEach(name => {
result[name] = typeof params[name] === 'undefined' ?
defaultParams[name] :
Expand Down Expand Up @@ -399,6 +405,5 @@ class Snowflakes {
}
Snowflakes.gid = 0;
Snowflakes.instanceCounter = 0;
Snowflakes.defaultParams = defaultParams;

export { Snowflakes as default };
49 changes: 29 additions & 20 deletions dist/snowflakes.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
/*! Snowflakes | © 2024 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
/*! Snowflakes | © 2025 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Snowflakes = factory());
})(this, (function () { 'use strict';

var defaultParams = {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
function getDefaultParams() {
return {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
}

/**
* Set inline style.
Expand Down Expand Up @@ -258,6 +260,13 @@
Snowflakes.hasSupport = function () {
return Boolean('onanimationend' in document);
};
Object.defineProperty(Snowflakes, "defaultParams", {
get: function () {
return getDefaultParams();
},
enumerable: false,
configurable: true
});
/**
* Start CSS animation.
*/
Expand Down Expand Up @@ -376,6 +385,7 @@
Snowflakes.prototype.setParams = function (rawParams) {
var params = rawParams || {};
var result = {};
var defaultParams = getDefaultParams();
Object.keys(defaultParams).forEach(function (name) {
result[name] = typeof params[name] === 'undefined' ?
defaultParams[name] :
Expand Down Expand Up @@ -418,7 +428,6 @@
};
Snowflakes.gid = 0;
Snowflakes.instanceCounter = 0;
Snowflakes.defaultParams = defaultParams;
return Snowflakes;
}());

Expand Down
49 changes: 29 additions & 20 deletions dist/snowflakes.light.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
/*! Snowflakes | © 2024 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
/*! Snowflakes | © 2025 Denis Seleznev | MIT License | https://github.com/hcodes/snowflakes/ */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Snowflakes = factory());
})(this, (function () { 'use strict';

var defaultParams = {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
function getDefaultParams() {
return {
color: '#5ECDEF',
container: document.body,
count: 50,
speed: 1,
stop: false,
rotation: true,
minOpacity: 0.6,
maxOpacity: 1,
minSize: 10,
maxSize: 25,
types: 6,
width: undefined,
height: undefined,
wind: true,
zIndex: 9999,
autoResize: true,
};
}

/**
* Set inline style.
Expand Down Expand Up @@ -258,6 +260,13 @@
Snowflakes.hasSupport = function () {
return Boolean('onanimationend' in document);
};
Object.defineProperty(Snowflakes, "defaultParams", {
get: function () {
return getDefaultParams();
},
enumerable: false,
configurable: true
});
/**
* Start CSS animation.
*/
Expand Down Expand Up @@ -376,6 +385,7 @@
Snowflakes.prototype.setParams = function (rawParams) {
var params = rawParams || {};
var result = {};
var defaultParams = getDefaultParams();
Object.keys(defaultParams).forEach(function (name) {
result[name] = typeof params[name] === 'undefined' ?
defaultParams[name] :
Expand Down Expand Up @@ -418,7 +428,6 @@
};
Snowflakes.gid = 0;
Snowflakes.instanceCounter = 0;
Snowflakes.defaultParams = defaultParams;
return Snowflakes;
}());

Expand Down
4 changes: 2 additions & 2 deletions dist/snowflakes.light.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/snowflakes.min.js

Large diffs are not rendered by default.

Loading