{"id":17178464,"url":"https://github.com/scottkellum/momentum","last_synced_at":"2025-04-13T17:11:31.119Z","repository":{"id":57301309,"uuid":"143487992","full_name":"scottkellum/momentum","owner":"scottkellum","description":"Track movement and basic events with CSS custom properties","archived":false,"fork":false,"pushed_at":"2025-02-13T00:06:00.000Z","size":56,"stargazers_count":19,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T08:01:50.111Z","etag":null,"topics":["css","parallax","scrolling","touch-events"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottkellum.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-04T01:28:48.000Z","updated_at":"2025-02-13T00:04:02.000Z","dependencies_parsed_at":"2022-09-03T10:00:15.265Z","dependency_job_id":null,"html_url":"https://github.com/scottkellum/momentum","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottkellum%2Fmomentum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottkellum%2Fmomentum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottkellum%2Fmomentum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottkellum%2Fmomentum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottkellum","download_url":"https://codeload.github.com/scottkellum/momentum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750108,"owners_count":21155686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","parallax","scrolling","touch-events"],"created_at":"2024-10-15T00:07:26.046Z","updated_at":"2025-04-13T17:11:31.095Z","avatar_url":"https://github.com/scottkellum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Momentum\n\nAdd page events like tracking scroll position, mouse position, device orientation, and more to your CSS! [See an example of momentum in use](https://momentumcss.netlify.com/).\n\n## Installation\n\nAdd [the js](https://raw.githubusercontent.com/scottkellum/momentum/master/js/momentum.min.js) inside your `\u003chead\u003e` tag.\n\n## Usage\n\nAll values are unitless meaning you will need to add your units to them. For example, `calc(var(--scrolly)*1px)` results in a pixel value for the vertical scroll position.\n\n### Global variables\n\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003eProperty\u003cth\u003eDescription\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--loaded\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003e\u003ccode\u003e0\u003c/code\u003e before the page is loaded, \u003ccode\u003e1\u003c/code\u003e when the page is done loading.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--viewportwidth\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eThe width of the viewport.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--viewportheight\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eThe height of the viewport.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--scrollx\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eDistance scrolled on the X axis.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--scrolly\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eDistance scrolled on the Y axis.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--clientx\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003ePointer coordinates on the X axis. This includes touch events.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--clienty\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003ePointer coordinates on the Y axis. This includes touch events.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--pointerdown\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eBoolean value if the pointer is up or down. Use touchpoints below for touch events.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--touchpoints\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eNumber of touch points currently active.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--orientationalpha\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eGyroscopic orientation along the alpha axis. Only avalible in some mobile browsers.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--orientationbeta\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eGyroscopic orientation along the beta axis. Only avalible in some mobile browsers.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--orientationgamma\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eGyroscopic orientation along the gamma axis. Only avalible in some mobile browsers.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--compassheading\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eCompass heading. Only avalible in some mobile browsers.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--random\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eA random value between \u003ccode\u003e0\u003c/code\u003e and \u003ccode\u003e1\u003c/code\u003e.\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--noise\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eA random value between \u003ccode\u003e0\u003c/code\u003e and \u003ccode\u003e1\u003c/code\u003e updated every \u003ccode\u003e100ms\u003c/code\u003e unless otherwise specified with \u003ccode\u003e--noise-interval\u003c/code\u003e on the \u003ccode\u003e\u0026lt;body\u0026gt;\u003c/code\u003e tag. Use a \u003ccode\u003e--noise-interval\u003c/code\u003e of \u003ccode\u003e0\u003c/code\u003e to disable jitter.\n\u003c/table\u003e\n\n### Element variables\n\nTo trigger element variables, add the class `momentumcss` to your elemnt.\n\n\u003ctable\u003e\n\u003ctr\u003e\u003cth style=\"width:14em\"\u003eProperty\u003cth\u003eDescription\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--width\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eWidth of the element\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--height\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eHeight of the element\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--top\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eElement offsetTop value\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--left\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eElement offsetLeft value\n\u003ctr\u003e\u003ctd\u003e\u003cpre\u003e\u003ccode\u003e--random\u003c/code\u003e\u003c/pre\u003e\u003ctd\u003eA random value between \u003ccode\u003e0\u003c/code\u003e and \u003ccode\u003e1\u003c/code\u003e. This overrides the global value in the CSS cascade.\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottkellum%2Fmomentum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottkellum%2Fmomentum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottkellum%2Fmomentum/lists"}