Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FXVPN-164: Refactor pageAction popup to match spec #81

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 9 additions & 80 deletions src/ui/pageAction/pageAction.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

@media (prefers-color-scheme: dark) {
:root {
--button-primary-bg-default: rgba(0, 221, 255, 1);
--button-primary-bg-hover: rgba(128, 235, 255, 1);
--button-primary-bg-active: rgba(170, 242, 255, 1);
--button-primary-bg-disabled: rgba(0, 221, 255, 1);
--button-primary-text-color: rgba(21, 20, 26, 1);
--button-secondary-bg-default: rgba(251, 251, 254, 0.07);
--button-secondary-bg-hover: rgba(251, 251, 254, 0.14);
--button-secondary-bg-active: rgba(251, 251, 254, 0.21);
Expand All @@ -20,11 +15,6 @@

@media (prefers-color-scheme: light) {
:root {
--button-primary-bg-default: rgba(0, 96, 223, 1);
--button-primary-bg-hover: rgba(2, 80, 187, 1);
--button-primary-bg-active: rgba(5, 64, 150, 1);
--button-primary-bg-disabled: rgba(0, 96, 223, 1);
--button-primary-text-color: rgba(255, 255, 255, 1);
--button-secondary-bg-default: rgba(21, 20, 26, 0.07);
--button-secondary-bg-hover: rgba(21, 20, 26, 0.14);
--button-secondary-bg-active: rgba(21, 20, 26, 0.21);
Expand All @@ -35,81 +25,20 @@

body {
margin: 0px;
padding: 1rem;
padding: 0px;
font-size: 13px;
min-inline-size: 240px;
min-inline-size: 192px;
display: flex;
flex-direction: column;
background-color: var(--panel-bg-color);
color: var(--text-color-primary);
color: #0c0c0d;
font-family: var(--font-family);
background-color: #e2e1e3;
overflow: hidden;
}

h1 {
font-size: 13px;
font-family: "Inter Semi Bold";
margin-block: 0px 0.5rem;
padding-block-end: 1rem;
text-align: center;
border-bottom: 1px solid rgb(173, 173, 173, 0.8);
}

.flex {
display: flex;
}

#context-description {
margin-block: 4px 0;
}

#context-img {
margin-inline-end: 0.5rem;
block-size: 1rem;
margin-block: auto;
}

/* #context-status {
padding: 1rem;
} */

p {
margin-block: 0.5rem;
}

button {
margin-block-start: 1rem;
margin-inline: auto 0;
padding: 4px 16px;
min-block-size: 32px;
border-radius: 4px;
border: none;
background: none;
transition: background 0.1s ease;
}

.primary {
background: var(--button-primary-bg-default);
color: var(--button-primary-text-color);
}

.primary:hover {
background: var(--button-primary-bg-hover);
}

.primary:active {
background: var(--button-primary-bg-active);
}

.secondary {
background: var(--button-secondary-bg-default);
color: var(--button-secondary-text-color);
}

.secondary:hover {
background: var(--button-secondary-bg-hover);
}

.secondary:active {
background: var(--button-secondary-bg-active);
@media (prefers-color-scheme: dark) {
body {
background-color: var(--panel-bg-color);
color: rgba(255, 255, 255, 0.9);
}
}
91 changes: 46 additions & 45 deletions src/ui/pageAction/pageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,22 @@ export class PageActionPopup extends LitElement {
proxyHandler.removeContextForOrigin(this._siteContext.origin);
};

const resetButtonClasses = () => {
return excluded ? "primary" : "secondary";
};

const resetButtonContent = () => {
return excluded ? "Turn on" : "Remove custom location";
};

return html`
<h1>${tr("productName")}</h1>
<p id="context-description">${contextDescriptionText()}</p>

<div class="flex">
<img id="context-img" src="${getSrc()}" />
<p id="context-location">${getLocationText()}</p>
<div class="wrapper">
<h1>${tr("productName")}</h1>
<p id="context-description">${contextDescriptionText()}</p>

<div class="flex line-height">
<img id="context-img" src="${getSrc()}" />
<p id="context-location">${getLocationText()}</p>
</div>
</div>
<div class="flex">
<button
class="${resetButtonClasses()}"
id="removeContext"
@click="${removeContext}"
>
<button id="removeContext" @click="${removeContext}">
${resetButtonContent()}
</button>
</div>
Expand All @@ -106,11 +100,19 @@ export class PageActionPopup extends LitElement {

h1 {
font-size: 13px;
margin-block: 0px 0.5rem;
padding-block-end: 1rem;
text-align: center;
border-bottom: 1px solid rgb(173, 173, 173, 0.8);
font-family: "Inter Semi Bold";
margin-block: 0px;
font-weight: normal;
font-family: "Inter Regular";
color: var(--grey40);
line-height: 21px;
}

.wrapper {
padding: 16px;
}

.line-height {
block-size: 21px;
}

.flex {
Expand All @@ -122,8 +124,8 @@ export class PageActionPopup extends LitElement {
}

#context-img {
margin-inline-end: 0.5rem;
block-size: 1rem;
margin-inline-end: 8px;
inline-size: 16px;
margin-block: auto;
}

Expand All @@ -132,43 +134,42 @@ export class PageActionPopup extends LitElement {
} */

p {
margin-block: 0.5rem;
margin-block: auto;
font-size: 13px;
}

button {
margin-block-start: 1rem;
margin-inline: auto 0;
padding: 4px 16px;
margin-block: 8px;
margin-inline: 8px;
padding: 4px 8px;
min-block-size: 32px;
border-radius: 4px;
border: none;
background: none;
background: rgba(255, 255, 255, 0);
width: 100%;
position: relative;
font-size: 13px;
text-align: left;
color: var(--button-secondary-text-color);
transition: background 0.1s ease;
}

.primary {
background: var(--button-primary-bg-default);
color: var(--button-primary-text-color);
}

.primary:hover {
background: var(--button-primary-bg-hover);
}

.primary:active {
background: var(--button-primary-bg-active);
}

.secondary {
background: var(--button-secondary-bg-default);
color: var(--button-secondary-text-color);
button::before {
content: "";
height: 1px;
width: 100%;
position: absolute;
top: -8px;
left: 0;
right: 0;
background-color: #c4c3c5;
}

.secondary:hover {
button:hover {
background: var(--button-secondary-bg-hover);
}

.secondary:active {
button:active {
background: var(--button-secondary-bg-active);
}
`;
Expand Down