mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
9cffc62371
commit
5f353c212f
@ -4,7 +4,11 @@ fieldset.Header>div.output div.title:first-child { font-size:var(--legend-font-s
|
||||
fieldset.Header>div.output div.title img { height:var(--action-height); width:var(--action-height); }
|
||||
fieldset.Header>div.output div.item.theme { margin-right:var(--button-margin); }
|
||||
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); }
|
||||
fieldset.Header>div.output div.item.theme>i.bi-moon-stars:last-child { font-size:12px; }
|
||||
fieldset.Header>div.output div.item.language>span:last-child { color:var(--disable-fg-color); }
|
||||
fieldset.Header>div.output div.item.language { user-select: none; }
|
||||
fieldset.Header>div.output div.item.theme { user-select: none; }
|
||||
fieldset.Header>div.output div.state { float:right; }
|
||||
fieldset.Header>div.output div.state.avatar { padding:0; }
|
||||
fieldset.Header>div.output div.state.avatar>img { height:var(--header-height); clip-path:circle(40%); }
|
||||
|
@ -15,7 +15,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
}, _init: function(target) {
|
||||
item == mdb.TIME && can.onimport._time(can, target)
|
||||
item == aaa.LANGUAGE && can.page.Append(can, target, [{text: "en / 中"}])
|
||||
item == chat.THEME && can.page.Append(can, target, [{icon: icon.SUN}])
|
||||
item == chat.THEME && can.page.Append(can, target, [{icon: icon.SUN}, {text: " / "}, {icon: icon.MOON}])
|
||||
}}])
|
||||
}) },
|
||||
_avatar: function(can, msg) { can.user.isExtension || can.user.isLocalFile || can.page.Modify(can, "div.state.avatar>img", {src: can.onexport.avatar(can)}) },
|
||||
@ -54,10 +54,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
}) },
|
||||
theme: function(can, theme) { theme = can.ui.diy&&can.ui.diy[theme]||theme; theme && can.runAction({}, chat.THEME, [theme])
|
||||
theme && can.misc.localStorage(can, "can.theme", can._theme = theme == ice.AUTO? "": theme) && can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: theme}))
|
||||
can.user.theme(can, theme = can.onexport.theme(can))
|
||||
can.page.Select(can, can._output, "div.item.theme>i", function(target) { var list = [html.LIGHT, html.WHITE]
|
||||
can.user.theme(can, theme = can.onexport.theme(can)); var list = [html.LIGHT, html.WHITE]
|
||||
can.page.Select(can, can._output, "div.item.theme>i:first-child", function(target) {
|
||||
if (list.indexOf(theme) == -1 && list.indexOf(theme[0]) == -1) { target.className = icon.MOON } else { target.className = icon.SUN }
|
||||
})
|
||||
can.page.Select(can, can._output, "div.item.theme>i:last-child", function(target) {
|
||||
if (list.indexOf(theme) == -1 && list.indexOf(theme[0]) == -1) { target.className = icon.SUN } else { target.className = icon.MOON }
|
||||
})
|
||||
},
|
||||
menu: function(can, cmds, cb, trans) { can.base.isString(cmds) && (cmds = [cmds])
|
||||
return can.page.Append(can, can._output, [{view: cmds[0], list: can.core.List(can.base.getValid(cmds.slice(1), [cmds[0]]), function(item) {
|
||||
@ -119,9 +122,11 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
||||
},
|
||||
carte: function(event, can, list, cb, trans) { return can.user.carte(event, can, can.onaction, list, cb, null, trans) },
|
||||
share: function(event, can, args) { can.user.share(can, can.request(event), [ctx.ACTION, chat.SHARE].concat(args||[])) },
|
||||
theme: function(event, can) { can.page.Select(can, can._output, "div.item.theme>i", function(target) {
|
||||
can.onimport.theme(can, target.className == icon.SUN? html.DARK: html.LIGHT)
|
||||
}) },
|
||||
theme: function(event, can) {
|
||||
can.page.Select(can, can._output, "div.item.theme>i:first-child", function(target) {
|
||||
can.onimport.theme(can, target.className == icon.SUN? html.DARK: html.LIGHT)
|
||||
})
|
||||
},
|
||||
language: function(event, can) { can.onimport.language(can, can.user.info.language.indexOf("zh") == 0? "en-us": "zh-cn") },
|
||||
avatar: function(event, can) { var src = can.onexport.avatar(can)
|
||||
can.onaction.carte(can.request(event, {_style: "header avatar"}), can, [`<img src="${src}">`])
|
||||
|
Loading…
x
Reference in New Issue
Block a user