index.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. <button class="btn btn-default" onclick="$('.help').toggle(300)"><i
  64. class="glyphicon glyphicon-question-sign"></i></button>
  65. <hr>
  66. </div>
  67. <div class="col-lg-8 col-md-10 col-xs-12">
  68. <div class="input-group">
  69. <span class="input-group-btn">
  70. <button type="button" class="btn btn-default" onclick="balUp()" id="balShare" title="导入配平结果"> <span
  71. class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></button>
  72. </span>
  73. <input id="balInput" type="text" class="form-control" oninput="input()" autocomplete="off">
  74. <span class="input-group-btn">
  75. <button type="button" class="btn btn-default" onclick="balance()" id="balBtn">配平</button>
  76. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  77. <span class="caret"></span>
  78. <span class="sr-only">切换下拉菜单</span>
  79. </button>
  80. <ul class="dropdown-menu" role="menu">
  81. <li class="dropdown-header">功能</li>
  82. <li><a href="#" onclick="setBal()">配平</a></li>
  83. <li><a href="#" onclick="setWeigh()">相对质量</a></li>
  84. <li><a href="#" onclick="setWeigh2()" data-toggle="tooltip" data-placement="left"
  85. title="四位有效数字">相对质量*</a></li>
  86. <li class="divider"></li>
  87. <li><a href="/chemist" data-toggle="tooltip" data-placement="left" title="将打开新页面">配平接口</a>
  88. </li>
  89. <!-- <li class="divider"></li>
  90. <li><a href="#" data-toggle="tooltip" data-placement="left" title="将会对所有人可见">发送到数据库</a></li> -->
  91. </ul>
  92. </span>
  93. </div>
  94. <hr>
  95. <div class="well frame">
  96. </div>
  97. <hr>
  98. <div class="input-group">
  99. <span class="input-group-btn">
  100. <button type="button" class="btn btn-default" onclick="qryUp()" id="qryShare" title="导入配平结果"> <span
  101. class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></button>
  102. <button type="button" class="btn btn-default" data-toggle="button" onclick="qryToggleMatch()"
  103. id="qryMatch">匹配分子</button>
  104. </span>
  105. <input id="qryInput" type="text" class="form-control qryInput" autocomplete="off" oninput="input2()">
  106. <span class="input-group-addon qryInputHidable" style="display:none">=</span>
  107. <input id="qryInput2" type="text" class="form-control qryInput qryInputHidable" style="display:none"
  108. autocomplete="off" oninput="input2()">
  109. <span class="input-group-btn">
  110. <button type="button" class="btn btn-default" onclick="query()" id="qryBtn">查询方程式</button>
  111. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  112. <span class="caret"></span>
  113. <span class="sr-only">切换下拉菜单</span>
  114. </button>
  115. <ul class="dropdown-menu" role="menu">
  116. <li class="dropdown-header">功能</li>
  117. <li><a href="#1" onclick="setQryEq()">查询方程式</a></li>
  118. <li><a href="#1" onclick="setQryEq2()" data-toggle="tooltip" data-placement="left"
  119. title="限制等号左右">查询方程式*</a></li>
  120. <!-- <li><a href="#4" onclick="setQryMo()">查询分子</a></li> -->
  121. <li class="divider"></li>
  122. <li><a href="#5" onclick="setAddEq()">上传方程式</a></li>
  123. <!-- <li><a href="#5" onclick="setAddMo()">上传分子</a></li> -->
  124. <li class="divider"></li>
  125. <li><a href="#1" onclick="setUpdEq()">修改方程式</a></li>
  126. <!-- <li><a href="#4" onclick="setUpdMo()">修改分子</a></li> -->
  127. </li>
  128. </ul>
  129. </span>
  130. </div>
  131. <div class="input-group addInput">
  132. <span id="addId"><span class="input-group-addon">id</span>
  133. <input type="text" class="form-control" id="addIdText" oninput="inputId()" autocomplete="off"
  134. placeholder="1">
  135. </span>
  136. <span><span class="input-group-addon">反应条件</span>
  137. <input id="addCondition" type="text" class="form-control" autocomplete="off"
  138. placeholder="加热;高温;点燃;通电;光照;MnO2">
  139. </span>
  140. <span><span class="input-group-addon">描述</span>
  141. <textarea id="addDescription" type="text" class="form-control" autocomplete="off"
  142. style="resize:vertical"></textarea>
  143. </span>
  144. <span class="input-group-addon">:)</span>
  145. </div>
  146. <pre class="ok" style="font-family: 'Consolas'"></pre>
  147. <hr>
  148. <div class="well frame">
  149. <span id="qryInputRender"></span>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="help" style="display:none">
  154. <p>忽然觉得可能多数人看到这个界面会一脸懵,所以我还是写个说明吧。</p>
  155. <p>上下两个面板都可以用文字直接输入化学式,上面那个负责运算,下面那个负责数据库的交互。</p>
  156. <p>具体怎么操作相信大家都能看懂,用最右边的箭头可以切换功能,然后输入化学式,按下按钮,或者回车也行。至于相对质量,由于不需要多少算力,它是实时更新的。</p>
  157. <p>我运用了聪明绝顶的正则表达式(也就是那一串火星文),保证了查询方程式时,只要所有分子完全匹配,无论顺序都能查得到。你也可以改为只查包含某种元素的化学式,按左边的按钮就行。</p>
  158. <p>左边的箭头按钮考虑的是在上下之间快速复制粘贴方程式,不过这个功能还没完全实现。以及根据描述查询方程式的功能也还没实现。</p>
  159. <p>我目前只录入了高一上学期末讲的一些硫有关的式子,你要是吃饱了闲着没事干也可以帮我录入。查到的方程式带着的数字就是它的 id,修改的时候用得到到。</p>
  160. </div>
  161. </body>
  162. </html>