pull/1/head
韩天峰 3 years ago
parent 42c0ae378d
commit 706f471028
  1. 2
      web/include/lang.php
  2. 25
      web/public/index.php
  3. 12
      web/public/static/css/style.css

@ -1,4 +1,4 @@
<select id="selectLanguage">
<select id="selectLanguage" disabled="disabled">
<?php if (false): ?>
<option value="language-html">HTML</option>
<option value="language-javascript">JavaScript</option>

@ -4,6 +4,20 @@
<head>
<title>Convert Python code to PHP</title>
<style id="styleFont">
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400&display=swap');
#preCode code,
textarea,
#lineNumbers,
.lineNumbers {
font-family: "Roboto Mono", monospace;
font-weight: 400;
font-size: 12pt;
line-height: 150%;
}
</style>
<link href="/static/css/style.css" rel="stylesheet"/>
<link id='theme1' href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/a11y-dark.min.css"
rel="stylesheet"/>
@ -20,19 +34,18 @@
define('ROOT_PATH', dirname(__DIR__));
?>
<p style="height: 36px">
编程语言:
<?php include ROOT_PATH . '/include/lang.php'; ?>
风格:
<?php include ROOT_PATH . '/include/style.php'; ?>
字体:
<?php include ROOT_PATH . '/include/font.php'; ?>
字体尺寸:
<input id="inputFontSize" type="number" step=".1" value="12" style="width: 40px;"/>
编程语言:
<?php include ROOT_PATH . '/include/lang.php'; ?>
<input id="inputFontSize" type="number" step="1" value="12" style="width: 40px;"/>
行高 (%):
<input id="lineHeight" type="number" value="200" style="width: 50px;"/>
<input id="lineHeight" type="number" step="10" value="200" style="width: 50px;"/>
</p>
<!-- Textarea, the code editor -->
<div id="divCodeWrapper">
<pre><code style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" class="lineNumbers"></code></pre>
<pre><code id="lineNumbers" style="opacity: 0.5;"></code></pre>
@ -114,7 +127,7 @@ define('ROOT_PATH', dirname(__DIR__));
}
function updateLang() {
document.getElementById("codeBlock").className = $("#selectLanguage").val()
document.getElementById("codeBlock").className = $("#selectLanguage").val()
highlightJS()
}

@ -1,19 +1,7 @@
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400&display=swap');
select {
height: 24px;
}
#preCode code,
textarea,
#lineNumbers,
.lineNumbers {
font-family: "Roboto Mono", monospace;
font-weight: 400;
font-size: 12pt;
line-height: 150%;
}
#divCodeWrapper {
height: calc(100vh - 200px);
max-height: 800px;

Loading…
Cancel
Save