index.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!DOCTYPE html>
  2. <head>
  3. <!-- <link async rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
  4. integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> -->
  5. <script type="text/javascript" src="../js/jquery.min.js" crossorigin="anonymous"></script>
  6. <link rel="stylesheet" href="../css/bootstrap.min.css" crossorigin="anonymous">
  7. <script type="text/javascript" src="../js/bootstrap.min.js" crossorigin="anonymous"></script>
  8. <link rel="stylesheet" href="../css/style.css">
  9. <link rel="preconnect" href="https://fonts.gstatic.com">
  10. <link href="https://fonts.loli.net/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700
  11. &family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet">
  12. <title>化学</title>
  13. <style>
  14. .well {
  15. padding: 10px;
  16. border: 1px solid rgb(173, 173, 173);
  17. background-color: #f5f5f5;
  18. margin-top: 5px;
  19. min-height: 160px;
  20. border-radius: 5px;
  21. width: 100%;
  22. overflow-x: auto;
  23. overflow-y: auto;
  24. }
  25. pre {
  26. overflow-x: auto;
  27. overflow-y: auto;
  28. white-space: pre-wrap;
  29. }
  30. .btn-default:focus,
  31. .btn-default:focus-visible,
  32. .btn-default:focus-within,
  33. .btn-default:active:focus {
  34. outline: 4px dashed rgba(59, 86, 100, 0.5);
  35. }
  36. .btn-default:hover {
  37. outline: 10px double rgba(59, 86, 100, 0.5);
  38. z-index: 4 !important
  39. }
  40. .btn.disabled {
  41. cursor: default;
  42. pointer-events: none;
  43. z-index: 0;
  44. }
  45. .text-muted a {
  46. color: rgb(173, 173, 173);
  47. }
  48. a {
  49. transition-duration: 300ms;
  50. }
  51. a:hover {
  52. box-shadow: inset 1px 1px 6px rgba(59, 86, 100, 0.3);
  53. }
  54. </style>
  55. <script id="MathJax-script" src="https://cdn.bootcss.com/mathjax/3.2.2/es5/tex-mml-chtml.js"></script>
  56. <!-- <script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script> -->
  57. <script src="../js/chem.min.js"></script>
  58. </head>
  59. <body>
  60. <div class="row">
  61. <div class="col-lg-2 col-md-2 col-xs-12">
  62. <a class="btn btn-info" href="/"><i class="glyphicon glyphicon-home" aria-hidden="true"></i>&nbsp;返回</a>
  63. <hr>
  64. </div>
  65. <div class="col-lg-8 col-md-10 col-xs-12">
  66. <div class="input-group">
  67. <span class="input-group-btn">
  68. <button type="button" class="btn btn-default" onclick="balUp()" id="balShare" title="导入配平结果"> <span
  69. class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></button>
  70. </span>
  71. <input id="balInput" type="text" class="form-control" oninput="input()" autocomplete="off">
  72. <span class="input-group-btn">
  73. <button type="button" class="btn btn-default" onclick="balance()" id="balBtn">配平</button>
  74. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  75. <span class="caret"></span>
  76. <span class="sr-only">切换下拉菜单</span>
  77. </button>
  78. <ul class="dropdown-menu" role="menu">
  79. <li class="dropdown-header">功能</li>
  80. <li><a href="#" onclick="setBal()">配平</a></li>
  81. <li><a href="#" onclick="setWeigh()">相对质量</a></li>
  82. <li><a href="#" onclick="setWeigh2()" data-toggle="tooltip" data-placement="left"
  83. title="四位有效数字">相对质量*</a></li>
  84. <li class="divider"></li>
  85. <li><a href="/chemist" data-toggle="tooltip" data-placement="left" title="将打开新页面">配平接口</a>
  86. </li>
  87. <!-- <li class="divider"></li>
  88. <li><a href="#" data-toggle="tooltip" data-placement="left" title="将会对所有人可见">发送到数据库</a></li> -->
  89. </ul>
  90. </span>
  91. </div>
  92. <hr>
  93. <div class="well frame">
  94. </div>
  95. <hr>
  96. <div class="input-group">
  97. <span class="input-group-btn">
  98. <button type="button" class="btn btn-default" onclick="qryUp()" id="qryShare" title="导入配平结果"> <span
  99. class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></button>
  100. <button type="button" class="btn btn-default" data-toggle="button" onclick="qryToggleMatch()"
  101. id="qryMatch">匹配分子</button>
  102. </span>
  103. <input id="qryInput" type="text" class="form-control qryInput" autocomplete="off" oninput="input2()">
  104. <span class="input-group-addon qryInputHidable" style="display:none">=</span>
  105. <input id="qryInput2" type="text" class="form-control qryInput qryInputHidable" style="display:none"
  106. autocomplete="off" oninput="input2()">
  107. <span class="input-group-btn">
  108. <button type="button" class="btn btn-default" onclick="query()" id="qryBtn">查询方程式</button>
  109. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  110. <span class="caret"></span>
  111. <span class="sr-only">切换下拉菜单</span>
  112. </button>
  113. <ul class="dropdown-menu" role="menu">
  114. <li class="dropdown-header">功能</li>
  115. <li><a href="#1" onclick="setQryEq()">查询方程式</a></li>
  116. <li><a href="#1" onclick="setQryEq2()" data-toggle="tooltip" data-placement="left"
  117. title="限制等号左右">查询方程式*</a></li>
  118. <!-- <li><a href="#4" onclick="setQryMo()">查询分子</a></li> -->
  119. <li class="divider"></li>
  120. <li><a href="#5" onclick="setAddEq()">上传方程式</a></li>
  121. <!-- <li><a href="#5" onclick="setAddMo()">上传分子</a></li> -->
  122. <li class="divider"></li>
  123. <li><a href="#1" onclick="setUpdEq()">修改方程式</a></li>
  124. <!-- <li><a href="#4" onclick="setUpdMo()">修改分子</a></li> -->
  125. </li>
  126. </ul>
  127. </span>
  128. </div>
  129. <div class="input-group addInput">
  130. <span id="addId"><span class="input-group-addon">id</span>
  131. <input type="text" class="form-control" id="addIdText" oninput="inputId()" autocomplete="off"
  132. placeholder="1">
  133. </span>
  134. <span><span class="input-group-addon">反应条件</span>
  135. <input id="addCondition" type="text" class="form-control" autocomplete="off"
  136. placeholder="加热;高温;点燃;通电;光照;MnO2">
  137. </span>
  138. <span><span class="input-group-addon">描述</span>
  139. <textarea id="addDescription" type="text" class="form-control" autocomplete="off"
  140. style="resize:vertical"></textarea>
  141. </span>
  142. <span class="input-group-addon">:)</span>
  143. </div>
  144. <pre class="ok" style="font-family: 'Consolas'"></pre>
  145. <hr>
  146. <div class="well frame">
  147. <span id="qryInputRender"></span>
  148. </div>
  149. </div>
  150. <div class="col-lg-2 col-md-12 col-xs-12">
  151. <button class="btn btn-default" onclick="$('.help').toggle(300)"><i
  152. class="glyphicon glyphicon-question-sign"></i></button>
  153. </div>
  154. </div>
  155. <div class="row help" style="display:none;">
  156. <p>忽然觉得可能多数人看到这个界面会一脸懵,所以我还是写个说明吧。</p>
  157. <p>上下两个面板都可以用文字直接输入化学式,上面那个负责运算,下面那个负责数据库的交互。</p>
  158. <p>具体怎么操作相信大家都能看懂,用最右边的箭头可以切换功能,然后输入化学式,按下按钮,或者回车也行。至于相对质量,由于不需要多少算力,它是实时更新的。</p>
  159. <p>我运用了聪明绝顶的正则表达式(也就是那一串火星文),保证了查询方程式时,只要所有分子完全匹配,无论顺序都能查得到。你也可以改为只查包含某种元素的化学式,按左边的按钮就行。</p>
  160. <p>左边的箭头按钮考虑的是在上下之间快速复制粘贴方程式,不过这个功能还没完全实现。以及根据描述查询方程式的功能也还没实现。</p>
  161. <p>我目前只录入了高一上学期讲的一些式子,你要是吃饱了闲着没事干也可以帮我录入。查到的方程式带着的数字就是它的 id,修改的时候用得到。</p>
  162. </div>
  163. </body>
  164. </html>