[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbutton] 01/02: Bug 41303: Implement 2022 Year End Campaign look in about:tor



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch maint-11.5
in repository torbutton.

commit 316da7e026e4d0c5bcaa50eb9249a6e31a2c08d5
Author: Henry Wilkes <henry@xxxxxxxxxxxxxx>
AuthorDate: Thu Sep 22 17:52:31 2022 +0100

    Bug 41303: Implement 2022 Year End Campaign look in about:tor
---
 LICENSE                                     |  92 +++++++++++++++++++
 chrome/content/aboutTor/aboutTor-content.js |  10 ++
 chrome/content/aboutTor/aboutTor.xhtml      |  36 +++++++-
 chrome/skin/aboutTor.css                    | 138 ++++++++++++++++++++++++++++
 chrome/skin/aboutTorYECfonts.css            |  21 +++++
 chrome/skin/yec-bg-2x.png                   | Bin 0 -> 115282 bytes
 chrome/skin/yec-bg-3x.png                   | Bin 0 -> 241727 bytes
 chrome/skin/yec-foreground-2x.png           | Bin 0 -> 29031 bytes
 chrome/skin/yec-foreground-3x.png           | Bin 0 -> 51701 bytes
 9 files changed, 294 insertions(+), 3 deletions(-)

diff --git a/LICENSE b/LICENSE
index 783d6a47..d2dc3c68 100644
--- a/LICENSE
+++ b/LICENSE
@@ -27,3 +27,95 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
+
+===========================================================================
+
+"Space Mono" and "Space Grotesk" font embedded in
+chrome/skin/aboutTorYECfonts.css is licensed under:
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/chrome/content/aboutTor/aboutTor-content.js b/chrome/content/aboutTor/aboutTor-content.js
index 601b817c..f4935c09 100644
--- a/chrome/content/aboutTor/aboutTor-content.js
+++ b/chrome/content/aboutTor/aboutTor-content.js
@@ -63,6 +63,13 @@ var AboutTorListener = {
         this.onLocaleChange(aNewVal);
       }
     });
+    const startYEC = Date.UTC(2022, 9, 13);
+    const endYEC = Date.UTC(2023);
+    const now = Date.now();
+    content.document.body.classList.toggle(
+      "isYEC",
+      now >= startYEC && now < endYEC
+    );
 
     // Add message and event listeners.
     addMessageListener(this.kAboutTorChromeDataMessage, this);
@@ -114,6 +121,9 @@ var AboutTorListener = {
     // Set localized "Get Involved" link.
     content.document.getElementById("getInvolvedLink").href =
                             "https://community.torproject.org/"; + aLocale;
+    content.document.getElementById(
+      "donateYECLink"
+    ).href = `https://www.torproject.org/donate/pbp-${aLocale}`;
 
     // Display the Tor Browser product name and version.
     try {
diff --git a/chrome/content/aboutTor/aboutTor.xhtml b/chrome/content/aboutTor/aboutTor.xhtml
index 11f3b28b..feb38641 100644
--- a/chrome/content/aboutTor/aboutTor.xhtml
+++ b/chrome/content/aboutTor/aboutTor.xhtml
@@ -20,10 +20,11 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml";>
 <head>
-  <meta http-equiv="Content-Security-Policy" content="default-src resource:; object-src 'none'" />
+  <meta http-equiv="Content-Security-Policy" content="default-src resource:; font-src data:;  object-src 'none'" />
   <meta name="viewport" content="width=device-width, initial-scale=1"/>
   <title>&aboutTor.title;</title>
   <link rel="stylesheet" href="chrome://browser/skin/onionPattern.css" type="text/css" media="all" />
+  <link rel="stylesheet" href="resource://torbutton-assets/aboutTorYECfonts.css" type="text/css" media="all" />
   <link rel="stylesheet" href="resource://torbutton-assets/aboutTor.css" type="text/css" media="all" />
   <script type="text/javascript" src="resource://torbutton-abouttor/aboutTor.js"></script>
 </head>
@@ -35,7 +36,7 @@
     </div>
     <img class="torcontent-logo" src="resource://torbutton-assets/torbrowser_mobile_logo.png"/>
     <div id="torstatus" class="top">
-      <div class="hideIfTorOff hideIfHasBeenUpdated torstatus-container">
+      <div class="hideIfTorOff hideIfHasBeenUpdated hideIfYEC torstatus-container">
 #if MOZ_UPDATE_CHANNEL == alpha
         <div class="heading1">&aboutTor.alpha.ready.label;</div>
         <br/>
@@ -50,6 +51,35 @@
         <div class="heading2">&aboutTor.ready2.label;</div>
 #endif
       </div>
+      <div class="hideIfTorOff hideIfHasBeenUpdated showIfYEC">
+        <div class="yec-grid">
+          <img class="yec-background-image"
+               alt=""
+               srcset="
+                 resource://torbutton-assets/yec-bg-2x.png 2x,
+                 resource://torbutton-assets/yec-bg-3x.png 3x" />
+          <img class="yec-foreground-image"
+               alt=""
+               srcset="
+                 resource://torbutton-assets/yec-foreground-2x.png 2x,
+                 resource://torbutton-assets/yec-foreground-3x.png 3x" />
+          <h1 class="yec-heading">
+            &aboutTor.yec2022.powered_by_privacy;
+          </h1>
+          <div class="yec-sub-headings">
+            <p class="yec-sub-heading-1">&aboutTor.yec2022.resistance;</p>
+            <p class="yec-sub-heading-2">&aboutTor.yec2022.change;</p>
+            <p class="yec-sub-heading-3">&aboutTor.yec2022.freedom;</p>
+          </div>
+          <a id="donateYECLink"
+             class="yec-donate-button"
+             href="https://donate.torproject.org/";
+             target="_blank">
+            &aboutTor.yec2022.donate_now;
+          </a>
+          <p class="yec-donate-text">&aboutTor.yec2022.donation_matching;</p>
+        </div>
+      </div>
       <div class="showIfHasBeenUpdated torstatus-container">
         <div class="heading1">&aboutTBUpdate.updated;</div>
         <br/>
@@ -94,7 +124,7 @@
     </div>
 #endif
 
-    <div id="bottom">
+    <div id="bottom" class="hideIfYEC">
       <p id="donate" class="moreInfoLink">&aboutTor.donationBanner.freeToUse;
         <a href="https://donate.torproject.org/"; target="_blank">&aboutTor.donationBanner.buttonA; &#187;</a>
       </p>
diff --git a/chrome/skin/aboutTor.css b/chrome/skin/aboutTor.css
index 2712b9f1..7569cf8d 100644
--- a/chrome/skin/aboutTor.css
+++ b/chrome/skin/aboutTor.css
@@ -9,6 +9,14 @@
   --abouttor-text-color: white;
   --abouttor-bg-toron-color: #420C5D;
   --abouttor-bg-toroff-color: #A4000F;
+  --abouttor-yec-page-bg-color: #0E0625;
+  --abouttor-yec-heading-color: #C0FF00;
+  --abouttor-yec-heading-alt-color: #FF8AFF;
+  --abouttor-yec-button-color: #000000;
+  --abouttor-yec-button-bg-color: #C0FF00;
+  --abouttor-yec-button-hover-bg-color: #A8DF00;
+  --abouttor-yec-button-active-bg-color: #90BF00;
+  --abouttor-yec-donate-text-color: #FAF5DF;
   --onion-opacity: 0.2;
   --onion-color: #fff;
   --onion-radius: 75px;
@@ -42,6 +50,10 @@ body[toron] {
   background-color: var(--abouttor-bg-toron-color);
 }
 
+body[toron]:not([hasbeenupdated]).isYEC {
+  background-color: var(--abouttor-yec-page-bg-color);
+}
+
 /* Hide the entire document by default to avoid showing the incorrect
  * Tor on / off status (that info must be retrieved from the chrome
  * process, which involves IPC when multiprocess mode is enabled). An
@@ -106,6 +118,8 @@ a {
   text-align: center;
 }
 
+body[toron]:not([hasbeenupdated]).isYEC .hideIfYEC,
+body:not(.isYEC) .showIfYEC,
 body[hasbeenupdated] .hideIfHasBeenUpdated,
 body[toron] .hideIfTorOn,
 body:not([toron]) .hideIfTorOff {
@@ -136,6 +150,130 @@ body:not([showmanual]) .showForManual {
   margin-bottom: 20px;
 }
 
+.yec-grid {
+  display: grid;
+  /* We use a three column grid. As such, if the button text content is shorter
+   * than the image, then the middle column's width will collapse to zero, so
+   * the donate-text and the sub-headings will be aligned at their start. If the
+   * button text content is longer than the image, then the middle column's
+   * width will grow to accommodate it. As such, the donate-text will no longer
+   * be aligned with the sub-headings, but the gap will be roughly the same. */
+  grid-template: "heading heading heading" min-content
+                 "image sub-headings sub-headings" min-content
+                 "button button donate-text" min-content
+                 / auto auto auto;
+  /* Center-align the grid relative to the yec-background-image. */
+  width: min-content;
+  margin-inline: auto;
+  margin-block-end: 50px;
+}
+
+.yec-background-image {
+  grid-area: image-start / image-start / image-end / sub-headings-end;
+  margin-inline: -25px;
+  margin-top: 45px;
+}
+
+.yec-foreground-image {
+  grid-area: image;
+  z-index: 2;
+  align-self: end;
+  margin-inline: -55px 25px;
+  margin-block: 15px 10px;
+}
+
+.yec-foreground-image:dir(rtl) {
+  transform: scaleX(-1);
+}
+
+.yec-heading {
+  grid-area: heading;
+  font-size: 1.75rem;
+  white-space: normal;
+  color: var(--abouttor-yec-heading-color);
+  line-height: 1.1;
+  font-family: 'Space Mono', monospace;
+  font-weight: 700;
+  letter-spacing: -0.05em;
+}
+
+.yec-sub-headings {
+  grid-area: sub-headings;
+  margin-top: 20px;
+  z-index: 2;
+  /* Do not contribute to the min-content of the yec-grid.
+   * This means that the yec-grid will remain center-aligned relative to the
+   * yec-background-image, even if one of the sub-heading elements has long text
+   * content that would normally grow the size of the grid. */
+  width: 1px;
+  line-height: 1;
+  font-family: 'Space Grotesk', sans-serif;
+  font-size: 60px;
+  letter-spacing: -0.05em;
+}
+
+.yec-sub-heading-2 {
+  color: var(--abouttor-yec-heading-color);
+  font-weight: 300;
+}
+
+.yec-sub-heading-1,
+.yec-sub-heading-3 {
+  color: var(--abouttor-yec-heading-alt-color);
+  font-weight: 500;
+}
+
+.yec-sub-headings,
+.yec-background-image {
+  transform: skewY(-2.25deg);
+}
+
+:is(
+  .yec-sub-headings,
+  .yec-background-image
+):dir(rtl) {
+  transform: skewY(2.25deg);
+}
+
+.yec-donate-button {
+  grid-area: button;
+  align-self: start;
+  justify-self: end;
+  margin-inline-end: 30px;
+  color: var(--abouttor-yec-button-color);
+  background-color: var(--abouttor-yec-button-bg-color);
+  text-decoration: none;
+  line-height: 1.4;
+  padding: 13px 20px;
+  border-radius: 8px;
+  font-size: 1rem;
+  font-family: 'Space Mono', monospace;
+  font-weight: 700;
+}
+
+.yec-donate-button:hover {
+  background-color: var(--abouttor-yec-button-hover-bg-color);
+}
+
+.yec-donate-button:active {
+  background-color: var(--abouttor-yec-button-active-bg-color);
+}
+
+.yec-donate-button:focus-visible {
+  outline: 2px solid var(--abouttor-yec-button-bg-color);
+  outline-offset: 2px;
+}
+
+.yec-donate-text {
+  grid-area: donate-text;
+  color: var(--abouttor-yec-donate-text-color);
+  white-space: normal;
+  font-size: 1.1rem;
+  line-height: 1.4;
+  font-family: 'Space Mono', monospace;
+  font-weight: 400;
+}
+
 #bottom {
   margin-top: 10vh;
   margin-inline: auto;
diff --git a/chrome/skin/aboutTorYECfonts.css b/chrome/skin/aboutTorYECfonts.css
new file mode 100644
index 00000000..298928ec
--- /dev/null
+++ b/chrome/skin/aboutTorYECfonts.css
@@ -0,0 +1,21 @@
+@font-face {
+    font-family: 'Space Mono';
+    font-weight: 400 400;
+    font-style: normal;
+    /* woff2 stream */
+    src: url('data:application/octet-stream;base64,d09GMgABAAAAAH6EAA8AAAABZkAAAH4kAAEAQgAAAAAAAAAAAAAAAAAAAAAAAAAAHKAuBmAAjVIIgQoJl2IRCAqEtAiD8koBNgIkA4s2C4s2AAQgBYhGB6x3DIExW7s+cQM9XQd4cnerKiLClk4K2LFH3A4vFH8TpYLdBA/OAyj3K/NT2f//f2bSIWOw6wD+q6U+s0oIzD1CjCHp4lJNnDWS3tJcsbsy74aWZsn0UGmZiVaTcL3lQzZdm9tzP1TKmaqLN0jKAK+U6z2kP29+gAm7GhLfl5U6TVZ4g1vd+FF6oN8MT/U2VL9Z5HgQX9OPq59guMn3p3pAEj53bMqLXLaCpcQMsuiQ5drD9U+tRS+jVJ2+C3VoauJDUgxv0+7qjSiEj3Mm/5KdIMzIMs4gR21q7UcosjWDlZCc7s9cSwN/INlnsgoox+bUS [...]
+}
+
+@font-face {
+    font-family: 'Space Mono';
+    font-weight: 700 700;
+    font-style: normal;
+    src: url('data:application/octet-stream;base64,d09GMgABAAAAAH1EAA8AAAABVbgAAHzmAAEAQgAAAAAAAAAAAAAAAAAAAAAAAAAAHKAuBmAAjVIIgQYJl2IRCAqEkxyD0jsBNgIkA4s2C4s2AAQgBYguB6x3DIExW5AucULctotaUG4H3PNbvaVfMI6t4HYEUkLy2qojNsoOAaFjhYP//z8xqciYSYWk3UAAZOr/QzAp08nVeqOCLZkFa+kuoYTshcQqQylLsGB6xo62GW7mhrYbScd2zC/7eW3UF6zLiytce2jFnq6wN9OxRHc6lB4dUGBS/B5Dn46vhGRjQJwsVlwoeOKf6Lrn7/Px8TuXP9wKpaDbCgRBogFJioanae9zCwy/Lm7enXxDcPLTxpdNd1xTveMKpf+ZLAPKuHnkyLjyZGW0X4hIru+ra2bf890H7EyOvjMos6IjuP3zv63/X3sTAiI6j [...]
+}
+
+@font-face {
+    font-family: 'Space Grotesk';
+    font-weight: 300 700;
+    font-style: normal;
+    src: url('data:application/octet-stream;base64,d09GMgABAAAAAL7UABQAAAACD8QAAL5gAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoRZG4KfcBydUj9IVkFSiGIGYD9TVEFUWCceAJEIL0QRCAqCw1iCjXcwgf5MATYCJAOeIAuPEgAEIAWIXAfFEAwHW/brkQrfT+7e/emWoZUAdWMARZvfbb8mDa+RjeEg+03n2BS4ewHRbtkaxs3XAXQHgQm9VSvl////////35JMZLiStFzSlLYAbODopjp1/hMkVZXAwSHAkjlYHktNrNXqXjKb5uxJpUl5oUVJqY3MKNEqNN3YBDK7SKoqISCrtLIyzauCqWoigCmYLqSrrlSvBLC9shEMqNTQQECwsS30QPBOiPS21XnHjU5mzrXRW5lZ2WlNcyOwBtbYQc5U6AyziPvjoBmk7ypso10u0lpFgwiIgKyiVepVV [...]
+}
diff --git a/chrome/skin/yec-bg-2x.png b/chrome/skin/yec-bg-2x.png
new file mode 100644
index 00000000..e3efab06
Binary files /dev/null and b/chrome/skin/yec-bg-2x.png differ
diff --git a/chrome/skin/yec-bg-3x.png b/chrome/skin/yec-bg-3x.png
new file mode 100644
index 00000000..a00e9cb5
Binary files /dev/null and b/chrome/skin/yec-bg-3x.png differ
diff --git a/chrome/skin/yec-foreground-2x.png b/chrome/skin/yec-foreground-2x.png
new file mode 100644
index 00000000..0c6d0658
Binary files /dev/null and b/chrome/skin/yec-foreground-2x.png differ
diff --git a/chrome/skin/yec-foreground-3x.png b/chrome/skin/yec-foreground-3x.png
new file mode 100644
index 00000000..49c777d9
Binary files /dev/null and b/chrome/skin/yec-foreground-3x.png differ

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits