From ed1512f9d488f02fae872bdfbeaf7aecc5caa7fe Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 26 Nov 2023 21:08:45 +0800 Subject: [PATCH] add main.css --- const.js | 4 ++-- index.css | 47 ++++++++++++++------------------------------ lib/misc.js | 4 ++-- panel/header.js | 2 +- plugin/input/date.js | 11 +++++++---- 5 files changed, 27 insertions(+), 41 deletions(-) diff --git a/const.js b/const.js index 40f990c5..ceb26fc7 100644 --- a/const.js +++ b/const.js @@ -153,8 +153,8 @@ var nfs = { SH: "sh", SHY: "shy", GO: "go", JS: "js", CSS: "css", HTML: "html", SVG: "svg", _JS: ".js", _CSS: ".css", TXT: "txt", CSV: "csv", JSON: "json", PNG: "png", WEBM: "webm", - PWD: "./", SRC: "src/", SRC_TEMPLATE: "src/template/", SRC_DOCUMENT: "src/document/", - SRC_TEMPLATE_WEB_FAVICON: "src/template/web/favicon.ico", + PWD: "./", SRC: "src/", SRC_MAIN_ICO: "src/main.ico", + SRC_TEMPLATE: "src/template/", SRC_DOCUMENT: "src/document/", USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", USR_VOLCANOS: "usr/volcanos/", USR_GEOAREA: "usr/geoarea/", USR_ICONS: "usr/icons/", USR_INTSHELL: "usr/intshell", USR_LEARNING: "usr/learning", REQUIRE: "/require/", REQUIRE_MODULES: "/require/modules/", diff --git a/index.css b/index.css index b57f02c7..d1558e45 100644 --- a/index.css +++ b/index.css @@ -1,15 +1,15 @@ body { - --body-bg-color:black; --body-fg-color:silver; --danger-bg-color:red; --danger-fg-color:var(--notice-fg-color); --notice-bg-color:blue; --notice-fg-color:white; --create-bg-color:var(--notice-bg-color); --create-fg-color:var(--notice-fg-color); --progress-bg-color:red; --disable-fg-color:gray; --hover-bg-color:#5066b945; --hover-fg-color:var(--notice-fg-color); --box-border:#404141 solid 1px; --box-shadow:var(--body-fg-color) 2px 2px 8px; --box-notice:var(--notice-bg-color) solid 1px; + --body-bg-color:var(--plugin-bg-color); --body-fg-color:var(--plugin-fg-color); - --plugin-bg-color:var(--body-bg-color); --plugin-fg-color:var(--body-fg-color); --plugin-border-color:var(--box-border); + --plugin-bg-color:black; --plugin-fg-color:silver; --plugin-border-color:var(--box-border); --legend-bg-color:var(--plugin-bg-color); - --input-bg-color:var(--body-bg-color); --input-fg-color: var(--body-fg-color); --input-border:var(--box-border); + --input-bg-color:var(--plugin-fg-color); --input-fg-color: var(--plugin-fg-color); --input-border:var(--box-border); --output-bg-color:var(--input-bg-color); --output-fg-color:var(--input-fg-color); --status-border:var(--box-border); --th-bg-color:var(--plugin-bg-color); --th-fg-color:var(--plugin-fg-color); --tr-hover-bg-color:var(--hover-bg-color); --td-hover-bg-color:var(--hover-bg-color); @@ -101,11 +101,11 @@ fieldset>form.option>div.item.text.cmd>input { background-color:var(--code-bg-co fieldset>form.option>div.item.select { border-radius:var(--button-radius); } fieldset>form.option>div.item.select>input { min-width:var(--button-width); } fieldset>form.option>div.item.button { border-radius:var(--button-radius); } -fieldset>div.action>div.item { box-shadow:var(--box-shadow); height:var(--action-height); } -fieldset>div.action>div.item:not(:last-child) { margin-right:var(--button-margin); } -fieldset>div.action>div.item.button { border-radius:var(--button-radius); } -fieldset>div.action>div.item.select:not(.cmds) { border-radius:var(--button-radius); } -fieldset>div.action>div.item.select.cmds { border-bottom:var(--notice-bg-color) solid 2px; height:var(--action-height); } +fieldset>div.action div.item { box-shadow:var(--box-shadow); height:var(--action-height); } +fieldset>div.action div.item:not(:last-child) { margin-right:var(--button-margin); } +fieldset>div.action div.item.button { border-radius:var(--button-radius); } +fieldset>div.action div.item.select:not(.cmds) { border-radius:var(--button-radius); } +fieldset>div.action div.item.select.cmds { border-bottom:var(--notice-bg-color) solid 2px; height:var(--action-height); } fieldset>div.output { width:100%; } fieldset>div.status { width:100%; } fieldset.input>legend { display:none; } @@ -115,18 +115,15 @@ fieldset.input.key div.status { background-color:var(--plugin-bg-color); } fieldset.input.key div.status:not(.hide) { display:block; position:sticky; bottom:0; } fieldset.input.key.simple th { display:none; } fieldset.input.key.simple td { min-width:var(--button-width); } -fieldset.input.date>div.action>div.item.next { margin-right:0; } -fieldset.input.date>div.action>div.item.today { margin-right:0; } -fieldset.input.date>div.output table.content { text-align:center; width:100%; min-width:350px; border:var(--notice-bg-color) solid 1px; } -fieldset.input.date>div.output td { padding:2px 10px; } +fieldset.input.date>div.action>div { display:flex; justify-content:space-between; } +fieldset.input.date>div.output table.content { text-align:center; width:100%; border:var(--notice-bg-color) solid 1px; } fieldset.input.date>div.output td.prev { color:var(--disable-fg-color); } fieldset.input.date>div.output td.next { color:var(--disable-fg-color); } -fieldset.input.date>div.output td.select { background-color:var(--hover-bg-color); } -fieldset.input.date>div.output td:hover { background-color:var(--hover-bg-color); } fieldset.input.date>div.output td span.lunar { font-size:8px; display:block; clear:both; } fieldset.input.date>div.output td span.lunar.term { color:green; } fieldset.input.date>div.output td span.lunar.fest { color:red; } fieldset.input.date>div.status { text-align:center; } +fieldset.input.date>div.status>div.today { padding:var(--input-padding); } fieldset.input.icon img { height:var(--desktop-icon-size); width:var(--desktop-icon-size); } /* float */ body div.float { padding:var(--plugin-padding); box-shadow:var(--box-shadow); } @@ -226,12 +223,6 @@ body.mobile.landscape>div.input.login { padding:0; } body.mobile.landscape>div.input.login>div.output { height:290px; } body.mobile.landscape>div.input.login>div.output img { max-height:280px; } legend, select, input[type=button], table.content td, th, h1, h2, h3, div.item, div.tabs, div.menu { cursor:pointer; } div.story[data-type=spark] { cursor:copy; } -body.en fieldset.input.date>div.action>div.item.select select { width:55px; } -body.en fieldset.input.date>div.action>div.item.select.year select { width:100px; } -body.en fieldset.input.date>div.action>div.item.select.month select { width:100px; } -body.zh fieldset.input.date>div.action>div.item.select select { width:58px; } -body.zh fieldset.input.date>div.action>div.item.select.year select { width:81px; } -body.zh fieldset.input.date>div.action>div.item.select.month select { width:81px; } body table.content { font-family:var(--table-font-family); } body div.code { font-family:var(--table-font-family); } body div.tabs { font-family:var(--code-font-family); } @@ -270,7 +261,7 @@ div.tabs>span.icon { font-size:var(--icon-font-size); font-style:normal; padding div.tabs.select>span.icon { visibility:visible; } div.tabs:hover>span.icon { visibility:visible; } /* div.action>div.item.icons.start>span.icon { font-size:30px; line-height:28px; } */ -fieldset.plugin>legend { font-style:italic; font-weight:bold; } +fieldset.plugin>legend { font-style:italic; } fieldset.plugin>form.option>div.button.icons>input { display:none; } fieldset.plugin>div.action>div.button.icons>input { display:none; } fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; } @@ -560,23 +551,16 @@ fieldset.draw>div.output>div.layout>div.layout>div.profile { width:var(--project fieldset.word>div.output>fieldset.story:not(.full) { margin:var(--title-margin) 0; } fieldset.word>div.output fieldset.story:not(.float):not(.full)>form.option>div.icon.delete { display:none; } fieldset.input.icon div.output td { font-size:28px; padding:var(--input-padding); } -fieldset.macos.desktop.cmd>div.output>fieldset.macos.dock { z-index:11; } fieldset.web.code.git>div.output>fieldset.web.code.inner>div.output { overflow:auto; } fieldset.web.code.git.status>div.output table.content { width:100%; } fieldset.web.code.git.total.draw div.output { text-align:center; } -fieldset.web.code.docker.studio>div.action>div.item { font-style:italic; padding:var(--input-margin) var(--button-padding); } -fieldset.web.code.docker.studio>div.output>fieldset { margin:0; } -fieldset.web.code.docker.studio>div.output>fieldset>legend { display:none; } -fieldset.web.code.docker.studio>div.output>fieldset>form.option>div:first-child { margin-left:var(--button-margin); } fieldset.web.wiki.draw div.output svg { min-width:100%; min-height:100%; } -fieldset.web.chat.wx.scan>div.output>table.content tr.expired { color:var(--disable-fg-color); } fieldset.web.chat.location>div.output>div.layout>div.layout { position:relative; } +fieldset.web.chat.location>div.output .amap-toolbar { z-index:unset; } +fieldset.web.chat.location>div.output .amap-controls { z-index:unset; } +fieldset.web.chat.location>div.output .amap-maptypecontrol { z-index:unset; } fieldset.web.chat.location>div.output>div.layout>div.layout>div.profile { background-color:var(--plugin-bg-color); position:absolute; right:0; width:360px; z-index:9; border-left:none; } fieldset.web.chat.iframe>form.option input[name=hash] { width:var(--river-width); } -fieldset.web.mall.region>div.output>table.content td:nth-child(3) { text-align:right; } -fieldset.web.mall.region>div.output>table.content td:nth-child(4) { text-align:right; } -fieldset.web.mall.region>div.output>table.content td:nth-child(5) { text-align:right; } -fieldset.web.mall.region>div.output>fieldset.web.mall.region.float>div.action { display:none; } fieldset.can.view { font-size:14px; } fieldset.can.data { font-size:14px; } fieldset.Search div.story[data-type=spark] { margin:0; } @@ -595,7 +579,6 @@ fieldset.plug>div.output table.content { width:100%; } fieldset.plug.dream.zone>div.output>div.item { display:flex; padding:var(--input-padding); } fieldset.plug.dream.zone>div.output>div.item>img { margin-right:var(--input-margin); } fieldset.plug.dream.zone>div.output>div.item>span { line-height:var(--action-height); } -body.cmd.web.chat.macos.desktop { background-color:#8ebff2; } body>div.input.vimer.plug td:first-child { display:none; } body>div.carte.header.avatar img { min-width:400px; } body>fieldset.story.web.chat.wx.agent { position:fixed; left:0; bottom:0; } diff --git a/lib/misc.js b/lib/misc.js index 8e5cbf1b..3538f41a 100644 --- a/lib/misc.js +++ b/lib/misc.js @@ -146,9 +146,9 @@ Volcanos("misc", { }) } return socket }, - ResourceFavicon(can) { return can.misc.Resource(can, nfs.SRC_TEMPLATE_WEB_FAVICON) }, + ResourceFavicon(can) { return can.misc.Resource(can, nfs.SRC_MAIN_ICO) }, Resource(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } - return can.base.MergeURL(nfs.REQUIRE+path+_version, ice.POD, space||can.ConfSpace()) + return can.base.MergeURL(nfs.REQUIRE+path+_version, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD)) }, ShareLocal(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } return can.base.MergeURL(nfs.SHARE_LOCAL+path+_version, ice.POD, space||can.ConfSpace()) diff --git a/panel/header.js b/panel/header.js index 9926e49e..49f5656e 100644 --- a/panel/header.js +++ b/panel/header.js @@ -53,7 +53,7 @@ Volcanos(chat.ONACTION, {_init: function(can) { onsize: function(can) { can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth) }, onmain: function(can) { function lang(msg, cb) { can.user.info.language = msg.SearchOrOption(aaa.LANGUAGE) - can.user.info.language? can.require([nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/language/"+can.user.info.language+".js"], cb, function(can, name, sub) { can.base.Copy(can.user._trans, sub._trans) }): cb && cb() + can.user.info.language? can.require([can.misc.Resource(can, nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/language/"+can.user.info.language+".js")], cb, function(can, name, sub) { can.base.Copy(can.user._trans, sub._trans) }): cb && cb() } if (!can.user.isMailMaster) { if (can.misc.Search(can, ice.MSG_SESSID)) { can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID)); return can.misc.Search(can, ice.MSG_SESSID, "") } } function show(msg) { var p = can.misc.Search(can, "redirect_uri") diff --git a/plugin/input/date.js b/plugin/input/date.js index 4049151f..c92bc4e9 100644 --- a/plugin/input/date.js +++ b/plugin/input/date.js @@ -3,9 +3,7 @@ Volcanos(chat.ONFIGURE, {date: { const TODAY = "today", YEAR = "year", MONTH = "month", HOUR = "hour", MINUTE = "minute", SECOND = "second" var today = new Date(), now = can.base.Date((target.value||"").trim()); function _cb(_now) { cb(can, can.user.time(can, now = _now), target.value) } can.base.Copy(can._trans, kit.Dict(TODAY, "今天", mdb.NEXT, "下一月", mdb.PREV, "上一月")) - can.onappend._action(can, [cli.CLOSE, [HOUR].concat(can.core.List(24)), [MINUTE].concat(can.core.List(0, 60, 5)), [SECOND].concat(can.core.List(0, 60, 5)), - TODAY, "", mdb.PREV, [YEAR].concat(can.core.List(now.getFullYear() - 10, now.getFullYear() + 10)), [MONTH].concat(can.core.List(1, 13)), mdb.NEXT, - ], can.onmotion.clear(can, can._action), kit.Dict(cli.CLOSE, function() { can.close() }, + var meta = kit.Dict(cli.CLOSE, function() { can.close() }, HOUR, function(event, can, button, value) { now.setHours(parseInt(value)||0), show(now) }, MINUTE, function(event, can, button, value) { now.setMinutes(parseInt(value)||0), show(now) }, SECOND, function(event, can, button, value) { now.setSeconds(parseInt(value)||0), show(now) }, @@ -14,7 +12,12 @@ Volcanos(chat.ONFIGURE, {date: { YEAR, function(event, can, button, value) { now.setFullYear(parseInt(value)), show(now) }, MONTH, function(event, can, button, value) { now.setMonth(parseInt(value)-1), show(now) }, mdb.NEXT, function() { now.setMonth(now.getMonth()+1), show(now) }, - )), can._table = can.page.Appends(can, can._output, [{view: [chat.CONTENT, html.TABLE], list: [{type: html.TBODY}]}]).tbody + ) + var ui = can.page.Append(can, can._action, ["time", "date"]) + can.onappend._action(can, [cli.CLOSE, [HOUR].concat(can.core.List(24)), [MINUTE].concat(can.core.List(0, 60, 5)), [SECOND].concat(can.core.List(0, 60, 5)), TODAY], ui.time, meta) + can.onappend._action(can, [mdb.PREV, [YEAR].concat(can.core.List(now.getFullYear() - 10, now.getFullYear() + 10)), [MONTH].concat(can.core.List(1, 13)), mdb.NEXT], ui.date, meta) + + can._table = can.page.Appends(can, can._output, [{view: [chat.CONTENT, html.TABLE], list: [{type: html.TBODY}]}]).tbody target.value == "" && (now.setMinutes(now.getMinutes()>30? 30: 0), now.setSeconds(0)) function show(now) { can.Action(YEAR, now.getFullYear()), can.Action(MONTH, now.getMonth()+1) can.Action(HOUR, now.getHours()), can.Action(MINUTE, parseInt(now.getMinutes()/5)*5), can.Action(SECOND, parseInt(now.getSeconds()/5)*5)