mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-12-22 19:21:08 +00:00
replace menu open icon
This commit is contained in:
parent
cad7f47e7e
commit
f49bc0ae90
|
@ -33,7 +33,7 @@ from .views.frontend import handle_frontend_path
|
|||
|
||||
def get_csp(request: web.Request) -> str:
|
||||
data = [
|
||||
"default-src 'none'",
|
||||
"default-src 'self'",
|
||||
f"script-src 'nonce-{request['hash']}'",
|
||||
f"style-src 'self' 'nonce-{request['hash']}'",
|
||||
"form-action 'self'",
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
%meta(name="viewport" content="width=device-width, initial-scale=1")
|
||||
%link(rel="stylesheet" type="text/css" href="/theme/{{config.theme}}.css" nonce="{{view.request['hash']}}" class="theme")
|
||||
%link(rel="stylesheet" type="text/css" href="/static/style.css" nonce="{{view.request['hash']}}")
|
||||
%link(rel="stylesheet" type="text/css" href="/static/bootstrap-icons.css" nonce="{{view.request['hash']}}")
|
||||
%link(rel="manifest" href="/manifest.json")
|
||||
%script(type="application/javascript" src="/static/api.js" nonce="{{view.request['hash']}}" defer)
|
||||
-block head
|
||||
|
@ -41,7 +42,7 @@
|
|||
|
||||
#container
|
||||
#header.section
|
||||
%span#menu-open << ⁞
|
||||
%span#menu-open -> %i(class="bi bi-list")
|
||||
%a.title(href="/") -> =config.name
|
||||
.empty
|
||||
|
||||
|
|
|
@ -32,18 +32,18 @@ function toast(text, type="error", timeout=5) {
|
|||
|
||||
const body = document.getElementById("container")
|
||||
const menu = document.getElementById("menu");
|
||||
const menu_open = document.getElementById("menu-open");
|
||||
const menu_open = document.querySelector("#menu-open i");
|
||||
const menu_close = document.getElementById("menu-close");
|
||||
|
||||
|
||||
menu_open.addEventListener("click", (event) => {
|
||||
var new_value = menu.attributes.visible.nodeValue === "true" ? "false" : "true";
|
||||
function toggle_menu() {
|
||||
let new_value = menu.attributes.visible.nodeValue === "true" ? "false" : "true";
|
||||
menu.attributes.visible.nodeValue = new_value;
|
||||
});
|
||||
}
|
||||
|
||||
menu_close.addEventListener("click", (event) => {
|
||||
menu.attributes.visible.nodeValue = "false"
|
||||
});
|
||||
|
||||
menu_open.addEventListener("click", toggle_menu);
|
||||
menu_close.addEventListener("click", toggle_menu);
|
||||
|
||||
body.addEventListener("click", (event) => {
|
||||
if (event.target === menu_open) {
|
||||
|
@ -53,6 +53,10 @@ body.addEventListener("click", (event) => {
|
|||
menu.attributes.visible.nodeValue = "false";
|
||||
});
|
||||
|
||||
for (const elem of document.querySelectorAll("#menu-open div")) {
|
||||
elem.addEventListener("click", toggle_menu);
|
||||
}
|
||||
|
||||
|
||||
// misc
|
||||
|
||||
|
|
2077
relay/frontend/static/bootstrap-icons.css
vendored
Normal file
2077
relay/frontend/static/bootstrap-icons.css
vendored
Normal file
File diff suppressed because it is too large
Load diff
BIN
relay/frontend/static/bootstrap-icons.woff2
Normal file
BIN
relay/frontend/static/bootstrap-icons.woff2
Normal file
Binary file not shown.
|
@ -155,6 +155,7 @@ textarea {
|
|||
z-index: 1;
|
||||
font-size: 1.5em;
|
||||
min-width: 300px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
#menu[visible="false"] {
|
||||
|
@ -188,11 +189,17 @@ textarea {
|
|||
}
|
||||
|
||||
#menu-open {
|
||||
color: var(--primary);
|
||||
color: var(--background);
|
||||
background: var(--primary);
|
||||
font-size: 38px;
|
||||
line-height: 38px;
|
||||
border: 1px solid var(--primary);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#menu-open:hover {
|
||||
color: var(--primary-hover);
|
||||
color: var(--primary);
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
#menu-open, #menu-close {
|
||||
|
|
Loading…
Reference in a new issue