help.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <!DOCTYPE html>
  2. <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link rel="icon" href="{{asset('icon/faviconc.ico')}}" type="image/x-icon"/>
  7. <title>系统🎯手册</title>
  8. <style>
  9. .sidebar {
  10. background: #ffffff;
  11. line-height: 180%;
  12. position: fixed;
  13. left: 0;
  14. top: 0;
  15. border: 1px solid #aaaaaa;
  16. width: 20%;
  17. height:100%;
  18. }
  19. .sidebar p {
  20. font-size: 18px;
  21. color: #15a230;
  22. margin: 0 0 0.3rem 0;
  23. text-align: right;
  24. }
  25. .sidebar li{
  26. text-indent: 0.5rem;
  27. font-size: 14px;
  28. list-style: none;
  29. border-bottom:1px solid #ced4da;
  30. }
  31. .sidebar li .nav_item{
  32. padding: 3px;
  33. }
  34. .sidebar li .item_h1{
  35. margin-left: 0;
  36. }
  37. .sidebar li .item_h2{
  38. margin-left: 2rem;
  39. font-size: 0.8rem;
  40. }
  41. .sidebar li .item_h3{
  42. margin-left: 4rem;
  43. font-size: 0.8rem;
  44. }
  45. .sidebar li .item_h4{
  46. margin-left: 5rem;
  47. font-size: 0.8rem;
  48. }
  49. .sidebar li .item_h5{
  50. margin-left: 6rem;
  51. font-size: 0.8rem;
  52. }
  53. .sidebar li .item_h6{
  54. margin-left: 7rem;
  55. font-size: 0.8rem;
  56. }
  57. .sidebar li .nav_item.current{
  58. color: white;
  59. background-color: #5cc26f;
  60. }
  61. .sidebar a:hover {
  62. color: #5cc26f;
  63. }
  64. .sidebar a {
  65. text-decoration: none;
  66. }
  67. .nowrap{white-space:nowrap;}
  68. code {
  69. border-radius: 6px;
  70. background: rgba(0,0,0,.1);
  71. color: red;
  72. padding: 8px;
  73. }
  74. kbd {
  75. border-radius: 6px;
  76. background: rgba(5,1,5,.2);
  77. color: #000000;
  78. font-weight: bold;
  79. padding: 8px;
  80. }
  81. </style>
  82. </head>
  83. <body>
  84. <div class="sidebar">
  85. <div class="AnchorContent nowrap" id="AnchorContent"></div>
  86. </div>
  87. <div id="content" style="margin-left: 100px"></div>
  88. <script src="{{mix("js/marked.js")}}"></script>
  89. <script>
  90. document.getElementById('content').innerHTML = marked("{!! $read !!}");
  91. </script>
  92. <script type="text/javascript">
  93. let currentIndex = 0;
  94. let currentScrollHigh = 0;
  95. let currentContentScrollHigh = 0;
  96. $(window).on("load",function(){
  97. let body = $("body");
  98. let content = $("#AnchorContent");
  99. let headCounts = [body.find("h1").length, body.find("h2").length, body.find("h3").length, body.find("h4").length,
  100. body.find("h5").length, body.find("h6").length];
  101. let vH1Tag = null; // 显示的最高层级
  102. let vH2Tag = null; // 显示的最低层级
  103. for(let i = 0; i < headCounts.length; i++){
  104. if(headCounts[i] > 0){
  105. if(vH1Tag == null)vH1Tag = 'h' + (i + 1);
  106. else vH2Tag = 'h' + (i + 1);
  107. }
  108. }
  109. if(vH1Tag == null)return;
  110. let vIndexH1 = 0;
  111. let vIndexH2 = 0;
  112. let vIndexH3 = 0;
  113. let vIndexH4 = 0;
  114. let vIndexH5 = 0;
  115. let vIndexH6 = 0;
  116. let headerALL = [];
  117. let headerIDALL = [];
  118. let headerHeightALL = [];
  119. body.find("h1,h2,h3,h4,h5,h6").each(function(i,item){
  120. let id = '';
  121. let name = '';
  122. let tag = $(item).get(0).tagName.toLowerCase();
  123. let className = '';
  124. switch (tag){
  125. case "h1":
  126. id = name = ++vIndexH1;
  127. vIndexH2 = 0;
  128. vIndexH3 = 0;
  129. vIndexH4 = 0;
  130. vIndexH5 = 0;
  131. vIndexH6 = 0;
  132. className = 'item_h1';
  133. break;
  134. case "h2":
  135. id = vIndexH1 + '_' + ++vIndexH2;
  136. name = vIndexH1 + '.' + vIndexH2;
  137. className = 'item_h2';
  138. vIndexH3 = 0;
  139. vIndexH4 = 0;
  140. vIndexH5 = 0;
  141. vIndexH6 = 0;
  142. break;
  143. case "h3":
  144. id = vIndexH1 + '_' + vIndexH2+ '_' + ++vIndexH3;
  145. name = vIndexH1 + '.' + vIndexH2+ '.' + +vIndexH3;
  146. className = 'item_h3';
  147. vIndexH4 = 0;
  148. vIndexH5 = 0;
  149. vIndexH6 = 0;
  150. break;
  151. case "h4":
  152. id = vIndexH1 + '_' + vIndexH2+ '_' +vIndexH3 +'_'+ ++vIndexH4 ;
  153. name = vIndexH1 + '.' + vIndexH2+ '.' +vIndexH3 +'.'+ vIndexH4 ;
  154. className = 'item_h4';
  155. vIndexH5 = 0;
  156. vIndexH6 = 0;
  157. break;
  158. case "h5":
  159. id = vIndexH1 + '_' + vIndexH2+ '_' +vIndexH3 +'_' +vIndexH4+'_'+ ++vIndexH5;
  160. name = vIndexH1 + '.' + vIndexH2+ '.' +vIndexH3 +'.' +vIndexH4+'.'+ vIndexH5;
  161. className = 'item_h5';
  162. vIndexH6 = 0;
  163. break;
  164. case "h6":
  165. id = vIndexH1 + '_' + vIndexH2+ '_' +vIndexH3 +'_' +vIndexH4+'_' +vIndexH5+'_'+ ++vIndexH6;
  166. name = vIndexH1 + '.' + vIndexH2+ '.' +vIndexH3 +'.' +vIndexH4+'.' +vIndexH5+'.'+ vIndexH6;
  167. className = 'item_h6';
  168. break;
  169. }
  170. if(name.length > 2){
  171. let mFirstName = name.substring(0,2);
  172. while(mFirstName === "0."){
  173. name = name.substring(2,name.length);
  174. mFirstName = name.substring(0,2);
  175. }
  176. }
  177. $(item).attr("id","wow"+id+"_index_"+i);
  178. $(item).addClass("wow_head");
  179. content.css('max-height', ($(document).height()) + 'px');
  180. content.css('height', ($(window).height()) + 'px');
  181. content.css('overflow','auto');
  182. content.append('<li><a class="nav_item '+className+' anchor-link" href="#wow'+id+'_index_'+i+'" link="#wow'+id+'" index="'+i+'">'+name+" "+$(this).text()+" "+'</a></li>');
  183. let str = "#wow"+id+"_index_"+i;
  184. headerALL.push($(item));
  185. headerIDALL.push(str);
  186. });
  187. $(".anchor-link").click(function(){
  188. let index = $(this).attr("index");
  189. $(".sidebar li .nav_item.current").removeClass('current');
  190. $(headerNavs[index]).addClass('current');
  191. currentScrollHigh = $(window).scrollTop();
  192. currentContentScrollHigh = headerHeightALL[index];
  193. currentIndex = headerTops[index];
  194. });
  195. let headerNavs = $(".sidebar li .nav_item");
  196. let headerTops = [];
  197. $(".wow_head").each(function(i, n){
  198. headerTops.push($(n).offset().top);
  199. });
  200. headerTops.push($(document).height());
  201. window.onresize = function(){
  202. headerTops = [];
  203. $.each(headerNavs, function(i, n){
  204. $(n).trigger("click");
  205. document.querySelector(headerIDALL[i]).scrollIntoView(true);
  206. let scrollTop = $(window).scrollTop();
  207. headerTops.push(scrollTop);
  208. }
  209. );
  210. headerTops.push($(document).height());
  211. content.css('height', ($(window).height()) + 'px');
  212. let xcontentWidth = content.width();
  213. let xWidth = $(window).width();
  214. let xlength = xWidth - xcontentWidth;
  215. body.css("marginLeft",xcontentWidth+'px');
  216. body.css("max-width",xlength);
  217. $(headerNavs[currentIndex]).trigger("click");
  218. }
  219. $(window).scroll(function(){
  220. let scrollTop = $(window).scrollTop(); // 获得将要到达的点离顶距离
  221. $.each(headerTops, function(i, n){
  222. if( (scrollTop >= (headerTops[i]) && scrollTop < (headerTops[i+1] -1)) ){
  223. $(".sidebar li .nav_item.current").removeClass('current');
  224. $(headerNavs[i]).addClass('current');
  225. currentScrollHigh = scrollTop;
  226. currentContentScrollHigh = headerHeightALL[i];
  227. currentIndex = i;
  228. let mscrollTop1 = content.scrollTop(); // 当前标签的高度
  229. if((currentContentScrollHigh - mscrollTop1)> ($(window).height()/2)){
  230. content.animate({scrollTop: (currentContentScrollHigh)}, 10);
  231. } else if( ( mscrollTop1 - currentContentScrollHigh )> 0 ){
  232. content.animate({scrollTop: currentContentScrollHigh-(content.height()/3)}, 10);
  233. }
  234. return false;
  235. }
  236. }
  237. );
  238. if(scrollTop === 0){
  239. content.animate({scrollTop: 0}, 10);
  240. }
  241. if(scrollTop === $(document).height()){
  242. content.animate({scrollTop: headerHeightALL[headerHeightALL.length-1]}, 10);
  243. }
  244. });
  245. $.each(headerNavs, function(i, n){
  246. headerHeightALL.push($(n).offset().top);
  247. }
  248. );
  249. headerTops = [];
  250. $.each(headerNavs, function(i, n){
  251. $(n).trigger("click");
  252. document.querySelector(headerIDALL[i]).scrollIntoView(true);
  253. let scrollTop = $(window).scrollTop();
  254. headerTops.push(scrollTop);
  255. }
  256. );
  257. headerTops.push($(document).height());
  258. $(headerNavs[0]).trigger("click");
  259. document.querySelector(headerIDALL[0]).scrollIntoView(true);
  260. let xcontentWidth = content.width();
  261. let xWidth = $(window).width();
  262. let xlength = xWidth - xcontentWidth;
  263. body.css("marginLeft",xcontentWidth+'px');
  264. body.css("max-width",xlength);
  265. });
  266. </script>
  267. </body>
  268. </html>