{"id":13452188,"url":"https://github.com/appleple/lookforward","last_synced_at":"2025-04-05T08:09:51.163Z","repository":{"id":24591180,"uuid":"101994989","full_name":"appleple/lookforward","owner":"appleple","description":"A small library that helps you to create smooth transitions between pages with the easiest way","archived":false,"fork":false,"pushed_at":"2022-06-22T05:43:10.000Z","size":1556,"stargazers_count":303,"open_issues_count":12,"forks_count":22,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-29T07:07:06.549Z","etag":null,"topics":["es2015","npm","page-transitions"],"latest_commit_sha":null,"homepage":"https://appleple.github.io/lookforward/","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/appleple.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-31T11:44:43.000Z","updated_at":"2024-11-30T05:27:06.000Z","dependencies_parsed_at":"2022-09-15T07:20:26.582Z","dependency_job_id":null,"html_url":"https://github.com/appleple/lookforward","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flookforward","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flookforward/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flookforward/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flookforward/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleple","download_url":"https://codeload.github.com/appleple/lookforward/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305935,"owners_count":20917208,"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":["es2015","npm","page-transitions"],"created_at":"2024-07-31T07:01:16.402Z","updated_at":"2025-04-05T08:09:51.131Z","avatar_url":"https://github.com/appleple.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# lookforward\n[![npm version](https://badge.fury.io/js/lookforward.svg)](https://badge.fury.io/js/lookforward)\n[![CircleCI](https://circleci.com/gh/appleple/lookforward/tree/master.svg?style=shield)](https://circleci.com/gh/appleple/lookforward/tree/master)\n[![npm download](http://img.shields.io/npm/dm/lookforward.svg)](https://www.npmjs.com/package/lookforward)\n[![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/appleple/lookforward/master/LICENSE)\n\nIt supports simple page transitions using HistoryAPI\n\nSee [https://appleple.github.io/lookforward/](https://appleple.github.io/lookforward/) for complete docs and demos\u003cbr/\u003e\n\n## Feature\n\n\n## Installation\n- [npm](https://www.npmjs.com/package/lookforward)\n- [standalone](https://raw.githubusercontent.com/appleple/smart-photo/master/js/lookforward.js)\n\nvia npm\n```shell\nnpm install lookforward --save\n```\n\nor yarn\n\n```shell\nyarn add lookforward\n```\n\n## Usage\nrequire\n```js\nconst lookforward = require('lookforward');\n```\n\nlookforward.js\n```js\nwindow.addEventListener('DOMContentLoaded',function(){\n    new LookForward(\".js-lookforward\");\n});\n```\n\njquery-lookforward.js\n```js\n$(function(){\n    $(\".js-lookforward\").lookforward();\n});\n```\n\n```html\n\u003ca href=\"./a.html\" class=\"js-lookforward\" data-transition-enter=\"slideup\" data-transition-leave=\"slidedown\"\u003eOpen\u003c/a\u003e\n```\n\n### Option\n\n```js\n{\n  classNames: {\n    LookForward: 'lookforward',\n    LookForwardBody: 'lookforward-body',\n    LookForwardInner: 'lookforward-inner',\n    LookForwardClose: 'lookforward-close',\n    LookForwardCloseBtn: 'lookforward-close-btn',\n    LookForwardHeader: 'lookforward-header',\n    LookForwardFooter: 'lookforward-footer'\n  },\n  scrapedArea: 'body', // Area to be scraped\n  useHistoryApi: true // Rewrite URL on page transitions using HistoryAPI\n}\n```\n\n### Event\n\n```js\n// when the modal is opened\nlookforward.on('open',function(e){\n  console.log('open');\n});\n\n// when the modal is closed\nlookforward.on('close',function(e){\n  console.log('close');\n});\n\n// when all modals are closed\nlookforward.on('closeAll',function(e){\n  console.log('closeAll');\n});\n```\n\n### Tips\n\nIf you want to execute JavaScript on each pages, I recommend you specifying scraped area so to exclude common JavaScript such as jQuery and include local JavaScript.\nThe following is the example how\n\n```html\n\u003cbody\u003e\n  \u003cdiv class=\"js-lookforward-body\"\u003e\n    \u003c!-- contents here --\u003e\n    \u003cscript src=\"/path/to/local.js\"\u003e\u003c/script\u003e\n  \u003c/div\u003e\n  \u003cscript src=\"/path/to/lookforward.js\"\u003e\u003c/script\u003e\n  \u003cscript\u003e\n  new LookForward('.js-lookforward', {\n    scrapedArea: '.js-lookforward-body',\n    execInnerScript: true\n  });\n  \u003c/script\u003e\n\u003c/body\u003e\n```\n\n\n## Download\n[Download ZIP](https://github.com/appleple/lookforward/archive/master.zip)\n\n## Github\n[https://github.com/appleple/lookforward](https://github.com/appleple/lookforward)\n\n## Contributor\n[@steelydylan](https://github.com/steelydylan)\n\n## License\nCode and documentation copyright 2017 by appleple, Inc. Code released under the [MIT License](https://github.com/appleple/lookforward/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Flookforward","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleple%2Flookforward","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Flookforward/lists"}