From fd85b603adae6228c012b5e7aafc6ae3ea9f3591 Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 27 Nov 2023 23:30:27 +0800 Subject: [PATCH] add flex --- const.js | 16 +++--- frame.js | 19 ++----- index.css | 52 ++++++++---------- lib/user.js | 11 ++-- panel/action.css | 2 +- panel/header.css | 4 +- panel/header.js | 4 +- panel/river.css | 2 +- panel/river.js | 4 +- plugin/input/img.js | 3 +- plugin/local/code/inner.css | 18 ++++--- plugin/local/code/inner.js | 24 +++++---- plugin/local/code/inner/syntax.js | 89 +++++++++++++++++-------------- plugin/local/code/vimer.css | 1 + plugin/local/mall/goods.css | 2 +- plugin/local/mall/goods.js | 2 +- plugin/local/wiki/feel.css | 3 +- plugin/local/wiki/feel.js | 2 + plugin/local/wiki/word.css | 2 - plugin/story/stats.js | 4 +- 20 files changed, 134 insertions(+), 130 deletions(-) diff --git a/const.js b/const.js index 04791b0d..74667ec6 100644 --- a/const.js +++ b/const.js @@ -155,8 +155,10 @@ var nfs = { PNG: "png", WEBM: "webm", 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", + USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", + USR_WEBSOCKET: "usr/websocket/", USR_GO_QRCODE: "usr/go-qrcode/", USR_GO_GIT: "usr/go-git/", + USR_VOLCANOS: "usr/volcanos/", USR_INTSHELL: "usr/intshell/", + USR_ICONS: "usr/icons/", USR_GEOAREA: "usr/geoarea/", USR_LEARNING: "usr/learning/", REQUIRE: "/require/", REQUIRE_MODULES: "/require/modules/", SHARE_LOCAL: "/share/local/", SHARE_CACHE: "/share/cache/", @@ -181,9 +183,9 @@ var code = { WEBPACK: "webpack", BINPACK: "binpack", AUTOGEN: "autogen", COMPILE: "compile", PUBLISH: "publish", UPGRADE: "upgrade", TEMPLATE: "template", COMPLETE: "complete", NAVIGATE: "navigate", CURRENT: "current", PULL: "pull", PUSH: "push", - COMMENT: "comment", KEYWORD: "keyword", - PACKAGE: "package", DATATYPE: "datatype", FUNCTION: "function", CONSTANT: "constant", - STRING: "string", NUMBER: "number", BOOLEAN: "boolean", OBJECT: "object", ARRAY: "array", UNDEFINED: "undefined", + COMMENT: "comment", KEYWORD: "keyword", DATATYPE: "datatype", PACKAGE: "package", + FUNCTION: "function", CONSTANT: "constant", STRING: "string", NUMBER: "number", BOOLEAN: "boolean", + OBJECT: "object", ARRAY: "array", UNDEFINED: "undefined", META: "Meta", ALT: "Alt", CONTROL: "Control", SHIFT: "Shift", TAB: "Tab", ESCAPE: "Escape", ENTER: "Enter", CMD: "Cmd", CTRL: "Ctrl", SPACE: "Space", BACKSPACE: "Backspace", ESC: "Esc", PS: "/", } @@ -289,11 +291,11 @@ var html = {RIVER_MARGIN: 80, PLUGIN_MARGIN: 10, PLUGIN_PADDING: 10, ACTION_MARG VISIBILITY: "visibility", VERTICAL: "vertical", HORIZON: "horizon", NOTICE: "notice", DANGER: "danger", - TOIMAGE: "toimage", + TOIMAGE: "toimage", CURSOR: "cursor", POINTER: "pointer", CROSSHAIR: "crosshair", MOVE: "move", RESIZE: "resize", - SIZE: "size", OPACITY: "opacity", VISIBLE: "visible", + SIZE: "size", OPACITY: "opacity", VISIBLE: "visible", CLASS: "class", DARK: "dark", LIGHT: "light", WHITE: "white", BLACK: "black", FILTER: "filter", TOGGLE: "toggle", EXPAND: "expand", SPEED: "speed", HOVER: "hover", HOVER_SELECT: "hover,select", NOT_HIDE: ":not(.hide)", diff --git a/frame.js b/frame.js index 4e73b298..48c1df1c 100644 --- a/frame.js +++ b/frame.js @@ -501,6 +501,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { ui.layout = function(height, width, delay, cb) { can.onmotion.delay(can, function() { defer = [], layout(type, ui.list, height, width), defer.forEach(function(cb) { cb() }), cb && cb(content_height, content_width) }, delay||0) }; return ui }, tabview: function(can, meta, list, target) { var ui = can.page.Append(can, target, [html.ACTION, html.OUTPUT]) + can.onappend.style(can, html.FLEX, ui.action) can.core.List(can.base.getValid(list, can.core.Item(meta)), function(name, index) { ui[name] = can.page.Append(can, ui.action, [{view: [html.TABS, html.DIV, name], onclick: function(event) { can.onmotion.select(can, ui.action, html.DIV_TABS, event.target) @@ -802,22 +803,10 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) { }, slideGrow: function(can, target) { if (can.page.tagis(target, html.DIV) && can.page.ClassList.has(can, target, html.INPUT)) { return } - var height = target.offsetHeight, begin = 0; if (height < 10) { return } - can.page.style(can, target, html.HEIGHT, 0) - can.core.Timer({interval: 1, length: height/5}, function(timer, interval, index, list) { + var height = target.offsetHeight, begin = 0; if (height < 50) { return } can.page.style(can, target, html.HEIGHT, 0) + can.core.Timer({interval: 10, length: height/10}, function(timer, interval, index, list) { can.page.style(can, target, html.HEIGHT, begin += height/list.length) - }, function() { - can.page.style(can, target, html.HEIGHT, "") - }) - }, - slideDown: function(can, target) { - var top = target.offsetTop, offset = 32, begin = top - offset - can.page.style(can, target, html.TOP, begin) - can.core.Timer({interval: 1, length: 30}, function(timer, interval, index, list) { - can.page.style(can, target, html.TOP, begin += offset/list.length) - }, function() { - can.page.style(can, target, html.TOP, top) - }) + }, function() { can.page.style(can, target, html.HEIGHT, "") }) }, }) Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||document.body diff --git a/index.css b/index.css index 47ce8e45..52a92473 100644 --- a/index.css +++ b/index.css @@ -46,7 +46,7 @@ input { font-family:var(--input-font-family); } body.width1 { /* 320-640 手机竖屏 */ --footer-height:60px; --input-width:80px; --river-margin:0; --plugin-margin:0; --button-margin:5px; - --project-width:120px; --river-width:280px;; + --project-width:120px; --river-width:280px;; --svg-font-size:13px; } body.width2 { /* 640-960 手机横屏 平板竖屏 笔记本调试 */ @@ -148,23 +148,13 @@ body>div.input>legend { font-style:italic; width:100%; } body>div.input td { padding:var(--table-padding); } body>div.input td:nth-child(2) { padding:var(--table-padding) 0; } body>div.input tr.img td:last-child>span { display:none; } -body>div.input tr.img td:last-child>div.item { - display:flex; flex-wrap:wrap; width:var(--river-width); -} -body>div.input tr.img td:last-child>div.item>div { - background-color:gray; margin:var(--input-margin); - display:flex; align-items:center; justify-content:center; -} -body>div.input tr.img td:last-child>div>span.icon { - display:none; -} +body>div.input tr.img td:last-child>div.item { flex-wrap:wrap; width:var(--river-width); } +body>div.input tr.img td:last-child>div.item>div { background-color:gray; margin:var(--input-margin); } +body>div.input tr.img td:last-child>div>span.icon { display:none; } body>div.input tr.img td:last-child>div>span { font-size:var(--action-height); } body>div.input tr.icon td:last-child { position:relative; } -/* body>div.input tr.icon td:last-child i:first-child { font-size:22px; } */ body>div.input tr.icon td:last-child img:first-child { position:absolute; height:28px; width:28px; left:12px; top:12px; } body>div.input tr.icon td:last-child input { padding-left:var(--action-height); } -body>div.input tr.icons td:last-child { position:relative; } -/* body>div.input tr.icons td:last-child i:first-child { font-size:22px; } */ body>div.input tr.icons td:last-child img:first-child { position:absolute; height:28px; width:28px; left:12px; top:12px; } body>div.input tr.icons td:last-child input { padding-left:var(--action-height); } body>div.input td span.icon { margin-left:-20px; visibility:hidden; } @@ -173,7 +163,7 @@ body>div.input td:hover span.icon { visibility:visible; } body>div.input td:hover span.icons { visibility:visible; } body>div.input textarea { height:var(--textarea-height); width:var(--river-width) !important; } body>div.input select { width:var(--river-width) !important; } -body>div.input input:not([type=button]) { width:var(--river-width) !important; } +body>div.input:not(.vimer) input:not([type=button]) { width:var(--river-width) !important; } body>div.input input.select[type=button] { width:var(--river-width) !important; } body>div.input input[name=cancel] { border:var(--danger-bg-color) solid 1px; } body>div.input input[name=submit] { border:var(--notice-bg-color) solid 1px; } @@ -182,18 +172,18 @@ body>div.input input[name=cancel]:hover { background-color:var(--danger-bg-color body>div.input div.action { padding:0 var(--table-padding); width:100%; position:sticky; bottom:0; flex-direction:row-reverse; } body>div.input div.action>div.item { margin-left:var(--button-margin); float:right; } body>div.input div.action>div.item>input[type=button] { width:112px; } -body>div.input.login { box-shadow:unset; display:flex; flex-direction:column; align-items:center; } -body>div.input.login>div.action { display:flex; align-items:center; justify-content:center; border-bottom:var(--box-border); } +body>div.input.login { box-shadow:unset; flex-direction:column; } +body>div.input.login>div.action { border-bottom:var(--box-border); } body>div.input.login>div.action>div.tabs { padding:var(--button-padding); } body>div.input.login>div.output { text-align:center; clear:both; } body>div.input.login>div.output { height:var(--qrcode-height); width:var(--iframe-height); overflow:hidden; } body>div.input.login>div.output>fieldset { box-shadow:none; } body>div.input.login>div.output>fieldset>div.output { background-color:transparent; } -body>div.input.login>div.display { display:flex; flex-direction:column; align-items:center; padding-top:var(--button-padding); width:100%; } +body>div.input.login>div.display { flex-direction:column; padding-top:var(--button-padding); width:100%; } body>div.input.login>div.display>label { color:var(--disable-fg-color); font-size:var(--status-font-size); font-style:italic; } body>div.input.login>div.display>span.item { font-style:italic; word-break:break-all; padding-left:var(--button-padding); border-left:var(--notice-bg-color) solid 5px; margin:var(--button-margin) 0; } -body>div.input.login>div.display div.sso { display:flex; justify-content:center; cursor:pointer; } -body>div.input.login>div.display div.sso div.item { display:flex; align-items:center; justify-content:center; padding:var(--input-padding); } +body>div.input.login>div.display div.sso { cursor:pointer; } +body>div.input.login>div.display div.sso div.item { padding:var(--input-padding); } body>div.input.login>div.display div.sso div.item:hover { background-color:var(--hover-bg-color); } body>div.input.login>div.display div.sso div.item>img { height:var(--action-height); width:var(--action-height); } body>div.input.login>div.display div.sso div.item>span { line-height:var(--action-height); padding:var(--input-padding); } @@ -210,7 +200,7 @@ legend { font-size:var(--legend-font-size); line-height:30px; height:var(--actio select, input { font-size:var(--body-font-size); height:var(--action-height); } input::placeholder, textarea::placeholder { font-style:italic; color:var(--disable-fg-color); } textarea { font-size:var(--body-font-size); padding:var(--input-padding); height:var(--textarea-height); width:100%; outline:none; resize:vertical; } table.content, div.code, div.story[data-type=spark] { white-space:pre; margin:0; } -div.story[data-type=spark] { padding:0 var(--table-padding); border-left:var(--notice-bg-color) solid 5px; } +div.story[data-type=spark] { padding:var(--input-padding) var(--table-padding); border-left:var(--notice-bg-color) solid 5px; } fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); } fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); } fieldset>div.output>div.code { font-size:var(--code-font-size); } @@ -236,7 +226,9 @@ form.option>div.item.icon { font-size:var(--icon-font-size); padding:0 var(--inp form.option>div.item.icon.refresh { font-size:28px; margin-top:-3px; } form.option>div.item.icon.goback { font-size:28px; margin-top:-3px; } form.option>div.item.icon.play { font-size:16px; } -div.item.text { position:relative; display:flex; align-items:center; } +body.mobile form.option>div.item.icon.prev { margin-top:4px; height:28px; } +body.mobile form.option>div.item.icon.next { margin-top:4px; height:28px; } +div.item.text { position:relative; } div.item.text>input { width:var(--input-width); height:var(--action-height); } div.item.text.id>input { width:var(--button-width); } div.item.text.url>input { width:var(--river-width); } @@ -248,14 +240,13 @@ div.item.text.will>input { border:var(--box-notice); } div.item.text>i:first-child { position:absolute; padding:7px; } div.item.text>span.icon { font-size:var(--icon-font-size); padding:var(--input-padding); position:absolute; right:0; visibility:hidden; } div.item.text:hover>span.icon { visibility:visible; } -div.item.button { position:relative; display:flex; align-items:center; height:var(--action-height); } +div.item.button { position:relative; height:var(--action-height); } div.item.button>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); } div.item.button.select>span.icon { visibility:hidden; position:absolute; right:0; } div.item.button.select:hover>span.icon { visibility:visible; } div.item.button.icons>i { font-size:20px; padding:var(--input-padding); } div.item.button.create>span.icon { font-size:30px; margin-top:-5px; } div.item.button.insert>span.icon { font-size:30px; margin-top:-5px; } -div.tabs:not(.hide) { display:flex; align-items:center; } div.tabs>span { font-style:italic; } div.tabs>span.icon { font-size:var(--icon-font-size); font-style:normal; padding-left:var(--input-padding); visibility:hidden; } div.tabs.select>span.icon { visibility:visible; } @@ -350,17 +341,18 @@ div.output.card>div.item>div.title>img { margin-right:var(--button-margin); marg div.output.card>div.item>div.content { font-size:var(--status-font-size); padding:var(--input-padding); height:var(--header-height); } div.output.card>div.item>div.action { text-align:right; width:100%; display:flex; } div.output.card>div.item>div.action>input { margin-right:var(--button-margin); box-shadow:var(--box-shadow); } -div.output.stats { display:flex; justify-content:center; flex-wrap:wrap; } -div.output.stats>div.item { text-align:center; padding:var(--plugin-padding); margin:var(--plugin-padding); float:left; display:flex; flex-direction:column; justify-content:center; flex-grow:1; } +div.output.stats { flex-wrap:wrap; } +div.output.stats>div.item { text-align:center; padding:var(--plugin-padding); margin:var(--plugin-padding); float:left; flex-direction:column; flex-grow:1; } div.output.stats>div.item>div.value span:first-child { font-size:32px; } div.output.stats>div.item>div.value span.units { color:var(--disable-fg-color); font-style:italic; } div.output.stats>div.item>div.name { color:var(--disable-fg-color); font-size:var(--status-font-size); font-family:var(--status-font-family); font-style:italic; } /* display */ +fieldset>form.option:not(.hide), fieldset>div.action:not(.hide):not(.flex) { display:contents; } .hide, .hidden { display:none; } fieldset.panel>legend, fieldset.panel>div.status { display:none; } -fieldset.output>legend, fieldset.output>form.option, fieldset.output>div.action, fieldset.output>div.status, fieldset.output>div.item { display:none; } -fieldset>form.option, fieldset>div.action { display:contents; } form.option.hide, div.action.hide, .hide, .hidden { display:none; } +fieldset.output>legend, fieldset.output>form.option, fieldset.output>div.action:not(.flex), fieldset.output>div.status, fieldset.output>div.item { display:none; } div.action, div.output, div.status, div.project, div.content, div.profile, div.display, table.content, table.content td, div.list, div.code, div.story, div.float, fieldset.float { overflow:auto; } -legend, form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, fieldset>div.status>div.item { float:left; display:flex; align-items:center; } +legend, form.option>div.item, div.action>div.item, div.action>div.tabs, fieldset>div.status>div.item { float:left; display:flex; align-items:center; } +div.flex:not(.hide) { display:flex; align-items:center; justify-content:center; } fieldset.story, fieldset>div.output, fieldset>div.status, div.output>div.project div.item, div.content:not(.item), div.code, div.story[data-type=spark] { clear:both; } fieldset.story { position:sticky; left:0; } fieldset.full { position:fixed; left:0; top:0; } @@ -369,7 +361,7 @@ div.float { position:fixed; z-index:100; box-shadow:var(--box-shadow); } fieldset.plug { position:absolute; bottom:0; right:0; } div.output { position:relative; } div.layout.flex>* { float:left; clear:none; } -div.output.flex { display:flex; overflow:hidden; } +div.output.flex { overflow:hidden; align-items:flex-start; } div.output>div.code { position:sticky; left:0; } div.output>div.code video { max-width:100%; } fieldset>div.status>legend { diff --git a/lib/user.js b/lib/user.js index 3b4e7bad..0bc59ab8 100644 --- a/lib/user.js +++ b/lib/user.js @@ -269,12 +269,13 @@ Volcanos("user", { } } else if (value.type == cli.QRCODE) { list[value.name] = function(target) { can.page.Modify(can, target, arg[2]) } } }) - var ui = can.onappend.tabview(can, list, can.core.Item(list), can.page.Append(can, document.body, [{view: "input login float"}])._target) + var ui = can.onappend.tabview(can, list, can.core.Item(list), can.page.Append(can, document.body, [{view: "input login float flex"}])._target) can.page.style(can, ui._target, {left: (window.innerWidth-ui._target.offsetWidth)/2, top: can.user.isMobile? can.user.isLandscape()? 0 :48 :window.innerHeight/8}) var _cmd = "space login "+arg[0]; ui.display = can.page.Append(can, ui._target, [html.DISPLAY])._target + can.onappend.style(can, html.FLEX, ui.display) can.page.Appends(can, ui.display, [{text: ["或命令行授权: ", html.LABEL]}, {text: ["$ "+_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }}]) - can.page.Append(can, ui.display, [{text: ["或第三方授权: ", html.LABEL]}, {view: "sso", list: msg.Table(function(value) { - return value.type == "oauth" && {view: html.ITEM, title: "点击跳转,授权登录", list: [{img: can.misc.Resource(can, value.icons)}, {text: value.name}], onclick: function() { can.user.jumps(value.link) }} + can.page.Append(can, ui.display, [{text: ["或第三方授权: ", html.LABEL]}, {view: [["sso", html.FLEX]], list: msg.Table(function(value) { + return value.type == "oauth" && {view: [[html.ITEM, html.FLEX]], title: "点击跳转,授权登录", list: [{img: can.misc.Resource(can, value.icons)}, {text: value.name}], onclick: function() { can.user.jumps(value.link) }} }) }]) } else if (cmd == ice.MSG_SESSID) { if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] } check() @@ -285,12 +286,12 @@ Volcanos("user", { }) }) }, header: function(can) { if (!can._root) { return } var header = can._root.Header var meta = { - time: !can.user.isMobile && {view: [[html.ITEM, mdb.TIME]], _init: function(target) { + time: !can.user.isMobile && {view: [[html.ITEM, mdb.TIME, html.FLEX]], _init: function(target) { can.onappend.figure(can, {action: "date", _hold: true}, target, function(sub, value) {}) can.core.Timer({interval: 100}, function() { can.page.Modify(can, target, can.user.time(can, null, "%H:%M:%S %w")) }) }}, avatar: {view: [[html.ITEM, aaa.AVATAR]], list: [{img: can.user.info.avatar}], onclick: function(event) { header && header.onaction.avatar(event, header) }}, - usernick: {view: [[html.ITEM, aaa.USERNICK], "", can.user.info.usernick], onclick: function(event) { header && header.onaction.usernick(event, header) }}, + usernick: {view: [[html.ITEM, aaa.USERNICK, html.FLEX], "", can.user.info.usernick], onclick: function(event) { header && header.onaction.usernick(event, header) }}, }; return can.core.List(can.base.getValid(can.core.List(arguments).slice(1), [html.SPACE, mdb.TIME, aaa.AVATAR, aaa.USERNICK]), function(item) { return meta[item] }) }, email: function(can) { diff --git a/panel/action.css b/panel/action.css index 680d5c69..0fb2eced 100644 --- a/panel/action.css +++ b/panel/action.css @@ -1,6 +1,6 @@ fieldset.Action { min-width:var(--project-width); } fieldset.Action>div.output { overflow-x:hidden; } -fieldset.Action>div.action { width:100%; display:none; background-color:var(--plugin-bg-color); } +fieldset.Action>div.action:not(.flex) { width:100%; display:none; background-color:var(--plugin-bg-color); } fieldset.Action>div.action div.item { font-style:italic; font-size:1.1rem; padding:10px 20px; } fieldset.Action.tabs>div.action { display:block; } fieldset.Action.tabs>div.output>fieldset>legend { display:none; } diff --git a/panel/header.css b/panel/header.css index f04baf0c..43b2d232 100644 --- a/panel/header.css +++ b/panel/header.css @@ -1,7 +1,7 @@ fieldset.Header>div.output { line-height:21px; height:var(--header-height); overflow:hidden; } fieldset.Header>div.output div.item { background-color:var(--panel-output-bg-color); padding:13.5px; height:var(--header-height); float:left; } -fieldset.Header>div.output div.title:first-child { font-size:var(--legend-font-size); font-style:italic; font-weight:bold; display:flex; align-items:center; justify-content:center; overflow:hidden; } -fieldset.Header>div.output div.title img { height:var(--action-height); width:var(--action-height); } +fieldset.Header>div.output div.item.title:first-child { font-size:var(--legend-font-size); font-style:italic; font-weight:bold; overflow:hidden; } +fieldset.Header>div.output div.item.title img { height:var(--action-height); width:var(--action-height); } fieldset.Header>div.output div.item.theme { user-select:none; } fieldset.Header>div.output div.item.theme>i { margin-right:0; } fieldset.Header>div.output div.item.theme>i:last-child { color:var(--disable-fg-color); } diff --git a/panel/header.js b/panel/header.js index 2057952b..810df84e 100644 --- a/panel/header.js +++ b/panel/header.js @@ -3,10 +3,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { }, _title: function(can, msg, target) { can.core.List(can.base.getValid(can.Conf(chat.TITLE)||(can.user.isExtension? "contexts": location.host)||msg.result, [location.host]), function(item) { - can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE]], list: [{img: can.misc.ResourceFavicon(can)}, {text: item}], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}]) + can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE, html.FLEX]], list: [{img: can.misc.ResourceFavicon(can)}, {text: item}], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}]) }) }, _state: function(can, msg, target) { can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [chat.THEME, aaa.LANGUAGE, aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) { + if (item == aaa.LANGUAGE && can.user.isMobile) { return } + if (item == chat.THEME && can.user.isMobile) { return } if (item == aaa.AVATAR ) { can.user.isLocalFile || can.page.Append(can, target, [{view: [[html.ITEM, chat.STATE, item]], list: [{img: lex.SP}], onclick: function(event) { can.core.CallFunc([can.onaction, item], [event, can, item]) }}]); return } if (can.user.isMobile && item == mdb.TIME) { return } diff --git a/panel/river.css b/panel/river.css index 81e5f844..1e378aca 100644 --- a/panel/river.css +++ b/panel/river.css @@ -1,5 +1,5 @@ fieldset.River { width:var(--river-width); float:left; position:relative; } -fieldset.River>div.action:not(.hide) { margin-top:var(--plugin-margin); width:100%; display:flex; justify-content:center; } +fieldset.River>div.action:not(.hide) { margin-top:var(--plugin-margin); width:100%; } fieldset.River>div.output { transition:all .3s; } fieldset.River>div.output div.item { font-family:var(--legend-font-family); padding:var(--legend-padding); border-left:#00ffae solid 3px; } fieldset.River>div.output div.item:hover { color:var(--panel-hover-fg-color); } diff --git a/panel/river.js b/panel/river.js index 592cf513..08d7ead2 100644 --- a/panel/river.js +++ b/panel/river.js @@ -1,5 +1,7 @@ (function() { const CAN_RIVER = "can.river", CAN_STORM = "can.storm" Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onimport._main(can, msg) + + can.onappend.style(can, html.FLEX, can._action) var select; can.page.Appends(can, can._output, msg.Table(function(item, index) { return can.onimport._river(can, item, function(target) { (index == 0 || item.hash == can._main_river) && (select = target) }) })), select && select.click(), can.onimport._menu(can, msg) @@ -54,7 +56,7 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func share: function(event, can) { can.core.CallFunc(can.ondetail.share, {event: event, can: can}) }, onsize: function(can, height) { var margin = "0px", _margin = 0; can.page.style(can, can._output, html.MARGIN, "0px", html.HEIGHT, "") if (can.page.isDisplay(can._action)) { _margin = can._action.offsetHeight + html.PLUGIN_MARGIN } - if (can._output.offsetHeight < height) { margin = can.base.Min((height-can._output.offsetHeight)/2, _margin)+"px 0px" } + if (can._output.offsetHeight < height) { margin = can.base.Min((height-_margin-can._output.offsetHeight)/2, _margin)+"px 0px" } height && can.page.style(can, can._output, html.MARGIN, margin, html.HEIGHT, can.base.Max(can._output.offsetHeight, height-_margin)) can.onexport.scroll(can) }, diff --git a/plugin/input/img.js b/plugin/input/img.js index c9cf2f71..d6f076f7 100644 --- a/plugin/input/img.js +++ b/plugin/input/img.js @@ -4,8 +4,9 @@ Volcanos(chat.ONFIGURE, {img: { function add(target, hash) { target._hash = hash, can.page.Appends(can, target, [{img: can.base.MergeURL(can.misc.MergeURL(can, {_path: web.SHARE_CACHE+hash}, true), {pod: meta.space||undefined}), height: width, width: width}]) } function set() { target.value = can.page.SelectChild(can, target.parentNode, html.DIV, function(target) { return target._hash }).join(mdb.FS) } can.onmotion.hidden(can, target) + can.onappend.style(can, html.FLEX, target.parentNode) for (var i = 0; i < count; i++) { - can.page.Append(can, target.parentNode, [{type: html.DIV, style: { + can.page.Append(can, target.parentNode, [{view: html.FLEX, style: { "clear": i%n == 0? "both": "none", height: width, width: width, }, _init: function(target) { if (images[i] && images[i].length > 10) { add(target, images[i]) } else { can.page.Append(can, target, [{text: "+"}]) } diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 151bf4cd..98bf3d30 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -7,7 +7,7 @@ fieldset.inner>div.output div.content td.text span.string { color:var(--code-str fieldset.inner>div.output div.content td.text span.object { color:var(--code-object); } fieldset.inner>div.output div.content td.text span.datatype { color:var(--code-datatype); } fieldset.inner>div.output div.content td.text span.package { color:var(--code-package); } -fieldset.inner>div.output>div.project div.zone div.action:not(.hide) { width:100%; display:flex; align-items:center; } +fieldset.inner>div.output>div.project div.zone div.action:not(.hide) { width:100%; } fieldset.inner>div.output>div.project div.zone div.action>div.item { padding-right:0; width:100%; } fieldset.inner>div.output>div.project div.zone div.action>div.item>input { padding-left:25px; width:100%; } fieldset.inner>div.output>div.layout>div.tabs { font-size:var(--code-font-size); display:none; } @@ -28,18 +28,20 @@ fieldset.inner>div.output>div.layout>div.layout>div.profile>div.code { white-spa fieldset.inner>div.output>div.layout>div.layout>div.profile div.status>div { padding:var(--input-padding); float:left; } fieldset.inner>div.output>div.layout>div.layout div.content div.tips { color:var(--disable-fg-color); font-style:italic; position:absolute; top:0; right:10px; } fieldset.inner.cmd>div.output>div.layout>div.tabs:not(.hide) { background-color:var(--plugin-bg-color); height:var(--code-tabs-height); display:flex; } -fieldset.inner.cmd>div.output>div.layout>div.tabs>div { height:var(--code-tabs-height); display:flex; align-items:center; } +fieldset.inner.cmd>div.output>div.layout>div.tabs>div { height:var(--code-tabs-height); } fieldset.inner.cmd>div.output>div.layout>div.tabs>div.icon>div.icon { font-size:26px; line-height:32px; padding:2px 5px; position:sticky; top:0; } -fieldset.inner.cmd>div.output>div.layout>div.tabs>div.tabs { flex-grow:1; flex-wrap:wrap; overflow:auto; } +fieldset.inner.cmd>div.output>div.layout>div.tabs>div.tabs { justify-content:flex-start; flex-grow:1; flex-wrap:wrap; overflow:auto; } fieldset.inner.cmd>div.output>div.layout>div.tabs>div.tabs:hover { background-color:unset; } -fieldset.inner.cmd>div.output>div.layout>div.tabs>div.tabs>div.tabs { padding:var(--input-padding) var(--button-padding); height:var(--code-tabs-height); } -fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div { white-space:pre; padding:10px; height:var(--code-tabs-height); display:flex; align-items:center; } +fieldset.inner.cmd>div.output>div.layout>div.tabs>div.tabs>div.tabs { padding:var(--input-padding) var(--button-padding); height:var(--code-tabs-height); display:flex; align-items:center; } +fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div { white-space:pre; padding:10px; height:var(--code-tabs-height); } fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div.avatar { padding:0; } fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div.avatar>img { height:var(--code-tabs-height); clip-path:circle(40%); } -fieldset.inner.cmd>div.output>div.layout>div.path:not(.hide) { font-style:italic; box-shadow:var(--box-shadow); display:flex; align-items:center; cursor:pointer; } +fieldset.inner.cmd>div.output>div.layout>div.path:not(.hide) { font-style:italic; box-shadow:var(--box-shadow); display:flex; cursor:pointer; } +fieldset.inner.cmd>div.output>div.layout>div.path>span { padding:var(--input-padding); } fieldset.inner.cmd>div.output>div.layout>div.path>span:hover { background-color:var(--hover-bg-color); } -fieldset.inner.cmd>div.output>div.layout>div.path span.func { padding:var(--input-padding) var(--button-padding); margin-left:var(--button-margin); flex-grow:1; } -fieldset.inner.cmd>div.output>div.layout>div.path span.mode { padding:var(--input-padding) var(--button-padding); margin-left:var(--button-margin); flex-grow:1; } +fieldset.inner.cmd>div.output>div.layout>div.path span.func { margin-left:var(--button-margin); } +fieldset.inner.cmd>div.output>div.layout>div.path span.mode { margin-left:var(--button-margin); } +fieldset.inner.cmd>div.output>div.layout>div.path span.space { flex-grow:1; } fieldset.inner.cmd>div.output>div.layout>div.path span.view { font-size:22px; padding:0 var(--input-padding); margin-top:-5px; float:right; } fieldset.inner.cmd>div.output>div.layout>fieldset.plug { bottom:var(--action-height); } fieldset.inner.cmd>div.output>div.layout>fieldset.plug.output { white-space:pre; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 0ec6eb0b..ace3b329 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -4,16 +4,15 @@ const RECOVER_TOOL = "recover:tool" const PROJECT_HIDE = "project:hide", TABVIEW_HIDE = "tabview:hide" const PROFILE_ARGS = "profile:args:", DISPLAY_ARGS = "display:args:" const CURRENT_FILE = "web.code.inner:currentFile", SELECT_LINE = "selectLine" -const VIEW_CREATE = "tabview.view.create", VIEW_REMOVE = "tabview.view.remove", LINE_SELECT = "tabview.line.select" +const VIEW_CREATE = "tabview.view.create", VIEW_REMOVE = "tabview.view.remove", LINE_SELECT = "tabview.line.select" Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Split(can.Option(nfs.PATH), mdb.FS); can.Option(nfs.PATH, paths[0]) can.Mode(msg.Option("mode")||can.Mode()), can.Option(nfs.FILE) == " " && can.Option(nfs.FILE, "") if (can.Mode() == ice.MSG_RESULT) { msg.result = msg.result||[can._output.innerHTML], can.Mode(chat.SIMPLE), can.sup.Mode(chat.SIMPLE) } can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) { if (can.base.beginWith(p, nfs.USR_LOCAL_WORK) || can.base.endWith(p, "-dict/") || can.base.isIn(p, - nfs.USR_INTSHELL, - nfs.USR_LEARNING, - nfs.USR_GEOAREA, - nfs.USR_ICONS, + nfs.USR_WEBSOCKET, nfs.USR_GO_QRCODE, nfs.USR_GO_GIT, + nfs.USR_ICONS, nfs.USR_GEOAREA, nfs.USR_LEARNING, + // nfs.USR_INTSHELL, )) { return } if (p && paths.indexOf(p) == -1 && p[0] != nfs.PS) { paths.push(p) } }), can.onmotion.clear(can), can.onappend.style(can, code.INNER), can.sup.onimport._process = function(_can, msg) { @@ -60,12 +59,17 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp {name: can.page.unicode.menu, onclick: function() { can.user.carte(event, can, can.onaction, can.onaction.list) }}, {name: can.page.unicode.refresh, style: {"font-size": 26, "padding-top": 2}, onclick: function() { location.reload() }}, ], function(item) { return can.base.Copy(item, {view: [[html.ITEM, html.ICON], "", item.name]}) })) + can.onappend.style(can, html.FLEX, ui.head) + can.onappend.style(can, html.FLEX, ui.tabs) + can.onappend.style(can, html.FLEX, ui.icon) can.page.Append(can, ui.head, can.user.header(can).reverse()) }, - __tabPath: function(can, cache) { var target = can.ui.path + __tabPath: function(can, cache) { var target = can.ui.path; can.onappend.style(can, html.FLEX, can.ui.path) can.onimport._tabPath(can, nfs.PS, nfs.PATH, can.base.Path(can.Option(nfs.PATH), can.Option(nfs.FILE)), function(p) { var ls = can.onexport.split(can, p); can.onimport.tabview(can, ls[0], ls[1]) - }, target), can.onimport._tabFunc(can, target, cache), can.onimport._tabMode(can), can.onimport._tabIcon(can) + }, target), can.onimport._tabFunc(can, target, cache), can.onimport._tabMode(can) + can.page.Append(can, target, [{view: [["item", "space"], html.SPAN]}]) + can.onimport._tabIcon(can) target.ondblclick = function(event) { if (event.target != target) { return } var show = can.onmotion.toggle(can, can.ui.tabs); can.onmotion.toggle(can, can.ui.project, show), can.onimport.layout(can) can.isCmdMode() && can.onexport.session(can, TABVIEW_HIDE, show? "": html.HIDE) @@ -233,7 +237,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp } else if (msg.Length() > 0 || msg.Result() != "") { can.onappend.table(can, msg, function(value, key, index, item) { return {text: [value, html.TD], onclick: function(event) { if (event.target.type == html.BUTTON) { return can.runAction(can.request(event, item), event.target.name, [], function() { - + }) } item.file && can.onimport.tabview(can, item.path, item.file||can.Option(nfs.FILE), item.line) }} }, target), can.onappend.board(can, msg, target), msg.Option(ice.MSG_STATUS) && can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, target, [html.STATUS])._target) @@ -288,7 +292,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp }) }) }, }, [""]) -Volcanos(chat.ONFIGURE, { +Volcanos(chat.ONFIGURE, { source: function(can, target, zone, path) { var args = can.base.getValid(can.misc.SearchHash(can), [can.Option(nfs.PATH), can.Option(nfs.FILE)]) function show(target, zone, path) { can.run(can.request({}, {dir_root: path, dir_deep: true, "_toast": "目录加载中..."}), [nfs.PWD], function(msg) { can.onmotion.clear(can, target) can.onimport.tree(can, can.core.List(msg.Table(), function(item) { @@ -461,7 +465,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { if (!msg) { return } } else if (value.type == mdb.INSERT) { _insert.push(item), inserts.push(_insert.join("")), _insert = [] } else if (_delete.length > 0 || _insert.length > 0) { - _delete.push(item), _insert.push(item), deletes.push(_delete.join("")), _delete = [], inserts.push(_insert.join("")), _insert = [] + _delete.push(item), _insert.push(item), deletes.push(_delete.join("")), _delete = [], inserts.push(_insert.join("")), _insert = [] } else { append(), can.onaction.appendLine(can, item) } }) }), _delete.length > 0 && deletes.push(_delete.join("")), _insert.length > 0 && inserts.push(_insert.join("")), append() var list = can.page.Select(can, can.ui.content, "tr.insert,tr.delete") diff --git a/plugin/local/code/inner/syntax.js b/plugin/local/code/inner/syntax.js index 08cec628..fef17230 100644 --- a/plugin/local/code/inner/syntax.js +++ b/plugin/local/code/inner/syntax.js @@ -261,50 +261,69 @@ Volcanos(chat.ONSYNTAX, { } }, }, json: {split: {operator: "{[:,]}"}, keyword: {"true": code.CONSTANT, "false": code.CONSTANT}}, - css: {prefix: {"// ": code.COMMENT, "/* ": code.COMMENT}, split: {operator: "{[(.,:;&>!=)]}"}, + css: { + prefix: {"// ": code.COMMENT, "/* ": code.COMMENT}, + split: {operator: "{[(.,:;)]}"}, regexp: { - "[-0-9]+deg": code.CONSTANT, - "[-0-9]+rem": code.CONSTANT, - "[-0-9]+px": code.CONSTANT, - "[-0-9]+%": code.CONSTANT, - "[-0-9]+": code.CONSTANT, - "#[^ ;]+": code.CONSTANT, + "#[^ ;]+": code.STRING, "[-0-9]+(deg|rem|px|s|%)?": code.STRING, + "--[^ ();]+": code.CONSTANT, }, keyword: { + "not": code.DATATYPE, "first-child": code.DATATYPE, "last-child": code.DATATYPE, "nth-child": code.DATATYPE, + "placeholder": code.DATATYPE, "hover": code.DATATYPE, "focus": code.DATATYPE, + "background-color": code.FUNCTION, "color": code.FUNCTION, "font-family": code.FUNCTION, "font-weight": code.FUNCTION, "font-style": code.FUNCTION, "font-size": code.FUNCTION, "line-height": code.FUNCTION, - "text-align": code.FUNCTION, "white-space": code.FUNCTION, "tab-size": code.FUNCTION, + "text-align": code.FUNCTION, "white-space": code.FUNCTION, "word-break": code.FUNCTION, "letter-space": code.FUNCTION, "tab-size": code.FUNCTION, "padding": code.FUNCTION, "padding-left": code.FUNCTION, "padding-top": code.FUNCTION, "padding-right": code.FUNCTION, "padding-bottom": code.FUNCTION, "border": code.FUNCTION, "border-left": code.FUNCTION, "border-top": code.FUNCTION, "border-right": code.FUNCTION, "border-bottom": code.FUNCTION, "margin": code.FUNCTION, "margin-left": code.FUNCTION, "margin-top": code.FUNCTION, "margin-right": code.FUNCTION, "margin-bottom": code.FUNCTION, + "box-sizing": code.FUNCTION, "border-radius": code.FUNCTION, "outline": code.FUNCTION, "box-shadow": code.FUNCTION, "height": code.FUNCTION, "width": code.FUNCTION, "min-width": code.FUNCTION, "max-width": code.FUNCTION, "min-height": code.FUNCTION, "max-height": code.FUNCTION, - "display": code.FUNCTION, "visibility": code.FUNCTION, "overflow": code.FUNCTION, "float": code.FUNCTION, "clear": code.FUNCTION, "both": code.CONSTANT, - "position": code.FUNCTION, "left": code.FUNCTION, "top": code.FUNCTION, "right": code.FUNCTION, "bottom": code.FUNCTION, - "border-radius": code.FUNCTION, "outline": code.FUNCTION, "box-shadow": code.FUNCTION, "text-shadow": code.FUNCTION, - "caret-color": code.FUNCTION, "cursor": code.FUNCTION, "pointer": code.CONSTANT, - - "hover": code.DATATYPE, "focus": code.DATATYPE, "not": code.DATATYPE, "type": code.FUNCTION, "name": code.FUNCTION, - "box-sizing": code.FUNCTION, "border-box": code.CONSTANT, - "background": code.FUNCTION, "background-position": code.FUNCTION, "background-size": code.FUNCTION, - "flex": code.FUNCTION, "justify-content": code.FUNCTION, - "flex-grow": code.FUNCTION, - "flex-shrink": code.FUNCTION, - "important": code.KEYWORD, - "transition": code.FUNCTION, "transform": code.FUNCTION, "translate": code.FUNCTION, "rotate": code.FUNCTION, + "display": code.FUNCTION, "float": code.FUNCTION, "clear": code.FUNCTION, "visibility": code.FUNCTION, "overflow": code.FUNCTION, + "flex": code.FUNCTION, "align-items": code.FUNCTION, "justify-content": code.FUNCTION, "flex-direction": code.FUNCTION, + "flex-grow": code.FUNCTION, "flex-shrink": code.FUNCTION, "flex-wrap": code.FUNCTION, + "position": code.FUNCTION, "z-index": code.FUNCTION, "cursor": code.FUNCTION, "transition": code.FUNCTION, + "transform": code.FUNCTION, "translate": code.FUNCTION, "rotate": code.FUNCTION, "stroke-width": code.FUNCTION, "stroke": code.FUNCTION, "fill": code.FUNCTION, - "z-index": code.FUNCTION, - "monospace": code.CONSTANT, "italic": code.CONSTANT, "bold": code.CONSTANT, "center": code.CONSTANT, - "solid": code.CONSTANT, "unset": code.CONSTANT, - "block": code.CONSTANT, "none": code.CONSTANT, "hidden": code.CONSTANT, "visible": code.CONSTANT, "auto": code.CONSTANT, "relative": code.CONSTANT, "absolute": code.CONSTANT, "sticky": code.CONSTANT, "fixed": code.CONSTANT, + "transparent": code.CONSTANT, + "monospace": code.CONSTANT, "bold": code.CONSTANT, "italic": code.CONSTANT, "normal": code.CONSTANT, + "center": code.CONSTANT, + "border-box": code.CONSTANT, + "calc": code.KEYWORD, "important": code.KEYWORD, + "solid": code.CONSTANT, "dashed": code.CONSTANT, + "0": code.CONSTANT, "none": code.CONSTANT, "unset": code.CONSTANT, + "block": code.CONSTANT, "both": code.CONSTANT, "hidden": code.CONSTANT, "visible": code.CONSTANT, "auto": code.CONSTANT, + "wrap": code.CONSTANT, "column": code.CONSTANT, "row-reverse": code.CONSTANT, + "relative": code.CONSTANT, "absolute": code.CONSTANT, "sticky": code.CONSTANT, "static": code.CONSTANT, "fixed": code.CONSTANT, + "left": code.FUNCTION, "top": code.FUNCTION, "right": code.FUNCTION, "bottom": code.FUNCTION, + "pointer": code.CONSTANT, "copy": code.CONSTANT, - "dark": code.CONSTANT, "light": code.CONSTANT, "transparent": code.CONSTANT, - "black": code.CONSTANT, "white": code.CONSTANT, "blue": code.CONSTANT, "red": code.CONSTANT, "yellow": code.CONSTANT, + "black": code.CONSTANT, "white": code.CONSTANT, + "silver": code.CONSTANT, "gray": code.CONSTANT, + "red": code.CONSTANT, "blue": code.CONSTANT, + "cyan": code.CONSTANT, "aliceblue": code.CONSTANT, + + "--plugin-bg-color": code.CONSTANT, "--plugin-fg-color": code.CONSTANT, + "--input-bg-color": code.CONSTANT, "--output-bg-color": code.CONSTANT, + "--danger-bg-color": code.CONSTANT, "--notice-bg-color": code.CONSTANT, + "--hover-bg-color": code.CONSTANT, "--hover-fg-color": code.CONSTANT, + "--body-bg-color": code.CONSTANT, "--body-fg-color": code.CONSTANT, + + /* + "text-shadow": code.FUNCTION, + "caret-color": code.FUNCTION, + + "type": code.FUNCTION, "name": code.FUNCTION, + "background": code.FUNCTION, "background-position": code.FUNCTION, "background-size": code.FUNCTION, + + + "dark": code.CONSTANT, "light": code.CONSTANT, + "yellow": code.CONSTANT, "green": code.CONSTANT, "purple": code.CONSTANT, - "silver": code.CONSTANT, - "gray": code.CONSTANT, "navy": code.CONSTANT, "teal": code.CONSTANT, @@ -317,7 +336,6 @@ Volcanos(chat.ONSYNTAX, { "snow": code.CONSTANT, "skyblue": code.CONSTANT, - "aliceblue": code.CONSTANT, "cadetblue": code.CONSTANT, "cornflowerblue": code.CONSTANT, "royalblue": code.CONSTANT, @@ -330,21 +348,12 @@ Volcanos(chat.ONSYNTAX, { "lightgray": code.CONSTANT, "lightgreen": code.CONSTANT, - "cyan": code.CONSTANT, "magenta": code.CONSTANT, - "word-break": code.FUNCTION, "vertical-align": code.FUNCTION, - "calc": code.FUNCTION, "url": code.FUNCTION, "contexts": code.CONSTANT, - - "--body-bg-color": code.CONSTANT, "--body-fg-color": code.CONSTANT, - "--danger-bg-color": code.CONSTANT, "--notice-bg-color": code.CONSTANT, - "--hover-bg-color": code.CONSTANT, "--hover-fg-color": code.CONSTANT, - "--box-border": code.CONSTANT, "--box-notice": code.CONSTANT, "--box-shadow": code.CONSTANT, - "--output-bg-color": code.CONSTANT, - "--plugin-bg-color": code.CONSTANT, "--plugin-fg-color": code.CONSTANT, + */ }, include: ["html"], func: function(can, push, text) { text.indexOf("/* ") == 0 && push(can.base.trimPrefix(can.base.trimSuffix(text, " */"), "/* ")) }, }, diff --git a/plugin/local/code/vimer.css b/plugin/local/code/vimer.css index 6c5e2eee..e635943a 100644 --- a/plugin/local/code/vimer.css +++ b/plugin/local/code/vimer.css @@ -3,6 +3,7 @@ fieldset.vimer>div.output>div.layout>div.layout div.content input.current { back fieldset.vimer>div.output>div.layout>div.layout div.content div.complete { background-color:unset; padding-top:0; display:none; position:absolute; height:1px; overflow:visible; } fieldset.vimer>div.output>div.layout>div.layout div.content div.complete div.prefix { color:transparent; white-space:pre; float:left; } fieldset.vimer>div.output>div.layout>div.layout div.content div.complete table.content thead { display:none; } +fieldset.vimer>div.output>div.layout>div.layout div.content div.complete table.content td:first-child { padding-left:0; } fieldset.vimer>div.output>div.layout>div.layout div.content div.complete table.content { padding-left:var(--input-padding); width:unset; max-width:600px; display:block; box-shadow:var(--box-shadow); } fieldset.vimer>div.output>div.layout>div.layout div.content.insert div.complete:not(.hide) { display:block; top:unset; } fieldset.vimer>div.output>div.layout>div.layout div.content.normal input.current { caret-color:var(--notice-bg-color); border:var(--notice-bg-color) solid 1px; } diff --git a/plugin/local/mall/goods.css b/plugin/local/mall/goods.css index 35e8f4c8..82fa826e 100644 --- a/plugin/local/mall/goods.css +++ b/plugin/local/mall/goods.css @@ -3,7 +3,7 @@ fieldset.goods>div.output>div.project>div.item { text-align:center; padding:20px fieldset.goods>div.output>div.project>div.item.select { border-right:var(--notice-bg-color) solid 4px; } fieldset.goods>div.output>div.layout>div.layout>div.content>div.item:not(.hide) { background-color:var(--plugin-bg-color); border-radius:var(--plugin-radius); box-shadow:var(--box-shadow); - margin:10px; float:left; display:flex; + margin:10px; float:left; } body:not(.mobile) fieldset.goods>div.output>div.layout>div.layout>div.content>div.item:not(.hide) { height:150px; diff --git a/plugin/local/mall/goods.js b/plugin/local/mall/goods.js index d8733aea..67c3363b 100644 --- a/plugin/local/mall/goods.js +++ b/plugin/local/mall/goods.js @@ -7,7 +7,7 @@ Volcanos(chat.ONIMPORT, { can.onmotion.scrollIntoView(can, item._target, 10) }) } - return {view: html.ITEM, style: style, list: [ + return {view: [[html.ITEM, html.FLEX]], style: style, list: [ {view: wiki.IMAGE, list: [{img: can.misc.MergeCache(can, can.core.Split(item.image)[0], item.space)}]}, {view: wiki.CONTENT, list: [ {view: [html.TITLE, html.DIV, item.name]}, diff --git a/plugin/local/wiki/feel.css b/plugin/local/wiki/feel.css index d500bcf9..8d947cb8 100644 --- a/plugin/local/wiki/feel.css +++ b/plugin/local/wiki/feel.css @@ -1,6 +1,6 @@ fieldset.feel>div.output>div.layout>div.display { position:relative; overflow-y:hidden; } fieldset.feel>div.output>div.layout>div.display>img:hover { background-color:var(--hover-bg-color); cursor:pointer; } -fieldset.feel>div.output>div.layout>div.display:not(.hide) { height:100px; display:flex; justify-content:center; gap:10px; } +fieldset.feel>div.output>div.layout>div.display:not(.hide) { height:100px; align-items:normal; gap:10px; } fieldset.feel>div.output>div.layout>div.display:not(:hover)>div.toggle { display:none; } fieldset.feel>div.output>div.layout>div.display>div.toggle { font-size:48px; padding:5px; position:absolute; top:20%; } fieldset.feel>div.output>div.layout>div.display>div.toggle.prev { left:0; } @@ -11,5 +11,4 @@ fieldset.feel>div.output>div.layout>div.layout>div.content>img:hover { backgroun fieldset.feel>div.output>div.layout>div.layout>div.content:not(:hover)>div.toggle { display:none; } fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle { font-size:48px; padding:5px; padding-top:32px; top:40%; height:120px; } fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle.next { right:0; } -fieldset.feel.float>div.output { display:flex; justify-content:center; } body.mobile fieldset.feel>div.output>div.project { overflow-x:hidden; } diff --git a/plugin/local/wiki/feel.js b/plugin/local/wiki/feel.js index d020d9b7..488b4669 100644 --- a/plugin/local/wiki/feel.js +++ b/plugin/local/wiki/feel.js @@ -1,5 +1,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.ui = can.onappend.layout(can), cb && cb(msg) can.db.hash = can.isCmdMode()? can.misc.SearchHash(can): [] + can.onappend.style(can, html.FLEX, can.ui.display) can.onmotion.hidden(can, can._action), can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can) can.onimport._project(can, msg), can.onimport.page(can, can.db.list, can.db.begin = parseInt(msg.Option(cli.BEGIN)||"0")) }, @@ -136,6 +137,7 @@ Volcanos(chat.ONACTION, {list: ["full", Volcanos(chat.ONDETAIL, {list: ["关闭", "上一个", "下一个", "设置头像", "设置背景", "复制链接", "下载", "删除"], _init: function(can, index) { can.onappend._init(can, {type: "story feel play float"}, [], function(sub) { can.sub = sub, sub._legend.onclick = can._legend.onclick + can.onappend.style(can, html.FLEX, sub._output) can.getActionSize(function(msg, left, top, width, height) { sub.onappend._action(can, can.ondetail.list, sub._action, can.ondetail), sub.onappend._status(sub, ["begin", nfs.FILE]) sub.page.style(sub, sub._target, {left: left||0, top: top||0}), sub.page.style(sub, sub._output, html.HEIGHT, height-2*html.ACTION_HEIGHT, html.WIDTH, width) can.order = index, can.show = function(order) { path = can.onimport._file(can, can.db.list[order].path); var cb = can.onfigure[can.base.Ext(path)]||can.onfigure[wiki.IMAGE] diff --git a/plugin/local/wiki/word.css b/plugin/local/wiki/word.css index a8b70f8e..40249c08 100644 --- a/plugin/local/wiki/word.css +++ b/plugin/local/wiki/word.css @@ -1,6 +1,4 @@ fieldset.word>div.output { padding:var(--plugin-padding); } -fieldset.word>div.output div.story.flex { display:flex; justify-content:center; } -fieldset.word>div.output div.story.flex div.story.flex { display:flex; justify-content:center; } fieldset.word>div.output div.story.flex>* { padding:var(--plugin-padding); } fieldset.word>div.output p { margin:var(--title-margin) auto; } fieldset.word>div.output h3 { margin-top:var(--title-margin); } diff --git a/plugin/story/stats.js b/plugin/story/stats.js index 45cb648a..86f9ace3 100644 --- a/plugin/story/stats.js +++ b/plugin/story/stats.js @@ -1,5 +1,5 @@ Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { can.onappend.style(can, "stats", can._output) + _init: function(can, msg) { can.onappend.style(can, ["stats", html.FLEX], can._output) var stats = {}, units = {}, index = {}; msg.Table(function(value) { units[value.name] = value.units stats[value.name] = parseFloat(stats[value.name]||"0") + parseFloat(value.value) index[value.name] = value.index @@ -10,7 +10,7 @@ Volcanos(chat.ONIMPORT, { value = parseInt(value/1000) } return ls.reverse().join(", ") } - can.core.Item(stats, function(name, value) { can.page.Append(can, can._output, [{view: [[html.ITEM, name]], list: [ + can.core.Item(stats, function(name, value) { can.page.Append(can, can._output, [{view: [[html.ITEM, name, html.FLEX]], list: [ {view: mdb.VALUE, list: [{text: can.base.trimSuffix(fmts(parseFloat(value).toFixed(2))+"", ".00")}, {text: [units[name], "", "units"]}]}, {view: [mdb.NAME, "", can.user.trans(can, name, null, html.INPUT)]}, ], onclick: function() {