Skip to content

Commit d7600ce

Browse files
committed
Piter WIP
1 parent fe2da95 commit d7600ce

File tree

19 files changed

+351
-43
lines changed

19 files changed

+351
-43
lines changed

assets/css/_base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ button,
1515
display: flex;
1616
background: var(--color-themed-bg);
1717
color: inherit;
18+
font-family: inherit;
1819
text-decoration: none;
1920
padding: var(--spacer-small);
2021
border-radius: var(--spacer-small);

assets/css/_settings.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
--color-bright-dimmed-transparent: hsla(0, 0%, 96%, 0);
1111
--color-bright-dimmed-more: hsl(0, 0%, 92%);
1212
--color-brand: hsl(330, 100%, 45%);
13+
--color-brand-alt: hsl(210, 100%, 45%);
1314
--color-themed-bg: var(--color-dark);
1415
--color-themed-bg-dimmed: var(--color-dark-dimmed);
1516
--color-themed-bg-dimmed-transparent: var(--color-dark-dimmed-transparent);
1617
--color-themed-bg-dimmed-more: var(--color-dark-dimmed-more);
1718
--color-themed-fg: var(--color-bright);
18-
--color-themed-fg-50: var(--color-bright-72);
19+
--color-themed-fg-72: var(--color-bright-72);
1920

2021
--lineLength-maxWidth: 35rem;
2122
--img-maxWidth: 51rem;
@@ -77,7 +78,7 @@
7778
--color-themed-bg-dimmed-more: var(--color-dark-dimmed-more);
7879
--color-themed-bg-dimmed-transparent: var(--color-dark-dimmed-transparent);
7980
--color-themed-fg: var(--color-bright);
80-
--color-themed-fg-50: var(--color-bright-72);
81+
--color-themed-fg-72: var(--color-bright-72);
8182
}
8283

8384
.theme-secondary {
@@ -86,7 +87,7 @@
8687
--color-themed-bg-dimmed-more: var(--color-bright-dimmed-more);
8788
--color-themed-bg-dimmed-transparent: var(--color-bright-dimmed-transparent);
8889
--color-themed-fg: var(--color-dark);
89-
--color-themed-fg-50: var(--color-dark-72);
90+
--color-themed-fg-72: var(--color-dark-72);
9091
}
9192

9293
@media (--highRes) {

assets/css/_typography.css

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
font-style: normal;
66
}
77

8+
:root {
9+
--font-family: 'gidole', sans-serif;
10+
--font-family-mono: Monaco, Menlo, Consolas, 'Lucida Console', monospace;
11+
}
12+
813
html {
914
font-size: var(--fontSize-html);
1015
}
1116

1217
body {
13-
font-family: 'gidole', sans-serif;
18+
font-family: var(--font-family);
1419
line-height: var(--lineHeight-body);
1520
-webkit-font-smoothing: antialiased;
1621
-moz-osx-font-smoothing: grayscale;
@@ -39,8 +44,12 @@ h2 {
3944
h1 {
4045
font-size: var(--fontSize-h1);
4146
letter-spacing: -0.02em;
42-
margin-top: var(--lineHeight-margin-large);
4347
margin-bottom: var(--lineHeight-margin-small);
48+
margin-top: var(--lineHeight-margin-large);
49+
50+
@nest .c-presentation & {
51+
margin-top: 0;
52+
}
4453
}
4554

4655
h2 {
@@ -56,8 +65,7 @@ h3 {
5665
margin-bottom: var(--lineHeight-margin-xsmall);
5766
}
5867

59-
*:not(h1):not(h2) + p,
60-
*:not(h1):not(h2) + code {
68+
*:not(h1):not(h2) + p {
6169
margin-top: var(--lineHeight-margin-small);
6270
}
6371

@@ -72,25 +80,20 @@ input {
7280

7381
pre,
7482
code {
75-
font-family: Monaco, Menlo, Consolas, 'Lucida Console', monospace;
83+
font-family: var(--font-family-mono);
7684
font-size: 0.8rem;
7785
line-height: calc(var(--lineHeight-body) * 3 / 4);
7886
letter-spacing: 0;
7987
user-select: all;
80-
}
8188

82-
code {
83-
position: relative;
84-
display: block;
85-
max-width: 100%;
86-
min-width: 0; /* Fixes wrapping issues inside grids */
89+
& > * {
90+
font-size: 0.8rem;
91+
}
8792
}
8893

8994
pre {
90-
padding: var(--spacer-small);
9195
border-radius: var(--spacer-xsmall);
9296
background-color: var(--color-themed-bg-dimmed);
93-
9497
overflow-x: auto;
9598
-webkit-overflow-scrolling: touch;
9699

@@ -109,6 +112,11 @@ pre {
109112
}
110113
}
111114

115+
code {
116+
display: inline-block;
117+
margin: var(--spacer-small);
118+
}
119+
112120
.layout .u-section a:not(.u-button) {
113121
background-image: linear-gradient(var(--color-brand), var(--color-brand));
114122
background-repeat: no-repeat;
@@ -133,12 +141,12 @@ pre {
133141

134142
.t-codeLabel {
135143
position: absolute;
136-
font-size: 1em;
137144
top: 0;
138145
margin-top: 0;
146+
color: var(--color-themed-fg-72);
147+
font-size: 1em;
139148
right: var(--spacer-xsmall);
140149
transform: translateY(-50%);
141-
opacity: var(--opacity-mid);
142150
z-index: 1;
143151
user-select: none;
144152
}

components/github-corner.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export default {}
4949
top: 0;
5050
right: 0;
5151
z-index: var(--zIndex-githubCorner);
52+
53+
@nest .is-presenting & {
54+
visibility: hidden;
55+
opacity: 0;
56+
pointer-events: none;
57+
}
5258
}
5359
5460
.c-githubCorner-svg {

components/navigation.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<nav
3-
:class="$store.state.navigationVisible ? 'is-expanded' : ''"
3+
:class="{
4+
'is-expanded': $store.state.navigationVisible,
5+
}"
46
class="c-navigation"
57
>
68
<div
@@ -61,11 +63,13 @@
6163
>
6264
Blog
6365
</div>
64-
<div
65-
class="c-navigation-link c-navigation-link--wip"
66+
<nuxt-link
67+
class="c-navigation-link"
68+
to="/talks"
69+
@click.native="hideNavigation"
6670
>
6771
Talks
68-
</div>
72+
</nuxt-link>
6973
</div>
7074
<div
7175
class="c-navigation-links-donate"
@@ -109,14 +113,15 @@
109113
<path
110114
class="c-navigation-toggle-logo-a"
111115
d="M33.97 23.87c1.77 0 3.57 0 4.84 1.27.9.9 1.38 2.44.62 4.18h4.26l-1.75 4.55 5.12.02s-2.73 4.79-3.95 7.46c4.62 0 7.6 2.85 8.8 6.8.74 2.41 1.41 7 1.96 11.98H48.6c-.58-4.76-1.13-9.14-1.94-11.22-1-2.53-2.32-3.56-5.57-3.35-2.56 5.46-2.94 9.88-2.94 14.57h-5.27c0-9.8 2.04-14 7.1-23.8l-4.42-.02 2.01-5.34c-1.07.46-2.37.46-3.59.46.32-2.44.32-5.12 0-7.56z"
112-
fill="#FFF" />
116+
fill="#fff" />
113117
</svg>
114118
</div>
115119
</nav>
116120
</template>
117121

118122
<script>
119123
import social from '~/components/social'
124+
120125
export default {
121126
components: {
122127
'app-social': social,
@@ -162,6 +167,12 @@ export default {
162167
&.is-expanded {
163168
pointer-events: auto;
164169
}
170+
171+
@nest .is-presenting & {
172+
visibility: hidden;
173+
opacity: 0;
174+
pointer-events: none;
175+
}
165176
}
166177
167178
.c-navigation-links {

components/prism.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<div class="u-position-relative c-prism">
3+
<h3 class="t-codeLabel">{{ label }}</h3>
4+
<prism :language="language">
5+
<slot/>
6+
</prism>
7+
</div>
8+
</template>
9+
10+
<script>
11+
import Prism from 'vue-prism-component'
12+
import 'prismjs'
13+
14+
export default {
15+
components: {
16+
Prism,
17+
},
18+
props: {
19+
language: {
20+
default: 'javascript',
21+
type: String,
22+
},
23+
label: {
24+
default: 'Javascript',
25+
type: String,
26+
},
27+
},
28+
}
29+
</script>
30+
31+
<style lang="postcss">
32+
*:not(h1):not(h2) + .c-prism {
33+
margin-top: var(--lineHeight-margin-small);
34+
}
35+
36+
.c-prism {
37+
& .selector,
38+
& .keyword {
39+
color: var(--color-brand-alt);
40+
}
41+
& .function {
42+
color: var(--color-brand);
43+
}
44+
& .comment {
45+
opacity: var(--opacity-mid);
46+
}
47+
& code {
48+
color: var(--color-themed-fg-72);
49+
}
50+
}
51+
</style>

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
},
3333
methods: {
3434
// lrgb as default value since it produces a result closes to most browser defaults
35-
gradientCalc(colorMode = 'lrgb') {
35+
gradientCalc(colorMode = 'lrgb', preview = false) {
3636
// Because number input in Safari is a bitch...
3737
let stepsNumber = Number(this.$store.state.gradient.steps.number)
3838
if (stepsNumber === undefined || stepsNumber < 2) {
@@ -44,7 +44,7 @@ export default {
4444
// Get the colorstops
4545
const colorStopsCoordinates =
4646
this.$store.state.gradient.settings.easingFunction === 'cubic-bezier'
47-
? cubicCoordinates(...this.getStoreBezierCoordinates())
47+
? cubicCoordinates(...this.getStoreBezierCoordinates(), 15)
4848
: stepsCoordinates(stepsNumber, this.$store.state.gradient.steps.skip)
4949

5050
this.$store.commit('updateStopCoordinates', colorStopsCoordinates)
@@ -71,7 +71,12 @@ export default {
7171
.join(', ')} ${rounded(stop.x * 100, 1)}%`
7272
})
7373
const direction = this.getStoreDirection()
74-
return `linear-gradient(${direction}, ${cssColorStops.join(', ')})`
74+
return preview
75+
? `linear-gradient(
76+
${direction},
77+
${cssColorStops.join(',\n ')}
78+
);`
79+
: `linear-gradient(${direction}, ${cssColorStops.join(', ')})`
7580
},
7681
getStoreDirection() {
7782
const deg = rounded(this.$store.state.gradient.direction.deg)

components/tools/gradient/editor.vue

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'--gradient--linear': `linear-gradient(${ gradientDirection }, ${ gradientColor1 }, ${ gradientColor2 })`
66
}"
77
:class="{
8-
'is-active': $store.state.gradient.editorActive !== ''
8+
'is-active': isEditorActive
99
}"
1010
class="c-gradientEditor"
1111
>
@@ -279,19 +279,14 @@
279279
</div>
280280
</transition>
281281
</div>
282-
<code>
283-
<h3 class="t-codeLabel">CSS</h3>
284-
<pre>{{ gradient }};</pre>
285-
</code>
286-
<code>
287-
<h3 class="t-codeLabel">CSSWG Proposal</h3>
288-
<pre>{{ prettyGradient }}</pre>
289-
</code>
282+
<prism language="css" label="CSSWG Proposal">{{ futureCSS }}</prism>
283+
<prism language="css" label="CSS">{{ oldCSS }}</prism>
290284
</div>
291285
</template>
292286

293287
<script>
294288
import selectChevron from '~/components/select-chevron'
289+
import prism from '~/components/prism'
295290
import colorEdit from '~/components/tools/gradient/color-edit'
296291
import easingEdit from '~/components/tools/gradient/easing-edit'
297292
import easingPreview from '~/components/tools/gradient/easing-preview'
@@ -307,9 +302,13 @@ export default {
307302
directionEdit,
308303
directionPreview,
309304
selectChevron,
305+
prism,
310306
},
311307
mixins: [gradientOutput],
312308
computed: {
309+
isEditorActive: function() {
310+
return !!this.$store.state.gradient.editorActive
311+
},
313312
gradient: function() {
314313
return this.gradientCalc(this.$store.state.gradient.settings.colorMode)
315314
},
@@ -321,6 +320,21 @@ export default {
321320
${this.gradientColor2}
322321
);`
323322
},
323+
oldCSS: function() {
324+
return `.forNow {
325+
${this.gradientCalc(this.$store.state.gradient.settings.colorMode, true)}
326+
};`
327+
},
328+
futureCSS: function() {
329+
return `#future {
330+
linear-gradient(
331+
${this.gradientDirection},
332+
${this.gradientColor1},
333+
${this.gradientFunction},
334+
${this.gradientColor2}
335+
);
336+
};`
337+
},
324338
},
325339
methods: {
326340
toggleEditor(editor) {
@@ -384,7 +398,7 @@ export default {
384398
.c-gradientEditor-label {
385399
display: block;
386400
margin-bottom: var(--lineHeight-margin-xsmall);
387-
color: var(--color-themed-fg-50);
401+
color: var(--color-themed-fg-72);
388402
}
389403
390404
.c-gradientEditor-editors {
@@ -428,7 +442,7 @@ export default {
428442
429443
.c-gradientEditor-gradient-tooltip {
430444
color: var(--color-themed-bg);
431-
background-color: var(--color-themed-fg-50);
445+
background-color: var(--color-themed-fg-72);
432446
padding: var(--spacer-xsmall);
433447
border-radius: var(--spacer-xsmall);
434448
}

layouts/default.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<template>
2-
<div>
2+
<div
3+
:class="{
4+
'is-presenting': $store.state.presentation.isLive
5+
}"
6+
>
37
<div
48
:class="{
59
'is-dimmed': $store.state.overlayVisible,
6-
'is-moused': $store.state.mouseElement
10+
'is-moused': $store.state.mouseElement,
711
}"
812
class="layout ie-check"
913
>

0 commit comments

Comments
 (0)