From 9808965ee09a4ffeca9178a10d64984462a86fd7 Mon Sep 17 00:00:00 2001 From: octo Date: Sun, 2 Jul 2023 14:29:00 +0300 Subject: [PATCH] Add log in button --- css/redditChanges.css | 5 ++++- js/user_sidebar.js | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/css/redditChanges.css b/css/redditChanges.css index 5ab26ae..67e5792 100644 --- a/css/redditChanges.css +++ b/css/redditChanges.css @@ -83,7 +83,7 @@ width: calc(100% - 10px - 10px); } .desktop-onboarding__col_sign-up_form { - width: 100vw; + width: 100%; } .pagename { font-variant: normal !important; @@ -97,3 +97,6 @@ .md blockquote { color: var(--md-sys-color-on-surface-variant) !important; } +.desktop-onboarding__col_sign-up_image { + display: none; +} diff --git a/js/user_sidebar.js b/js/user_sidebar.js index 487f121..f3bc639 100644 --- a/js/user_sidebar.js +++ b/js/user_sidebar.js @@ -103,6 +103,21 @@ async function setupSubreddits(actualSidebar) { function moveHeaderItems(actualSidebar) { const rheader = document.getElementById("header-bottom-right"); const userlink = rheader.querySelector(".user a"); + if (userlink.innerText.includes("Log in")) { + const loginitem = createSidebarItem( + "Log in", + "javascript:void(0)", + "login", + false + ); + loginitem.addEventListener("click", () => { + const rheader = document.getElementById("header-bottom-right"); + const userlink = rheader.querySelector(".user a"); + userlink.click(); + }); + actualSidebar.appendChild(loginitem); + return; + } actualSidebar.appendChild( createSidebarItem( userlink.text,