From 1dae347fe741bd89c0048e6ac603e2336562ad05 Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 6 Sep 2023 16:06:01 +0800 Subject: [PATCH] add some --- index.css | 22 ++++++++++++++-------- lib/user.js | 1 + panel/action.css | 2 ++ panel/action.js | 21 +++++++++++---------- panel/header.css | 2 +- panel/river.js | 2 +- plugin/table.js | 1 + 7 files changed, 31 insertions(+), 20 deletions(-) diff --git a/index.css b/index.css index 25df4439..3a8ac9ac 100644 --- a/index.css +++ b/index.css @@ -73,7 +73,6 @@ kbd { padding:0 5px; font-family:var(--code-font-family); } img, iframe { margin-bottom:-3px; } iframe { height:420px; width:100%; } /* fieldset */ -// fieldset>legend { margin-right:10px; box-shadow:var(--box-shadow); } fieldset>legend { box-shadow:var(--box-shadow); } fieldset>legend>i { margin-right:5px; } fieldset>form.option>div.item:not(.icon) { margin-right:10px; box-shadow:var(--box-shadow); } @@ -110,6 +109,8 @@ fieldset.input.date>div.status { text-align:center; } /* float */ body div.float { padding:5px; box-shadow:var(--box-shadow); } body>div.toast div.title { color:var(--notice-bg-color); float:left; } +body>div.toast div.delete { color:var(--body-bg-color); float:right; cursor:pointer; } +body>div.toast div.delete:hover { background-color:var(--hover-bg-color); } body>div.toast div.duration { color:var(--disable-fg-color); float:right; } body>div.toast div.content { color:var(--notice-bg-color); text-align:center; } body>div.toast div.progress { border:var(--box-notice); margin-left:0px; height:20px; clear:both; } @@ -170,11 +171,11 @@ body:not(.windows) div.carte { font-family:monospace; } div.item>i:first-child { margin-right:10px; } div.project div.item>i:first-child { color:var(--panel-output-fg-color); } div.project div.item.text:hover>i:first-child { color:var(--plugin-fg-color); } -div.action div.icon, div.action span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; } +div.action div.icon, div.action>div.item:not(.tabs)>span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; } +div.action>div.item.icons>span.icon { font-size:30px; line-height:28px; } form.option div.icon, form.option span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; } -// form.option div.icon:first-child { margin-left:-5px; } -form.option div.icon.refresh { font-size:28px; line-height:28px; translate:0 -1px; } -form.option div.icon.goback { font-size:28px; line-height:28px; translate:0 -1px; } +form.option div.icon.refresh { font-size:28px; line-height:28px; } +form.option div.icon.goback { font-size:28px; line-height:28px; } form.option div.icon.next { font-size:18px; } form.option div.icon.prev { font-size:18px; } div.item.select { position:relative; } @@ -183,8 +184,9 @@ div.item.select:hover>span.icon { visibility:visible; } div.item.text { position:relative; } div.item.text>span.icon { position:absolute; right:0; visibility:hidden; } div.item.text:hover>span.icon { visibility:visible; } -div.item.button>span.icon.create { font-size:32px; line-height:32px; translate:0px -2px; display:block; } -div.tabs span.icon { padding:0 8px; visibility:hidden; } +div.item.button>span.icon.create { font-size:32px; line-height:28px; display:block; } +// div.tabs span.icon { font-style:normal; font-size:20px; line-height:20px; padding:0 5px; visibility:hidden; } +div.tabs span.icon { font-style:normal; line-height:20px; padding:0 5px; visibility:hidden; } div.tabs>div.select span.icon { visibility:visible; } div.tabs>div:hover span.icon { visibility:visible; } div.tabs:hover>span.icon { visibility:visible; } @@ -380,7 +382,7 @@ body.print fieldset.draw div.output { background-color:lightgray; } body.print fieldset.draw div.output div.content svg { background-color:lightgray; } /* misc */ fieldset.Search div.story[data-type=spark] { margin:0; } -fieldset.Search>div.output>div.profile { border-left:none; } +fieldset.Search>div.output>div.profile { border-left:none; width:unset; } fieldset.Action>div.output>fieldset.plugin:not(.output):not(.float):not(.full):not(.cmd) { padding:10px; margin:10px; box-shadow:var(--box-shadow); } fieldset.Action>div.output>fieldset.plugin:not(.float):not(.full):not(.cmd)>legend { float:none; } fieldset.cmd>div.item.time { line-height:22px; padding:5px 10px; float:right; } @@ -416,6 +418,10 @@ fieldset.can.view { font-size:14px; } fieldset.can.data { font-size:14px; } fieldset.word>form.option>div.item>input[name=path] { width:320px !important; } fieldset.plan div.output div.content>table.content { height:100%; width:100%; } +fieldset.plan>div.output>div.layout>div.layout>div.profile:not(.toggle) { width:unset; } +fieldset.plan>div.output>div.layout>div.layout>div.profile input { box-shadow:var(--box-shadow); } +fieldset.plan>div.output>div.layout>div.layout>div.profile input:not(:last-child) { margin-right:5px; } +fieldset.plan>div.output>div.layout>div.layout>div.profile td:last-child { cursor:text; } fieldset.draw div.output svg { margin-bottom:-5px; } fieldset.draw>form.option>div.item.pid>input { width:60px !important; } fieldset.draw.trend div.output svg { background-color:#1b5b738c; } diff --git a/lib/user.js b/lib/user.js index fcf28971..7649ba1d 100644 --- a/lib/user.js +++ b/lib/user.js @@ -82,6 +82,7 @@ Volcanos("user", { var width = meta.width||400; if (width < 0) { width = window.innerWidth + width } meta.action = meta.action||[""] var ui = can.page.Append(can, document.body, [{view: [[chat.TOAST, chat.FLOAT]], style: {left: (window.innerWidth-width)/2, width: width, top: can.page.height()/2}, list: [ {text: [meta.title||"", html.DIV, html.TITLE], title: "点击复制", onclick: function(event) { can.user.copy(event, can, meta.title) }}, + {view: ["delete", "", can.page.unicode.delete], title: "点击关闭", onclick: function() { action.close() }}, {view: "duration", title: "点击关闭", onclick: function() { action.close() }}, can.base.isObject(meta.content)? meta.content: {text: [meta.content||"", html.DIV, nfs.CONTENT]}, html.ACTION, !can.base.isUndefined(meta.progress) && {view: "progress", style: {width: width-10}, list: [ diff --git a/panel/action.css b/panel/action.css index dcd60fc8..54d727e1 100644 --- a/panel/action.css +++ b/panel/action.css @@ -5,9 +5,11 @@ fieldset.Action.tabs>div.action { display:block; } fieldset.Action.tabs>div.output>fieldset>legend { display:none; } fieldset.Action.tabs>div.output>fieldset.plugin:not(.select) { display:none; } fieldset.Header div.Action { display:contents; } +fieldset.Action.tabview>div.output>fieldset.plugin>legend { display:none; } fieldset.Action.tabview>div.output>fieldset.plugin:not(.select) { display:none; } fieldset.Action.vertical>div.output>fieldset.plugin { float:left; } fieldset.Action.horizon>div.output>fieldset.plugin { float:left; } +fieldset.Action.horizon>div.output>fieldset.plugin>div.status { display:none; } fieldset.Action.flow>div.output>fieldset.plugin { float:left; } fieldset.Action.free>div.output>fieldset.plugin { position:absolute; } fieldset.Action.free>div.output>fieldset.plugin.select { z-index:10; } diff --git a/panel/action.js b/panel/action.js index a154badc..757ab541 100644 --- a/panel/action.js +++ b/panel/action.js @@ -13,7 +13,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.R _tabs: function(can, sub, meta) { var tabs = [{view: [html.ITEM, "", meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_ITEM, sub._header_tabs) can.onmotion.select(can, can._action, html.DIV_ITEM, sub._tabs), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target) - if (sub._delay_refresh) { sub._delay_refresh = false, sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), can.onexport.isauto(can)) } + if (sub._delay_refresh) { sub._delay_refresh = false, sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) } can.onexport.layout(can) == FREE || (can._output.scrollTop = sub._target.offsetTop-html.PLUGIN_MARGIN) can.onexport.layout(can) && can.misc.SearchHash(can, can.Conf(chat.RIVER), can.Conf(chat.STORM), meta.index) }, oncontextmenu: sub._legend.onclick}]; sub._header_tabs = can.page.Append(can, can._header_tabs, tabs)._target, sub._tabs = can.page.Append(can, can._action, tabs)._target @@ -24,12 +24,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.R }, }) Volcanos(chat.ONACTION, {_init: function(can, target) { - can.Conf(html.MARGIN_Y, 4*html.PLUGIN_MARGIN+html.ACTION_MARGIN), can.Conf(html.MARGIN_X, (can.user.isMobile? 2: 4)*html.PLUGIN_MARGIN) + can.Conf(html.MARGIN_Y, 4*html.PLUGIN_MARGIN+html.ACTION_HEIGHT), can.Conf(html.MARGIN_X, (can.user.isMobile? 2: 4)*html.PLUGIN_MARGIN) can.core.List(["ontouchstart", "ontouchmove", "ontouchend"], function(item) { can.onengine.listen(can, item, function(event, msg) { can.onaction[item](event, can), can.onengine.signal(can, chat.ONACTION_TOUCH, msg) }, target) }) }, - onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height-can.Conf(html.MARGIN_Y), 240), width: width-can.Conf(html.MARGIN_X)}) }, + onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height, 240), width: width}) }, onlogin: function(can, msg) { can.onimport._menu(can, msg), can.onkeymap._build(can) can._root.River && can.onmotion.delay(can, function() { if (can.Mode()) { return } var gt = can.page.unicode.next, lt = can.page.unicode.prev, river = can._root.River._target var target = can.page.Append(can, can._target, [{view: [[html.TOGGLE, chat.PROJECT], "", can.page.isDisplay(river)? lt: gt], onclick: function(event) { @@ -103,24 +103,25 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { _trans: kit.Dict("dream", "空间", "repos", "资源", "portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"), }) Volcanos(chat.ONLAYOUT, { - tabs: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)+html.ACTION_MARGIN), can.ConfWidth(width-can.Conf(html.MARGIN_X)) }) + tabs: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width) }) can.core.List(can._plugins, function(sub) { sub._delay_refresh = true }) can.onmotion.select(can, can._action, html.DIV_ITEM, can.onmotion.select(can, can._action, html.DIV_ITEM)||0, function(target) { target.click() }); return true }, - tabview: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width) }) + tabview: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width) }) can.core.List(can._plugins, function(sub) { sub._delay_refresh = true }), can.onmotion.toggle(can, can._header_tabs, true) can.onmotion.select(can, can._action, html.DIV_ITEM, can.onmotion.select(can, can._action, html.DIV_TABS)||0, function(target) { target.click() }); return true }, horizon: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width/2) }) }, vertical: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height/2), can.ConfWidth(width) }) }, - grid: function(can) { can.getActionSize(function(height, width) { var m = can.user.isMobile? 1: 2, n = 2 - var h = height/n-4*html.PLUGIN_MARGIN, w = width/m-can.Conf(html.MARGIN_X); can.ConfHeight(h), can.ConfWidth(w) - }) }, - free: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)), can.ConfWidth(width-can.Conf(html.MARGIN_Y)) + grid: function(can) { can.getActionSize(function(height, width) { var m = can.user.isMobile? 1: 2, n = 2, h = height/n, w = width/m; can.ConfHeight(h+html.ACTION_HEIGHT), can.ConfWidth(w) }) }, + free: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height*3/4), can.ConfWidth(width*3/4) can.core.List(can._plugins, function(sub, index, array) { can.onmotion.move(can, sub._target, {left: (width/array.length/8*5+20)*index, top: (height/array.length/8*5)*index}) }), can.onmotion.toggle(can, can._header_tabs, true) }) }, + flow: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-html.ACTION_MARGIN), can.ConfWidth(width) }) }, page: function(can) { can.page.styleHeight(can, can._output, ""), can.page.style(can, document.body, kit.Dict(html.OVERFLOW, "")) }, - _plugin: function(can, button) { can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "") }) }, + _plugin: function(can, button) { can.core.List(can._plugins, function(sub) { + sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button? 0: html.ACTION_MARGIN), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "") + }) }, _storage: function(can, value) { return can.misc.sessionStorage(can, can.core.Keys(CAN_LAYOUT, location.pathname), value) }, }) Volcanos(chat.ONEXPORT, { diff --git a/panel/header.css b/panel/header.css index 9c5f4816..40a8fff4 100644 --- a/panel/header.css +++ b/panel/header.css @@ -1,5 +1,5 @@ fieldset.Header>div.output { font-size:1.1rem; line-height:21px; height:48px; overflow:hidden; } -fieldset.Header>div.output div.item { padding:13.5px; float:left; } +fieldset.Header>div.output div.item { background-color:var(--panel-output-bg-color); padding:13.5px; float:left; } fieldset.Header>div.output div.title:first-child { font-style:italic; font-weight:bold; text-align:center; width:230px; overflow:auto; } fieldset.Header>div.output div.state { float:right; } fieldset.Header>div.output div.state.avatar { padding:0; } diff --git a/panel/river.js b/panel/river.js index b844dca2..6d670fd4 100644 --- a/panel/river.js +++ b/panel/river.js @@ -25,7 +25,7 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func onaction_touch: function(can, msg) { can.user.isMobile && can.onmotion.hidden(can) }, onaction_notool: function(can, msg, river, storm) { can.ondetail["addcmd"](msg._event, can, "addcmd", river, storm) }, onsearch: function(can, msg, arg) { if (arg[0] == chat.STORM) { can.onexport.storm(can, msg, arg) } }, - onlayout: function(can, layout) { can.user.isMobile || can.onmotion.toggle(can, can._target, !layout || layout == "tabs") }, + onlayout: function(can, layout) { can.user.isMobile || can.onmotion.toggle(can, can._target, !can.base.isIn(layout, "tabview", "horizon","vertical", "page")) }, ontitle: function(can, msg) { can.misc.sessionStorage(can, CAN_RIVER, ""), can.misc.sessionStorage(can, CAN_STORM, "") }, create: function(event, can) { can.user.input(can.request(event, {title: "创建群组"}), can, [ {name: mdb.TYPE, values: [aaa.TECH, aaa.ROOT, aaa.TECH, aaa.VOID], _trans: "类型"}, diff --git a/plugin/table.js b/plugin/table.js index 789eaca8..8f4e7e3a 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -187,6 +187,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( if (can.page.SelectOne(can, status, nfs.PT+html.SELECT, function(target) { can.onmotion.hidden(can, target._target), can.page.ClassList.del(can, target, html.SELECT); return target }) == sub._legend) { return } sub.onimport.size(sub, can.ConfHeight()/2, (can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0))/2) can.onmotion.select(can, status, html.LEGEND, sub._legend), can.onmotion.toggle(can, sub._target, true) + can.onmotion.select(can, target, "fieldset.plug", sub._target) // sub.Focus() if (sub._delay_init || meta.msg) { sub._delay_init = false, meta.msg = false, sub.Update() } }) }, sub._delay_init = true, sub.onaction.close = function() { sub.select() }, sub.select = function(show) {