-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
390 lines (223 loc) · 15.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<!DOCTYPE HTML>
<html>
<head>
<script>
if (
window.location.protocol === "http:" &&
!window.location.href.includes("localhost")
) {
var restOfUrl = window.location.href.substr(5);
window.location = "https:" + restOfUrl;
}
</script>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8">
<title>A Front End Blog</title>
<meta name="author" content="Skylar Brown">
<meta name="description" content="16 Oct 2020 Fixed Attachment CSS Gradients Yeah it’s been a while since I last posted. I need to start posting more small things instead of …">
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/atom.xml" rel="alternate" title="A Front End Blog" type="application/atom+xml">
<link rel="canonical" href="">
<link href="/favicon.png" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic|Open+Sans:700,400" />
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/styles/tomorrow.min.css" />
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="home-template">
<header id="site-head">
<div class="vertical">
<div id="site-head-content" class="inner">
<h1 class="blog-title"><a class="no-rollover" href="/">A Front End Blog</a></h1>
<h2 class="blog-description">By Skylar Brown</h2>
</div>
</div>
</header>
<main class="content" role="main">
<article class="post">
<header class="post-header">
<span class="post-meta">16 Oct 2020</span>
<h2 class="post-title">
<a href="/blog/2020/10/16/fixed-attachment-css-gradients/">
Fixed Attachment CSS Gradients</a>
</h2>
</header>
<section class="post-excerpt">
<p>Yeah it’s been a while since I last posted. I need to start posting more small things instead of convincing myself that only really big cool things are blog worthy. So, here’s something small.</p>
<p>I was recently admiring the gradient backgrounds on messages in Facebook messenger. Specifically, I liked how the gradient colors stayed relative to your viewport even as you scrolled. I thought it would be fun to attempt to replicate this in CSS.</p>
<p>The way I implemented this was simply to use the desired gradient as a <code>background-image</code> on the element, which allows us to use the powerful css properties that are available for background images. There are quite a few interesting ones that can be used for cool things, like <code>background-position</code> and <code>background-clip</code>, which I may explore some other time. The only property we need to use in this case is <code>background-attachment: fixed;</code> on the message elements. This works much like <code>fixed</code> in other contexts in CSS.</p>
<p>From MDN on <code>background-attachment</code>:</p>
<blockquote><p><code>fixed</code>: The background is fixed relative to the viewport. Even if an element has a scrolling mechanism, the background doesn’t move with the element.</p></blockquote>
<p>Try scrolling on the messages to see the effect in action. Also try switching the color scheme for some more dramatic gradients.</p>
<p class="codepen" data-height="700" data-theme-id="dark" data-default-tab="css,result" data-user="skylarmb" data-slug-hash="WNxwzoR" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Messenger background gradients">
<span>See the Pen <a href="https://codepen.io/skylarmb/pen/WNxwzoR">
Messenger background gradients</a> by Skylar Brown (<a href="https://codepen.io/skylarmb">@skylarmb</a>)
on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
<p>Shoutout to some cool and fun tools I used:</p>
<p>Emojify: <a href="https://matthewmiller.dev/experiments/emojify/">https://matthewmiller.dev/experiments/emojify/</a></p>
<p>Corporate Ipsum: <a href="https://www.cipsum.com">https://www.cipsum.com</a></p>
<p>uiGradients: <a href="https://uigradients.com/">https://uigradients.com/</a></p>
...<br/><a href="/blog/2020/10/16/fixed-attachment-css-gradients/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<article class="post">
<header class="post-header">
<span class="post-meta">27 Jan 2018</span>
<h2 class="post-title">
<a href="/blog/2018/01/27/a-simple-input-toggle/">
A Simple Input Toggle</a>
</h2>
</header>
<section class="post-excerpt">
<p>A simple, animated, and functional all-CSS toggle switch I made for Headnote. It is based on a checkbox input and there is no Javascript required, so you can easily put it right into any existing application where you use checkboxes.</p>
<p><br></p>
<p data-height="265" data-theme-id="0" data-slug-hash="POJpPR" data-default-tab="css,result" data-user="skylarmb" data-embed-version="2" data-pen-title="CSS Toggle" class="codepen">See the Pen <a href="https://codepen.io/skylarmb/pen/POJpPR/">CSS Toggle</a> by Skylar Brown (<a href="https://codepen.io/skylarmb">@skylarmb</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
...<br/><a href="/blog/2018/01/27/a-simple-input-toggle/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<article class="post">
<header class="post-header">
<span class="post-meta">27 Jan 2018</span>
<h2 class="post-title">
<a href="/blog/2018/01/27/loading-spinners/">
Loading Spinners</a>
</h2>
</header>
<section class="post-excerpt">
<p>Inspired by <a href="https://reddit.com/r/LoadingIcon">/r/LoadingIcon</a>, I made these two CSS loading icons.</p>
<p><br></p>
<p data-height="365" data-theme-id="0" data-slug-hash="ZvLoPG" data-default-tab="css,result" data-user="skylarmb" data-embed-version="2" data-pen-title="squares3" class="codepen">See the Pen <a href="https://codepen.io/skylarmb/pen/ZvLoPG/">squares3</a> by Skylar Brown (<a href="https://codepen.io/skylarmb">@skylarmb</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
<p data-height="365" data-theme-id="0" data-slug-hash="zpNjLr" data-default-tab="css,result" data-user="skylarmb" data-embed-version="2" data-pen-title="squares2" class="codepen">See the Pen <a href="https://codepen.io/skylarmb/pen/zpNjLr/">squares2</a> by Skylar Brown (<a href="https://codepen.io/skylarmb">@skylarmb</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
...<br/><a href="/blog/2018/01/27/loading-spinners/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<article class="post">
<header class="post-header">
<span class="post-meta">21 Jul 2017</span>
<h2 class="post-title">
<a href="/blog/2017/07/21/a-break-from-the-norm/">
A Break From the Norm</a>
</h2>
</header>
<section class="post-excerpt">
<p>I usually post about code, but today I want to post about tooling and process. There are a few things that greatly aide my productivity that I would like to share. In no particular order, here are things I think can save you somewhere on the order of hours per day in productivity, not to mention your sanity.</p>
<h5>1. Make notes for yourself</h5>
<p>Every day before I leave I spend 30 seconds writing myself a couple notes about where I left off and what I have on my mind. I use <a href="https://www.google.com/keep/" target="_blank">Google Keep</a> to take notes, but to each their own. These notes are wonderful the next morning as I can pick up right where I left off, and even refer to them throughout the day to remember the small things that might otherwise slip through the cracks.</p>
<h5>2. Create shortcuts</h5>
<p>Allow yourself to do things faster. I create endless shortcuts. Here are just a few of them</p>
<ul>
<li>I have browser bookmarks for all the services and sites I need to use daily, with shortened names so that more fit on the bookmark bar.</li>
<li>I use LastPass to manage passwords. I log in once in the morning and never have to worry about remembering credentials for the rest of the day.</li>
<li>I have TONS of aliases. Check out my <a href="https://github.com/skylarmb/dotfiles/blob/master/.zshrc" target="_blank"><code>.zshrc</code></a>, my <a href="https://github.com/skylarmb/dotfiles/blob/master/.gitconfig" target="_blank"><code>.gitconfig</code></a>, or my <a href="https://github.com/skylarmb/dotfiles/blob/master/.vimrc" target="_blank"><code>.vimrc</code></a>.</li>
<li>I use BetterTouchTool to set up keyboard shortcuts for moving windows to different monitors, minimizing, maximizing, snapping, etc. You can find my config <a href="https://github.com/skylarmb/dotfiles/blob/master/btt.json" target="_blank">here</a>.</li>
<li>I have trackpad gestures to close tabs, switch tabs, switch windows, switch desktops, etc (included in above BTT config).</li>
</ul>
<h5>3. Be proactive</h5>
<p>Investing time up front will save time in the long run. Shitty build process that requires
...<br/><a href="/blog/2017/07/21/a-break-from-the-norm/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<article class="post">
<header class="post-header">
<span class="post-meta">28 May 2017</span>
<h2 class="post-title">
<a href="/blog/2017/05/28/map-markers/">
Animated Markers on an SVG Map</a>
</h2>
</header>
<section class="post-excerpt">
<p>I recently started my new job at <a href="https://headnote.com">Headnote</a>. My first project was to redo all of the public facing pages to update the branding and advertising language. The one piece of code I would like to share from the experience is the animated markers that pop up in various places on a map. Now, I am new to Less (purely a Sass guy before this gig), so this was a great learning experience for me about what advanced features Less supports compared to Sass. There were definitely some challenges. The main one being that Less is much less flexible (no pun intended) in terms of interpolation and apparently is very very picky about using variables / interpolation on the <em>left</em> side of a definition (I dont know what else to call it)… For example:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='scss'><span class='line'><span class="k">@side</span><span class="nd">:</span> <span class="nt">left</span><span class="o">;</span>
</span><span class='line'>
</span><span class='line'><span class="nc">.my-class</span> <span class="p">{</span>
</span><span class='line'> <span class="nt">margin-</span><span class="o">@</span><span class="p">{</span><span class="nt">side</span><span class="p">}</span><span class="nd">:</span> <span class="nt">5px</span><span class="o">;</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>
<p>This particular example works… however when I tried to use this sort of interpolation for keyframe animation
...<br/><a href="/blog/2017/05/28/map-markers/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<article class="post">
<header class="post-header">
<span class="post-meta">07 Aug 2016</span>
<h2 class="post-title">
<a href="/blog/2016/08/07/cubic-beziers/">
Cubic Bezier Curves</a>
</h2>
</header>
<section class="post-excerpt">
<h4>Preface</h4>
<p>Everything I make is made to work in the latest chrome. Because this is a dev blog I don’t bother with vendor prefixes / browser compatibility.</p>
<h4>Curves</h4>
<p>A cubic bezier curve in CSS looks like a bunch of random numbers.</p>
<pre><code class="css">.class {
transition: all 1s cubic-bezier(0.95, 0.05, 0.795, 0.035);
}
</code></pre>
<p>What do those values mean? First lets understand the structure and a cubic bezier curve.</p>
<p><img src="/images/bezier.png" alt="" /></p>
<p>A curve is defined by four points
...<br/><a href="/blog/2016/08/07/cubic-beziers/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<article class="post">
<header class="post-header">
<span class="post-meta">04 Jun 2016</span>
<h2 class="post-title">
<a href="/blog/2016/06/04/a-rainbow-thing/">
A Rainbow Thing</a>
</h2>
</header>
<section class="post-excerpt">
<p>I came across this gif on reddit today.
<br>
<br>
<img src="https://s-media-cache-ak0.pinimg.com/originals/50/b4/97/50b497753dc91b55c5410f531935d7c3.gif">
<br>
<br></p>
<p>No idea how it was made but thought it would be an interesting challenge to replicate it with css keyframe animation. I explicitly set out to do this with no javascript just to explore the limitations of keyframe animation, and yes, I am well aware that the problems listed below can all be solved with JS. Thats not the point.</p>
<p>Here are some interesting limitations of keyframe animation that I came across while doing this.</p>
<h6>Problem 1: Iteration Delays</h6>
<p>As helpful as the <code>animation-delay</code> property can be, it only delays the start of the animation relative to page load (or to when the animation was applied to the element). There is no delay-per-iteration type property. I would love to be able to specify an animation something like this…</p>
...<br/><a href="/blog/2016/06/04/a-rainbow-thing/"><h6>Read more...</h6></a>
<!-- content | excerpt }} -->
</section>
</article>
<nav class="pagination" role="pagination">
<span class="page-number">
Page 1 of 1
</span>
</nav>
</main>
<footer class="site-footer"><a class="subscribe icon-feed" href="http://skylar.xyz/atom.xml"><span class="tooltip">Subscribe!</span></a>
<div class="inner">
Follow me on
<a class="social github" href="http://github.com/skylarmb" title="GitHub">GitHub</a>
<section class="copyright">All content copyright <a href="/">Skylar Brown</a> © 2020 • All rights reserved.</section>
<section class="poweredby">Casper theme by <a class="icon-ghost" href="http://tryghost.org">Ghost</a> & Published with <a href="http://octopress.org">Octopress</a></section>
</div>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad()</script>
</body>
</html>