From b5cd652ea30532c6839c7e7fad6baf58dd6fc54a Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 4 Jan 2024 12:36:55 +0800 Subject: update --- public/js/getrepo.js | 2 +- public/js/mouseblob.js | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'public') diff --git a/public/js/getrepo.js b/public/js/getrepo.js index 3cfc14e5..c1995466 100644 --- a/public/js/getrepo.js +++ b/public/js/getrepo.js @@ -39,7 +39,7 @@ var getProfile = function () { getProfile(); var displayProfile = function displayProfile(profile) { var userInfo = document.querySelector('.user-info'); - userInfo.innerHTML = "\n\t\t
\n\t\t\t\"user\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t

").concat(profile.name, "

\n\t\t\t\n\t\t\t

").concat(profile.bio, "

\n\t\t\t

\n\t\t\tMail: ").concat(profile.email, "\n\t\t\t

\n\t\t\t

\n\t\t\t\tLocation: ").concat(profile.location, "\n\t\t\t

\n\t\t\t

\n\t\t\t\t@").concat(profile.login, " \n\t\t\t\tRepos: ").concat(profile.public_repos, "\n\t\t\t\tGists: ").concat(profile.public_gists, "\n\t\t\t

\n\t\t
\n\t"); + userInfo.innerHTML = "\n\t\t
\n\t\t\t\"user\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t

").concat(profile.name, "

\n\t\t\t\n\t\t\t

").concat(profile.bio, "

\n\t\t\t

\n\t\t\tMail: ").concat(profile.email, "\n\t\t\t

\n\t\t\t

\n\t\t\t\tLocation: ").concat(profile.location, "\n\t\t\t

\n\t\t\t

\n\t\t\t\t@").concat(profile.login, " \n\t\t\t\tRepos: ").concat(profile.public_repos, "\n\t\t\t\tGists: ").concat(profile.public_gists, "\n\t\t\t

\n\t\t
\n\t"); }; var getRepos = function () { var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee2() { diff --git a/public/js/mouseblob.js b/public/js/mouseblob.js index 69cbacac..32e082e9 100644 --- a/public/js/mouseblob.js +++ b/public/js/mouseblob.js @@ -1,15 +1,24 @@ "use strict"; window.onpointermove = function (event) { - var x = event.pageX; - var y = event.pageY; + var pageX = event.pageX, + pageY = event.pageY; + var momentumX = pageX + pageX - blob.offsetLeft; + var momentumY = pageY + pageY - blob.offsetTop; blob.animate({ - left: "".concat(x, "px"), - top: "".concat(y, "px") + left: "".concat(momentumX, "px"), + top: "".concat(momentumY, "px") + }, { + duration: 1500, + fill: "forwards" + }); + blob.animate({ + left: "".concat(pageX, "px"), + top: "".concat(pageY, "px") }, { duration: 1000, fill: "forwards" }); - blob.style.left = x + 'px'; - blob.style.top = y + 'px'; + blob.style.left = "".concat(pageX, "px"); + blob.style.top = "".concat(pageY, "px"); }; \ No newline at end of file -- cgit v1.2.3