@linear_non/stellar-libs 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linear_non/stellar-libs",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Reusable JavaScript libraries for Non-Linear Studio projects.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -13,6 +13,7 @@ export default class Smooth {
13
13
  this.threshold = 100
14
14
  this.sections = null
15
15
  this.scrollbar = null
16
+ this.dpr = Math.max(1, Math.round(window.devicePixelRatio || 1))
16
17
  this.init()
17
18
  }
18
19
 
@@ -81,7 +82,9 @@ export default class Smooth {
81
82
  }
82
83
 
83
84
  getTransform(transform) {
84
- return `translate3d(0, ${-transform}px, 0)`
85
+ let y = -transform
86
+ y = Math.round(y * this.dpr) / this.dpr
87
+ return `translate3d(0, ${y}px, 0)`
85
88
  }
86
89
 
87
90
  getVars(el, speed) {