Skip to content

Commit

Permalink
Merge pull request #10 from csthenry/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
csthenry authored Dec 7, 2023
2 parents fc65c7d + d0a54e4 commit de96437
Show file tree
Hide file tree
Showing 26 changed files with 569 additions and 592 deletions.
128 changes: 108 additions & 20 deletions hoj-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,99 @@ export default {
</script>

<style>
@import url("./assets/fonts/harmonyos.css");
@import url("./assets/css/harmonyos.css");
@import url("./assets/css/darkmode.color.css");
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
--border-color: #e8eaec;
--row-stripe-bg-color: #fafafa;
--nav-bg-color: rgba(255,255,255,0.7);
--data-nav-bg-color: hsl(211, 20%, 97%);
--box-bg-color: #fff;
--bg-color: #eff3f5;
--el-text-color: #495060;
--text-color: #495060;
--submit-row-color: #e6ffdf;
--code-pre-numbering-bg-color: #f1f1f1;
--code-bg-color: #fafafa;
}
body {
background-color: #eff3f5 !important;
font-family: "HarmonyOS Sans SC", "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif !important;
color: #495060 !important;
font-size: 12px !important;
color: var(--text-color)!important;
background-color: var(--bg-color)!important;
}
.dark {
--row-stripe-bg-color: #141414;
--nav-bg-color: #1d1e1f;
--data-nav-bg-color: #333333;
--box-bg-color:#1d1e1f;
--border-color: #4c4d4f;
--bg-color: #141414;
--el-text-color: #9d9d9d;
--code-pre-numbering-bg-color: #141414;
--code-bg-color: #1d1e1f;
--text-color: #b5bcc9;
--submit-row-color: #172116;
}
.dark .el-divider__text {
background-color: #1d1e1f!important;
}
.dark .el-card__header {
border-bottom: none;
}
.v-note-wrapper .v-note-panel .v-note-show .v-show-content, .v-note-wrapper .v-note-panel .v-note-show .v-show-content-html {
color: #606266;
}
.vxe-table {
color: var(--text-color)!important;
background-color: var(--bg-color)!important;
}
.vxe-table .vxe-table--header-wrapper {
background-color: var(--box-bg-color)!important;
}
.vxe-table .vxe-table--body-wrapper, .vxe-table .vxe-table--footer-wrapper {
background-color: var(--box-bg-color)!important;
}
.vxe-table .vxe-table--body {
background-color: var(--row-stripe-bg-color)!important;
}
.vxe-table .vxe-body--row.row--stripe {
background-color: var(--box-bg-color)!important;
}
.vxe-table.border--default .vxe-body--column, .vxe-table.border--default .vxe-footer--column, .vxe-table.border--default .vxe-header--column, .vxe-table.border--inner .vxe-body--column, .vxe-table.border--inner .vxe-footer--column, .vxe-table.border--inner .vxe-header--column {
background-image: -webkit-gradient(linear,left top, left bottom,from(var(--border-color)),to(var(--border-color)))!important;
background-image: linear-gradient(var(--border-color),var(--border-color))!important;
}
.vxe-table .vxe-table--header-wrapper .vxe-table--header-border-line, .vxe-table .vxe-table--border-line {
border-bottom: 1px solid var(--border-color)!important;
}
.vxe-table .vxe-table--border-line {
border: 1px solid var(--border-color)!important;
}
.vxe-input--inner {
border: 1px solid var(--border-color)!important;
color: var(--text-color)!important;
background-color: var(--box-bg-color)!important;
}
.vxe-input:not(.is--disabled).is--active .vxe-input--inner {
border: 1px solid #409eff!important;
}
.mu-paper {
background-color: var(--box-bg-color)!important;
}
.mu-item, .mu-item-action {
color: var(--text-color)!important;
}
.el-menu-item, .el-submenu__title {
color: var(--text-color)!important;
font-size: 16px;
}
code,
kbd,
Expand All @@ -295,7 +375,7 @@ samp {
min-height: 12px;
min-width: 10px;
border-radius: 8px;
background-color: #bbb;
background-color: var(--text-color);
}
::-webkit-scrollbar-thumb:hover {
Expand Down Expand Up @@ -336,7 +416,7 @@ samp {
a {
text-decoration: none;
background-color: transparent;
color: #495060;
color: var(--text-color);
outline: 0;
cursor: pointer;
transition: color 0.2s ease;
Expand All @@ -345,10 +425,17 @@ a:hover {
color: #2196f3 !important;
}
.markdown-body {
color: var(--text-color);
font-family: -apple-system, BlinkMacSystemFont, PingFang SC, HarmonyOS Sans SC,
Segoe UI, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial,
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
}
.markdown-body table tr {
background-color: var(--bg-color);
}
.markdown-body table tr:nth-child(2n) {
background-color: var(--box-bg-color);
}
.markdown-body a {
color: #2196f3;
cursor: pointer;
Expand Down Expand Up @@ -529,19 +616,18 @@ a:hover {
color: #fff !important;
}
.own-submit-row {
background: rgb(230, 255, 223) !important;
background: var(--submit-row-color) !important;
}
.submission-hover:hover {
cursor: pointer;
}
.vxe-table {
color: #000 !important;
font-size: 12px !important;
font-weight: 500 !important;
}
.row--hover {
cursor: pointer;
background-color: #ebf7ff !important;
background-color: var(--box-bg-color)!important;
}
.vxe-table .vxe-body--column:not(.col--ellipsis),
.vxe-table .vxe-footer--column:not(.col--ellipsis),
Expand Down Expand Up @@ -588,7 +674,7 @@ a:hover {
-ms-flex-item-align: stretch;
align-self: stretch;
border-style: solid;
background: #fafafa;
background-color: var(--code-bg-color);
border-left: 2px solid #3498db;
}
Expand All @@ -597,7 +683,7 @@ a:hover {
white-space: pre-wrap;
margin-top: 15px;
margin-bottom: 15px;
background: #fafafa;
background-color: var(--code-bg-color);
border: 1px dashed #e9eaec;
}
Expand All @@ -610,7 +696,7 @@ a:hover {
text-align: center;
}
.el-tag--dark {
border-color: #fff !important;
border: none !important;
}
.el-notification .el-icon-info {
color: #409eff;
Expand Down Expand Up @@ -723,12 +809,12 @@ a:hover {
}
footer {
color: #555 !important;
background-color: #fff;
color: var(--text-color) !important;
background-color: var(--box-bg-color);
text-align: center;
}
footer a {
color: #555;
color: var(--text-color);
}
footer a:hover {
color: #409eff;
Expand All @@ -739,7 +825,7 @@ footer h1 {
Segoe UI, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial,
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
font-weight: 300;
color: #3d3d3d;
color: var(--text-color);
line-height: 1.1;
font-size: 1.5rem;
}
Expand Down Expand Up @@ -775,12 +861,12 @@ footer h1 {
.markdown-body pre {
display: block;
border-radius: 3px !important;
border: 1px solid #c3ccd0;
border: 1px solid var(--border-color);
padding: 0 16px 0 50px !important;
position: relative !important;
overflow-y: hidden !important;
font-size: 1rem !important;
background: #fafafa !important;
background-color: var(--code-bg-color) !important;
white-space: pre !important;
}
.markdown-body pre code {
Expand All @@ -795,7 +881,7 @@ footer h1 {
padding: 0;
list-style-type: none;
counter-reset: sectioncounter;
background: #f1f1f1;
background-color: var(--code-pre-numbering-bg-color);
color: #777;
font-size: 12px;
}
Expand Down Expand Up @@ -855,12 +941,12 @@ footer h1 {
padding-bottom: 0.3em;
font-size: 1.86em;
line-height: 1.2;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--border-color);
}
.markdown-body h2 {
font-size: 1.45em;
line-height: 1.425;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--border-color);
padding: 8px 10px;
color: #545857;
border-radius: 3px;
Expand Down Expand Up @@ -897,6 +983,8 @@ footer h1 {
line-height: 1.8;
}
.hljs {
color: var(--text-color) !important;
background: var(--code-bg-color) !important;
padding: 0 !important;
}
</style>
1 change: 1 addition & 0 deletions hoj-vue/src/assets/css/darkmode.color.css

Large diffs are not rendered by default.

File renamed without changes.
55 changes: 55 additions & 0 deletions hoj-vue/src/common/darkmodedom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
function hasClass(el, cls) {
if (!el || !cls) return false
if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.')
if (el.classList) {
return el.classList.contains(cls)
} else {
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1
}
}

function addClass(el, cls) {
if (!el) return
var curClass = el.className
var classes = (cls || '').split(' ')

for (var i = 0, j = classes.length; i < j; i++) {
var clsName = classes[i]
if (!clsName) continue

if (el.classList) {
el.classList.add(clsName)
} else if (!hasClass(el, clsName)) {
curClass += ' ' + clsName
}
}
if (!el.classList) {
el.setAttribute('class', curClass)
}
}

function removeClass(el, cls) {
if (!el || !cls) return
var classes = cls.split(' ')
var curClass = ' ' + el.className + ' '

for (var i = 0, j = classes.length; i < j; i++) {
var clsName = classes[i]
if (!clsName) continue

if (el.classList) {
el.classList.remove(clsName)
} else if (hasClass(el, clsName)) {
curClass = curClass.replace(' ' + clsName + ' ', ' ')
}
}
if (!el.classList) {
el.setAttribute('class', trim(curClass))
}
}

module.exports = {
hasClass,
addClass,
removeClass,
}
8 changes: 4 additions & 4 deletions hoj-vue/src/components/oj/comment/comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,9 @@ export default {
.container {
padding: 10px 20px;
box-sizing: border-box;
background-color: #fff;
background-color: var(--box-bg-color);
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
border: 1px solid #ebeef5;
border: 1px solid var(--border-color);
margin-bottom: 10px;
}
.container .own-input {
Expand Down Expand Up @@ -1098,7 +1098,7 @@ export default {
display: flex;
flex-direction: column;
padding: 10px;
border-top: 1px solid #eee;
border-top: 1px solid var(--border-color);
}
.container .comment .info {
display: flex;
Expand Down Expand Up @@ -1127,7 +1127,7 @@ export default {
}
.container .comment .content {
font-size: 16px;
color: #303133;
color: var(--text-color);
line-height: 20px;
padding: 10px 0;
}
Expand Down
2 changes: 1 addition & 1 deletion hoj-vue/src/components/oj/common/Announcements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default {
}
.flex-container .title .entry {
color: #495060;
color: var(--text-color);
font-size: 18px;
}
.flex-container .title a:hover {
Expand Down
6 changes: 3 additions & 3 deletions hoj-vue/src/components/oj/common/CodeMirror.vue
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ export default {
}
.setting-title {
border-bottom: 1px solid #f3f3f6;
color: #000;
color: var(--text-color);
font-weight: 700;
padding: 10px 0;
}
Expand All @@ -1000,7 +1000,7 @@ export default {
}
.setting-item-name {
flex: 2;
color: #333;
color: var(--text-color);
font-weight: 700;
font-size: 13px;
margin-top: 7px;
Expand Down Expand Up @@ -1049,7 +1049,7 @@ export default {
flex: 10;
}
/deep/.el-textarea__inner[readonly] {
background-color: #f7f8f9 !important;
background-color: var(--bg-color) !important;
}
.color-gray {
color: #999;
Expand Down
Loading

0 comments on commit de96437

Please sign in to comment.