瀏覽代碼

Removes cyberweek code

main
Keith Daulton 1 年之前
父節點
當前提交
a5fbbec0e6
共有 5 個檔案被更改,包括 2 行新增114 行删除
  1. +0
    -25
      src/webviews/apps/home/home.html
  2. +0
    -75
      src/webviews/apps/home/home.scss
  3. +2
    -14
      src/webviews/apps/home/home.ts
  4. 二進制
      src/webviews/apps/media/cyber-week-banner-dark.png
  5. 二進制
      src/webviews/apps/media/cyber-week-banner-light.png

+ 0
- 25
src/webviews/apps/home/home.html 查看文件

@ -83,32 +83,7 @@
.gl-plus-banner {
background-image: url(#{webroot}/media/gitlens-backdrop-opacity.webp);
}
.vscode-high-contrast .ribbon-banner,
.vscode-dark .ribbon-banner {
background-image: url(#{webroot}/media/cyber-week-banner-dark.webp);
}
.vscode-high-contrast-light .ribbon-banner,
.vscode-light .ribbon-banner {
background-image: url(#{webroot}/media/cyber-week-banner-light.webp);
}
</style>
<div class="ribbon-banner-container" data-banner="cyberweek2022" hidden>
<a href="https://bit.ly/3V2uvVY" class="ribbon-banner">
<h2>
<strong>50% off</strong>
<span class="ribbon-banner__subtext">GitLens Pro &amp; all GitKraken products!</span>
</h2>
<p>Expires Dec 5, 2022 11:59pm PT</p>
</a>
<a
href="#"
class="ribbon-banner-dismiss"
data-banner-dismiss="cyberweek2022"
title="Dismiss"
aria-label="Dismiss"
><code-icon icon="close"></code-icon
></a>
</div>
<div class="stepped-sections">
<stepped-section id="welcome">
<span slot="heading">Welcome to GitLens 13</span>

+ 0
- 75
src/webviews/apps/home/home.scss 查看文件

@ -609,81 +609,6 @@ vscode-button {
}
}
.ribbon-banner {
&-container {
position: relative;
}
&-dismiss {
position: absolute;
top: 0;
right: 0;
display: inline-flex;
justify-content: center;
align-items: center;
width: 2.2rem;
height: 2.2rem;
color: var(--color-foreground--75);
&:hover {
color: var(--color-foreground--75);
text-decoration: none;
}
}
.vscode-high-contrast &,
.vscode-dark & {
background-color: var(--color-background--lighten-10);
background-position: right -7rem center;
background-size: auto 140px;
}
.vscode-high-contrast-light &,
.vscode-light & {
background-color: var(--color-background--darken-10);
background-position: right 2.5rem center;
background-size: auto 28px;
}
background-repeat: no-repeat;
display: block;
text-align: left;
color: inherit;
padding: 1.2rem 9.3rem 1.2rem 1.4rem;
line-height: 1.1;
margin-top: -2rem;
margin-bottom: 1rem;
border-radius: 0.4rem;
mix-blend-mode: luminosity;
opacity: 0.8;
transition: opacity ease 250ms, mix-blend-mode ease 250ms;
&:focus,
&:hover {
color: inherit;
text-decoration: none;
mix-blend-mode: normal;
opacity: 1;
}
h2 {
font-size: 1.2rem;
font-weight: inherit;
margin: 0 0 0.8rem 0;
}
p {
font-size: 1rem;
margin: 0;
opacity: 0.8;
}
strong {
font-weight: 800;
opacity: 1;
}
&__subtext {
opacity: 0.8;
}
}
@media (max-width: 280px) {
.not-small {
display: none;

+ 2
- 14
src/webviews/apps/home/home.ts 查看文件

@ -230,15 +230,10 @@ export class HomeApp extends App {
return;
}
const { subscription, dismissedBanners } = this.state;
const isPaid = subscription.state === SubscriptionState.Paid;
const { dismissedBanners } = this.state;
$banners.forEach($el => {
const key = $el.getAttribute('data-banner');
if (
isPaid ||
(key !== null && dismissedBanners?.includes(key)) ||
(key === 'cyberweek2022' && !showCyberWeek())
) {
if (key !== null && dismissedBanners?.includes(key)) {
$el.setAttribute('hidden', 'true');
} else {
$el.removeAttribute('hidden');
@ -357,11 +352,4 @@ function toggleArrayItem(list: string[] = [], item: string, add = true) {
return list;
}
const cyberweekStart = Date.parse('2022-11-28T07:00:00.000-08:00');
const cyberweekEnding = Date.parse('2022-12-06T00:00:00.000-08:00');
function showCyberWeek() {
const now = Date.now();
return now < cyberweekEnding && now >= cyberweekStart;
}
new HomeApp();

二進制
src/webviews/apps/media/cyber-week-banner-dark.png 查看文件

Before After
Width: 892  |  Height: 260  |  Size: 129 KiB

二進制
src/webviews/apps/media/cyber-week-banner-light.png 查看文件

Before After
Width: 106  |  Height: 56  |  Size: 2.9 KiB

Loading…
取消
儲存