-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathabout.html
More file actions
103 lines (81 loc) · 2.71 KB
/
Copy pathabout.html
File metadata and controls
103 lines (81 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
layout: page
title: "About"
description: "Sh7ne On."
header-img: "img/about-bg.jpg"
---
<!-- Language Selector -->
<select class="sel-lang" onchange= "onLanChange(this.options[this.options.selectedIndex].value)">
<option value="0" selected> English 英文 </option>
<option value="1"> 中文 Chinese </option>
</select>
<!-- English Version -->
<div class="en post-container">
<blockquote>
<p>
Geeks love the latest features but most people fear change
</p>
</blockquote>
<p>Hi, I am <strong>Sh7ne</strong>. a Developer.(<a href="http://github.com/Sh7ne">Github</a>).
</div>
<!-- Chinese Version -->
<div class="zh post-container">
<!--copied from markdown -->
<p>
大家好,我是谁也不是,望多交流。
</p>
</div>
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//sh7ne.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!-- Handle Language Change -->
<script type="text/javascript">
// get nodes
var $zh = document.querySelector(".zh");
var $en = document.querySelector(".en");
var $select = document.querySelector("select");
// bind hashchange event
window.addEventListener('hashchange', _render);
// handle render
function _render(){
var _hash = window.location.hash;
// zh
if(_hash == "#zh"){
$select.selectedIndex = 1;
$en.style.display = "none";
$zh.style.display = "block";
// en by default
}else{
// not trigger onChange, otherwise cause a loop call.
$select.selectedIndex = 0;
$zh.style.display = "none";
$en.style.display = "block";
}
}
// handle select change
function onLanChange(index){
if(index == 1){
window.location.hash = "#zh"
}else{
window.location.hash = "#en"
}
}
// init
_render();
</script>