diff --git a/const.js b/const.js index 2e2f3dca..49d011a8 100644 --- a/const.js +++ b/const.js @@ -311,6 +311,7 @@ var html = {value: { PLUGIN_PADDING: 0, PLUGIN_MARGIN: 0, ACTION_BUTTON: 3, TABLE_BUTTON: 5, CODE_FONT_SIZE: 14, + CARD_WIDTH: 320, CARD_HEIGHT: 180, PLUG_WIDTH: 800, PLUG_HEIGHT: 480, STORY_HEIGHT: 480, FLOAT_HEIGHT: 480, FLOAT_WIDTH: 1200, DESKTOP_WIDTH: 1200, DESKTOP_HEIGHT: 684, }, FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status", diff --git a/frame.js b/frame.js index e022a9f0..699e83d5 100644 --- a/frame.js +++ b/frame.js @@ -701,15 +701,15 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro }), can.onengine.signal(can, chat.ONSIZE, can.request({}, {height: height, width: width})) can.user.isMobile && can.user.isLandscape() || can.page.style(can, document.body, kit.Dict(html.OVERFLOW, html.HIDDEN)) }, - expand: function(can, target, width, height, item) { var margin = 2*html.PLUGIN_PADDING; width = width||320, height = height||160 + expand: function(can, target, width, height, item) { + var margin = 2*html.PLUGIN_PADDING; width = width||html.CARD_WIDTH, height = height||html.CARD_HEIGHT var n = parseInt(target.offsetWidth/(width+margin)); width = target.offsetWidth/n - margin if (width+margin >= target.offsetWidth) { n = 1, width = target.offsetWidth - margin } var m = parseInt(target.offsetHeight/(height+margin)); height = target.offsetHeight/m - margin if (height+margin >= target.offsetHeight) { n = 1, height = target.offsetHeight - margin } can.page.SelectChild(can, target, item||html.DIV_ITEM, function(target) { can.page.styleHeight(can, target, height), can.page.styleWidth(can, target, width) - }) - return height+margin + }); return height+margin }, background: function(can, url, target) { can.page.style(can, target||can._root._target, "background-image", url == "" || url == "void"? "": 'url("'+url+'")') }, figure: function(event, can, target, right, min) { diff --git a/index.css b/index.css index 2e3d19de..cffa563d 100644 --- a/index.css +++ b/index.css @@ -46,8 +46,9 @@ body { --code-font-size:14px; --code-line-height:24px; --code-tabs-height:48px; --svg-font-size:24px; --svg-stroke-width:1; --status-font-size:12px; - --header-height:48px; --footer-height:var(--action-height); --action-height:32px; --status-height:var(--action-height); + --header-height:48px; --footer-height:var(--action-height); --action-height:32px; --status-height:var(--action-height); --river-width:var(--project-width); --project-width:230px; --input-width:120px; --button-width:60px; --form-width:320px; + --card-width:320px; --card-height:180px; --desktop-height:684px; --float-height:480px; --plug-height:480px; --story-height:var(--float-height); --desktop-width:1200px; --float-width:1200px; --plug-width:1000px; --textarea-height:96px; --qrcode-height:364px; --iframe-height:420px; @@ -84,6 +85,7 @@ body.width3 { /* 960-1280 平板横屏 */ } body.width4 { /* 1280-1600 笔记本 显示器调试 */ --table-button:4; + --card-height:150; } body.width5 { /* 1600-1920 */ --table-button:4; @@ -416,7 +418,7 @@ body.mobile div.output.card { overflow-x:hidden; } div.output.card>div.item { background-color:var(--plugin-bg-color); padding:var(--plugin-padding); margin:var(--plugin-padding); border:var(--box-border); border-radius:var(--plugin-radius); box-shadow:var(--box-shadow); - min-height:160px; min-width:320px; position:relative; float:left; + min-width:320px; position:relative; float:left; } div.output.card>div.item.stop { color:var(--disable-fg-color); } div.output.card>div.item>div.title { font-size:var(--legend-font-size); font-weight:bold; padding-bottom:var(--input-padding); border-bottom:var(--box-border); display:flex; align-items:center; overflow:hidden; }