Skip to content

Commit

Permalink
add credits prop
Browse files Browse the repository at this point in the history
  • Loading branch information
rikschennink committed Nov 2, 2020
1 parent a983dde commit 9375aa7
Show file tree
Hide file tree
Showing 30 changed files with 226 additions and 177 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v10.15.3
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

**1.8.0** | 02-11-2020

- Add credits property.


**1.7.2** | 25-06-2019

- Fix issue with JavaScript based templates not rendering correctly.
Expand Down
76 changes: 10 additions & 66 deletions dist/flip.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* @pqina/tick v1.7.6 - Counters Made Easy
* @pqina/tick v1.8.0 - Counters Made Easy
* Copyright (c) 2020 PQINA - https://github.com/pqina/tick/
*/
.tick {
Expand All @@ -18,6 +18,14 @@
max-width: 100%; }
.tick span[data-view] {
display: inline-block; }
.tick .tick-credits {
position: absolute;
right: 0;
bottom: 0;
opacity: .4;
text-decoration: none;
font-size: 11px;
color: inherit; }
.tick [data-layout~='pad'] {
margin: -.25em; }
.tick [data-layout~='pad'] > * {
Expand Down Expand Up @@ -182,72 +190,8 @@
top: 0;
bottom: 0; }

/*
// Default Visual Style
.tick-text[data-style*='transition'] {
// prevents width changes when animating between empty space and characters
min-width:1ex;
text-align:center;
}
// flipper
.tick-flip {
// distance from other possible flippers
margin-left:.0625em;
margin-right:.0625em;
// prevents width changes when animating between empty space and characters
min-width:1.125em;
// sets default border radius
border-radius:.125em;
// default spacing
letter-spacing: .25em;
text-indent: .25em;
}
.tick-flip-front,
.tick-flip-back {
color:#eee;
background-color:#333;
box-shadow:0 .125em .3125em rgba(0,0,0,.25), 0 .02125em .06125em rgba(0,0,0,.25);
}
// matrix
.tick-matrix-char {
margin:0 .05em;
}
.tick-matrix-pixel {
width:5px;
height:5px;
margin:1px;
background-color:currentColor;
border-radius:2px;
}
// meter (horizontal / vertical)
.tick-meter-rail {
background-color:#eee;
}
.tick-meter-fill {
background-color:currentColor;
}
// meter (ring)
.tick-meter canvas {
}
*/

/*
* @pqina/flip v1.7.7 - A Beautifully Animated Flip Clock
* @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock
* Copyright (c) 2020 PQINA - https://pqina.nl/flip/
*/
/**
Expand Down
28 changes: 25 additions & 3 deletions dist/flip.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if (!Object.keys) {
/* eslint-disable */

/*
* @pqina/flip v1.7.7 - A Beautifully Animated Flip Clock
* @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock
* Copyright (c) 2020 PQINA - https://pqina.nl/flip/
*/
(function(root, undefined) {
Expand Down Expand Up @@ -743,7 +743,7 @@ module.exports = index;
/* eslint-disable */

/*
* @pqina/tick v1.7.6 - Counters Made Easy
* @pqina/tick v1.8.0 - Counters Made Easy
* Copyright (c) 2020 PQINA - https://github.com/pqina/tick/
*/
(function(root, plugins, undefined) {
Expand Down Expand Up @@ -3644,6 +3644,7 @@ var Tick = function () {
this._constants = null;
this._presets = null;
this._updater = null;
this._credits = null;

// callback methods
this._didInit = null;
Expand Down Expand Up @@ -3735,6 +3736,7 @@ var Tick = function () {
this._value = this._options.value;
this._presets = this._options.presets;
this._constants = this._options.constants;
this._credits = this._options.credits;

// no more use of options behind this line
// ---------------------------------------
Expand Down Expand Up @@ -3775,6 +3777,18 @@ var Tick = function () {

// done with init
this._didInit(this, this.value);

// credits
if (this._credits) {
var credits = document.createElement('a');
credits.className = 'tick-credits';
credits.href = this._credits.url;
credits.tabindex = -1;
credits.target = '_blank';
credits.rel = 'noopener noreferrer';
credits.textContent = this._credits.label;
this._element.appendChild(credits);
}
}
}, {
key: '_update',
Expand Down Expand Up @@ -3819,7 +3833,11 @@ var Tick = function () {
didInit: function didInit(tick) {},
didUpdate: function didUpdate(tick, value) {},
willDestroy: function willDestroy(tick) {},
didDestroy: function didDestroy(tick) {}
didDestroy: function didDestroy(tick) {},
credits: {
label: 'Powered by PQINA',
url: 'https://pqina.nl/?ref=credits'
}
};
}
}]);
Expand Down Expand Up @@ -3936,6 +3954,10 @@ var getOptionsFromAttributes = function getOptionsFromAttributes(element) {
}
}

if (dataset.credits === 'false') {
options.credits = false;
}

return options;
};

Expand Down
4 changes: 2 additions & 2 deletions dist/flip.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tick.view.flip.amd.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */

/*
* @pqina/flip v1.7.7 - A Beautifully Animated Flip Clock
* @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock
* Copyright (c) 2020 PQINA - https://pqina.nl/flip/
*/
define(function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/tick.view.flip.commonjs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */

/*
* @pqina/flip v1.7.7 - A Beautifully Animated Flip Clock
* @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock
* Copyright (c) 2020 PQINA - https://pqina.nl/flip/
*/
module.exports = (function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/tick.view.flip.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* @pqina/flip v1.7.7 - A Beautifully Animated Flip Clock
* @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock
* Copyright (c) 2020 PQINA - https://pqina.nl/flip/
*/
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/tick.view.flip.global.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */

/*
* @pqina/flip v1.7.7 - A Beautifully Animated Flip Clock
* @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock
* Copyright (c) 2020 PQINA - https://pqina.nl/flip/
*/
(function(root, undefined) {
Expand Down
Loading

0 comments on commit 9375aa7

Please sign in to comment.