Skip to content

Commit

Permalink
feat: Style optimization and add search reset
Browse files Browse the repository at this point in the history
  • Loading branch information
372798735 committed Apr 20, 2024
1 parent a1ca4f8 commit fa68d7f
Show file tree
Hide file tree
Showing 5 changed files with 574 additions and 289 deletions.
13 changes: 0 additions & 13 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,7 @@ Github 全球/中国用户排名,全球仓库 Star 最多排名,通过 Githu
现在每天可以自动更新了,利用 [GitHub Actions Workflows](https://github.com/actions/starter-workflows) 通过定时器,每天 `00:00` (北京时间早上8:00) 触发 GitHub 的工作流,自动爬数据,将生成的 web 页面提交到 `gh-pages` 分支,并且自动发布 [npm](https://www.npmjs.com/package/@wcj/github-rank) 版本,真香!!

更新时间:<!--GAMFC-->2022-11-05 09:15:32<!--GAMFC-END-->
## 克隆项目

```bash
git clone https://github.com/372798735/github-rank-fork.git
```
```bash
cd github-rank-fork

npm install
```
run
```bash
npm run start
```

## 插件使用

Expand Down
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,6 @@ Now it can be updated automatically every day, using [GitHub Actions Workflows](

Update date: <!--GAMFC-->2024-04-18 05:58:49<!--GAMFC-END-->

## 克隆项目

```bash
git clone https://github.com/372798735/github-rank-fork.git
```
```bash
cd github-rank-fork

npm install
```
run
```bash
npm run start
```
## Plug-in Usage

```bash
npm install @wcj/github-rank --save-dev
```

Users can obtain ranking data by importing data, or directly access the [user leaderboard](https://unpkg.com/@wcj/github-rank/web/index.html) through [UNPKG](https://unpkg.com/@wcj/github-rank/dist/users.json).

Expand Down
22 changes: 20 additions & 2 deletions template/_partial/form_filtering.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
margin-left: 5px;
cursor: pointer;
}
.form_filtering .reset-button {
margin-left: 5px;
}
.hidden {
display: none !important;
}
Expand All @@ -27,8 +30,9 @@
}
</style>
<script>
/** 查询功能 */
function validateForm(event) {
event.preventDefault(); // 阻止默认的表单提交行为
event?.preventDefault(); // 阻止默认的表单提交行为
/** Users 的搜索*/
const name = document.forms["myForm"]["githubName"]?.value.toLowerCase();
Expand Down Expand Up @@ -65,6 +69,14 @@
}
});
}
function resetForm() {
// 获取表单元素
var form = document.forms["myForm"];
// 重置表单
form.reset();
validateForm();
}
</script>
</header>
<div class="form_filtering">
Expand All @@ -85,6 +97,12 @@
<input type="text" id="githubName" name="githubName" />
</div>
<% } %>
<input type="submit" value="查询" />
<input type="submit" value="Search" />
<input
type="reset"
value="Reset"
class="reset-button"
onclick="resetForm()"
/>
</form>
</div>
Loading

0 comments on commit fa68d7f

Please sign in to comment.