Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
5,253 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#------------------- | ||
# Emacs | ||
*~ | ||
*.elc | ||
[#]*[#] | ||
*[#] | ||
.[#]* | ||
|
||
|
||
#------------------- | ||
# OS junk | ||
.DS_Store | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
Thumbs.db | ||
|
||
#------------------- | ||
# site | ||
_site | ||
.sass-cache | ||
.jekyll-metadata | ||
Gemfile.lock | ||
.jekyll-metadata | ||
.vscode | ||
.idea | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cslearner.cn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Settings | ||
title: 骑鹿人的计算机科学自学指南 | ||
owner: "DeerRIDER" | ||
# url: "bcqlr.com" | ||
baseurl: "" | ||
# baseurl: "/pRoJEct-NeGYa" | ||
permalink: /:title/ | ||
description: "" | ||
markdown: kramdown | ||
webrick: | ||
headers: | ||
Access-Control-Allow-Origin: "*" | ||
## Global Variables | ||
email: "akiritsu@outlook.com" | ||
github: "akiritsu/cslearner.cn" | ||
# path to: css/, fonts/, img/ and js/ | ||
assets_path: "/assets" # i.e. "/assets" | ||
statement: "Designed by DeerRIDER, All Rights Reserved" | ||
# default max toc levels: 1 - 6 (h1 - h6) | ||
toc_level: 3 | ||
# texts randomly displayed in background | ||
bgtext: "αβγδεζηθικλμνξοπρστυφχψω∷∫∮∝∞∧∨∑∏∪∩∈∵∴⊥‖∠⌒⊙≌∽√" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- background animations --> | ||
<div class="div_bg"> | ||
<canvas id="c"></canvas> | ||
</div> | ||
<script> | ||
var c = document.getElementById("c"); | ||
var ctx = c.getContext("2d"); | ||
c.height = window.innerHeight; | ||
c.width = window.innerWidth; | ||
var txts = "{{site.bgtext}}"; | ||
txts = txts.split(""); | ||
var font_size = 12; | ||
var columns = c.width / font_size; | ||
var drops = []; | ||
for (var x = 0; x < columns; x++) drops[x] = 1; | ||
|
||
function draw() { | ||
ctx.fillStyle = "rgba(0, 0, 0, 0.05)"; | ||
ctx.fillRect(0, 0, c.width, c.height); | ||
ctx.fillStyle = "#490"; | ||
ctx.font = font_size + "px arial"; | ||
for (var i = 0; i < drops.length; i++) { | ||
var text = txts[Math.floor(Math.random() * txts.length)]; | ||
ctx.fillText(text, i * font_size, drops[i] * font_size); | ||
if (drops[i] * font_size > c.height || Math.random() > 0.98) drops[i] = 0; | ||
drops[i]++; | ||
} | ||
} | ||
setInterval(draw, 20); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="footer"> | ||
<nav class="nav_bar"> | ||
<ul> | ||
<li class="copyright"> | ||
© 2019 | ||
</li> | ||
{% if site.statement %} | ||
<li> | ||
{{ site.statement }} | ||
</li> | ||
{% endif %} | ||
</nav> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<head> | ||
<meta charset="utf-8" /> | ||
<!-- multi-device width --> | ||
<meta content="width=device-width, initial-scale=1" name="viewport" /> | ||
<!-- site description --> | ||
{% if page.excerpt %} | ||
{% assign desc = page.excerpt | strip_html | | ||
strip_newlines | truncate: 160 %} | ||
{% else %} | ||
{% assign desc = site.description | ||
%} | ||
{% endif %} | ||
<meta content="{{ desc }}" name="description" /> | ||
<!-- referer for 3rd-part images--> | ||
<meta content="no-referrer" name="referrer" /> | ||
<!-- title --> | ||
<title> | ||
{% if page.title %} | ||
{{ page.title | escape }} | ||
{% else %} | ||
{{ site.title | escape }} | ||
{% endif %} | ||
</title> | ||
<!-- icon --> | ||
<link href="{{site.url }}{{site.baseurl}}{{site.assets_path}}/img/favicon.ico?" rel="shortcut icon bookmark" type="image/x-icon" /> | ||
<!-- main stylesheet --> | ||
<link rel="stylesheet" href="{{site.url}}{{site.baseurl}}{{site.assets_path}}/css/main.css" type="text/css" /> | ||
<!-- fa 5.9.0 --> | ||
<link rel="stylesheet" href="{{site.url}}{{site.baseurl}}{{site.assets_path}}/css/fa.min.css" type="text/css" /> | ||
<!-- rouge theme--> | ||
<link rel="stylesheet" href="{{site.url}}{{site.baseurl}}{{site.assets_path}}/css/rouge-bg.css" /> | ||
<!-- mathjax 2.7.5 --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML" async></script> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
<div class="header"> | ||
<nav class="nav_bar"> | ||
<ul> | ||
<!-- left header --> | ||
<li class="li_left"> | ||
<!-- home --> | ||
{% if page.home_btn != false %} | ||
<a class="header_btn" href="{{ site.url }}{{ site.baseurl }}"> | ||
<i class="fa fa-home"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Home</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
{% endif %} | ||
<!-- email --> | ||
{% if site.email != ""%} | ||
<a class="header_btn" href="mailto://{{ site.email }}"> | ||
<i class="fa fa-envelope-square"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Email</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
{% endif %} | ||
<!-- github --> | ||
{% if site.github != "" %} | ||
<a class="header_btn" href="https://github.com/{{ site.github }}"> | ||
<i class="fa fa-github"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Github</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
{% endif %} | ||
<!-- maximize --> | ||
{% if page.maximize != false %} | ||
<a class="header_btn" id="mxmz_btn" onclick="toggle_maximize()"> | ||
<i class="fa fa-window-maximize"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text" id="mxmz_text">Maximize</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
{% endif %} | ||
<!-- access token --> | ||
{% if page.encrypted_text == true %} | ||
<a class="header_btn" id="acs_btn" onclick="apply_token()"> | ||
<i class="fa fa-key"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Token</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
<textarea | ||
class="access_token" | ||
rows="1" | ||
cols="8" | ||
id="acs_tkn" | ||
></textarea> | ||
{% endif %} | ||
</li> | ||
<!-- right header --> | ||
<span class="span_right"> | ||
<!-- popup table of content --> | ||
{% if page.toc != false %} | ||
<a class="header_btn" onclick="scroll_percentage(-0.88)"> | ||
<i class="fa fa-backward"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Prev</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
<!-- scroll down --> | ||
<a class="header_btn" onclick="scroll_percentage(0.88)"> | ||
<i class="fa fa-forward"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Next</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
<!-- popup table of content --> | ||
<a class="header_btn popup_btn" onclick="toggle_toc()"> | ||
<i class="fa fa-bars"> | ||
{% if page.btn_text != false %} | ||
<p class="btn_text">Content</p> | ||
{% endif %} | ||
</i> | ||
</a> | ||
{% else site.title %} | ||
<a class="title">{{ site.title }}</a> | ||
{% if site.owner != ""%} | ||
<a class="owner"> - {{ site.owner }}</a> | ||
{% endif %}{% endif %} | ||
</span> | ||
</ul> | ||
</nav> | ||
<hr /> | ||
</div> | ||
{% if page.toc != false %} | ||
<!-- table of content --> | ||
<div class="div_toc toc" id="popup_toc"> | ||
{% if page.toc_level %} {% assign toclv = page.toc_level %} {% elsif | ||
site.toc_level %} {% assign toclv = site.toc_level %} {% else} {% assign toclv | ||
= 3 %} {% endif %} {% include toc.html html=page sanitize=true class="ul_toc" | ||
id="ul_toc" h_min=1 h_max=toclv %} | ||
</div> | ||
<!-- toggle toc --> | ||
<script> | ||
function toggle_toc() { | ||
var popup = document.getElementById("popup_toc"); | ||
popup.classList.toggle("show"); | ||
} | ||
</script> | ||
<!-- scroll page --> | ||
<script> | ||
function scroll_percentage(mtpler) { | ||
document | ||
.getElementById("div_atcl") | ||
.scrollBy(0, window.innerHeight * mtpler); | ||
} | ||
</script> | ||
{% endif %} {% if page.maximize != false %} | ||
<!-- toggle maximize --> | ||
<script> | ||
var ctner_state = 0; | ||
var ctner = document.getElementById("ctner"); | ||
function toggle_maximize() { | ||
if (ctner_state == 0) { | ||
ctner.style.width = "100%"; | ||
ctner.style.height = "100%"; | ||
ctner.style.top = "0"; | ||
ctner.style.maxWidth = "100%"; | ||
if (document.getElementById("mxmz_text")) { | ||
document.getElementById("mxmz_text").innerHTML = "Restore"; | ||
} | ||
ctner_state = 1; | ||
} else if (ctner_state == 1) { | ||
ctner.style.width = "84%"; | ||
ctner.style.height = "97%"; | ||
ctner.style.top = "2%"; | ||
ctner.style.maxWidth = "1240px"; | ||
if (document.getElementById("mxmz_text")) { | ||
document.getElementById("mxmz_text").innerHTML = "Maximize"; | ||
} | ||
ctner_state = 0; | ||
} | ||
} | ||
</script> | ||
{% endif %} {% if page.encrypted_text == true %} | ||
<!-- encrypt and decrypt --> | ||
<script | ||
src="{{ site.url }}{{ site.baseurl }}{{ site.assets_path }}/js/sjcl.js" | ||
async | ||
></script> | ||
<script> | ||
function decrypt_all(pwd, class_name) { | ||
var elem_clct = document.getElementsByClassName(class_name); | ||
if (elem_clct.length == 0) { | ||
console.log("No texts to decrypt!"); | ||
return false; | ||
} | ||
for (acc = 0; acc < elem_clct.length; acc++) { | ||
var encrypted = elem_clct[acc].innerHTML; | ||
var ct = | ||
'{"iv":"' + | ||
encrypted.substring(0, 22) + | ||
'==",salt:"","ct":"' + | ||
encrypted.substring(22) + | ||
'"}'; | ||
try { | ||
var txt = sjcl.json.decrypt(pwd, ct); | ||
} catch (e) { | ||
alert("Invalid Access Token!"); | ||
return; | ||
} | ||
elem_clct[acc].innerHTML = txt; | ||
} | ||
return true; | ||
} | ||
function apply_token() { | ||
var tkn = document.getElementById("acs_tkn"); | ||
if (decrypt_all(tkn.value, "encrypted")) { | ||
tkn.style.display = "none"; | ||
document.getElementById("acs_btn").style.display = "none"; | ||
} | ||
} | ||
</script> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% if page.post_list == "date" %} | ||
<!-- list of articles: sort by date (by default) --> | ||
<h1 class="loa">计算机科学免费在线资源</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th> 标题 </th> | ||
<th> 日期 </th> | ||
<th> 系列 </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for post in site.posts %} | ||
{% if page.finished != false %} | ||
</tr> | ||
<td class="td_title"><a href="{{post.url}}">{{post.title}}</a></td> | ||
<td class="td_date">{{post.date | date: "%b %d, %y"}}</td> | ||
<td class="td_category">{{post.category}}</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% elsif page.post_list == "category" %} | ||
<!-- list of articles: sorted by category--> | ||
<h1>Post List, sorted by Category</h1> | ||
<table> | ||
{% for cate in site.categories %} | ||
{% capture cate_name %} | ||
{{ cate | first }} | ||
{% endcapture %} | ||
<table id="t_{{ cate_name | slugzie }}"> | ||
<thead> | ||
<tr> | ||
<th id="cate_name"><i class="fa fa-tags"></i>{{ cate_name }}</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for post in cate[1] %} | ||
<tr> | ||
<td class="td_title"> | ||
<a href="{{ post.url }}">{{ post.title }}</a> | ||
</td> | ||
<td class="td_date">{{ post.date | date: "%b %d, %y" }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
{% endfor %} | ||
</table> | ||
{% endif %} |
Oops, something went wrong.