Skip to content

Commit af31d58

Browse files
committed
Bug 1997406 — implement new status card designs for the ip protection panel r=fluent-reviewers,ip-protection-reviewers,bolsson,rking
Differential Revision: https://phabricator.services.mozilla.com/D271156
1 parent 8c2a1ee commit af31d58

15 files changed

+127
-439
lines changed
-350 Bytes
Binary file not shown.

browser/components/ipprotection/assets/ipprotection-connection-off.svg

Lines changed: 0 additions & 16 deletions
This file was deleted.

browser/components/ipprotection/assets/ipprotection-connection-on.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

browser/components/ipprotection/assets/rings.svg

Lines changed: 0 additions & 35 deletions
This file was deleted.

browser/components/ipprotection/content/ipprotection-constants.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export const LINKS = Object.freeze({
1717
SUPPORT_URL: "https://support.mozilla.org/kb/use-ip-concealment-in-firefox",
1818
});
1919

20-
export const FLAGS = Object.freeze({
21-
us: "chrome://browser/content/ipprotection/assets/flags/us.png",
22-
});
23-
2420
export const ERRORS = Object.freeze({
2521
GENERIC: "generic-error",
2622
});

browser/components/ipprotection/content/ipprotection-content.mjs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import {
1212
// eslint-disable-next-line import/no-unassigned-import
1313
import "chrome://browser/content/ipprotection/ipprotection-header.mjs";
1414
// eslint-disable-next-line import/no-unassigned-import
15-
import "chrome://browser/content/ipprotection/ipprotection-flag.mjs";
16-
// eslint-disable-next-line import/no-unassigned-import
1715
import "chrome://browser/content/ipprotection/ipprotection-message-bar.mjs";
1816
// eslint-disable-next-line import/no-unassigned-import
1917
import "chrome://browser/content/ipprotection/ipprotection-signedout.mjs";
@@ -226,16 +224,6 @@ export default class IPProtectionContentElement extends MozLitElement {
226224
`;
227225
}
228226

229-
descriptionTemplate() {
230-
return this.state.location
231-
? html`
232-
<ipprotection-flag
233-
.location=${this.state.location}
234-
></ipprotection-flag>
235-
`
236-
: null;
237-
}
238-
239227
statusCardTemplate() {
240228
return html`
241229
<ipprotection-status-card

browser/components/ipprotection/content/ipprotection-flag.css

Lines changed: 0 additions & 17 deletions
This file was deleted.

browser/components/ipprotection/content/ipprotection-flag.mjs

Lines changed: 0 additions & 66 deletions
This file was deleted.

browser/components/ipprotection/content/ipprotection-status-card.css

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
@import "chrome://global/skin/global.css";
66

77
:host {
8-
--status-card-connected-background-color: var(--color-violet-90);
9-
--status-card-connected-text-color: var(--color-white);
10-
--connection-globe-icon-size: 48px;
11-
--connection-rings-extra-space-x: 23px;
12-
--connection-rings-extra-space-y: 23px;
13-
--connection-shield-color: var(--panel-background);
14-
--connection-shield-off-background-color: var(--icon-color-critical);
15-
--connection-shield-on-background-color: var(--color-accent-primary);
8+
--border-color: var(--border-color-card);
169
}
1710

1811
#ipprotection-content-wrapper {
@@ -22,11 +15,6 @@
2215
padding-block: var(--panel-subview-body-padding-block);
2316
}
2417

25-
.vpn-top-content {
26-
margin-inline: var(--space-large);
27-
margin-block-start: var(--space-small);
28-
}
29-
3018
.vpn-status-group {
3119
display: block;
3220
position: relative;
@@ -35,76 +23,14 @@
3523
}
3624

3725
.is-enabled {
38-
color: var(--status-card-connected-text-color);
39-
background-color: var(--status-card-connected-background-color);
26+
background-color: var(--background-color-success);
4027
}
4128

4229
#status-card {
43-
--shield-bgcolor: var(--connection-shield-off-background-color);
44-
--box-icon-size: var(--connection-globe-icon-size);
45-
--box-icon-fill: var(--connection-shield-color);
46-
--box-icon-stroke: var(--shield-bgcolor);
4730
--box-label-font-weight: var(--font-weight-semibold);
4831
-moz-context-properties: fill, stroke;
49-
/**
50-
* moz-box-group changes the border of items based on its position in the group.
51-
* Undo it to preserve the border radius even though the animation rings are
52-
* loaded first in the group.
53-
*/
54-
--box-border-radius-start: initial;
55-
fill: var(--connection-shield-color);
56-
stroke: var(--shield-bgcolor);
57-
58-
&.is-enabled {
59-
--shield-bgcolor: var(--connection-shield-on-background-color);
60-
}
6132
}
6233

6334
#connection-toggle {
64-
--toggle-width: var(--size-item-xlarge);
65-
--toggle-height: var(--size-item-medium);
66-
--toggle-dot-margin: 2px;
6735
margin-inline-end: var(--space-small);
6836
}
69-
70-
#status-card-animation {
71-
display: block;
72-
position: absolute;
73-
width: 100%;
74-
height: 100%;
75-
pointer-events: none;
76-
z-index: 1;
77-
}
78-
79-
#animation-rings {
80-
display: block;
81-
width: 100%;
82-
height: 100%;
83-
contain: strict;
84-
/**
85-
* A hacky attempt at centering the rings with the globe icon.
86-
* It makes some assumptions about the icon size and padding pixels used in moz-box-item.
87-
* The rings are 200px in height and width, so they have a radius of 100px.
88-
* Additional px gap is merely for alignment and not tied to any element.
89-
* TODO: (Bug 1981251) See if we can better calculate the center coords.
90-
*/
91-
background-position-x: calc(-100px + var(--connection-globe-icon-size) + var(--space-large) - var(--connection-rings-extra-space-x));
92-
background-position-y: calc(-100px + var(--connection-globe-icon-size) + var(--space-large) - var(--connection-rings-extra-space-y));
93-
background-image: url("chrome://browser/content/ipprotection/assets/rings.svg");
94-
background-repeat: no-repeat;
95-
96-
&:dir(rtl) {
97-
--connection-rings-extra-space-x: 4.5px;
98-
/* Shift by approximately 100% of the element's width to move the rings to the opposite side. */
99-
background-position-x: calc(100% + var(--connection-globe-icon-size) + var(--space-large) + var(--connection-rings-extra-space-x));
100-
}
101-
102-
@media (prefers-reduced-motion: reduce) {
103-
display: none;
104-
}
105-
}
106-
107-
#location-wrapper {
108-
--box-icon-fill: currentColor;
109-
--box-label-font-weight: var(--font-weight-semibold);
110-
}

0 commit comments

Comments
 (0)