vevet
Version:
Vevet is a JavaScript library for creative development that simplifies crafting rich interactions like split text animations, carousels, marquees, preloading, and more.
35 lines • 1.59 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SnapKeyboard = void 0;
var utils_1 = require("../../../../utils");
var SnapLogic_1 = require("../SnapLogic");
var SnapKeyboard = /** @class */ (function (_super) {
__extends(SnapKeyboard, _super);
function SnapKeyboard(snap) {
var _this = _super.call(this, snap) || this;
_this.addDestructor((0, utils_1.addEventListener)(snap.container, 'scroll', function () { return _this._handleScroll(); }));
return _this;
}
/** Handle scroll lock */
SnapKeyboard.prototype._handleScroll = function () {
this.snap.container.scrollTo({ top: 0, left: 0, behavior: 'instant' });
};
return SnapKeyboard;
}(SnapLogic_1.SnapLogic));
exports.SnapKeyboard = SnapKeyboard;
//# sourceMappingURL=index.js.map