feat: 优化问题页面样式并添加复制功能

This commit is contained in:
2026-04-11 19:44:27 +08:00
parent 5a39432029
commit ab2a3ca65f
3 changed files with 87 additions and 11 deletions

View File

@@ -97,7 +97,15 @@
<?php <?php
foreach($view_problemset as $row){ foreach($view_problemset as $row){
echo "<tr>"; echo "<tr>";
foreach($row as $table_cell){ foreach($row as $cell_index => $table_cell){
if ($cell_index === 0) {
$status_value = trim(strip_tags($table_cell));
if ($status_value === 'Y') {
$table_cell = '<span style="color:#21ba45" title="Y">✅</span>';
} else if ($status_value === 'N') {
$table_cell = '<span style="color:#db2828" title="N">❌</span>';
}
}
echo "<td>".$table_cell."</td>"; echo "<td>".$table_cell."</td>";
} }
echo "</tr>"; echo "</tr>";

View File

@@ -2,5 +2,69 @@
font-family: 'Fira Mono'; font-family: 'Fira Mono';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-display: swap;
src: url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype'); src: url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
} }
@font-face {
font-family: 'Sarasa Mono SC';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Sarasa Mono SC'), local('SarasaMonoSC-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'Sarasa Fixed SC';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Sarasa Fixed SC'), local('SarasaFixedSC-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'Sarasa Gothic SC';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Sarasa Gothic SC'), local('SarasaGothicSC-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('JetBrains Mono'), local('JetBrainsMono-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'Cascadia Code';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Cascadia Code'), local('CascadiaCode-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'Cascadia Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Cascadia Mono'), local('CascadiaMono-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}
@font-face {
font-family: 'source-code-pro';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(../fonts/N0bX2SlFPv1weGeLZDtgJv7X.ttf) format('truetype');
}

View File

@@ -47,16 +47,22 @@ if ($pr_flag) {
.sample-header { .sample-header {
display: flex !important; display: flex !important;
align-items: center; align-items: center;
justify-content: space-between;
gap: 12px;
} }
.sample-box { .sample-box {
position: relative;
border: 1px solid #cfd7e6 !important; border: 1px solid #cfd7e6 !important;
background: linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%) !important; background: linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%) !important;
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
} }
.sample-copy {
position: absolute;
top: 12px;
right: 12px;
z-index: 2;
}
.sample-box pre { .sample-box pre {
margin: 0; margin: 0;
padding: 16px 18px; padding: 16px 18px;
@@ -256,12 +262,11 @@ if ($pr_flag) {
<?php if (strlen($sinput) > 0 && $sinput != "\n" || isset($_GET['spa'])) { ?> <?php if (strlen($sinput) > 0 && $sinput != "\n" || isset($_GET['spa'])) { ?>
<div class="row"> <div class="row">
<div class="column"> <div class="column">
<h4 class="ui top attached block header sample-header"><?php echo $MSG_Sample_Input ?> <h4 class="ui top attached block header sample-header"><?php echo $MSG_Sample_Input ?></h4>
<span class="copy" id="copyin"
data-clipboard-text="<?php echo htmlentities($sinput, ENT_QUOTES, 'UTF-8'); ?>"><?php echo $MSG_COPY; ?></span>
</h4>
<!-- <span class=copy id=\"copyin\" data-clipboard-text=\"".($sinput)."\"><?php echo $MSG_COPY; ?></span> --> <!-- <span class=copy id=\"copyin\" data-clipboard-text=\"".($sinput)."\"><?php echo $MSG_COPY; ?></span> -->
<div class="ui bottom attached segment font-content sample-box"> <div class="ui bottom attached segment font-content sample-box">
<span class="copy sample-copy" id="copyin"
data-clipboard-text="<?php echo htmlentities($sinput, ENT_QUOTES, 'UTF-8'); ?>"><?php echo $MSG_COPY; ?></span>
<!-- <pre><?php echo ($sinput); ?></pre> --> <!-- <pre><?php echo ($sinput); ?></pre> -->
<pre <pre
style="margin-top: 0; margin-bottom: 0; "><code id='sinput' class="lang-plain"><?php echo ($sinput); ?></code></pre> style="margin-top: 0; margin-bottom: 0; "><code id='sinput' class="lang-plain"><?php echo ($sinput); ?></code></pre>
@@ -272,12 +277,11 @@ if ($pr_flag) {
<?php if (strlen($soutput) > 0 && $soutput != "\n" || isset($_GET['spa'])) { ?> <?php if (strlen($soutput) > 0 && $soutput != "\n" || isset($_GET['spa'])) { ?>
<div class="row"> <div class="row">
<div class="column"> <div class="column">
<h4 class="ui top attached block header sample-header"><?php echo $MSG_Sample_Output ?> <h4 class="ui top attached block header sample-header"><?php echo $MSG_Sample_Output ?></h4>
<span class="copy" id="copyout"
data-clipboard-text="<?php echo htmlentities($soutput, ENT_QUOTES, 'UTF-8'); ?>"><?php echo $MSG_COPY; ?></span>
</h4>
<!-- <span class=copy id=\"copyout\" data-clipboard-text=\"".($soutput)."\"><?php echo $MSG_COPY; ?></span> --> <!-- <span class=copy id=\"copyout\" data-clipboard-text=\"".($soutput)."\"><?php echo $MSG_COPY; ?></span> -->
<div class="ui bottom attached segment font-content sample-box"> <div class="ui bottom attached segment font-content sample-box">
<span class="copy sample-copy" id="copyout"
data-clipboard-text="<?php echo htmlentities($soutput, ENT_QUOTES, 'UTF-8'); ?>"><?php echo $MSG_COPY; ?></span>
<!-- <div class="ui existing segment"> --> <!-- <div class="ui existing segment"> -->
<pre <pre
style="margin-top: 0; margin-bottom: 0; "><code id='soutput' class="lang-plain"><?php echo ($soutput); ?></code></pre> style="margin-top: 0; margin-bottom: 0; "><code id='soutput' class="lang-plain"><?php echo ($soutput); ?></code></pre>