{"id":25412324,"url":"https://github.com/xty1992a/intro","last_synced_at":"2025-08-27T11:08:10.893Z","repository":{"id":57138781,"uuid":"180050096","full_name":"xty1992a/intro","owner":"xty1992a","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-10T05:39:08.000Z","size":431,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-10T01:14:37.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xty1992a.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":"2019-04-08T01:55:57.000Z","updated_at":"2019-04-10T05:39:10.000Z","dependencies_parsed_at":"2022-09-03T10:40:59.272Z","dependency_job_id":null,"html_url":"https://github.com/xty1992a/intro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xty1992a/intro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xty1992a%2Fintro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xty1992a%2Fintro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xty1992a%2Fintro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xty1992a%2Fintro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xty1992a","download_url":"https://codeload.github.com/xty1992a/intro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xty1992a%2Fintro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272324360,"owners_count":24914404,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-02-16T11:18:44.628Z","updated_at":"2025-08-27T11:08:10.870Z","avatar_url":"https://github.com/xty1992a.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### 截图上传组件\n\n#### 简介\n一个简单的引导插件.\n支持事件钩子并跳过步骤.\numd格式,可`\u003cscript\u003e`和import引入使用.\n\n[Live Code](https://codepen.io/xty1992a/pen/WWGdKX)\n\n#### 安装\njs: `npm i @redbuck/intro`或`yarn add @redbuck/intro`\n\ncss: 位于`@redbuck/intro/lib/intro.css`\n\n#### 使用\n```\nconst intro = new Intro(options)\n```\n\noptions:\n\n属性 | 类型 | 默认值|描述\n--:|--:|--:|--:\nsteps| `Array` | []|步骤\nstepCount|`Number`|1|播放次数\nstorageKey|`String`|'intro_play_count'|标识播放次数\n\nsteps为一个成员为对象(step)的数组.对象必须包含el,text字段\n\n其中,el字段应为DOM对象,或DOM对象组成的数组,或者是返回前述类型的函数.\n\n引导窗将聚焦这个(些)DOM围合成的矩形.\ntext字段将自动排布在剩余方向中,最大的一个.\n\n\n实例支持浏览器事件风格绑定回调.\n```\nintro.on(event, callback)\n```\n支持事件\n\n事件|参数|描述\n--:|--:|--:|\nbefore-next|{step, next, skip}|下一步之前,传入下一步step对象,调用next以继续插件流程,也可以调用skip跳过该步骤\ndone|无|结束事件\n\n#### 示例\n查看static/demo.html获取全部详情\n```javascript\nconst intro = new Intro({\n  playCount: 3,\n  steps: [\n\t{\n\t  el: $('#left'),\n\t  text: '点击这里,打开新世界大门!',\n\t},\n\t{\n\t// el can be on array\n\t  el: [$('#block1'), $('#block2'), $('#block3')],\n\t  text: '根据你想【赠送的奖励】,选择不同的活动类型',\n\t},\n\t{\n\t  el: $('#block4'),\n\t  text: '选择第5项活动',\n\t},\n\t{\n\t  el: $('#block6'),\n\t  text: '当你同时要赠送多种奖励时，请选择组合送吧！',\n\t},\n\t{\n\t  el: $('#item1'),\n\t  text: '点这里，可以查看和管理所有的活动1',\n\t},\n\t{\n\t  el: $('#item2'),\n\t  text: '点这里，可以查看和管理所有的活动2',\n\t},\n\t{\n\t  el: $('#item3'),\n\t  text: '点这里，可以查看和管理所有的活动3',\n\t},\n\t{\n\t  el: $('#item4'),\n\t  text: '点这里，可以查看和管理所有的活动4',\n\t},\n\t{\n\t  el: $('#item5'),\n\t  text: '点这里，可以查看和管理所有的活动5',\n\t},\n  ],\n})\n\n// if you did not listen this event, intro will auto next\nintro.on('before-next', async ({step, next, skip}) =\u003e {\n  // do something\n  console.log('before-next', step)\n  // continue this step\n  if (step.el) {\n\tnext()\n  }\n  // you can skip this step\n  else {\n\tskip()\n  }\n})\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxty1992a%2Fintro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxty1992a%2Fintro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxty1992a%2Fintro/lists"}