Skip to content

Commit 51157df

Browse files
committed
💄 style: New notification style (more discrete)
1 parent 0305d7f commit 51157df

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed

src/content_scripts/content_script.css

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,26 @@
4141
}
4242

4343
#feedback-notif {
44-
padding: 1em;
45-
z-index: 1000;
44+
font-size: 14px;
45+
font-family: Mukta, Arial, sans-serif, Helvetica;
46+
color: #b31b1b;
47+
height: 36px;
48+
background: white;
49+
opacity: 1;
50+
position: fixed;
51+
border-radius: 4px;
52+
border: 1px solid;
53+
padding: 0px;
54+
bottom: 48px;
55+
right: -200px;
4656
display: flex;
4757
align-items: center;
4858
justify-content: center;
4959
text-align: center;
50-
color: white;
51-
background: #b31b1b;
52-
border-radius: 4px;
53-
position: fixed;
54-
font-size: 14px;
55-
bottom: 64px;
56-
right: -200px;
57-
opacity: 0;
58-
padding: 1rem;
59-
-webkit-box-shadow: 14px 30px 122px -30px rgba(0, 0, 0, 0.75);
60-
-moz-box-shadow: 14px 30px 122px -30px rgba(0, 0, 0, 0.75);
61-
box-shadow: 14px 30px 122px -30px rgba(0, 0, 0, 0.75);
62-
font-family: Mukta, Arial, sans-serif, Helvetica;
60+
z-index: 1000;
61+
box-shadow: #b31b1b 4px 4px 0px 0px;
62+
-moz-box-shadow: #b31b1b 4px 4px 0px 0px;
63+
-webkit-box-shadow: #b31b1b 4px 4px 0px 0px;
6364
}
6465

6566
#feedback-pwc {
@@ -98,22 +99,22 @@
9899
justify-content: center;
99100
align-items: center;
100101
padding: 0px 16px;
101-
min-height: 60px;
102102
}
103103

104104
#notif-cancel {
105+
color: #b31b1b;
105106
display: flex;
106107
justify-content: center;
107108
align-items: center;
108-
min-height: 60px;
109109
padding: 0px 16px;
110110
cursor: pointer;
111-
border-left: 1px solid #7f2828;
111+
border-left: 1px solid #ffe9e9;
112112
border-top-right-radius: 4px;
113113
border-bottom-right-radius: 4px;
114114
}
115-
#notif-cancel:hover {
116-
background: #7f2828;
115+
116+
.notif-small {
117+
width: 36px;
117118
}
118119

119120
/*

src/content_scripts/content_script.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ const svg = (name) => {
136136

137137
case "notif-cancel":
138138
return /*html*/ `<svg
139-
width="25"
140-
height="25"
139+
width="20"
140+
height="20"
141141
viewBox="0 0 24 24"
142142
stroke-width="1"
143143
fill="none"
144144
stroke-linecap="round"
145145
stroke-linejoin="round"
146-
stroke="white"
146+
stroke="#b31b1b"
147147
>
148148
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
149149
<line x1="4" y1="7" x2="20" y2="7" />
@@ -163,9 +163,9 @@ const injectNotifCSS = () => {
163163
el.type = "text/css";
164164
el.innerText = `
165165
.pm-notif-loader {
166-
width: 24px;
167-
height: 24px;
168-
border: 2px solid #FFF;
166+
width: 16px;
167+
height: 16px;
168+
border: 1px solid #b31b1b;
169169
border-bottom-color: transparent;
170170
border-radius: 50%;
171171
display: inline-block;
@@ -416,6 +416,7 @@ const hideNotif = () =>
416416
const end = ({ dontWait = false } = {}) => {
417417
global.notif.prevent = false;
418418
global.notif.isLoading = false;
419+
querySelector("#feedback-notif")?.classList.remove("notif-small");
419420
setTimeout(resolve, dontWait ? 0 : 150);
420421
};
421422

@@ -495,10 +496,11 @@ const feedback = async ({
495496
<div>${text}</div>
496497
</div>
497498
<div title="Cancel" id="notif-cancel">
498-
<div>${svg("notif-cancel")}</div>
499+
${svg("notif-cancel")}
499500
</div>`;
500501
} else if (loading) {
501502
global.notif.isLoading = true;
503+
querySelector("#feedback-notif")?.classList.add("notif-small");
502504
content = /*html*/ `<div id="notif-text"><span class="pm-notif-loader"></span></div>`;
503505
} else {
504506
content = /*html*/ ` <div id="notif-text">

src/shared/js/utils/paper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ const addOrUpdatePaper = async ({
685685
}
686686
log("paper: ", paper);
687687

688-
notifText = "Added to your Memory";
688+
notifText = "Saved ✓";
689689
if (pwc.codeLink) {
690690
notifText +=
691691
"<br/><div id='feedback-pwc'>(+ repo from PapersWithCode) </div>";

0 commit comments

Comments
 (0)