index.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?PHP
  2. include "../pcdl/html_head.php";
  3. ?>
  4. <body class="wiki_body" onload="wiki_index_init()">
  5. <style>
  6. .term_link,.term_link_new{
  7. color: blue;
  8. padding-left: 2px;
  9. padding-right: 2px;
  10. }
  11. .term_link_new{
  12. color:red;
  13. }
  14. #search_result{
  15. position: absolute;
  16. background: var(--bg-color);
  17. box-shadow: 8px 8px 20px var(--border-shadow);
  18. max-width: 95%;
  19. width: 24em;
  20. z-index: 20;
  21. }
  22. chapter{
  23. color: blue;
  24. text-decoration: none;
  25. cursor: pointer;
  26. }
  27. chapter:hover{
  28. color: blue;
  29. text-decoration: underline;
  30. }
  31. .fun_block {
  32. color: var(--tool-color);
  33. width: 95%;
  34. margin-top:3em;
  35. margin-left:auto;
  36. margin-right:auto;
  37. max-width: 30em;
  38. margin-bottom: 20px;
  39. box-shadow: 2px 2px 10px 2px var(--shadow-color);
  40. border-radius: 8px;
  41. }
  42. .wiki_body{
  43. align-items: center;
  44. }
  45. .search_toolbar{
  46. height: initial;
  47. padding: 1em 1em;
  48. background-color: var(--tool-bg-color1);
  49. border-bottom: none;
  50. }
  51. #index_list{
  52. display:flex;
  53. }
  54. .wiki_search_list li{
  55. padding:0 1em;
  56. line-height:1.8em;
  57. }
  58. .wiki_search_list li:hover {
  59. background-color: beige;
  60. }
  61. </style>
  62. <style media="screen and (max-width:800px)">
  63. #index_list{
  64. display:block;
  65. }
  66. </style>
  67. <?php
  68. require_once("../pcdl/head_bar.php");
  69. ?>
  70. <script src="../../node_modules/highcharts/highcharts.js"></script>
  71. <script src="../../node_modules/highcharts/modules/exporting.js"></script>
  72. <script src="../../node_modules/highcharts/modules/data.js"></script>
  73. <script src="../../node_modules/highcharts/modules/series-label.js"></script>
  74. <script src="../../node_modules/highcharts/modules/oldie.js"></script>
  75. <script src="../term/term.js"></script>
  76. <script src="../term/note.js"></script>
  77. <script src="wiki.js"></script>
  78. <div id="container" style="min-width:400px;height:200px;"></div>
  79. <div id="wiki_search" style="width:100%;">
  80. </div>
  81. <!-- tool bar begin-->
  82. <div id='search_toolbar' class="search_toolbar">
  83. <div style="display:flex;justify-content: space-between;">
  84. <div ></div>
  85. <div>
  86. <div>
  87. <input id="wiki_search_input" type="input" placeholder="<?php echo $_local->gui->search;?>" style="width: 40em;max-width: 100%;font-size:140%;padding: 0.3em;color: var(--btn-hover-bg-color);background-color: var(--btn-color);" onkeyup="wiki_search_keyup(event,this)"/>
  88. </div>
  89. <div id="search_result">
  90. </div>
  91. </div>
  92. <div >
  93. <ul>
  94. <li>人人皆可编辑</li>
  95. <li>引用圣典原文</li>
  96. <li><a href="wiki.php?word=:new"><?php echo $_local->gui->new_technic_term; ?></a></li>
  97. </ul>
  98. </div>
  99. </div>
  100. </div>
  101. <!--tool bar end -->
  102. <div id="index_list">
  103. <div style="flex:3;margin:12px;">
  104. <div class="card" style="padding:10px;">
  105. <div>最近搜索</div>
  106. </div>
  107. </div>
  108. <div style="flex:3;margin:12px;">
  109. <div class="card" style="padding:10px;">
  110. <div>优质词条</div>
  111. </div>
  112. </div>
  113. <div style="flex:3;margin:12px;">
  114. <div class="card" style="padding:10px;">
  115. <div>我的贡献</div>
  116. <div>新手指南</div>
  117. </div>
  118. </div>
  119. </div>
  120. <script>
  121. $.get('../term/update_analytics.php', function (csvStr) {
  122. console.log(csvStr);
  123. csvStr = csvStr.replace(/\n\n/g, '\n');
  124. Highcharts.chart('container', {
  125. chart: {
  126. scrollablePlotArea: {
  127. minWidth: 700
  128. }
  129. },
  130. data: {
  131. //csvURL: 'https://cdn.jsdelivr.net/gh/highcharts/highcharts@v7.0.0/samples/data/analytics.csv',
  132. csv: csvStr
  133. },
  134. title: {
  135. text: '圣典百科百日更新'
  136. },
  137. subtitle: {
  138. text: ''
  139. },
  140. xAxis: {
  141. tickInterval: 7 * 24 * 3600 * 1000, // one week
  142. tickWidth: 0,
  143. gridLineWidth: 1,
  144. labels: {
  145. align: 'left',
  146. x: 3,
  147. y: -3
  148. }
  149. },
  150. yAxis: [{ // left y axis
  151. title: {
  152. text: null
  153. },
  154. labels: {
  155. align: 'left',
  156. x: 3,
  157. y: 16,
  158. format: '{value:.,0f}'
  159. },
  160. showFirstLabel: false
  161. }, { // right y axis
  162. linkedTo: 0,
  163. gridLineWidth: 0,
  164. opposite: true,
  165. title: {
  166. text: null
  167. },
  168. labels: {
  169. align: 'right',
  170. x: -3,
  171. y: 16,
  172. format: '{value:.,0f}'
  173. },
  174. showFirstLabel: false
  175. }],
  176. legend: {
  177. align: 'left',
  178. verticalAlign: 'top',
  179. borderWidth: 0
  180. },
  181. tooltip: {
  182. shared: true,
  183. crosshairs: true
  184. },
  185. plotOptions: {
  186. series: {
  187. cursor: 'pointer',
  188. point: {
  189. events: {
  190. click: function (e) {
  191. hs.htmlExpand(null, {
  192. pageOrigin: {
  193. x: e.pageX || e.clientX,
  194. y: e.pageY || e.clientY
  195. },
  196. headingText: this.series.name,
  197. maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':<br/> ' +
  198. this.y + ' sessions',
  199. width: 200
  200. });
  201. }
  202. }
  203. },
  204. marker: {
  205. lineWidth: 1
  206. }
  207. }
  208. },
  209. series: [{
  210. name: 'All sessions',
  211. lineWidth: 4,
  212. marker: {
  213. radius: 4
  214. }
  215. }, {
  216. name: 'New users'
  217. }]
  218. });
  219. });
  220. </script>
  221. </body>
  222. </html>