打开主菜单

少前百科GFwiki β

更改

Widget:NewCharPreview

添加319字节2021年5月24日 (一) 13:42
无编辑摘要
.preview-name { font-weight: bold; }
.preview-quote::after { content: "”"; }
.preview-quote::before { content: "“"; } #arrow-drop { position: relative; right: 8px;}
#preview-list {
displayflex-wrap: flexwrap;
list-style: none;
margin-left: 0; margin-right: 0;} #preview-list li { height: 36px; padding-top: 12px; textz-align: center; widthindex: 10em1;
}
#preview-menu {
background: #fff3; border-radius: 4px4px 0 0;
height: 48px;
width: 10emcalc(8em + 56px);} #preview-menu div:first-child { padding: 13px 0 4px 16px; width: 8em;} #preview-menu div:last-child { padding: 12px 8px;
}
<!--{assign var=name_count value=$name|@count}-->
width: <!--{$name_count*100}-->%;
z-index: 0;
}
width: 100%;
max-width: 512px;
height: 100%;
}
}
</style>
<div onclick="toggleMenu()" id="preview-menu"> <spandiv><!--{$name[0]}--></spandiv> <div> <svg xmlns="http://www.w3.org/2000/svg" id="arrow-drop" height="24px" width="24px" viewBox="0 0 24 24"> <path d="M 7,10 l 5,5 5,-5 H 7 z" idfill="arrow-dropwhite" /> </svg> </div>
</div>
<ul id="preview-list">
(window.RLQ=window.RLQ||[]).push(function(){
if (isMobile) {
$("#preview-list").css(["background", "#222"); $("#preview-colorlist", ).css("border-radius", "4px"); $("#preview-list").css("box-shadow", "display0 4px 6px #0005", ); $("padding#preview-list", ).css("positiondisplay", "widthnone"],); [ $("#333preview-list").css("margin-top", "0 0 4px -4px", ); $("0 4px 4px #fff3preview-list", ).css("nonepadding", "8px 0"); $("#preview-list").css("position", "absolute"); $("#preview-list").css("width", "10emcalc(8em + 56px)"]);
charList.forEach(item => {
item.style.cssText = "height: 28px26px; margin-bottom: 0; padding: 4px 6px 0 0 16px 0; text-align: left; width: calc(10em - 16px)"; })100%; $("#content").on("click", e => { if (e.target != $("#preview-menu")) { $("#preview-list").css("display", "none"); }
});
$("#tab-indicator").css("display", "none");
$("#preview-menu").css("display", "flex");
$("#preview-menu").on("click", toggleMenu);
} else {
$("#preview-menu").css("display", "none");
$("#preview-list").css("display", "flex");
$charList.forEach(item => { item.style.cssText = "#previewheight: 36px; padding-menu").css("display", "nonetop: 12px; text-align: center; width: 10em;"; });
}
charList.forEach(item => {
item.onkeydown = parseOnKeyDown;
});
selectTab(charList[0]);
})
if (isMobile) {
toggleMenu();
if ($("#preview-menu spandiv:first-child").text() != targetItem.text()textContent) { $("#preview-menu spandiv:first-child").text(targetItem.text()textContent);
}
}
if (isOpen) {
$("#preview-list").css("display", "none");
$("#arrow-drop").css("transform", "rotate(180deg0deg)");
$("#preview-menu").blur();
} else {
$("#preview-list").css("display", "flex");
$("#arrow-drop").css("transform", "rotate(0deg180deg)");
}
isOpen ^= true;