index.html 9.0 KB

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