<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xml" href="http://www.annatraussnig.com/feed.xslt.xml"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="http://www.annatraussnig.com/feed.xml" rel="self" type="application/atom+xml" /><link href="http://www.annatraussnig.com/" rel="alternate" type="text/html" /><updated>2018-05-28T21:46:08+02:00</updated><id>http://www.annatraussnig.com//</id><title type="html">Anna Traussnig</title><subtitle>Welcome to my store: cheap thoughts, flash fiction, pretty things and affordable dreams on sale and on offer!
</subtitle><author><name>Anna Traussnig</name></author><entry><title type="html">Jekyll In Style</title><link href="http://www.annatraussnig.com/posts/jekyll-in-style" rel="alternate" type="text/html" title="Jekyll In Style" /><published>2017-01-17T00:00:00+01:00</published><updated>2017-01-17T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/jekyll-in-style</id><content type="html" xml:base="http://www.annatraussnig.com/posts/jekyll-in-style">&lt;p&gt;Feeling in the mood for a change, I recently moved my website to &lt;em&gt;&lt;a href=&quot;https://jekyllrb.com/&quot; target=&quot;_blank&quot;&gt;Jekyll&lt;/a&gt;&lt;/em&gt;. This change wasn’t about the look and feel, but purely about leveraging the simplicity of the Jekyll framework. The appearance of the site had to remain absolutely identical.&lt;/p&gt;

&lt;p&gt;Let’s say the information on how to style Jekyll sites is out there, but it’s a bit scattered. So here is my version of a step-by-step guide:&lt;/p&gt;

&lt;h4 id=&quot;1-get-rid-of-the-default-theme&quot;&gt;1) get rid of the default theme&lt;/h4&gt;

&lt;p&gt;Open the &lt;code class=&quot;highlighter-rouge&quot;&gt;_config.yml&lt;/code&gt; of your Jekyll site (at the root of the project). You should see that the default theme is set to ‘minima’.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;s&quot;&gt;theme&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;minima&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Delete the theme line and get rid of any predefined styling.&lt;/p&gt;

&lt;h4 id=&quot;2-create-your-own-layouts&quot;&gt;2) create your own layouts&lt;/h4&gt;

&lt;p&gt;If you now try to serve the site (&lt;code class=&quot;highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;), you will notice that, amongst others, Jekyll is complaining that it cannot find the ‘post’ layout. To remedy to this, create a &lt;code class=&quot;highlighter-rouge&quot;&gt;_layouts&lt;/code&gt; directory at the root of the project.&lt;/p&gt;

&lt;p&gt;Then define a default layout. In the &lt;code class=&quot;highlighter-rouge&quot;&gt;_layouts&lt;/code&gt; folder, create a &lt;code class=&quot;highlighter-rouge&quot;&gt;default.html&lt;/code&gt; file, which will describe your default layout, and add a &lt;code class=&quot;highlighter-rouge&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;&lt;/code&gt; tag to make sure any nested content will be included.&lt;/p&gt;

&lt;p&gt;A typical &lt;code class=&quot;highlighter-rouge&quot;&gt;default.html&lt;/code&gt; layout file could look like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;X-UA-Compatible&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;IE=edge&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;{{ page.title | escape }}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    {{ content }}
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;After that, we have to implement our more specific layouts. As Jekyll offers the possibility to nest layouts, we can specify a parent layout in the front matter and then only take care of the layout of the content block we declared in &lt;code class=&quot;highlighter-rouge&quot;&gt;default.html&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is a simplistic &lt;code class=&quot;highlighter-rouge&quot;&gt;post.html&lt;/code&gt; layout:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;---
layout: default
---
&lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;I'm a Post:&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ page.title }}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;

{{ content }}

&lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Thanks for reading me!&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And a &lt;code class=&quot;highlighter-rouge&quot;&gt;home.html&lt;/code&gt; layout (for our index page):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;---
layout: default
---
&lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Introducing:&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ site.title }}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    {% for post in site.posts %}
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{{ post.url | relative_url }}&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;{{post.title}}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    {% endfor %}
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/about.html&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Read more&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; about this site!&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We won’t implement an ‘about’ layout here, so you should replace the more specific ‘page’ layout used in &lt;code class=&quot;highlighter-rouge&quot;&gt;about.md&lt;/code&gt; by our generic ‘default’ layout. (Alternately, you can create your own ‘page’ layout just like we did for ‘post’.)&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-markdown&quot; data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;About&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;permalink&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/about/&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you now try to run &lt;code class=&quot;highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;, you’ll observe that the server is still complaining about a missing ‘include’. We will talk about those files in the next subsection.&lt;/p&gt;

&lt;h4 id=&quot;3-keep-it-dry&quot;&gt;3) keep it DRY&lt;/h4&gt;

&lt;p&gt;Your ‘includes’ are those files you may want to extract from your pages and layouts to make your code cleaner and more modular. They should be placed inside an &lt;code class=&quot;highlighter-rouge&quot;&gt;_includes&lt;/code&gt; folder. So go ahead and create that folder at the root of your project.&lt;/p&gt;

&lt;p&gt;Let’s open a new file called &lt;code class=&quot;highlighter-rouge&quot;&gt;stupid-snippet.html&lt;/code&gt; in the &lt;code class=&quot;highlighter-rouge&quot;&gt;_includes&lt;/code&gt; directory:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I'm a bit stupid, but at least I'm here!&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;At the moment, the server is trying to retrieve includes that don’t exist anymore (they were part of the ‘minima’ theme). To fix this, open the &lt;code class=&quot;highlighter-rouge&quot;&gt;about.md&lt;/code&gt; page and change the text to remove the default includes (and text) and use use our own content:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-markdown&quot; data-lang=&quot;markdown&quot;&gt;We are busy making a new layout and styling it...
{% include stupid-snipped.html %}&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;You should now be able to serve (and view!) your Jekyll project. Woohoo!&lt;/p&gt;

&lt;h4 id=&quot;3-add-your-own-css&quot;&gt;3) add your own CSS&lt;/h4&gt;

&lt;p&gt;At this point you might feel a bit cheated. The layout we created so far doesn’t look much like an improvement! What we want to do is be able to create and apply our own stylesheets to the website. To get started with this, create not one, but two directories at the root of the project: &lt;code class=&quot;highlighter-rouge&quot;&gt;_sass&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;assets&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;_sass&lt;/code&gt; directory is conceived to contain… your sass stylesheets. Let’s create a &lt;code class=&quot;highlighter-rouge&quot;&gt;typography.scss&lt;/code&gt; file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-scss&quot; data-lang=&quot;scss&quot;&gt;&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Futura&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Trebuchet MS&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Arial&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;#dedede&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;#735959&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;#fff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And a &lt;code class=&quot;highlighter-rouge&quot;&gt;layout.scss&lt;/code&gt; file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-scss&quot; data-lang=&quot;scss&quot;&gt;&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now that we have those files defined, we can create a &lt;code class=&quot;highlighter-rouge&quot;&gt;main.scss&lt;/code&gt; in the assets directory (as files in &lt;code class=&quot;highlighter-rouge&quot;&gt;_sass&lt;/code&gt; are only available for import). This &lt;code class=&quot;highlighter-rouge&quot;&gt;main.scss&lt;/code&gt; file will be compiled into &lt;code class=&quot;highlighter-rouge&quot;&gt;main.css&lt;/code&gt; by Jekyll, which we will be able to load into your layouts.&lt;/p&gt;

&lt;p&gt;This is how &lt;code class=&quot;highlighter-rouge&quot;&gt;assets/main.scss&lt;/code&gt; could look like:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-scss&quot; data-lang=&quot;scss&quot;&gt;&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;Only&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;Sass&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;needs&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;front&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;matter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;dashes&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;are&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;enough&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;typography&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;layout&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;… Which we load into &lt;code class=&quot;highlighter-rouge&quot;&gt;default.html&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{{ '/assets/styles/shared.css' | relative_url }}&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Of course then you are absolutely free to add classes to your layouts in order to style your content even more! (You can also drop html into your Markdown files, whenever you need that extra bit of customisation.)&lt;/p&gt;

&lt;h4 id=&quot;4-load-page-specific-css&quot;&gt;4) load page-specific CSS&lt;/h4&gt;

&lt;p&gt;It is generally recommended to load all the CSS in the &lt;code class=&quot;highlighter-rouge&quot;&gt;head&lt;/code&gt; of the page in order to prevent a flash of unstyled content.  However, in a nested template structure such as ours, the &lt;code class=&quot;highlighter-rouge&quot;&gt;head&lt;/code&gt; is defined in the topmost template (here: &lt;code class=&quot;highlighter-rouge&quot;&gt;layout.html&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Problem: we want to load page- or layout-specific CSS without having to redefine a base layout every time. Solution: use a front matter &lt;code class=&quot;highlighter-rouge&quot;&gt;css&lt;/code&gt; value and parse it to build the head of &lt;code class=&quot;highlighter-rouge&quot;&gt;layout.html&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is how we give this capability to the &lt;code class=&quot;highlighter-rouge&quot;&gt;head&lt;/code&gt; of &lt;code class=&quot;highlighter-rouge&quot;&gt;layout.html&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;X-UA-Compatible&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;IE=edge&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/assets/main.css&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;{{ page.title | escape }}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;

    {% for css in layout.css %}
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/assets/&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
    {% endfor %}

    {% for css in page.css %}
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/assets/&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
    {% endfor %}
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Let’s put this into use by adding a &lt;code class=&quot;highlighter-rouge&quot;&gt;blue-bg.css&lt;/code&gt; file into the assets directory:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#29183e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;… Which we can now for instance load into &lt;code class=&quot;highlighter-rouge&quot;&gt;about.md&lt;/code&gt;. To do so, we simply need to update the front matter of the file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-markdown&quot; data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;About&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;permalink&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/about/&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;blue-bg.css&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This will load our custom stylesheet in &lt;code class=&quot;highlighter-rouge&quot;&gt;about.md&lt;/code&gt; and turn the background of the page blue. (By the way, the technique would also work for includes or Javascript files!)&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;And… voilà! It’s now up to you to get cracking and create your own fabulously unique Jekyll site.&lt;/p&gt;

&lt;p&gt;I tend to find static tutorials difficult to follow, so I created a small &lt;em&gt;&lt;a href=&quot;https://github.com/annatraussnig/jekyll-styling&quot; target=&quot;_blank&quot;&gt;GitHub repo&lt;/a&gt;&lt;/em&gt; where you can go through history and follow the steps commit after commit. Go have a look.&lt;/p&gt;

&lt;p&gt;In the meantime, happy coding :)&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">Feeling in the mood for a change, I recently moved my website to Jekyll. This change wasn’t about the look and feel, but purely about leveraging the simplicity of the Jekyll framework. The appearance of the site had to remain absolutely identical.</summary></entry><entry><title type="html">Scroll Advert</title><link href="http://www.annatraussnig.com/posts/scroll-advert" rel="alternate" type="text/html" title="Scroll Advert" /><published>2017-01-04T00:00:00+01:00</published><updated>2017-01-04T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/scroll-advert</id><content type="html" xml:base="http://www.annatraussnig.com/posts/scroll-advert">&lt;p&gt;The trick to &lt;em&gt;&lt;a href=&quot;https://css-tricks.com/scroll-drawing/&quot; target=&quot;_blank&quot;&gt;reveal an SVG path on scroll&lt;/a&gt;&lt;/em&gt; is relatively well-known. Every SVG path comes with two useful attributes: &lt;em&gt;&lt;a href=&quot;https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-dasharray&quot; target=&quot;_blank&quot;&gt;stroke-dasharray&lt;/a&gt;&lt;/em&gt;, which determines the dash-gap pattern of the path (dotted or dashed line, how long the dashes are, how long the gaps are, etc.), and &lt;em&gt;&lt;a href=&quot;https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-dashoffset&quot; target=&quot;_blank&quot;&gt;stroke-dashoffset&lt;/a&gt;&lt;/em&gt;, which controls the offset of the pattern specified by stroke-dasharray.&lt;/p&gt;

&lt;p&gt;Now imagine that our dash-gap pattern consists in a dash as long as the path itself, followed by a gap also as long as the path. Depending on the offset we choose, we can either have the dash fully covering the path, making said path visible, or we can place the gap over the path, hiding it entirely. Anything between those two extremes yields a partial reveal of the path.&lt;/p&gt;

&lt;p&gt;Using this trick, we adjust the dash offset proportionally to the scrolling fraction of the window in order to create a smooth scroll-based reveal. The more the visitor scrolls, the more she sees from the path.&lt;/p&gt;

&lt;p&gt;A few months ago, I decided to play around with this technique and see how far it could be pushed. The &lt;em&gt;&lt;a href=&quot;https://annatraussnig.github.io/hire-me/&quot; target=&quot;_blank&quot;&gt;result&lt;/a&gt;&lt;/em&gt; was showcased here for a while, before moving to GitHub pages. (Unfortunately, fancy self-promotion splash pages come with an expiry date – or so I believe.)&lt;/p&gt;

&lt;p&gt;The feedback I got from it was… well, I guess it was mixed. But it was the good kind of mixed. What I mean is that everybody I showed the page to seemed to either love it or be really skeptical. &lt;em&gt;&lt;a href=&quot;https://blog.okcupid.com/index.php/the-mathematics-of-beauty/&quot; target=&quot;_blank&quot;&gt;Polarising responses are good&lt;/a&gt;&lt;/em&gt; (nice article by the way – go read it). Funnily enough, the comments were strongly segregated by age. Young people found it cool, older people had a hard time figuring out what the deal was and why they should waste half a minute of their life scrolling down (… because it’s fun?). I won’t dwell on feedback, but eventually we also build that stuff for people, so their opinion kind of matters. Right?&lt;/p&gt;

&lt;p&gt;So, how do we build that kind of animation? Sit tight, I’ll tell you everything.&lt;/p&gt;

&lt;p&gt;As you can see, a fair bit happens during scrolling, but obviously not everything happens at the same time. We should be able to specify a start and an end scrolling fraction between which we want the animation to take place, and get some kind of ‘relative scroll fraction’ based on those boundaries, instead of using the whole window. Let’s transform the total scroll fraction into a relative measure:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getTotalScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;documentElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollTop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollTop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; 
           &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;documentElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollHeight&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;documentElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;clientHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getRelativeScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;startFraction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;endFraction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;totalScrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getTotalScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;relativeScrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;totalScrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;startFraction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; 
                                 &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;endFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;startFraction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;clip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;relativeScrollFraction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now, we need a way to gradually move from any initial to any final (numerical) property value based on relative scroll fraction. The idea here is to linearly interpolate (and assign) a property value using a user-defined setter function. That way, any property becomes animatable, as long as it is numerical.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFractions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getRelativeScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollFractions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFractions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;newValue&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;setValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;newValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Note that while this approach works well, it requires the user to write a new function for every new property, even when the logic remains essentially the same. Not super convenient, but it does the job.&lt;/p&gt;

&lt;p&gt;For instance here is how we animate the opacity of an element:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setOpacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'opacity'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;scroll&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#my-selector'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.07&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setOpacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;A more particular case is the reveal (or hiding) of paths. All paths have a set direction, which in turn determines from which end the animation starts. To be able to change the direction of animation without re-generating the path, we have to tweak the basic dash-offset code by addind a direction parameter, and create two setter functions (one for each direction).&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;changeDashOffset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pathLength&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getTotalLength&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;drawLength&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pathLength&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;strokeDashoffset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pathLength&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;drawLength&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//setters&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;revealPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeDashOffset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;revealPathReverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeDashOffset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The last non-standard parameter we should handle is colour. Because colour is in fact three values bundled into one, it requires a separate interpolation for each colour channel:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getColorMix&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;color1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;color2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rgb1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;hexToRgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;color1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rgb2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;hexToRgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;color2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;newRgb&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt;
        
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;newRgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rgb1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;factor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rgb2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rgb1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]));&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rgbToHex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;newRgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;colorOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollPositions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;colors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getRelativeScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollPositions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollPositions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fill&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;getColorMix&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;colors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;colors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFraction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;(Hex/RGB conversion functions recklessly stolen from &lt;em&gt;&lt;a href=&quot;http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb&quot;&gt;StackOverflow&lt;/a&gt;&lt;/em&gt;.)&lt;/p&gt;

&lt;p&gt;And that’s essentially all we need to build our animations. To give you an idea, here is how the lightbulb animation starts:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;scroll&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// bulb appears&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#lightbulb'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.03&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.04&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setRadius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#light-fitting'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.03&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.07&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;revealPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#lightbulb'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.06&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.08&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;21.6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setRadius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#top-shadow-straight'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.07&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setOpacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;changeOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#bottom-shadow-straight'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.07&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setOpacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;colorOnScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#lightbulb'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'#877F5C'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'#F89406'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;[...]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I left some details on the side, but &lt;em&gt;&lt;a href=&quot;https://github.com/annatraussnig/svg-scroll&quot; target=&quot;_blank&quot;&gt;the code is on GitHub&lt;/a&gt;&lt;/em&gt;, so if you are curious about the whole thing and want to dig into it, feel free to have a look.&lt;/p&gt;

&lt;p&gt;Also! I refactored the code, fixed the bits I didn’t like (no more setter and separate colour functions), and created a nifty little library out of it. &lt;em&gt;&lt;a href=&quot;https://www.npmjs.com/package/svg-scroll&quot; target=&quot;_blank&quot;&gt;It’s called SVG-Scroll and it’s on NPM&lt;/a&gt;&lt;/em&gt;. I purposely kept it as simple as I could. It doesn’t require any third party dependencies and it’s complete enough to recreate everything on my promotion page. If you are thinking about making something similar, go check it out (no pun intended)!&lt;/p&gt;

&lt;p&gt;Comments? Send me a &lt;em&gt;&lt;a href=&quot;https://twitter.com/atraussnig&quot; target=&quot;_blank&quot;&gt;tweet&lt;/a&gt;&lt;/em&gt; or an &lt;em&gt;&lt;a href=&quot;mailto:anna.traussnig@gmail.com&quot; target=&quot;_blank&quot;&gt;email&lt;/a&gt;&lt;/em&gt;!&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">The trick to reveal an SVG path on scroll is relatively well-known. Every SVG path comes with two useful attributes: stroke-dasharray, which determines the dash-gap pattern of the path (dotted or dashed line, how long the dashes are, how long the gaps are, etc.), and stroke-dashoffset, which controls the offset of the pattern specified by stroke-dasharray.</summary></entry><entry><title type="html">The Typist</title><link href="http://www.annatraussnig.com/posts/the-typist" rel="alternate" type="text/html" title="The Typist" /><published>2016-03-01T00:00:00+01:00</published><updated>2016-03-01T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/the-typist</id><content type="html" xml:base="http://www.annatraussnig.com/posts/the-typist">&lt;h4 id=&quot;a-cliché&quot;&gt;A Cliché&lt;/h4&gt;

&lt;p&gt;Her whole life, the typist had wanted to be a writer, and it was purely coincidental that she decided to focus on the technical aspect of things.&lt;/p&gt;

&lt;p&gt;There weren’t many typing positions available in the modern world. Instead of looking for another career, the typist bought a pink suit, a cute hat, wiggled her hands, and stepped into the nineteen sixties. (It never occurred to her that time-travel was physically impossible. After all, many people had funny skills.)&lt;/p&gt;

&lt;p&gt;She immediately found a job at a lawyer’s office. From morning to evening she would type tirelessly, until her fingers were burning. Once she knew everything about the words of the law, she left, and started typing for an old doctor, thus learning the words of medicine. She then moved on, successively working for advertisers, real-estate agents, professors, factory owners, and even for a local radio station.&lt;/p&gt;

&lt;p&gt;She soon became known as the best typist in town. She would lay her hands on the keyboard, purse her lips, and the words would happen. She was so competent, people quickly went on to other tasks, almost forgetting that she existed. No one stopped at her desk or told her what to do. Had they done so, it wouldn’t have made much of a difference. She knew the words, and the words needed to be typed. The words needed her.&lt;/p&gt;

&lt;p&gt;Interestingly enough, no one ever seemed to notice there was something odd about that girl. They never saw beyond the perfect documents that came out of her typewriter – out of nowhere, really.&lt;/p&gt;

&lt;p&gt;Her? She was just a pretty typist.&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">A Cliché</summary></entry><entry><title type="html">The Wealthiest Woman On Earth</title><link href="http://www.annatraussnig.com/posts/the-wealthiest-woman-on-earth" rel="alternate" type="text/html" title="The Wealthiest Woman On Earth" /><published>2016-02-02T00:00:00+01:00</published><updated>2016-02-02T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/the-wealthiest-woman-on-earth</id><content type="html" xml:base="http://www.annatraussnig.com/posts/the-wealthiest-woman-on-earth">&lt;p&gt;Long before religions, kingdoms and cities, the wealthiest woman on Earth found a nugget of gold at the bottom of a stream. She inspected it carefully – gasped. For sure, she was holding a piece of sun. How did it get here?&lt;/p&gt;

&lt;p&gt;It was the first time humanity ever saw gold.&lt;/p&gt;

&lt;p&gt;And there she was: a young woman with wild eyes and dirty hair, a bit naked, wearing the sun on her chest. What would the others say to such a miracle? After all, they were now the wealthiest tribe on Earth. People whispered. It’s shining! Look at her chest! Look at the sun! The wealthiest of woman of Earth smiled and started talking.&lt;/p&gt;

&lt;p&gt;It was the first time they saw gold too. They couldn’t hear what she was saying. They couldn’t see where she was standing. How could they? She wasn’t one of them anymore. She had the necklace of a goddess. This commanded respect. So much respect.&lt;/p&gt;

&lt;p&gt;No one talked to the woman: it was not appropriate. No one shared food with the woman: it was not appropriate. No one touched the woman: it was definitely not appropriate. Sometimes, people would briefly look at the necklace, before lowering their gaze. Not appropriate.&lt;/p&gt;

&lt;p&gt;Of course, the wealthiest woman on Earth understood. She knew about respect. She understood what she was now: a sacred ghost, or maybe even the shadow of a god. She deserved this respect. Every day, she stood under the sun, without friends and without food, growing thinner and weaker, waiting for another miracle to happen. Or maybe for a god.&lt;/p&gt;

&lt;p&gt;Eventually she got ill. Too much sun, not enough to eat. On her last day, she asked for the healer, but the healer refused to see her. He had too much respect for ghosts.&lt;/p&gt;

&lt;p&gt;After she died, the tribe decided to return the gold to the sun. Everybody nodded, and agreed that they didn’t need any more ghosts or holy shadows in these parts. At this moment, one man stood up. Without a word, he took the necklace and slowly walked away.&lt;/p&gt;

&lt;p&gt;The wealthiest man on Earth left, and didn’t ever think about coming back.&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">Long before religions, kingdoms and cities, the wealthiest woman on Earth found a nugget of gold at the bottom of a stream. She inspected it carefully – gasped. For sure, she was holding a piece of sun. How did it get here?</summary></entry><entry><title type="html">Pigments Of Death Awards</title><link href="http://www.annatraussnig.com/posts/pigments-of-death-awards" rel="alternate" type="text/html" title="Pigments Of Death Awards" /><published>2016-01-27T00:00:00+01:00</published><updated>2016-01-27T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/pigments-of-death-awards</id><content type="html" xml:base="http://www.annatraussnig.com/posts/pigments-of-death-awards">&lt;section class=&quot;plot mod-left&quot;&gt;
  &lt;p&gt;As a web developer, I often have to do a bit of colour magic. Thank goodness it’s not very difficult. I change a line or two in a file, save the file, and there you go: the colour on the screen changes magically. It’s so easy, it’s amazing.&lt;/p&gt;

  &lt;p&gt;Has colour always been that easy? Certainly not. So let’s get a bit nostalgic and remind ourselves of the good old times when colouring stuff was still a true health and safety hazard. From plain weird to downright deadly, 5 pigments to remember. (And forget...)&lt;/p&gt;
&lt;/section&gt;

&lt;section class=&quot;mediagrid padpad mod-fixed&quot;&gt;
  &lt;article class=&quot;media-fill&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/pigments/paris_green.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h2&gt;&lt;strong&gt;Dead Mouse Award:&lt;/strong&gt;&lt;/h2&gt;
        &lt;h3&gt;Paris Green&lt;/h3&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
&lt;/section&gt;

&lt;section class=&quot;plot mod-left&quot;&gt;
  &lt;p&gt;Heavily dosed with arsenic, this one started its career as a rodent killer in the Parisian sewage system – hence the name – before expanding into the insecticide market. As you would expect, it is highly toxic and, surprise! degrades into a gas with time. But it has a nice, fresh, soothing green colour, so impressionists like Monet and Renoir got hooked.&lt;/p&gt;

  &lt;p&gt;Interior designers also quickly jumped on the bandwagon, leading to an unexpected surge of poisonous wallpaper and arsenic fumes inside 19th century homes.&lt;/p&gt;
&lt;/section&gt;

&lt;section class=&quot;mediagrid padpad mod-fixed&quot;&gt;
  &lt;article class=&quot;media-fill&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/pigments/cinnabar.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h2&gt;&lt;strong&gt;Rouge Award:&lt;/strong&gt;&lt;/h2&gt;
        &lt;h3&gt;Vermilion&lt;/h3&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
&lt;/section&gt;

&lt;section class=&quot;plot mod-left&quot;&gt;
  &lt;p&gt;Early vermilion was ground from a bright red stone with an enchanting name: cinnabar. As usual, reality turned out to be slightly less enchanting for those mining it, since they were actually mining mercury all day long. It didn't stop anyone though. Eventually, alchemists discovered how to synthesise the pigment by mixing sulfur and mercury together.&lt;/p&gt;

  &lt;p&gt;Throughout 10'000 years of vermilion history, the pigment has featured literally everywhere: in prehistorical art, on pre-Columbian monuments and graves, in Roman houses, on Chinese palaces, temples and lacquerware, in medieval manuscripts and on Renaissance canvasses, on Venetian cheeks and on Indian foreheads, and even in food. No comment.&lt;/p&gt;

  &lt;p&gt;This mania probably killed quite a few people along the way, so it is safe to assume that humanity &lt;b&gt;really&lt;/b&gt; likes red.&lt;/p&gt;
&lt;/section&gt;

&lt;section class=&quot;mediagrid padpad mod-fixed&quot;&gt;
  &lt;article class=&quot;media-fill&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/pigments/ceruse.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h2&gt;&lt;strong&gt;Michelangelo Award:&lt;/strong&gt;&lt;/h2&gt;
        &lt;h3&gt;White Lead&lt;/h3&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
&lt;/section&gt;

&lt;section class=&quot;plot mod-left&quot;&gt;
  &lt;p&gt;Known since Antiquity, white lead was all over art history until the rise of titanium white, around 1920. Painters loved its vibrancy and when you love something, you don't care if it's trying to kill you.&lt;/p&gt;

  &lt;p&gt;Aside from art, white lead got used on the hulls of English ships and on the faces of Venetian beauties, which couldn't have been very beneficial. The ships benefited from the treatment more than the Venetians, as the paint waterproofed the wood and protected it from worms. The Venetians died early.&lt;/p&gt;

  &lt;p&gt;White lead has a few other pretty names, such as Venetian ceruse and spirits of Saturn. We still refer to lead poisoning as saturnism.&lt;/p&gt;
&lt;/section&gt;

&lt;section class=&quot;mediagrid padpad mod-fixed&quot;&gt;
  &lt;article class=&quot;media-fill&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/pigments/yellowcake.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h2&gt;&lt;strong&gt;Marie Curie Award:&lt;/strong&gt;&lt;/h2&gt;
        &lt;h3&gt;Yellowcake&lt;/h3&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
&lt;/section&gt;

&lt;section class=&quot;plot mod-left&quot;&gt;
  &lt;p&gt;Yellowcake = powdered uranium. Yes, for real. Do I need to say any more? While yellowcake is still in use for safer things, such as atomic bombs and nuclear reactors, it also enjoyed a stint in the world of ceramics, where the stunning yellow glazes didn't pass unnoticed. It then got banned, apparently more because of the radioactive glow of the word uranium than because of the actual radiation levels.&lt;/p&gt;
&lt;/section&gt;

&lt;section class=&quot;mediagrid padpad mod-fixed&quot;&gt;
  &lt;article class=&quot;media-fill&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/pigments/indian_yellow.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h2&gt;&lt;strong&gt;Hot Piss Award:&lt;/strong&gt;&lt;/h2&gt;
        &lt;h3&gt;Indian Yellow&lt;/h3&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
&lt;/section&gt;

&lt;section class=&quot;plot mod-left&quot;&gt;
  &lt;p&gt;You know when you have that bunch of cows, but milk production is, like, too mainstream for you, so you decide to put your cows on a diet of organic vegan fair-trade mango leaves and collect their urine to produce a dark yellow pigment? That's right bitch, that's how you make Indian yellow.&lt;/p&gt;

  &lt;hr /&gt;

  &lt;p&gt;One thing they will never take away from us, as a species we are damn creative.&lt;/p&gt;
&lt;/section&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">As a web developer, I often have to do a bit of colour magic. Thank goodness it’s not very difficult. I change a line or two in a file, save the file, and there you go: the colour on the screen changes magically. It’s so easy, it’s amazing.</summary></entry><entry><title type="html">The Box</title><link href="http://www.annatraussnig.com/posts/the-box" rel="alternate" type="text/html" title="The Box" /><published>2016-01-13T00:00:00+01:00</published><updated>2016-01-13T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/the-box</id><content type="html" xml:base="http://www.annatraussnig.com/posts/the-box">&lt;p&gt;I always wanted to know more about &lt;em&gt;the future&lt;/em&gt;. So when a lame antiquarian offered to sell me a so-called box of futures, I did not hesitate very long.&lt;/p&gt;

&lt;p&gt;Of course he wouldn’t let me look inside, but I inspected the outside carefully before purchasing it – I am not an idiot. The box seemed authentic enough. Also, the price was very reasonable for such a rare object: about one month of salary. I went to the bank and paid the man cash.&lt;/p&gt;

&lt;p&gt;I left the shop with my box in a bag. My box of futures. I felt a bit anxious. Futures can leak easily, and putting them back inside isn’t something just anyone can do. I was so afraid of the jolts of mechanical transportation that I decided to skip the metro and walk home. It was a long walk.&lt;/p&gt;

&lt;p&gt;It has been a while now, and the box is still closed. I must admit that I’m afraid to open it. It’s such a serious decision.&lt;/p&gt;

&lt;p&gt;But I spend a lot of time looking at it.&lt;/p&gt;

&lt;p&gt;I enjoy it more and more, putting the box on my little table, sitting on the sofa, and staring at it, thinking of all those futures tumbling inside.&lt;/p&gt;

&lt;p&gt;Because of that new hobby of mine, I have stopped seeing my friends so often. I also neglect my family, and find it difficult to make time for work. But I guess it’s OK. I stare at the box and I know it’s OK. I don’t even need to open it anymore. I know. My whole future is in this box.&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">I always wanted to know more about the future. So when a lame antiquarian offered to sell me a so-called box of futures, I did not hesitate very long.</summary></entry><entry><title type="html">The Anatomy Of Life</title><link href="http://www.annatraussnig.com/posts/the-anatomy-of-life" rel="alternate" type="text/html" title="The Anatomy Of Life" /><published>2015-12-16T00:00:00+01:00</published><updated>2015-12-16T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/the-anatomy-of-life</id><content type="html" xml:base="http://www.annatraussnig.com/posts/the-anatomy-of-life">&lt;p&gt;It is said that &lt;em&gt;life&lt;/em&gt; comes into being as a light and delicate object.&lt;/p&gt;

&lt;p&gt;Such is a newborn’s life, light, faintly glowing over the top of the head, almost detached from the body, lovely prey of negligible value.&lt;/p&gt;

&lt;p&gt;With the years, life grows, and slowly descends from the top of the head to the middle of the chest. Adolescence, which experts agree to be a most troubled and dangerous time, occurs as life travels behind the translucent skin of the neck, finding itself once again painfully close to the outside world.&lt;/p&gt;

&lt;p&gt;People used to think that life stopped growing once it had settled inside the heart. But more recent measurements have shown that it keeps accumulating weight, sinking always deeper into the heart.&lt;/p&gt;

&lt;p&gt;Who would know? People have done terrible things, ripping other people’s chests open, so they could get a glimpse at their own secrets. They snatched away what didn’t belong to them, measured everything, put labels on all the parts. They prepared potions full of life and sung songs of immortality.&lt;/p&gt;

&lt;p&gt;People thought they could live forever. Whether they succeeded or not is, to this day, a matter of speculation.&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">It is said that life comes into being as a light and delicate object.</summary></entry><entry><title type="html">Lost Keys</title><link href="http://www.annatraussnig.com/posts/lost-keys" rel="alternate" type="text/html" title="Lost Keys" /><published>2015-12-07T00:00:00+01:00</published><updated>2015-12-07T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/lost-keys</id><content type="html" xml:base="http://www.annatraussnig.com/posts/lost-keys">&lt;section class=&quot;plot&quot;&gt;
  &lt;p&gt;Two little keys fell into my mailbox. They should be mine, yet they are not.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Now what?&lt;/em&gt;&lt;/p&gt;

  &lt;hr /&gt;

  &lt;p&gt;The adventures of two lookalike keys looking for their true home:&lt;/p&gt;
&lt;/section&gt;

&lt;section class=&quot;mediagrid mod-padpad mod-fixed mod-tall&quot;&gt;
  &lt;article class=&quot;media-duo&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/keys/keys1.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h3&gt;&lt;strong&gt;Rule Number 1&lt;/strong&gt;&lt;/h3&gt;
        &lt;p&gt;keys are people, too&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
  &lt;article&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/keys/keys3.jpg')&quot; class=&quot;case&quot;&gt;
      &lt;div class=&quot;titles&quot;&gt;
        &lt;h3&gt;&lt;strong&gt;Rule Number 2&lt;/strong&gt;&lt;/h3&gt;
        &lt;p&gt;explain what's going on&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
  &lt;article class=&quot;media-fill&quot;&gt;
    &lt;div style=&quot;background-image:url('/assets/images/posts/keys/keys2.jpg')&quot; class=&quot;case&quot;&gt;
    &lt;div class=&quot;titles&quot;&gt;
        &lt;h3&gt;&lt;strong&gt;Rule Number 3&lt;/strong&gt;&lt;/h3&gt;
        &lt;p&gt;get too clever with your first mailbox try and the adventure may slip by...&lt;/p&gt;
        &lt;p&gt;What key needs a story when it is home safely?&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/article&gt;
&lt;/section&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">Two little keys fell into my mailbox. They should be mine, yet they are not.</summary></entry><entry><title type="html">S Bahn</title><link href="http://www.annatraussnig.com/posts/s-bahn" rel="alternate" type="text/html" title="S Bahn" /><published>2015-11-25T00:00:00+01:00</published><updated>2015-11-25T00:00:00+01:00</updated><id>http://www.annatraussnig.com/posts/s-bahn</id><content type="html" xml:base="http://www.annatraussnig.com/posts/s-bahn">&lt;p&gt;Berlin S-Bahn trains. The esban everybody takes, because. Just because. The esban in which everybody waits, patiently, to be brought from anywhere to somewhere. One in a crowd of metropolitan crows. Amongst old and young people, hipsters and hippies, mommies and babies. Sometimes, amongst a &lt;em&gt;Strange Man&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The Strange Man isn’t waiting to be somewhere. He picked his coach carefully and entered. Now he is here. Don’t talk to him. Don’t look at him. He has Issues. I start searching for my phone.&lt;/p&gt;

&lt;p&gt;The Strange Man leaks colour. Green clothes, yellow hat. Four times he tries to spark a conversation with the unfortunate German old lady who holds a leash attached to an old dachshund. The woman stares at an imaginary dot far in front of her, very straight in her fluffy coat. Not moving, not blinking. She does not have Issues.&lt;/p&gt;

&lt;p&gt;At last the Strange Man takes out a destroyed photograph. Someone he is looking for, it seems. A plastic wallet holds shreds of cheap photographic paper together. A Christmas picture. I had a good look. But when he approached me with the photograph, I stared at an imaginary dot far inside my phone.&lt;/p&gt;

&lt;p&gt;The worst I could have seen on the picture? A little Anna Traussnig, sitting by the Christmas tree, smiling at her wrapped presents. A picture I had already seen, of someone I already knew. Are Strange Men looking for me? Issues are contagious. I am unique. I am wonderful. I do not have Issues.&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">Berlin S-Bahn trains. The esban everybody takes, because. Just because. The esban in which everybody waits, patiently, to be brought from anywhere to somewhere. One in a crowd of metropolitan crows. Amongst old and young people, hipsters and hippies, mommies and babies. Sometimes, amongst a Strange Man.</summary></entry><entry><title type="html">A Perfect Wedding</title><link href="http://www.annatraussnig.com/posts/a-perfect-wedding" rel="alternate" type="text/html" title="A Perfect Wedding" /><published>2015-09-28T00:00:00+02:00</published><updated>2015-09-28T00:00:00+02:00</updated><id>http://www.annatraussnig.com/posts/a-perfect-wedding</id><content type="html" xml:base="http://www.annatraussnig.com/posts/a-perfect-wedding">&lt;h4 id=&quot;an-angular-fairytale&quot;&gt;An angular fairytale&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;They&lt;/em&gt; said he was peculiar. He was a neat young man with beautiful hands and the eyes of a storm. They also said that he was afraid of corners.&lt;/p&gt;

&lt;p&gt;While he always had a distaste for corners, edges and other line-swallowing monstrosities, it never used to be more than a minor annoyance back home. The corners might have been, well, a bit cornery and the edges a bit edgy – in the end, they were also his corners and his edges. He knew them.&lt;/p&gt;

&lt;p&gt;But one day a war came, and just like that, his family was gone. In the empty house, all the corners started looking at him.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;As soon as the war ended, he sold the family house for near to nothing, and moved to the biggest city in the country. Because even he knew there wasn’t anything you couldn’t find in a city large enough: cheap women, expensive beer and reasonably priced happiness for everyone.&lt;/p&gt;

&lt;p&gt;He started by looking for a flat in the city center, where the people kindly smiled at him and nodded. No one here understood corners.&lt;/p&gt;

&lt;p&gt;At last the night came. He walked and walked, until there was nothing but closed doors and empty streets. A perfect full moon was glowing low in the sky, yellow as oil. He sat down and stared at it. The moon stared back at him, and saw a handsome young man, with a soul like simmering milk. The moon had no beginning, no end, no corners. But she had many daughters.&lt;/p&gt;

&lt;p&gt;One of the doors opened. A very fat woman was filling the frame. In fact, she wasn’t merely filling the frame, but the whole space around her. Every corner of it. She was very white and beautiful. She was smiling.&lt;/p&gt;

&lt;p&gt;He realised that he was smiling too. So this was the place. No more corners. She kindly smiled again and nodded. He got up. In one straight mouvement, he walked to the door, took her hand, and brought it to his heart.&lt;/p&gt;

&lt;p&gt;They said it was a perfect wedding.&lt;/p&gt;

&lt;p&gt;Then, together, under the soft light of the obese moon, the newlyweds entered the house and were never seen again.&lt;/p&gt;</content><author><name>Anna Traussnig</name></author><summary type="html">An angular fairytale</summary></entry></feed>
