Skip to content

Commit

Permalink
导航栏样式增加激活状态(.enabled)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benature committed Apr 18, 2020
1 parent d8cae10 commit 003e608
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ conda activate <venvName> # 小白流程不用这条命令
python manage.py runserver
```

打开[localhost:8000](localhost:8000/),开始背单词之旅吧 🤓
默认情况下会自动在默认浏览器打开<localhost:8000/>,开始背单词之旅吧 🤓
>如果您没有修改过配置但不能自动打开浏览器,请[提交 issue 反馈](https://github.com/Benature/WordReview/issues)
当你想要更新代码的时候,请
当您想要更新代码的时候,请

```shell
git pull
Expand Down Expand Up @@ -171,6 +172,7 @@ tain
### 更新日志

- 2020.04
- update: 导航栏样式增加激活状态(`.enabled`) @04-18
- update: 配置文件更换为`.conf`文件(以支持默认参数) @04-18
- feature: 命令行启动后自动打开浏览器 ([Issue#4](https://github.com/Benature/WordReview/issues/4)) @04-16
- feature: 新增[在线预览](https://benature.github.io/WordReview/) @04-16
Expand Down
2 changes: 1 addition & 1 deletion apps/review/templates/review.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nav.navbar.navbar-light.bg-light.sticky-top
button#btn-quick-jump.btn 跳转
div.navbar-nav.ml-auto.flex-row
li.nav-item(style="margin-right:20px;")
a.nav-link.repeat.cur-p 重现模式:开
a.nav-link.repeat.cur-p.enabled 重现模式:开
li.nav-item
a.nav-link.sort-array 顺序
li.nav-item
Expand Down
8 changes: 4 additions & 4 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ git clone https://github.com/Benature/WordReview.git
</details>
</br>

进入项目文件夹内,复制一份`./config_sample.py`文件,改名为`./config.py`
进入项目文件夹内,复制一份`./config_sample.conf`文件,改名为`./config.conf`

# 2. Python 环境

<b><details><summary>选择一:开发者流程</summary></b>

1. Install `Miniconda` (recommanded) or `Anaconda` at first.
2. create a virtual environment
名字随便定,这里以`tgword`为例
名字随便定,这里以`word`为例

```shell
conda create -n tgword python=3
Expand All @@ -35,10 +35,10 @@ conda create -n tgword python=3
3. activate the environment

```shell
source activate tgword
source activate word
```

此时命令行左边应该有显示`(tgword)`
此时命令行左边应该有显示`(word)`

4. install requirements

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<button id="btn-quick-jump" class="btn">跳转</button>
</div>
<div class="navbar-nav ml-auto flex-row">
<li style="margin-right:20px;" class="nav-item"><a class="nav-link repeat cur-p">重现模式:开</a>
<li style="margin-right:20px;" class="nav-item"><a class="nav-link repeat cur-p enabled">重现模式:开</a>
</li>
<li class="nav-item"><a class="nav-link sort-array">顺序</a>
</li>
Expand Down
9 changes: 5 additions & 4 deletions static/js/review.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,6 @@ $(function () {
}
}

function selectWord() {
return ++wordIndex;
}
// =============================================================
// 页面初始渲染
// =============================================================
Expand Down Expand Up @@ -575,7 +572,7 @@ $(function () {
wordCount++;
hotUpdate(remember);
if (wordIndex != wordArray.length - 1) {
wordIndex = selectWord();
wordIndex++;
$('.hide').addClass('d-none')
renderWord(wordArray[wordIndex]);
} else {
Expand Down Expand Up @@ -673,6 +670,8 @@ $(function () {
default:
console.error('未知' + text);
}
$('.sort-array').removeClass('enabled');
$(this).addClass('enabled');
$('.hide').addClass('d-none');
sortMode = text;
console.log(text);
Expand All @@ -688,10 +687,12 @@ $(function () {
if ($(this).text() == '重现模式:关') {
repeatMode = true
$(this).text('重现模式:开')
.addClass('enabled');
layer.msg('重现模式已开')
} else if ($(this).text() == '重现模式:开') {
repeatMode = false
$(this).text('重现模式:关')
.removeClass('enabled');
layer.msg('重现模式已关')
} else {
layer.msg('未知选择:' + $(this).text())
Expand Down
8 changes: 8 additions & 0 deletions static/scss/review.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ i{
font-size: 16px;
color: #c46943;
// text-align: center;
background: #f3f4f4;
border-radius: 0.25rem;
padding: 0px 2px;
}
}

Expand All @@ -203,3 +206,8 @@ i{
}
}

.nav-item{
.enabled{
color: black !important;
}
}
8 changes: 7 additions & 1 deletion staticsfile/scss/review.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 003e608

Please sign in to comment.