Browse Source

Compress images u2fkey/yubikey using avif/webp (#1232)

Co-authored-by: Hinton <oscar@oscarhinton.com>
pull/1383/head
Simon Legner 4 years ago committed by GitHub
parent
commit
45284eefb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/app/accounts/two-factor.component.html
  2. 6
      src/connectors/webauthn-mobile.html
  3. 6
      src/connectors/webauthn.html
  4. BIN
      src/images/u2fkey-mobile.avif
  5. BIN
      src/images/u2fkey-mobile.webp
  6. BIN
      src/images/u2fkey.avif
  7. BIN
      src/images/u2fkey.webp
  8. BIN
      src/images/yubikey.avif
  9. BIN
      src/images/yubikey.webp
  10. 2
      webpack.config.js

6
src/app/accounts/two-factor.component.html

@ -58,7 +58,11 @@ @@ -58,7 +58,11 @@
</ng-container>
<ng-container *ngIf="selectedProviderType === providerType.Yubikey">
<p class="text-center">{{ "insertYubiKey" | i18n }}</p>
<img src="../../images/yubikey.jpg" class="rounded img-fluid mb-3" alt="" />
<picture>
<source srcset="../../images/yubikey.avif" type="image/avif">
<source srcset="../../images/yubikey.webp" type="image/webp">
<img src="../../images/yubikey.jpg" class="rounded img-fluid mb-3" alt="">
</picture>
<div class="form-group">
<label for="code" class="sr-only">{{ "verificationCode" | i18n }}</label>
<input

6
src/connectors/webauthn-mobile.html

@ -16,7 +16,11 @@ @@ -16,7 +16,11 @@
<div>
<img src="../images/logo-dark@2x.png" class="logo mb-2" alt="Bitwarden" />
<p id="webauthn-header" class="lead text-center mx-4 mb-4"></p>
<img src="../images/u2fkey-mobile.jpg" class="rounded img-fluid" />
<picture>
<source srcset="../images/u2fkey-mobile.avif" type="image/avif">
<source srcset="../images/u2fkey-mobile.webp" type="image/webp">
<img src="../images/u2fkey-mobile.jpg" class="rounded img-fluid">
</picture>
<div class="text-center mt-4">
<button id="webauthn-button" class="btn btn-primary btn-lg"></button>
</div>

6
src/connectors/webauthn.html

@ -6,7 +6,11 @@ @@ -6,7 +6,11 @@
</head>
<body style="background: transparent">
<img src="../images/u2fkey.jpg" class="rounded img-fluid mb-3" />
<picture>
<source srcset="../images/u2fkey.avif" type="image/avif">
<source srcset="../images/u2fkey.webp" type="image/webp">
<img src="../images/u2fkey.jpg" class="rounded img-fluid mb-3">
</picture>
<div class="text-center">
<button id="webauthn-button" class="btn btn-primary"></button>
</div>

BIN
src/images/u2fkey-mobile.avif

Binary file not shown.

BIN
src/images/u2fkey-mobile.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
src/images/u2fkey.avif

Binary file not shown.

BIN
src/images/u2fkey.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
src/images/yubikey.avif

Binary file not shown.

BIN
src/images/yubikey.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

2
webpack.config.js

@ -36,7 +36,7 @@ const moduleRules = [ @@ -36,7 +36,7 @@ const moduleRules = [
type: "asset/resource",
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
test: /\.(jpe?g|png|gif|svg|webp|avif)$/i,
exclude: /.*(fontawesome-webfont)\.svg/,
generator: {
filename: "images/[name].[ext]",

Loading…
Cancel
Save