@inglorious/logo 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/logo",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "The Inglorious Coderz logo, remade to be compatible with Inglorious Web.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "**/*.css"
45
45
  ],
46
46
  "dependencies": {
47
- "@inglorious/web": "6.0.0"
47
+ "@inglorious/web": "6.0.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "prettier": "^3.6.2",
package/src/style.css CHANGED
@@ -21,7 +21,8 @@
21
21
  }
22
22
 
23
23
  &.left {
24
- transform: rotateY(0deg) translateZ(var(--z-translation)) skew(12deg);
24
+ transform: rotateY(0deg) translateZ(var(--z-translation))
25
+ skew(calc(1 * var(--skew)));
25
26
 
26
27
  > img {
27
28
  transform: var(--left-face-flip);
@@ -29,7 +30,8 @@
29
30
  }
30
31
 
31
32
  &.right {
32
- transform: rotateY(90deg) translateZ(var(--z-translation)) skew(-12deg);
33
+ transform: rotateY(90deg) translateZ(var(--z-translation))
34
+ skew(calc(-1 * var(--skew)));
33
35
 
34
36
  > img {
35
37
  transform: var(--right-face-flip);
package/src/template.js CHANGED
@@ -21,10 +21,10 @@ import { when } from "@inglorious/web/directives/when"
21
21
  import eye from "./assets/eye.svg"
22
22
  import * as faces from "./assets/faces/index.js"
23
23
 
24
- const MINUS_FORTY_DEGREES = -0.6981
25
- const MINUS_FORTY_FIVE_DEGREES = -0.7854
24
+ const DEFAULT_POSITION = [0, 0] // eslint-disable-line no-magic-numbers
25
+ const DEFAULT_ROTATION = [-45, -40] // eslint-disable-line no-magic-numbers
26
26
  const DEFAULT_SIZE = 256
27
- const DEFAULT_COORDS = 0
27
+ const DEFAULT_SKEW = 12
28
28
  const STEP = 0.001
29
29
  const HALF = 0.5
30
30
 
@@ -36,7 +36,14 @@ const HALF = 0.5
36
36
  * @returns {import('lit-html').TemplateResult}
37
37
  */
38
38
  export function render(entity) {
39
- const { size = DEFAULT_SIZE, x = DEFAULT_COORDS, y = DEFAULT_COORDS } = entity
39
+ const {
40
+ size = DEFAULT_SIZE,
41
+ position = DEFAULT_POSITION,
42
+ rotation = DEFAULT_ROTATION,
43
+ skew = DEFAULT_SKEW,
44
+ } = entity
45
+ const [x, y] = position
46
+ const [hRotation, vRotation] = rotation
40
47
  const [left, right] = entity.faces
41
48
 
42
49
  return html`<div
@@ -44,12 +51,13 @@ export function render(entity) {
44
51
  style=${styleMap({
45
52
  "--size": `${size}px`,
46
53
  "--transform": `scaleY(1.2) translateZ(-${size}px) rotateX(${
47
- MINUS_FORTY_DEGREES - STEP * y
48
- }rad)
49
- rotateY(${MINUS_FORTY_FIVE_DEGREES + STEP * x}rad)`,
54
+ vRotation - STEP * y
55
+ }deg)
56
+ rotateY(${hRotation + STEP * x}deg)`,
50
57
  "--z-translation": `${size * HALF}px`,
51
58
  "--left-face-flip": left.reverse ? "rotateY(180deg)" : "none",
52
59
  "--right-face-flip": right.reverse ? "rotateY(180deg)" : "none",
60
+ "--skew": `${skew}deg`,
53
61
  })}
54
62
  >
55
63
  <div class="iw-logo-cube">