diff --git a/docs/assets/js/custom.js b/docs/assets/js/custom.js new file mode 100644 index 00000000..b72e7927 --- /dev/null +++ b/docs/assets/js/custom.js @@ -0,0 +1,392 @@ +const description_icon = ''; +const purchase_icon = ''; +const example_icon = ''; +const video_icon = ''; +const quickstart_icon = ''; +const schematic_icon = ''; +const icon_list = { + "EASYLOADER":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/EASYLOADER_ICON.png", + "CORE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/CORE_ICON.png", + "MODULE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/MODULE_ICON.png", + "BASE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/BASE_ICON.png", + "UNIT":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/UNIT_ICON.png", + "HAT":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/HAT_ICON.png", + "ATOM-BASE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ATOM_BASE_ICON.png", + "APPLICATION":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/APPLICATION_ICON.png", + "ACCESSORY":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ACCESSORY_ICON.png", + "ALUMINIUM":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ALUMINIUM_ICON.png" +}; + +var Label1 = ''; +var Label2 = 'here is the anchor_name'; +function anchor_create(anchor_name,anchor_id){ + var page_url = window.location.href; + var Part_A = Label1.replace(/here is the anchor_id/, anchor_id); + var Part_B = Label2.replace(/here is the anchor_name/, anchor_name.toUpperCase()); + if((anchor_name == "DESCRIPTION")||(anchor_name == "描述")){ + $(".anchor-box").append(Part_A+description_icon+Part_B); + } + else if((anchor_name == "EXAMPLE")||(anchor_name == "案例程序")){ + $(".anchor-box").append(Part_A+example_icon+Part_B); + } + else if((anchor_name == "SCHEMATIC")||(anchor_name == "原理图")){ + $(".anchor-box").append(Part_A+schematic_icon+Part_B); + } + else if((anchor_name == "VIDEO")||(anchor_name == "相关视频")){ + $(".anchor-box").append(Part_A+video_icon+Part_B); + } + else if(icon_list.hasOwnProperty(anchor_name)){ + $(".anchor-box").append(Part_A+""+Part_B); + if (anchor_name == "EASYLOADER"){ + if(("#example_video").length >0) + $("#play-btn").on("click",function(ev){ + ev.stopPropagation(); + $(".easyloader-mask").toggleClass('video_play'); + $("#example_video")[0].play(); + }) + $("#example_video").on("click",function(ev){ + ev.preventDefault(); + $(".easyloader-mask").toggleClass('video_play'); + $("#example_video")[0].pause(); + }) + } + }else if((page_url.indexOf(/uiflow/) != -1)||(page_url.indexOf(/arduino/) != -1)||(page_url.indexOf(/quick_start/) != -1)||(page_url.indexOf(/related_documents/) != -1)){ + $(".anchor-box").append(Part_A+quickstart_icon+''+anchor_name+''); + } +} + +function anchor_search(purchase_link="none",quickstart_link="none"){ + isSupportWebp(); + var page_url = window.location.href; + if((page_url.slice(-4) == "/en/")||(page_url.slice(-7)== "/zh_CN/")||(page_url.slice(-3)== "/#/")){ + $("#search_note").eq(0).after("
"); + var anchor_list= $(".product_page > div:gt(1)"); + } + else{ + $("h2").eq(0).before("
"); + var anchor_list= $("#main h2"); + } + for (var i=0; i< anchor_list.length ; i++){ + anchor_create(anchor_list[i].id.toUpperCase(), anchor_list[i].id); + } + if(page_url.indexOf(/zh_CN/) != -1) { + var purchase_name = "购买链接" + var quickstart_name = "快速上手" + } + else { + var purchase_name = "PURCHASE" + var quickstart_name = "QUICK START" + } + if(purchase_link!="none"){ + $(".anchor-box").append(''+purchase_icon+''+purchase_name+''+''); + } + if(quickstart_link!="none"){ + $(".anchor-box").append(''+quickstart_icon+''+quickstart_name+''+''); + } +} + +function anchor_scroll(anchor_name,anchor_id,anchor_length){ + var page_url = window.location.href; + var offset = $("#"+anchor_id).offset().top + $("#"+anchor_id).height() - $(window).scrollTop(); + if((offset > 100)&&(offset < ($("#"+anchor_id).height()+700))){ + for (var i= 0; i< anchor_length; i++){ + if( anchor_name == $(".anchor-box span").eq(i).html()){ + $(".anchor-box a").addClass("anchor-quiet"); + $(".anchor-box a").eq(i).removeClass("anchor-quiet"); + $(".anchor-box a").eq(i).addClass("anchor-active"); + if((page_url.indexOf(/uiflow/) != -1)||(page_url.indexOf(/arduino/) != -1)||(page_url.indexOf(/quick_start/) != -1)){ + var marquee_status1 = $(".anchor-box a marquee").eq(i).attr("scrollamount"); + $(".anchor-box a marquee").attr("scrollamount","0"); + $(".anchor-box a marquee").eq(i).attr("scrollamount","2"); + var marquee_status2 = $(".anchor-box a marquee").eq(i).attr("scrollamount"); + if(marquee_status1 != marquee_status2){ + $(".anchor-box a marquee").eq(i)[0].start(); + } + } + return true + } + } + } +} + +var scrollFunc = function (e) { + e = e || window.event; +// if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 + var page_url = window.location.href; + if((page_url.slice(-4) == "/en/")||(page_url.slice(-7)== "/zh_CN/")||(page_url.slice(-3)== "/#/")){ + var anchor_list= $(".product_page > div:gt(1)"); + } + else{ + var anchor_list= $("#main h2"); + } + for (var i=0; i< anchor_list.length ; i++){ + if(anchor_scroll(anchor_list[i].id.toUpperCase(), anchor_list[i].id, anchor_list.length)) break; + } +} + +scrollFunc(); +/*IE、Opera注册事件*/ +if(document.attachEvent){ +document.attachEvent('onmousewheel',scrollFunc); + +} +//Firefox使用addEventListener添加滚轮事件 +if (document.addEventListener) {//firefox +document.addEventListener('DOMMouseScroll', scrollFunc, false); +} +window.onscroll = scrollFunc; + +function product_search(onEnter_content){ + $("#search_note").css("display","block"); + var p = $(".item .item-title"); + var sku = $(".item .mask_sku"); + for (var i=0; i 0) { + pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight) + leftHeight -= pageHeight; + position -= 841.89; + if(leftHeight > 0) { + pdf.addPage(); + } + } + } + var page_url = window.location.href; + var a = page_url.indexOf('#') + var pdf_name = page_url.slice(a+2); + pdf.save(pdf_name+".pdf"); + } + }) + $(".anchor-box").removeAttr("style"); + $(".related_links").removeAttr("style"); + $(".easyloader-box").removeAttr("style"); + } \ No newline at end of file diff --git a/docs/assets/js/custom.min.js b/docs/assets/js/custom.min.js new file mode 100644 index 00000000..76223941 --- /dev/null +++ b/docs/assets/js/custom.min.js @@ -0,0 +1 @@ +const description_icon='',purchase_icon='',example_icon='',video_icon='',quickstart_icon='',schematic_icon='',icon_list={EASYLOADER:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/EASYLOADER_ICON.png",CORE:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/CORE_ICON.png",MODULE:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/MODULE_ICON.png",BASE:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/BASE_ICON.png",UNIT:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/UNIT_ICON.png",HAT:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/HAT_ICON.png","ATOM-BASE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ATOM_BASE_ICON.png",APPLICATION:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/APPLICATION_ICON.png",ACCESSORY:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ACCESSORY_ICON.png",ALUMINIUM:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ALUMINIUM_ICON.png"};var Label1="",Label2='here is the anchor_name';function anchor_create(e,c){var t=window.location.href,n=Label1.replace(/here is the anchor_id/,c),o=Label2.replace(/here is the anchor_name/,e.toUpperCase());"DESCRIPTION"==e||"描述"==e?$(".anchor-box").append(n+description_icon+o):"EXAMPLE"==e||"案例程序"==e?$(".anchor-box").append(n+example_icon+o):"SCHEMATIC"==e||"原理图"==e?$(".anchor-box").append(n+schematic_icon+o):"VIDEO"==e||"相关视频"==e?$(".anchor-box").append(n+video_icon+o):icon_list.hasOwnProperty(e)?($(".anchor-box").append(n+""+o),"EASYLOADER"==e&&("#example_video".length>0&&$("#play-btn").on("click",function(e){e.stopPropagation(),$(".easyloader-mask").toggleClass("video_play"),$("#example_video")[0].play()}),$("#example_video").on("click",function(e){e.preventDefault(),$(".easyloader-mask").toggleClass("video_play"),$("#example_video")[0].pause()}))):-1==t.indexOf(/uiflow/)&&-1==t.indexOf(/arduino/)&&-1==t.indexOf(/quick_start/)&&-1==t.indexOf(/related_documents/)||$(".anchor-box").append(n+quickstart_icon+'"+e+"")}function anchor_search(e="none",c="none"){isSupportWebp();var t=window.location.href;if("/en/"==t.slice(-4)||"/zh_CN/"==t.slice(-7)||"/#/"==t.slice(-3)){$("#search_note").eq(0).after("
");var n=$(".product_page > div:gt(1)")}else{$("h2").eq(0).before("
");n=$("#main h2")}for(var o=0;o'+purchase_icon+''+a+""),"none"!=c&&$(".anchor-box").append("'+quickstart_icon+''+s+"")}function anchor_scroll(e,c,t){var n=window.location.href,o=$("#"+c).offset().top+$("#"+c).height()-$(window).scrollTop();if(o>100&&o<$("#"+c).height()+700)for(var a=0;a div:gt(1)");else t=$("#main h2");for(var n=0;n0;)l.addImage(i,"JPEG",0,a,595.28,s),a-=841.89,(o-=n)>0&&l.addPage();var r=window.location.href,h=r.indexOf("#"),p=r.slice(h+2);l.save(p+".pdf")}}),$(".anchor-box").removeAttr("style"),$(".related_links").removeAttr("style"),$(".easyloader-box").removeAttr("style")}Input.focusin(function(){Input.animate({width:300})}),Input.focusout(function(){Input.animate({width:240})}),$(document).ready(function(){$(".btn-toggle").on("click",function(){$(".btn-toggle").toggleClass("open"),$(".d-flex").toggleClass("open")})}),window.onhashchange=page_loading,page_loading(); \ No newline at end of file diff --git a/docs/en/unit/env.md b/docs/en/unit/env.md index 3fe7890f..640111ef 100644 --- a/docs/en/unit/env.md +++ b/docs/en/unit/env.md @@ -13,7 +13,7 @@ BMP280 is an absolute barometric pressure sensor especially designed for mobile **I2C address:DHT12(0x5C)、BMP280(0x76)** -## Feature +## Product Features - Temperature: - measuring range: -20 ~ 60 ℃ diff --git a/docs/index.html b/docs/index.html index 23f8fa63..5a1ae0f4 100755 --- a/docs/index.html +++ b/docs/index.html @@ -1,544 +1,5 @@ - - - - - - - - - - M5Stack - A series of modular stackable development devices - - - - - - - - - - - - -
- -
-

- M5Stack Docs

- -
- -
loading...
- - - - - - - - - - - - - - - - - - - - \ No newline at end of file +M5Stack Docs - The reference docs for M5Stack products.
loading...
\ No newline at end of file diff --git a/docs/index_source.html b/docs/index_source.html index d120c6d0..34a8ea03 100644 --- a/docs/index_source.html +++ b/docs/index_source.html @@ -5,9 +5,9 @@ - + - M5Stack - A series of modular stackable development devices + M5Stack Docs - The reference docs for M5Stack products. @@ -28,8 +28,8 @@
-
- M5Stack Docs
+

+ M5Stack Docs