change navigation

This commit is contained in:
Sean
2019-11-11 21:19:49 +08:00
parent fc1c2607dd
commit 755d8844ff
9 changed files with 92 additions and 60 deletions
+14 -6
View File
@@ -9,7 +9,7 @@ a {
.markdown-section {
max-width: 80%;
margin-top: 50px;
margin-top: 25px;
}
.markdown-section a {
@@ -77,7 +77,7 @@ body[data-page="en/uiflow/uiflow_home_page.md"] article.markdown-section {
position: fixed;
top:20%;
right: 4%;
z-index: 9999;
z-index: 900;
}
@@ -169,6 +169,7 @@ body[data-page="en/uiflow/uiflow_home_page.md"] article.markdown-section {
.dropdown{
display: inline-block;
transition:all .25s ease;
color: #343a40;
}
.dropdown div{
@@ -179,18 +180,20 @@ body[data-page="en/uiflow/uiflow_home_page.md"] article.markdown-section {
/* border: 1px solid rgba(0,0,0,.15);
border-radius: .25rem; */
transition:all .25s ease;
left: -60px;
left: -44px;
text-align: center;
top: 50px;
top: 40px;
z-index: 1001;
}
.dropdown:hover {
box-shadow: 0px 2px 0 0 #007bff;
color: #007bff;
}
.dropdown:hover div{
min-width: 10rem;
padding: .5rem 0;
margin: .125rem 0 0;
@@ -199,11 +202,16 @@ body[data-page="en/uiflow/uiflow_home_page.md"] article.markdown-section {
list-style: none;
background-clip: padding-box;
height: max-content;
box-shadow: 0px 12px 11px 0px #888888;
}
.dropdown div a:hover{
color:#007bff;
color:#007bff !important;
}
.dropdown div a:active{
background-color:#cccccc !important;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
# M5Stack Cases {docsify-ignore-all}
## M5Stack Awesome
## M5Stack User Cases
* [M5Stack-SD-Updater](https://github.com/tobozo/M5Stack-SD-Updater) - Customizable menu system for M5Stack - loads apps from the Micro SD card
+1 -1
View File
@@ -95,7 +95,7 @@ There are two versions of IMU sensors (MPU6886 and SH200Q) currently available o
Power structure block diagram
<img src="assets/img/product_pics/core/minicore/m5stickc/m5stickc_05.jpg" width="300px">
<img src="assets/img/product_pics/core/minicore/m5stickc/m5stickc_05.webp" width="300px">
**RED LED & IR Transmitter & BUTTON A & BUTTON B**
+70 -46
View File
@@ -23,8 +23,8 @@
//监听加载状态改变
document.onreadystatechange = completeLoading;
//加载状态为complete时隐藏loading效果
function completeLoading() {  
if (document.readyState == "complete") {    
function completeLoading() {
if (document.readyState == "complete") {
var loadingMask = document.getElementById('loading');  
loadingMask.style.display = 'none';
// loadingMask.parentNode.removeChild(loadingMask);  
@@ -61,19 +61,26 @@
<h5 class="my-0 mr-md-auto font-weight-normal">
<a href="https://m5stack.com/"><img src="//cdn.shopify.com/s/files/1/0056/7689/2250/files/LOGO_70x.jpg?v=1563273356" style="margin-right:10px;margin-top:-5px" width="52"></a>M5Stack Docs</h5>
<nav class="my-2 my-md-0 mr-md-3">
<a id="product" class="p-2 text-dark" href="#">Product</a>
<div class="p-2 text-dark dropdown">API
<a id="product" class="p-2 dropdown" href="#">Product</a>
<div id="platform" class="p-2 dropdown"><span>Platform</span>
<div>
<a id="arduino" class="dropdown-item" href="#/en/api">Arduino API</a>
<a class="dropdown-item" href="https://github.com/m5stack/UIFlow-Code/wiki">MicroPython API</a>
<a id="uiflow" class="dropdown-item" href="#/en/uiflow/uiflow_home_page">UIFlow</a>
<a id="arduino" class="dropdown-item" href="#en/related_documents/Arduino_IDE">Arduino</a>
<a class="dropdown-item" href="https://github.com/m5stack/UIFlow-Code">MicroPython</a>
</div>
</div>
<a id="cases" class="p-2 dropdown" href="#/en/case">Cases</a>
<a id="faq" class="p-2 dropdown" href="#/en/faq">FAQ</a>
<div id="language" class="p-2 dropdown" style="margin-right: 40px;">
<span>Language</span>
<div>
<a class="dropdown-item" onclick="language('en')">English</a>
<a class="dropdown-item" onclick="language('zh_CN')">中文</a>
<!-- <a class="dropdown-item" onclick="language('ja')">日本語</a> -->
</div>
</div>
<a id="cases" class="p-2 text-dark" href="#/en/case">Cases</a>
<a id="uiflow" class="p-2 text-dark" href="#/en/uiflow/uiflow_home_page">UIFlow</a>
<a id="related" class="p-2 text-dark" href="#/en/related_documents">Software Tutorial</a>
<a id="faq" class="p-2 text-dark" href="#/en/faq" style="margin-right: 70px;">FAQ</a>
</nav>
<a id="language" class="btn btn-primary" style="color:#fff" onclick="language()">中文</a>
<!-- <a id="language" class="btn btn-primary" style="color:#fff" onclick="language()">中文</a> -->
</div>
<div class="related_links">
<a href="https://github.com/m5stack" target="view_window"><img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/github_logo.png"><div>Github</div></a>
@@ -212,67 +219,83 @@
function change_title(language) {
if (language == "en") {
$("#language").text("中文");
$("#product").text("Product");
$("#product").attr("href", "#");
$("#arduino").text("Arduino API");
$("#arduino").attr("href", "#/en/api");
$("#arduino").text("Arduino");
$("#arduino").attr("href", "#en/related_documents/Arduino_IDE");
$("#cases").text("Cases");
$("#cases").attr("href", "#/en/case");
$("#related").text("Software Tutorial");
$("#related").attr("href", "#/en/related_documents");
$("#faq").text("FAQ");
$("#faq").attr("href", "#/en/faq");
$("#uiflow").attr("href", "#/en/uiflow/uiflow_home_page");
} else {
$("#language").text("EN");
$("#platform span").text("Platform");
$("#language span").text("Language");
}
if(language == "zh_CN"){
$("#product").text("产品列表");
$("#product").attr("href", "#/zh_CN/");
$("#arduino").text("Arduino API");
$("#arduino").attr("href", "#/zh_CN/api");
$("#cases").text("用户案例");
$("#arduino").text("Arduino");
$("#arduino").attr("href", "#/zh_CN/related_documents/Arduino_IDE");
$("#cases").text("案例");
$("#cases").attr("href", "#/zh_CN/case");
$("#related").text("软件教程");
$("#related").attr("href", "#/zh_CN/related_documents");
$("#faq").text("常见问题");
$("#faq").attr("href", "#/zh_CN/faq");
$("#uiflow").attr("href", "#/zh_CN/uiflow/uiflow_home_page");
$("#platform span").text("开发平台");
$("#language span").text("切换语言");
}
if(language == "ja"){
$("#product").text("製品リスト");
$("#product").attr("href", "#/ja/");
$("#arduino").text("Arduino");
$("#arduino").attr("href", "#/ja/related_documents/Arduino_IDE");
$("#cases").text("事例");
$("#cases").attr("href", "#/ja/case");
$("#faq").text("問題");
$("#faq").attr("href", "#/ja/faq");
$("#uiflow").attr("href", "#/ja/uiflow/uiflow_home_page");
$("#platform span").text("開発");
$("#language span").text("言語選択");
}
}
function language() {
function language(language) {
var test = window.location.href;
if ((test.indexOf(/en/) == -1) && (test.indexOf(/zh_CN/) == -1)) {
var test2 = test.concat("", "zh_CN/");
if ((test.indexOf(/en/) == -1) && (test.indexOf(/zh_CN/) == -1) && (test.indexOf(/ja/) == -1)) {
var test2 = test.concat("", language+"/");
window.location.href = test2;
change_title('zh_CN');
change_title(language);
} else if (test.indexOf(/en/) == -1) {
var test2 = test.replace(/zh_CN/, "en");
}
if (test.indexOf(/en/) != -1) {
var test2 = test.replace(/en/, language);
window.location.href = test2;
change_title('en');
change_title(language);
} else {
var test2 = test.replace(/en/, "zh_CN");
}else if(test.indexOf(/zh_CN/) != -1){
var test2 = test.replace(/zh_CN/, language);
window.location.href = test2;
change_title('zh_CN');
change_title(language);
}else if(test.indexOf(/ja/) != -1){
var test2 = test.replace(/ja/, language);
window.location.href = test2;
change_title(language);
}
}
function page_loading() {
var test = window.location.href;
if ((test.indexOf(/en/) == -1) && (test.indexOf(/zh_CN/) == -1)) {
if ((test.indexOf(/en/) == -1) && (test.indexOf(/zh_CN/) == -1)&& (test.indexOf(/ja/) == -1)) {
change_title('en');
} else if (test.indexOf(/en/) == -1) {
var test2 = test.replace(/zh_CN/, "en");
}
if(test.indexOf(/en/) != -1){
change_title('en');
}
if(test.indexOf(/zh_CN/) != -1){
change_title('zh_CN');
} else {
var test2 = test.replace(/en/, "zh_CN");
change_title('en');
}
if(test.indexOf(/ja/) != -1){
change_title('ja');
}
}
@@ -282,6 +305,7 @@
scrollTop: (t - 100)
}, 500);
}
window.onhashchange = page_loading
page_loading();
</script>
<script src="./assets/js/docify.min.js"></script>
@@ -301,7 +325,7 @@
</script>
<!-- Hotjar Tracking Code for https://docs.m5stack.com/#/ -->
<script>
<!-- <script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:1546100,hjsv:6};
@@ -310,6 +334,6 @@
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
</script> -->
</html>
+2 -2
View File
@@ -272,8 +272,8 @@
$(".product_page div:last-child").attr("id",product_class_name[i]);
}
console.log(product_class[0][0].a);
console.log(product_class[0].length);
// console.log(product_class[0][0].a);
// console.log(product_class[0].length);
for (var class_num=0; class_num<product_class.length; class_num++ ){
for (var i=0; i<product_class[class_num].length; i++ ) {
if(product_class[class_num][i].p == "BASIC"){
+2 -2
View File
@@ -271,8 +271,8 @@
$(".product_page div:last-child").attr("id",product_class_name[i]);
}
console.log(product_class[0][0].a);
console.log(product_class[0].length);
// console.log(product_class[0][0].a);
// console.log(product_class[0].length);
for (var class_num=0; class_num<product_class.length; class_num++ ){
for (var i=0; i<product_class[class_num].length; i++ ) {
if(product_class[class_num][i].p == "BASIC"){
+2 -2
View File
@@ -98,7 +98,7 @@ M5StickC仅支持WIN10&Linux&MAC免驱,其余操作系统则需要用户自行
电源结构框图
<img src="assets/img/product_pics/core/minicore/m5stickc/m5stickc_05.jpg" width="300px">
<img src="assets/img/product_pics/core/minicore/m5stickc/m5stickc_05.webp" width="300px">
**红色 LED & 红外发射管 IR & 按键 BUTTON A & 按键 BUTTON B**
@@ -110,7 +110,7 @@ M5StickC仅支持WIN10&Linux&MAC免驱,其余操作系统则需要用户自行
<tr><td>按键 BUTTON B</td><td> </td><td> </td><td> </td><td>按键管脚</td></tr>
</table>
**彩色TFT屏幕**
**彩色TFT屏幕**
*驱动芯片:ST7735S*