Skip to content

Commit 6bc219c

Browse files
committed
hdr toplayer guides
1 parent 886c0e6 commit 6bc219c

12 files changed

+44
-30
lines changed

app/components/_variables.css

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
--theme-blue: hsl(188 90% 45%);
99
--theme-purple: hsl(267 100% 58%);
1010

11+
--neon-pink: color(display-p3 1 0 1);
12+
--neon-purple: color(display-p3 .75 0 1);
13+
--neon-lime: color(display-p3 0.25 1 0);
14+
--neon-cyan: color(display-p3 0 1 1);
15+
1116
--theme-text_color: hsl(0 0% 10%);
1217
--theme-icon_color: hsl(0 0% 20%);
1318
--theme-icon_hover-bg: hsl(0 0% 95%);

app/components/selection/box-model.element.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export class BoxModel extends HTMLElement {
4444
}
4545

4646
if (color === 'pink') {
47-
this.drawable.bg = 'hsla(330, 100%, 71%, 15%)'
48-
this.drawable.stripe = 'hsla(330, 100%, 71%, 80%)'
47+
this.drawable.bg = 'color(display-p3 1 0 1 / 15%)'
48+
this.drawable.stripe = 'color(display-p3 1 0 1 / 80%)'
4949
}
5050
else {
51-
this.drawable.bg = 'hsla(267, 100%, 58%, 15%)'
52-
this.drawable.stripe = 'hsla(267, 100%, 58%, 80%)'
51+
this.drawable.bg = 'color(display-p3 .75 0 1 / 15%)'
52+
this.drawable.stripe = 'color(display-p3 .75 0 1 / 80%)'
5353
}
5454

5555
this.styles({sides})

app/components/selection/corners.element.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
width: 5px;
55
height: 5px;
66
vector-effect: non-scaling-stroke;
7-
stroke: var(--theme-purple);
7+
stroke: var(--neon-purple);
88
stroke-width: 1px;
99
fill: none;
1010
stroke-linecap: round;

app/components/selection/distance.element.css

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@import "../_variables.css";
22

33
:host {
4-
--line-color: var(--theme-purple);
5-
--line-base: var(--theme-color);
4+
--line-color: 1 0 1;
5+
--line-base: .75 0 1;
66
--line-width: 1px;
77
--distance-h: 5px;
88
--distance-w: 5px;
@@ -40,8 +40,8 @@
4040
color: white;
4141
text-shadow: var(--text-shadow);
4242
box-shadow: var(--text-shadow);
43-
background: hsl(var(--line-color) / 75%);
44-
border: 1px solid hsl(var(--line-color));
43+
background: color(display-p3 var(--line-color) / 75%);
44+
border: 1px solid color(display-p3 var(--line-color));
4545
border-radius: 1em;
4646
font-size: 0.7em;
4747
font-weight: bold;
@@ -51,19 +51,19 @@
5151
}
5252

5353
:host > figure span {
54-
background: hsl(var(--line-color));
54+
background: color(display-p3 var(--line-color));
5555
height: var(--line-h);
5656
width: var(--line-w);
5757
}
5858

5959
:host > figure div {
6060
flex: 2;
61-
background: hsl(var(--line-color));
61+
background: color(display-p3 var(--line-color));
6262
width: var(--line-w);
6363
height: var(--line-h);
6464
}
6565

6666
:host figure:matches([quadrant="bottom"], [quadrant="right"]) > div:first-of-type,
6767
:host figure:matches([quadrant="top"], [quadrant="left"]) > div:last-of-type {
68-
background: linear-gradient(to var(--quadrant), hotpink 0%, hsl(var(--line-color)) 100%);
68+
background: linear-gradient(to var(--quadrant), var(--neon-pink) 0%, color(display-p3 var(--line-color)) 100%);
6969
}

app/components/selection/distance.element.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class Distance extends HTMLElement {
2323

2424
set styleProps({y,x,d,q,v = false, color}) {
2525
this.style.setProperty('--top', `${y + window.scrollY}px`)
26-
this.style.setProperty('--right', q === 'left' ? `${x}px` : 'auto')
27-
this.style.setProperty('--left', q !== 'left' ? `${x}px` : '')
26+
this.style.setProperty('--right', 'auto')
27+
this.style.setProperty('--left', `${x}px`)
2828
this.style.setProperty('--direction', v ? 'column' : 'row')
2929
this.style.setProperty('--quadrant', q)
3030

@@ -40,11 +40,11 @@ export class Distance extends HTMLElement {
4040
: this.style.setProperty('--line-w', `var(--line-w)`)
4141

4242
this.style.setProperty('--line-color', color === 'pink'
43-
? '330 100% 71%'
44-
: '267 100% 58%')
43+
? '1 0 1'
44+
: '.75 0 1')
4545
this.style.setProperty('--line-base', color === 'pink'
46-
? '330 100% 71%'
47-
: '267 100% 58%')
46+
? '1 0 1'
47+
: '.75 0 1')
4848
}
4949

5050
render({q,d}, node_label_id) {

app/components/selection/gridlines.element.css

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
@import "../_variables.css";
22

33
:host {
4-
--color: var(--theme-color);
4+
background: transparent;
5+
border: none;
6+
overflow: visible;
7+
padding: 0;
8+
margin: 0;
9+
inset: auto;
510
}
611

712
:host > svg {
@@ -15,7 +20,7 @@
1520

1621
:host rect,
1722
:host line {
18-
stroke: var(--color);
23+
stroke: var(--neon-pink);
1924
}
2025

2126
:host line {

app/components/selection/gridlines.element.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ export class Gridlines extends HTMLElement {
1010

1111
connectedCallback() {
1212
this.$shadow.adoptedStyleSheets = [GridlineStyles]
13+
this.setAttribute('popover', 'manual')
14+
this.showPopover()
1315
}
1416

15-
disconnectedCallback() {}
17+
disconnectedCallback() {
18+
this.hidePopover()
19+
}
1620

1721
set position(boundingRect) {
1822
this.$shadow.innerHTML = this.render(boundingRect)

app/components/selection/grip.element.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
height: .5em;
1010
width: 20%;
1111
max-width: 10vmax;
12-
stroke: var(--theme-color);
12+
stroke: var(--neon-pink);
1313
stroke-width: 1px;
1414
stroke-linecap: round;
1515
rx: 4;
@@ -19,6 +19,6 @@
1919
z-index: var(--layer-5);
2020

2121
&[hovering] rect {
22-
fill: var(--theme-color);
22+
fill: var(--neon-pink);
2323
}
2424
}

app/components/selection/handle.element.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
:host > button {
1515
pointer-events: auto;
1616
background-color: white;
17-
border: 1px solid hotpink;
17+
border: 1px solid var(--neon-pink);
1818
padding: 0;
1919
width: 0.5rem;
2020
height: 0.5rem;

app/components/selection/hover.element.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
width: 100%;
55
height: 100%;
66
vector-effect: non-scaling-stroke;
7-
stroke: var(--hover-stroke, var(--theme-purple, hsl(267 100% 58%)));
7+
stroke: var(--hover-stroke, var(--neon-purple, hsl(267 100% 58%)));
88
stroke-width: 1px;
99
fill: none;
1010
}

app/components/selection/label.element.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
max-width: var(--max-width);
2020
z-index: var(--layer-4);
2121
transform: translateY(-100%);
22-
background: var(--label-bg, hotpink);
22+
background: var(--label-bg, var(--neon-pink));
2323
border-radius: 0.2em 0.2em 0 0;
2424
text-shadow: var(--text-shadow);
2525
color: white;

app/features/measurements.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ export function createMeasurements({$anchor, $target}) {
3737
// left
3838
if (anchorBounds.left > targetBounds.right) {
3939
measurements.push({
40-
x: window.innerWidth - anchorBounds.left,
40+
x: targetBounds.right,
4141
y: anchorBounds.top + (anchorBounds.height / 2) - 3,
4242
d: anchorBounds.left - targetBounds.right,
4343
q: 'left',
4444
})
4545
}
46-
if (anchorBounds.left > targetBounds.left && anchorBounds.left < targetBounds.right) {
46+
else if (anchorBounds.left > targetBounds.left && anchorBounds.left < targetBounds.right) {
4747
measurements.push({
48-
x: window.innerWidth - anchorBounds.left,
48+
x: targetBounds.left,
4949
y: anchorBounds.top + (anchorBounds.height / 2) - 3,
5050
d: anchorBounds.left - targetBounds.left,
5151
q: 'left',
@@ -95,7 +95,7 @@ export function createMeasurements({$anchor, $target}) {
9595
// inside left/right
9696
if (anchorBounds.right > targetBounds.right && anchorBounds.left < targetBounds.left) {
9797
measurements.push({
98-
x: window.innerWidth - anchorBounds.right,
98+
x: targetBounds.right,
9999
y: anchorBounds.top + (anchorBounds.height / 2) - 3,
100100
d: anchorBounds.right - targetBounds.right,
101101
q: 'left',

0 commit comments

Comments
 (0)