Skip to content

Commit 3997c8e

Browse files
committed
WIP
1 parent 50019dd commit 3997c8e

File tree

8 files changed

+80
-25
lines changed

8 files changed

+80
-25
lines changed

assets/css/_slideshow.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
@keyframes fadeIn {
2+
0% {
3+
opacity: 0;
4+
}
5+
100% {
6+
opacity: 1;
7+
}
8+
}
19
.eg-slide {
210
width: calc(100% - var(--spacer-small) * 2);
311
height: calc(100% - var(--spacer-small) * 2);
@@ -15,8 +23,16 @@
1523
justify-content: center;
1624

1725
& iframe {
18-
background-color: hsla(0, 0%, 100%, 0.5);
26+
animation: fadeIn 1s;
27+
background-color: white;
1928
width: 100%;
2029
height: 100%;
30+
31+
&.c-iframe--scaled {
32+
width: 175%;
33+
height: 175%;
34+
transform: scale(0.571428571);
35+
transform-origin: top left;
36+
}
2137
}
2238
}

assets/css/_utilities.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,20 @@
5050
}
5151

5252
.u-grid {
53-
display: grid;
53+
display: grid !important;
5454
grid-gap: var(--spacer-small);
5555
}
5656

57+
.u-grid--3-2 {
58+
grid-template-columns: repeat(3, 1fr);
59+
grid-template-rows: repeat(2, 1fr);
60+
}
61+
62+
.u-grid--2-2 {
63+
grid-template-columns: repeat(2, 1fr);
64+
grid-template-rows: repeat(2, 1fr);
65+
}
66+
5767
.u-aspect--1-1,
5868
.u-aspect--2-3 {
5969
position: relative;

components/slides/color-spaces-demo.vue

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
}"
1313
class="eg-slide"
1414
>
15-
<div class="eg-slide-content eg-slide-colorSpacesDemo">
15+
<div class="eg-slide-content eg-slide-colorSpacesDemo u-grid u-grid--3-2">
1616
<div class="u-position-relative">
1717
Default
1818
</div>
1919
<div class="u-position-relative">
2020
RGB
2121
</div>
2222
<div class="u-position-relative">
23-
1
23+
LRGB
2424
</div>
2525
<div class="u-position-relative">
26-
1
26+
HSL
2727
</div>
2828
<div class="u-position-relative">
29-
1
29+
LAB
3030
</div>
3131
<div class="u-position-relative">
32-
1
32+
LCH
3333
</div>
3434
</div>
3535
</div>
@@ -99,12 +99,6 @@ export default {
9999

100100
<style lang="postcss">
101101
.eg-slide-colorSpacesDemo {
102-
display: grid;
103-
grid-gap: var(--spacer-small);
104-
grid-template-columns: repeat(3, 1fr);
105-
grid-template-rows: repeat(2, 1fr);
106-
overflow: hidden;
107-
108102
& > * {
109103
padding: var(--spacer-xsmall);
110104
width: 100%;

components/slides/linear-to-easing.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default {
8787
const color2 = {
8888
h: 0,
8989
s: 0,
90-
l: 80,
90+
l: 100,
9191
a: 1,
9292
hsv: {
9393
s: 0,
@@ -176,7 +176,7 @@ export default {
176176
fill: none;
177177
stroke-width: var(--stroke-medium);
178178
stroke-linecap: round;
179-
stroke: currentColor;
179+
stroke: hsl(0, 0%, 50%);
180180
vector-effect: non-scaling-stroke;
181181
}
182182
</style>

components/tools/gradient/calculations/gradient-output.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,29 @@ export default {
5151
const colors = [this.getStoreHsla1(), this.getStoreHsla2()]
5252

5353
// Browsers don't really agree how to treat gradients that go from one hue to alpha 0 of another hue...
54-
const correctTransparentColors = colors.map((color, i) => {
54+
const [color1, color2] = colors.map((color, i) => {
5555
return chroma(color).alpha() === 0
5656
? chroma(colors[Math.abs(i - 1)]).alpha(0)
5757
: chroma(color)
5858
})
5959

6060
// Mix them colors and write it as sensible css
6161
const cssColorStops = colorStopsCoordinates.map(stop => {
62-
let mixedColor = chroma.mix(
63-
...correctTransparentColors,
64-
stop.y,
65-
colorMode
66-
)
62+
let mixedColor
63+
if (colorMode === 'squared') {
64+
const color1rgba = color1.rgba(false)
65+
const color2rgba = color2.rgba(false)
66+
const colorMix = color1rgba.map((num, i) => {
67+
const value = Math.sqrt(
68+
num ** 2 * (1 - stop.y) + color2rgba[i] ** 2 * stop.y
69+
)
70+
return i < 3 ? rounded(value) : value
71+
})
72+
console.log(colorMix)
73+
mixedColor = chroma(`rgba(${colorMix.join(',')})`)
74+
} else {
75+
mixedColor = chroma.mix(color1, color2, stop.y, colorMode)
76+
}
6777
mixedColor = mixedColor.alpha(rounded(mixedColor.alpha(), 3))
6878
return `${mixedColor
6979
.css('hsl')
@@ -72,10 +82,9 @@ export default {
7282
})
7383
const direction = this.getStoreDirection()
7484
return preview
75-
? `linear-gradient(
76-
${direction},
77-
${cssColorStops.join(',\n ')}
78-
);`
85+
? `linear-gradient(\n ${direction},\n ${cssColorStops.join(
86+
',\n '
87+
)}\n );`
7988
: `linear-gradient(${direction}, ${cssColorStops.join(', ')})`
8089
},
8190
getStoreDirection() {

components/tools/gradient/easing-preview.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@ export default {
5050
@nest .c-gradientEditor-editors & {
5151
stroke-width: var(--stroke-large);
5252
}
53+
54+
@nest .eg-slide-linearToEasing & {
55+
stroke: hsl(0, 0%, 50%);
56+
}
5357
}
5458
</style>

components/tools/gradient/editor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<option>lab</option>
5353
<option>lch</option>
5454
<option>lrgb</option>
55+
<option>squared</option>
5556
</select>
5657
</div>
5758
</div>

pages/talks/piter.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@
2323
<p v-if="step >= 3">{{ step }}</p>
2424
</slide>
2525
<linear-to-easing />
26+
<slide>
27+
<div class="u-position-cover u-grid u-grid--2-2">
28+
<iframe
29+
class="c-iframe--scaled"
30+
src="http://gka.github.io/chroma.js/"
31+
/>
32+
<iframe
33+
class="c-iframe--scaled"
34+
src="http://pomax.github.io/bezierjs/"
35+
/>
36+
<iframe
37+
class="c-iframe--scaled"
38+
src="https://zulko.github.io/eaglejs-demo/"
39+
/>
40+
<iframe
41+
class="c-iframe--scaled"
42+
src="https://larsenwork.com/"
43+
style="background-color:transparent;"
44+
/>
45+
</div>
46+
</slide>
2647
<slide>
2748
<h1>The End</h1>
2849
<p>@larsenwork</p>

0 commit comments

Comments
 (0)