<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sean Grindal on Medium]]></title>
        <description><![CDATA[Stories by Sean Grindal on Medium]]></description>
        <link>https://medium.com/@sean37gl?source=rss-a43e17b4de6b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rSlntIKuzXbWyBttK50rYw.jpeg</url>
            <title>Stories by Sean Grindal on Medium</title>
            <link>https://medium.com/@sean37gl?source=rss-a43e17b4de6b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:26:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sean37gl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Important Typography Tips for Improving Your Designs]]></title>
            <link>https://medium.com/@sean37gl/tips-for-using-typography-in-design-fcbfe72960f2?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcbfe72960f2</guid>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[typography]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Fri, 10 May 2024 19:15:59 GMT</pubDate>
            <atom:updated>2024-05-10T19:20:57.197Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9akzJ2MxRTMI4gdqaoA3A.jpeg" /></figure><p>There is no escaping typography. It’s everywhere and a large part of every product you use. Getting typography right is therefore a huge part of making something look and feel professionally designed. Here are some simple tips to keep in mind when you’re working with typography.</p><h3>Be Bold With Contrast</h3><p>Contrast is the most consistently important design fundamental. Make sure to avoid minimal differences in typography for visual designs, like on websites and posters. This includes weights, sizes, and different font families.</p><p>If you’re using different weights for a title and a paragraph, an example would be to use 400 and 700, not 400 and 500. For different sizes, I would advise at least doubling between emphasized text like headers and text. High contrast is decisive. Small contrast is arbitrary and boring.</p><p>Notice the contrast in font sizes between the main heading, list items, and paragraph text on this example poster for Vercel’s Geist Typeface. Each is about half the size of the last, creating a clear hierarchy and visual con</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQRaSHck8krTJ_RioABVvQ.png" /><figcaption>Poster Showcasing Type Contrast (by Vercel)</figcaption></figure><p>There are of course exceptions depending on the use cases. Like on blogs, where many large headings can be overwhelming, you might want to use a smaller contrast and compensate with color or weight.</p><h3>Know Your Type Classifications</h3><p>Understanding typeface groups and the styles they suit is the first step in choosing the best fonts for a project. Three important umbrella terms are Serif, Sans Serif, and Monospace. Each has subclasses. Here I’ll just give a general overview but I would advise looking into each classification more deeply.</p><h4>Serifs</h4><p>Serifs have, well, serifs. They are the tail-like accents on characters. These are generally more traditional and professional. You’ll find these fonts used in a lot of traditional brands where trust is important, like banks. They are also used for the body text of most long books because some serif fonts can be particularly easy to read at small font sizes because of their accents.</p><p>Two subclasses to know are Modern Serifs and Humanist Serifs. Modern serifs have very high stroke constrast and thin, blocky serifs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtFrBEvZOGiJTMq6NRMohw.jpeg" /><figcaption>Bodini, a Modern Serif</figcaption></figure><p>Humanist Serifs have less stroke contrast and more closely resemble human handwriting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-Nt3_JXPhY5PcgSmZ23Mg.jpeg" /><figcaption>Source Serif 4, a Humanist Serif</figcaption></figure><h4>Sans Serifs</h4><p>As per the name (sans is French for without), these are fonts without serifs. This is the typical font style for most websites and apps. They are generally more modern and clean. Two subcategories are Transitional Sans Serifs and Geometric Sans Serifs.</p><p>Transitional Sans Serifs have some cursive elements like more subtle stroke contrast and a tail on the lowercase a.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZ2S-yxUbtM9Iq6lbyesNg.jpeg" /><figcaption>Helvetica, Transitional Sans-Serif</figcaption></figure><p>Geometric Sans Serifs are based on geometric forms like circles and triangles. Letters like v more closely resemble a triangle and the o is a perfect circle. They convey a very modern and industrial aesthetic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_IO7N7YuyrL9hRCWmWE-Q.jpeg" /><figcaption>Futura, a Geometric Sans Serif</figcaption></figure><h4>Monospace</h4><p>Each character in a monospace font is the same width. This makes them great for counters, clocks, and tables — or wherever width needs to be maintained across varying characters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5tIuvTkIESwyjgvVw8Kuw.jpeg" /><figcaption>Roboto Mono</figcaption></figure><p>Some sans-serif fonts even have a superfamily that includes a matching mono font. <a href="https://vercel.com/font">Geist designed by Vercel</a> is an example of this, being broken into Geist Sans and Geist Mono.</p><h3>Pay Attention To Leading</h3><p>Leading, or line height, is the amount of space between lines of text and plays a large role in the readability and aesthetics of text. As a general rule of thumb, the fewer characters in a line of text, the less line height you want. Larger leadings make it easier for the eye to find new lines of text, but on short lines of text, too much space can look strange.</p><p>Leading also plays a large role in the style of a design. A small leading makes a design more dense and containerized, making each block of text a coherent element. A lot of leading makes a design more airy and open, with each line of text starting to look like an independent element of the page. Think about the type of design you want to create and adjust the leading accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0R3Q-mpL5cM2pS69sUVR8w.jpeg" /><figcaption>Large Leading (210%)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gox1XbF3idjcCQuoVHjGQ.jpeg" /><figcaption>Tight Leading (120%)</figcaption></figure><h3>Adjust Tracking And Leading For Headings</h3><p>The tracking of a font, or the standard space between characters, is usually optimized for a standard reading size of around 16px. When you blow that text size up for large headings the tracking is often wide and the headings don’t feel clean. I usually drop the letter spacing to around -0.03 em for large headings. Play with this value depending on the heading size and the font until you get something that looks right to you.</p><p>Headings also generally demand less leading for the same reasons they require less tracking. And on particularly large headings and fonts, you might want to lower j and i dots as they can start to look too far from their stems. I usually don&#39;t go this far on most headings but it makes sense on posters where squeezing the most out of each detail is feasible.</p><p>For example, here is a default heading:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zV3naDCDyIXs08G-_uBAhw.jpeg" /></figure><p>This can work for a variety of styles but the line height and tracking is often too much, especially when paired with smaller text. Here is an adjusted heading with reduced tracking and leading:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uwrNYfTgBn2-Mwv_cCYePA.jpeg" /></figure><h3>Contain Paragraph Widths</h3><p>Sometimes called the measure, the width of a line of text is one of the most important but simple considerations. Long lines of text look unprofessional and are hard to read because your eye has to scan a farther distance to find the next line of text, making it easier to miss the correct next line.</p><p>A good rule of thumb is to set a max width of around 75 characters. Take a look at any book, popular website site, or newspaper and you’ll see this rule in action.</p><p>Here each line has 120 characters, which is usually too many:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHenG0GFCVQv39bGl6vJag.jpeg" /></figure><p>Let’s tighten this up a bit. Here each line has 69 characters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IiaFfqynNNpTioZHBpJusA.jpeg" /></figure><h3>Small Text Needs Large X-Heights</h3><p>The X-Height of a font is the imaginary line that lowercase letters are drawn to. Text with large x-heights is more readable at smaller font sizes and looks fuller because characters have less white space.</p><p>Some examples of high x-height fonts are Helivitca and Inter. Large x-height fonts also look more full and appear darker. Take this into account with your intended designs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kh_Wq8Dp-S32NohiA6kB0A.jpeg" /></figure><p>An example of a small x-height is Baskerville. Notice how it’s harder to read at this size than Inter. Small x-height fonts are generally intended for headings and larger text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCcqTEHwg54uSa8gdVVZhw.jpeg" /></figure><h3>Don’t Tolerate Orphans</h3><p>Orphans are single words or a very short last line of text of a paragraph. It’s easy to account for these in static designs with subtle size and wording changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*hrdQO3O45v673BR3o6drtg.jpeg" /></figure><p>For responsive designs like on websites, you can use CSS properties like text-wrap: pretty on important lines of text like headings to force better text balance. This is a pretty slow algorithm and doesn&#39;t work on long paragraphs so use it only when needed.</p><h3>Lighten Up Paragraphs</h3><p>If you spend a lot of time looking at websites you might notice that paragraph text is rarely fully black or white. Instead it’s usually an offset back or white, something like rgb(30, 30, 30). This makes long text softer on the eyes and easier to read.</p><h3>Use Various Heading Styles</h3><p>To create more contrast in designs, a standard list of styles you can apply to text to build contrast are:</p><ol><li>Uppercase captions</li><li>Framed captions or tags</li><li>Italics for emphasis</li><li>Color offsets</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41i4bH9pm2gnICXO-fl88w.jpeg" /></figure><h3>Use “&amp;” Appropriately</h3><p>Use ampersands for headings and text where space is limited, like captions. Use and in paragraphs where space is more freely available. Don&#39;t use &amp; in body text.</p><h3>Hang Punctuation</h3><p>This one is simple. Make sure you hang your quotes so they don’t eat into paragraphs and leave unappealing white space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEm6zwlUosMllFJTAVrq8A.jpeg" /><figcaption>Quotes disturb crisp left-edge (Bad)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xDoh-LM6S6X1gzDWWFAEOA.jpeg" /><figcaption>Quotes hang off the edge (Good)</figcaption></figure><h3>Make Use Of Non-Lining Numerals</h3><p>A lot of people are surprised to learn there are two different figures for each numeral in a lot of fonts, particularly in serif fonts.</p><p>One type is called Lining Numerals which is the type most people are familiar with. They all are mono-spaced so they take up the same width and are the height of capitals. They were developed so tables of numbers took up the same width.</p><p>The second type called Non-lining Numerals (sometimes called Old Style) are variable width and sometimes descend below the baseline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SacZdIVlzQshbOAq9un68Q.jpeg" /></figure><p>Lining numerals can look quite invasive in running text, especially if a lot of numbers are used. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u1psHOI9NyW0nlDR-D7HiA.jpeg" /></figure><p>Non-lining numerals generally look better in running text like the characters are less intrusive and look more organic. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxhGmNjQpwE31mQif-QAbA.jpeg" /></figure><p>Thanks for reading and I hope you’ve found some of this helpful. If you want to chat further, you can connect with me on <a href="https://twitter.com/SeanGrindal">X</a> and ready more of my writing on <a href="https://seangrindal.com/">seangrindal.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcbfe72960f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Container Media Queries in Tailwind CSS]]></title>
            <link>https://medium.com/@sean37gl/using-container-media-queries-in-tailwind-css-ffe7353edb2a?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffe7353edb2a</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-design]]></category>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Fri, 10 May 2024 19:05:14 GMT</pubDate>
            <atom:updated>2024-05-10T19:05:14.422Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*iWCd-yN3FrYQlLeHe_Wq2A.gif" /></figure><p>Container media queries are now widely supported. If you’re not familiar with them, they allow you to apply CSS styles based on the size of the parent container instead of the viewport. This is especially important when building reusable components that rarely depend on the viewport size but instead on some parent container like a modal or card.</p><h3>How Container Queries Work</h3><p>To specify a reference container you can use the container-type property in CSS. Then children can use the @container media query to apply styles based on the container size. That looks like this:</p><pre>&lt;div className=&quot;resize-container&quot;&gt;<br>  &lt;div className=&quot;my-component&quot;&gt;<br>    &lt;!-- content here --&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><pre>.resize-container {<br>  container-type: inline-size;<br>}<br><br>.my-component {<br>  @container (min-width: 800px) {<br>    // styles here<br>  }<br>}</pre><p>A simple use case could be to size text more responsively based on the parent container, or make a more responsive profile icon component.</p><h3>Use With Tailwind CSS</h3><p>Tailwind doesn’t natively support container media queries at the time of writing, but there are plugins that can help. One such plugin is <a href="https://github.com/tailwindlabs/tailwindcss-container-queries">tailwindcss-container-queries</a>.</p><p>To use it, first install the plugin:</p><pre>/* tailwind.config.js */<br><br>module.exports = {<br>  // ...<br><br>  plugins: [require(&quot;@tailwindcss/container-queries&quot;)],<br>};</pre><p>Now you can use container media queries in your Tailwind CSS. First, add the @container class to the container you want to use as the reference. Then for any children you want to style, instead of using the normal media queries like md:text-lg, you can use @md:text-lg to apply styles based on the container size.</p><pre>&lt;div class=&quot;@container&quot;&gt;<br>  &lt;p class=&quot;@[16rem]:text-sm @sm:text-base text-xs&quot;&gt;...&lt;/p&gt;<br>&lt;/div&gt;</pre><p>You can also name containers for more specific targeting:</p><pre>&lt;div class=&quot;@container/main&quot;&gt;<br>  &lt;div class=&quot;@lg/main:underline&quot;&gt;...&lt;/div&gt;<br>&lt;/div&gt;</pre><h3>Full Example</h3><p>For more context, here’s a profile icon example build using Tailwind CSS in React.</p><pre>&lt;div className=&quot;@container flex items-center gap-3&quot;&gt;<br>  &lt;div className=&quot;@[16.5rem]:h-12 @[16.5rem]:w-12 border-mono-4 bg-mono-4 relative h-10 w-10 shrink-0 overflow-hidden rounded-full border&quot;&gt;<br>    &lt;Image<br>      src=&quot;/profile.jpeg&quot;<br>      alt=&quot;Profile picture&quot;<br>      layout=&quot;fill&quot;<br>      sizes=&quot;100px&quot;<br>    /&gt;<br>  &lt;/div&gt;<br>  &lt;div className=&quot;flex w-full items-center justify-between gap-6&quot;&gt;<br>    &lt;div className=&quot;flex flex-col&quot;&gt;<br>      &lt;p className=&quot;text-pretty text-base font-bold !leading-[1.2]&quot;&gt;<br>        Sean Grindal<br>      &lt;/p&gt;<br>      &lt;p className=&quot;@[16.5rem]:block text-mono-2 hidden text-xs leading-[1.1]&quot;&gt;<br>        Software Engineer at Company<br>      &lt;/p&gt;<br>    &lt;/div&gt;<br>    &lt;div className=&quot;@[20.5rem]:block hidden pr-4&quot;&gt;<br>      &lt;a target=&quot;_blank&quot; href={`https://x.com/seangrindal`}&gt;<br>        &lt;Icon icon=&quot;x-social&quot; height={16} /&gt;<br>      &lt;/a&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Thanks for reading and I hope you learned something useful. If you want to chat with me further, you can connect with me on <a href="https://twitter.com/SeanGrindal">X</a> and follow my writing and work on <a href="https://seangrindal.com/">seangrindal.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffe7353edb2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to leverage ChatGPT’s new JSON mode to build better user experiences]]></title>
            <link>https://medium.com/@sean37gl/how-to-leverage-chatgpts-new-json-mode-to-build-better-user-experiences-db8f6963f608?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/db8f6963f608</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Wed, 15 Nov 2023 02:45:56 GMT</pubDate>
            <atom:updated>2023-11-15T02:59:56.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_NlUtEfBwe-jVKMVX1oOQ.jpeg" /></figure><p>With OpenAI’s first developer conference came a new feature for ChatGPT: <a href="https://platform.openai.com/docs/guides/text-generation/json-mode">JSON Mode</a>. If you’re interested in building powerful AI tools you need to be leveraging this new powerful feature.</p><h3>Motivation — Why JSON is better</h3><p>In my experience, JSON response are objectively better than regular string responses for almost every application.</p><p>Let’s demonstrate this with the example of a language-translation app. First, let’s ask ChatGPT a standard translation question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rTaD14P5EzYXIlHuM138Q.png" /></figure><p>This response is pretty good, but it’s not ideal. It’s not easy to skim, and it also doesn’t offer any extra functionality. For example, how do I correctly pronounce <strong><em>Konnichiwa</em></strong><em> </em>anyways? And what if I want to use this response to create a flash card for future review. With this format I’d have to copy sections of the response into some other parts of my potential application manually.</p><p>Yet, this certainly doesn’t need to be the case. The above response is just stringing together four discrete bits of data with natural language:</p><ol><li>The initial phrase</li><li>Romanized translation</li><li>Translation in Japanese writing</li><li>Extra Context</li></ol><p>Considering this is the the only information I care about, ideally the response should just look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nooNDiou0Xi7yidxOwlAbg.png" /></figure><p>Better yet, we aren’t limited to just one response format. In my experience, the newly released GPT-4 Turbo can reliably choose which prompt-specified JSON formats is best for the current question. You can then leverage those different formats for different questions styles.</p><p>So now let’s say we are going from Japanese → English. We can force the response into a similar but slightly different format:</p><ol><li>The initial Japanese phrase</li><li>English Translation</li><li>Extra Context</li></ol><p>That could look like the following on the frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMVTCf_zmiG_fyCti8XxkA.png" /></figure><p>These same benefits can apply in parts to almost any possible application, because the basic principles of what’s going on here continue to apply.</p><blockquote>Most language model responses are a combination of some useful data with a bunch of natural language junk tossed in. JSON allows a developer to cut out all the garbage and just show the data the user wants in an optimized format.</blockquote><p>This formatted data can then also be used for other purposes in the interface, like performing additional operations of sections of the response. With this above response as an example, I can add one button to my application that turns this response into flash card. It can do that because the data is already parsed. Overall, this pattern leads to much cleaner and powerful UX for interfacing with AI language models.</p><p>Finally, in the case a question doesn’t conform to our preset formats, we can always just fallback to a standard looking response, losing nothing in the process.</p><p>Now that the motivation is out of the way, let’s talk implementation.</p><h3>Backend</h3><p>First we need to our language model to respond in only JSON. For the article I’m going to be using the GPT 4 Turbo. We can do that with the following config.</p><pre>const response = await openai.chat.completions.create({<br>  model: &#39;gpt-4-1106-preview&#39;,<br>  stream: true,<br>  response_format: {<br>    type: &#39;json_object&#39;,<br>  },<br>  messages: [...]<br>});</pre><p>Next we need to feed the model a prompt that tells it what JSON formats to enforce. The following is an example prompt that specifies formats for different cases.</p><blockquote>You are a Japanese tutor and will be helper users answer questions about Japanese. You will have a few formats to respond with but you will always respond in JSON.</blockquote><blockquote>If the user asks you to translate something into Japanese, you will respond with JSON keys “type”, “phrase”, “romaji”, “kana”, and “context”.For example, you will use this format if the user asks “How would I say “hello” in Japanese?”. The “type” key will always be “to-japanese” for this kind of response.</blockquote><blockquote>If the user asks for you to translate Japanese into English, you will also respond in JSON, but with only have keys “type”, “phrase’, “translation”, and “context”. For example, use this format if they ask quesitons like, “What does o-genki desu ka?” mean. The “type” key will always be “to-english” for this kind of response.</blockquote><blockquote>If a user asks you any other general question that doesn’t fall into the above categories, respond in JSON with just the “types”, and “answer” keys. For example, if they ask, Can you please explain the “wa” particle to me, you will respond in this format. The “type” key will always be “general” for this kind of response.</blockquote><p>Pay close attention to the last case, which acts as a backup. On the frontend we can then use whatever display format we choose by reading the type and changing the UI component accordingly.</p><p>This format expands to an arbitrary number of cases and formats. Note that this prompt is shortened for readability, in practice I would provide more examples and cases*. If you’re interested in writing good prompts, checkout <a href="https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api">OpenAI’s tips</a>. Prompts are powerful so you want to get them right.</p><p>Now we have a bit of a problem. JSON mode <strong>only</strong> ensures that the <strong>final response</strong> will be parsable JSON. However, the JSON response is streamed just like any regular string response, so it won’t always be valid JSON. It might sometimes look like the following.</p><pre>`{&quot;fruit&quot;: &quot;tangerine&quot;, &quot;origin&quot;: &quot;United Sta`</pre><p>That means we can’t parse the JSON with a simple JSON.parse() until the entire response has been received. This is obviously less than ideal, but solving for this isn’t much trouble. For now let’s pass the response onto the frontend, and solve this there.</p><h3>Frontend</h3><p>Now that we are receiving our incomplete JSON strings, we need to parse it into usable data. We can do that using a function capable of converting incomplete JSON strings into a valid objects. In code:</p><pre>const incomplete = `{&quot;fruit&quot;: &quot;tangerine&quot;, &quot;origin&quot;: &quot;United Sta`<br>const usableData = parse(incomplete)<br>console.log(usableData)<br><br>/* <br>{<br> fruit: &#39;tangerine&#39;,<br> origin: &#39;United Sta&#39;<br>}<br>*/</pre><p>Then we just run that parse function on every AI stream update. Writing this function is non-trivial so I’m using an NPM package wrapped with my own fallbacks which works well for this purpose. You can find that <a href="https://www.npmjs.com/package/best-effort-json-parser">parsing package here</a>.</p><p>Great, now we have usable data! Finally we can then support each of the following cases in the frontend from the different type values of the parsed response object. Just make sure sure to provide fallbacks incase the JSON can’t be parsed or the type key isn’t present.</p><p>To see the parsing in action, I spun up a Japanese learning app which uses the examples discussed here, called <a href="https://lingoza.io/">Lingoza</a>. Check it out and you should see the different JSON formats get parsed live.</p><p>Thanks for reading and I hope you’ve find some of this helpful. If you want to chat with me further, you can connect with me on <a href="https://twitter.com/SeanGrindal">Twitter</a>.</p><p>Happy building!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db8f6963f608" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My pragmatic approach to learning Japanese for travelling in Japan]]></title>
            <link>https://medium.com/@sean37gl/my-pragmatic-approach-to-learning-japanese-for-travelling-in-japan-963b8bcb1fef?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/963b8bcb1fef</guid>
            <category><![CDATA[travel-tips]]></category>
            <category><![CDATA[japanese]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[language-learning]]></category>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 00:00:40 GMT</pubDate>
            <atom:updated>2023-10-25T14:37:45.337Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_K-ObmlIbZzUqGbd6dAoQ.jpeg" /><figcaption>Tori Gates</figcaption></figure><p>I recently spent 10 weeks in Japan this summer. I went in wanting to learn basic Japanese to make the experience more enjoyable.</p><p>I was joined by one of my friends who loves learning languages. He speaks 5 romance languages and picked up conversational Korean in 3 months, so I naturally asked him for stragies.</p><p>His advice was to always focus on learning a foundation of words and phrases that would consistently be used in common situations. Think phrases like <em>“I’d like to have this”</em>, <em>“I don’t need that, thank you”</em>, <em>“Could I have some water”</em>, and so on. This is pretty straightforwards advice, and yet it’s all to easy to overlook.</p><p>I spent every year from grade 4–9 taking a mandatory French class and yet I can speak no real French. If you’ve taken language classes in school you probably know the reason — the classes don’t focus on practical communication. You memorize lists of verbs, conjugations, and numbers, but never use the language in context or to solve a real problem. This doesn’t work because language is a means to convey a real message.</p><p>This is the core issue with language courses like Duolingo. The courses contain many words and phrases that aren’t immediately useful like “doctor”, “teacher”, “brother”, etc. You also can’t choose what words or phrases you want to learn. Everyone has different situation when travelling and will want to say different things so being able to create your own list of phrases is a necessity.</p><h4>My Process</h4><p>I took my friends advice and it was easy to start with the core basics like “hello”, “thank you”, “please”, but I soon found myself wanting phrases for specific situations that weren’t so straightforward, like:</p><ul><li>How do I ask for less sugar in my coffee?</li><li>What are the common phrases a cashier uses to ask if you want a bag?</li><li>How do I politely decline an offer?</li></ul><p>At first I tried googling the questions, but they were usually too specific to get solid answers. Google searches for Japanese phrases are crowded by low-quality blogs optimized to rank highly in search results that rarely answer your specific questions.</p><p>After some looking around I generally found that the best way to answer these types of questions was to ask AI language models (like ChatGPT), which turn out to be surprising good at Japanese translation and could answer questions for specific situations with more depth and explanation than any traditional translation apps. However, there were no apps where I could quickly answer these questions and then save them for future reference, so I ended up having to re-ask the same question multiple times.</p><p>To make the steps easy, I built an app for myself which I ended up using throughout my time in Japan. <a href="https://lingoza.io/">You can use it for free here</a>.</p><p>My process was simple. I would anticipate encounters during the day and ask questions relating to the situation, or I would think back on previous encounters and what phrases might have been useful. I would then save whole phrases or words for review later. Those saved phrases can be skimmed in a list and they are automatically turned into flash cards if you want to increase your retention. Those flash cards use something called <a href="https://en.wikipedia.org/wiki/Spaced_repetition">spaced repetition</a>, which the same algorithm Anki uses if you’re familiar.</p><p>I was pleasantly surprised how often the simple words and phrases I knew could be used to handle most situations I came across. It felt extremely rewarding to communicate in real Japanese with such little time spent learning.</p><p>If you learn language out of practicality and necessity, it’s much easier to remember, and far more enjoyable. If you want to give it a go, you can create an account on <a href="https://lingoza.io/">Lingoza</a> with Google. If you don’t know where to get started, checkout some <a href="https://lingoza.io/classroom">basic blog posts on Lingoza with some phrases I found useful</a>. You can save any phrases directly to your profile from the articles.</p><h4><strong>Don’t you need more guidance than this to learn a Language?</strong></h4><p>Well it depends what your goals are. If your aim is real communication in the shortest time possible, learning specific phrases for common situation is far more time efficient.</p><p>If you want to learn a language to fluency, then some more structure is always a good idea. If you’re learning Japanese seriously, I would suggest checking out <a href="https://learnjapanese.moe/">https://learnjapanese.moe/</a>, it’s a great resource that has helped many learners reached fluency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=963b8bcb1fef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calming Shinto shrines among a bustling machine]]></title>
            <link>https://medium.com/@sean37gl/calming-shinto-shrines-among-a-bustling-machine-d7bc53290042?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7bc53290042</guid>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Thu, 20 Jul 2023 05:55:14 GMT</pubDate>
            <atom:updated>2023-12-04T04:26:13.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YM16ziDhj8CDx_oSz826g.jpeg" /><figcaption>Sky shot of Tokyo Tower</figcaption></figure><p>I’ve wanted to visit Japan since fifth-grade. I grew up as a huge anime fan and viewed the country as this mystical place. The feeling was heightened in grade 6 when one of my friends’ dad got a job in Japan. He moved there for the year and I remember him coming back with stories of the foreign country, talking about foods like Wasabi and ramen, detailing the frequent earthquakes and idyllic nature. He even brought back strange Kit-Kat flavours that were only available in Japan. It all seemed magical.</p><p>In grade 10 I started planning a serious two-week graduation trip to Japan with 2 of my best friends. We outlined budget, the things we’d do, and I dreamed about the summer after grade 12 when I’d get to visit. That was until Covid hit and Japan closed it’s borders for almost three years.</p><p>This year that changed (2023), and Japan opened back up to the world. I knew I was going to be spending my summer there even though I hadn’t thought much about what I’d being doing.</p><p>One morning I was grabbing coffee with a friend who advised me to look into the Cansbridge Fellowship, a $10k scholarship program for Canada students to experience a self-organized internship in Asia. I applied and after three rounds of interviews I was selected as one of 26 other 2023 fellows.</p><p>The Fellowships starts the summer with a week-long bootcamp in SF — you get to meet the rest of your cohort, meet senior fellows, and tour Silicon Valley. It acts a good initiator to the summer. You get to share plans with the other fellows and get advice for what’s to come.</p><p>Straight from the bootcamp I hopped on a flight to Tokyo. The first things I noticed upon arrival was the contrast between SF’s and Japan’s public infrastructure. SF’s train stations were decrepit. More than half the ticket machine were broken, paint peeled off the walls, and cigarets filled the station platforms. Trains were never on time and it was a headache getting anywhere.</p><p>In contrast, Japan’s transit was a machine — thousands of people going about there daily commutes congregating in orderly lines to board. The stations were pristine and in perfect working order with dozens of backup routes if you missed your train. Everything was on time to the second and functioned like one big dance, every actor doing exactly what they needed to when it was needed.</p><p>I soon found that efficiency transcended just the subway — there were sushi restaurants with tablets to order and conveyor belts to bring your food, bullet trains that zip you across the country on 5 minutes cycles, and vending machines of every kind on every block corner. Even among the crowds of thousands, everything seemed orderly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_3HAhCuT8T6bubgw54j5Q.jpeg" /><figcaption>Orderly chaos: Shibuya Crossing (busiest crossing in the world) — near where I stayed in Tokyo.</figcaption></figure><h3>A culture of contrast</h3><p>After a few weeks what I came to find most interesting and endearing was the many juxtaposed aspects of the country.</p><p>You can be walking in a bustling downtown centre — lights flashing around you, sirens going off, crowds of people wiring past you — just to come across a shrine sheltered away off the main road, surrounded by trees and framed by a red Shinto gate.</p><p>As you enter it’s as if all the noise around you quickly fades, leaving you in a bubble of tranquility. You look up to the bright summer sun beating down on your neck, to your left is small waterfall gently wishing over shimming rocks, and to your right is an elderly man resting on a bench surrounded by bright green leaves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cGacHPUTh_XWp6hHuSc6gw.jpeg" /><figcaption>A shrine in the middle of Tokyo next to my apartment</figcaption></figure><p>Then you walk back out through the gate and the buzz of the city hits you once more.</p><p>You can see this contrast in other areas as well. Take cash, for example. In Canada I never carry cash. I can be pretty confident anywhere I go in the city will take card or Apple pay. But in Tokyo I don’t have that luxury. Many restaurants don’t take card, and it’s actually considered rude to assume that they do. You would think that such a technologically efficient country would have pivoted from cash as soon as possible — but I guess not.</p><p>Japanese people also seem to be very reserved and polite. From what you usually see, they take great lengths to avoid disturbing or insulting the people around them. But then you walk into an Izakya (a Japanese bar) and the atmosphere just explodes — people are yelling while hammering down boos, all crammed elbow to elbow into this often very small restaurant. I distinctly remember a friend I was travelling with say, “Wow, I guess Japanese people aren’t always reserved after all”.</p><p>As strange as this may sound, I like things to be unpredictable in a predictable way. That is to say I want things in my everyday life, like the subway, to be efficient and just work. But occasionally I want to come across something that doesn’t quite fit — an event or scene that breaks the tone and mixes things up — to keep life exciting. A world without contrast or surprises is just dull. So be like Japan — embrace contrast where you find it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7bc53290042" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The future of creator communities — empowering fans through identity and ownership]]></title>
            <link>https://medium.com/@sean37gl/the-future-of-creator-communities-empowering-fans-through-identity-and-ownership-471b7dbc5dda?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/471b7dbc5dda</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[community-engagement]]></category>
            <category><![CDATA[youtube]]></category>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Thu, 19 May 2022 00:56:30 GMT</pubDate>
            <atom:updated>2022-05-19T00:56:30.308Z</atom:updated>
            <content:encoded><![CDATA[<h3>The future of creator communities — empowering fans through identity and ownership</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XAkT4fhKQlstJddp" /></figure><blockquote>The creator economy is in the midst of a decisive shift — from a “bigger is better,” ad-driven revenue model to one of niche communities and direct user-to-creator payment” —<a href="https://li-jin.co/2020/02/19/100-true-fans/"> Li Jin</a></blockquote><p>The current creator economy is one characterized by passive consumption. For example, when was the last time you actively engaged with your favorite YouTubers, streamers, singer, and artists?</p><p>And I’m not talking about liking or commenting on a video, or retweeting a tweet. I mean <em>real</em> engagement: going out to shoot photos from your neighborhood for their thumbnails, vetting a video script, reaching out to a creator to suggest video ideas, parsing your network to find them the perfect editor.</p><p>If you’re like most fans and aren’t friends with creators, probably never.</p><p>For a Youtuber, fans contribute to the creator first and foremost by providing their attention. You watch ads, listen to brand deals, and contribute to their watch time so Youtube ranks their content higher.</p><p>More dedicated fans can also contribute with their money — donating on Twitch, subscribing on Patreon, or buying merch. These fans get ‘rewarded’ with a shoutout on a Twitch stream, a basic utility found in many Patreon tiers (like early access to content), or the good karma of supporting the content you enjoy.</p><p>This works well for some creators but remains passive and wasteful. Fans have so much more to contribute than just their attention and money. Content creators have often millions of people watching their content, all with unique networks, skill sets, viewpoints, and value to add. Why aren’t more fans directly helping a creator grow by assisting with content or solving their problems?</p><h4>Lacking rewards to incentivize fan participation</h4><p>I can suggest proposals for future content, or offer professional services to my favorite creators. But why should I? Maybe for a shoutout, maybe because I genuinely enjoy the content and want to give back, or maybe just because I enjoy doing so. These are all valid reasons for some in the community but are by no means enticing enough to galvanize thousands.</p><p>However, we are on the edge of a technological shift that can change this. Decentralized ownership, like what is enabled with NFTs, provides a new way to ‘own’ content on the internet and is the foundation of this shift.</p><p>You may know little about NFTs and be wondering how they come into play. So first let’s understand what exactly they are. At their core, NFTs are a digital proof of ownership that can be verified without any centralized corporation like a bank or tech conglomerate. An NFT is just a digital token that points to some data about what it represents. This data can be an image, a video, an IRL object like a Rolex, a piece of descriptive text, and the list goes on.</p><p>Using NFTs as membership cards to a group gives owners a stake in the community, that allows them to benefit when the creator (and group) succeeds.</p><p>The Bored Ape Yacht Club is the perfect example of NFTs being used to build both engaged and rewarding communities. For those unfamiliar, the ‘<a href="https://boredapeyachtclub.com/#/">BAYC</a>’ is a community where membership is facilitated by owning one of <a href="https://opensea.io/collection/boredapeyachtclub">10,000 uniquely generated apes</a>. Owners get to identify with their ape and receive access to private IRL parties, merch drops, discord servers, and more.</p><p>The uniqueness of the BAYC apes coupled with the fact that holders own them (which allows them to be traded and sold) created intense feelings of belonging. Because of this, members in the BAYC began using their apes as their Twitter profile pictures, gushing about the project to friends, attending IRL events, and creating directly for the community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttuLUlSv7tCCmiU1gpEEHw.png" /><figcaption>Examples of BAYC members engaging with the community.</figcaption></figure><p>This active participation has made the project one of the most successful community experiments of all time, with each ape now being worth more than $200,000 (their initial sale price was ~$300). When people look at the BAYC and can’t understand why anyone would ever spend this much money on a monkey picture, they are missing the point. The apes aren’t just JPEGs, they’re membership cards and status signals for one of the most exciting and exclusive communities of recent times. Members already include Justin Bieber, Serena Williams, Jimmy Fallon, Shaq, Post Malone, Neymar, Snoop Dog, and many more high-profile celebrities.</p><p>Original owners of these apes have not only been incentivized to participate in the community but they have also been rewarded by sharing in its success. The apes have increased drastically in price, and owners have been given free access to other adjacent NFT communities which have also been extremely successful (<a href="https://opensea.io/collection/mutant-ape-yacht-club">Mutant Ape Yacht Club</a>, <a href="https://opensea.io/collection/bored-ape-kennel-club">Bored Ape Kennel Club</a>, <a href="https://opensea.io/collection/otherdeed">The Otherside</a>, etc). This goes without mentioning that the original creators of the club have also done insanely well. They benefit from the increased price of their personal apes and get a small royalty on every second-hand sale.</p><p>It’s important to note that the extreme success of the BAYC resulted in part because it was one of the first NFT projects of its kind. But the fundamental principles behind its success still hold:</p><blockquote>By having ownership and an identity in a community, members are incentivized to participate, which leads to increased community success and rewards for all its members.</blockquote><p>Creators, which have some of the largest pre-existing communities on the internet, are prime for this same recipe. Artists, Youtubers, streamers, musicians, brands, and anyone with a substantial following can now create their own ownership-knit communities to drive participation.</p><p>The top fans of a creator can buy in through NFTs and own an IP of the creator&#39;s brand to gain an identity and stake in the community. This not only comes with the aforementioned benefits, but it also serves as a direct way to generate revenue for the creator. A membership for even just the creator&#39;s biggest 5,000 fans at a $200 entrance cost still nets the creator $1,000,000 of initial revenue (even without secondhand sale royalties).</p><p>Members of this exclusive community will not only be incentivized to increase the frequency of current participation — sharing content, commenting, liking, re-watching videos, gushing to friends — but are also more likely to increase the magnitude of services they’ll offer, like helping with editing or merch designs.</p><p>For the fans, membership can provide various utilities — free merch claims, invitations to IRL events, early access to content, and more. The way a creator chooses to reward their holders is entirely up to them. However, how they reward holders will directly impact the price of membership and the willingness of fans to contribute and remain in the community. Membership NFTs are, after all, subject to supply and demand since they can be freely sold and bought on platforms like <a href="https://opensea.io/">Open Sea</a>. This can be a careful balancing act that will come from experimentation, transparency, and direct discussions with the community.</p><h4><strong>A platform for interaction</strong></h4><p>The next step is to build out the infrastructure that facilitates the participation of community members. Fans shouldn’t just be wanting to help a creator, it should be easy for them to do it.</p><p>Currently, if I want to help a creator, I have to reach out through discord, Twitter, or maybe even email, with no clue if a creator will respond or not. This is inherently high friction, which it shouldn’t be.</p><p>It’s also not clear to fans how they can help creators. It’s not like they are broadcasting every time they can’t find an option in Photoshop, or can’t get a reservation at a restaurant for a video. This of course makes sense — why would creators want to fill their fan&#39;s Twitter feeds with requests for help and how would they be able to filter through the comments to find the people who can genuinely help.</p><p>In an ownership community, members could have exclusive access to a platform where creators regularly outline issues they are facing, ranging from small annoyances to major roadblocks. Fans can help directly solve these issues by suggesting proposals or reaching out through channels to solve the problem. Spam should be lower in gated communities, but there will still need to be validated mods to parse through and find the good stuff. And these mods can have higher levels of ownership in the community to incentivize this extra work!</p><p>But helping a creator directly is just the first step. Fans can through their own parties, organize their own networking events, etc.</p><p>To facilitate many more possibilities like this, communities need platforms tailored to these purposes that interact nicely with these new communities. That is the stage we are currently in — building the infrastructure to take full advantage of the ownership economy.</p><h3>Addressing NFT sentiment</h3><p>It is no secret that fans in the creator economy dislike NFTs. For many, even the mention of NFTs can result in backlash.</p><p>First, if you’re a creator or brand thinking about doing an NFT launch, you need to understand where these views come from and why they are held.</p><p>Earlier this year Discord CEO Jason Citron tweeted a screenshot of a potential NFT integration in the works. The subsequent backlash was so intense that discord had to announce the integration had no official plans of being pushed to live. A good percentage of the dislike follows a version of the two following responses.</p><p><strong>“They impact the environment”</strong></p><p>NFTs that run on Ethereum do use a lot of power. However, most people who use this as an argument rarely know there already exists NFTs where this isn’t a problem. Solana, which is the second most popular NFT blockchain as of writing, uses far less energy than Ethereum (more than 60,000x less). For perspective, minting an NFT on Solona uses <a href="https://solana.com/news/solanas-energy-use-report-march-2022">less energy than 11 google searches</a>. NFT communities don’t need to use a lot of power if the creator chooses.</p><p><strong>“It’s a scam and they’re worthless (so it must be a Ponzi scheme)”</strong></p><p>People think NFTs are a scam because they don’t understand their underlying value. It can be hard to see how an ape picture can be worth a million dollars.</p><p>Many also can’t understand why you would ever ‘own’ an online image when anyone can look at it. This is missing the point. I can look at the Salvator Mundi by Leonardo de Vinci (which sold for $450 million) without owning it. But I don’t receive the status, exclusive access to events, the potential to make money through its increasing popularity, or the history that owning it comes with.</p><p>The value behind NFTs follows the same principles that define the value of everything in our society. NFTs are scarce, provide status, offer the potential to make money, and carry utilities that are valuable to millions of people.</p><p>It is also a misconception that all NFTs are worth insane amounts of money. This is just an example of selection bias in action. You don’t hear about the NFTs that sell for $4, just as you don’t hear about the real-life painting that sells for $4 — you hear about the outliers, and the outliers often incite outrage by their very nature.</p><h4>How to build an NFT community without backlash</h4><p>NFT hate is mostly fueled by a lackluster understanding of the space, so it follows that community sediment can be altered with transparency and a determined willingness to explain a project’s true intentions.</p><p>There are multiple ways to go about this. Ease your community in with tweets that test the water, start by targeting the crypto native audience who already know the space, demonstrate that you understand what you’re doing and aren’t just in this for a quick cash grab, donate a portion of the proceeds to charity, and so on.</p><h3>A promise for much more</h3><p>What I find most exciting about new software and technology is they never just change how we consume content — they fundamentally change what type of content is possible.</p><p>When the internet came around, you no longer need to buy air time on a channel. You could just pick up your camcorder, shoot a home video, and upload it to the internet. If that content was good, people could come to watch it. And if it was really good, they would tell their friends to come too. Youtube was built on this model. You didn’t need a team of makeup artists, a design crew, or huge studio cameras — you just needed an idea and a passion to create something.</p><p>In other words, with the advent of the internet, we didn’t just keep watching the same old cable TV shows. It gave rise to almost countless new forms of content: vlogs, video game commentary, reaction videos, low-budget animation, performance skits, educational series, and much more.</p><p>The very fact that the internet and Youtube exploded content possibilities makes it exciting to think about what innovations are on the horizon that could do the same.</p><p>I think the ownership economy is that.</p><p>Consider the scale of a Mr. Beast video and what he can pull off. He can do his crazy videos only because of the teams of people that are all working to help him. Now imagine if this was commonplace and our communities of thousands (often millions) were incentivized to help.</p><p>On a lesser scale, fans are simply more engaged to buy more merch, like videos more regularly, share more content with friends, and rep their brand in public.</p><p>On a grander scale, fans can build props for videos, help with CGI, provide professional direction, help with editing, and develop games around membership NFTs. They can make merch for the community, throw parties, and help organize creator meetups. They can lend their studio-grade gear to creators, come up with their ideas for new content, and more.</p><p>Over the next decade, we can incentivize our fans to create bigger, better, and more diverse content. We can cultivate a space where everyone is rewarded when a creator succeeds. And we can allow creators more financial freedom so they don’t need to rely on brand deals or advertisements.</p><p>This is what an ownership-driven community can create. Now we just have to build it. Developing new infrastructure is always difficult, and it doesn’t help that most people hate NFTs. But hardly anything worth doing <em>is</em> simple and almost all technology capable of radical change is controversial in its early stages. Even the internet had its haters and doubter <a href="https://www.newsweek.com/clifford-stoll-why-web-wont-be-nirvana-185306">(for years even the top professionals in the space saw it as nothing but a fad)</a>.</p><p>We need to remember that <em>all</em> innovation comes from those who push through controversy to try and create something new and better. We can sit on the sidelines and wait, or be bold and forge the path to a better future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=471b7dbc5dda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easily Create an Interactive Custom Cursor With JS — Custom-Cursor.JS]]></title>
            <link>https://medium.com/swlh/easily-create-an-interactive-custom-cursor-with-js-custom-cursor-js-8d296cbd9ac7?source=rss-a43e17b4de6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d296cbd9ac7</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sean Grindal]]></dc:creator>
            <pubDate>Sun, 11 Oct 2020 02:53:44 GMT</pubDate>
            <atom:updated>2020-10-14T23:14:11.560Z</atom:updated>
            <content:encoded><![CDATA[<h3>Easily Create an Interactive Custom Cursor With JS — Custom-Cursor.JS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*8DDMZzyjJHzOLEBl" /></figure><p>Before we dive in you can check out this simple live example of the type of custom-cursor I’m referring to.</p><p><a href="https://seangrindal.github.io/custom-cursor-example/">custom-cursor.js | example</a></p><p>The web is evolving at an incredible pace, yet the web cursor has remained unchanged for decades. I think it’s about time we not only add some flair to the cursor but also add to its UI capabilities.</p><p>However, simply because the mouse cursor has been a constant for so long, changing it up can be jarring and irritating to users if implemented incorrectly. But let’s not let that stop us! Let’s forge ahead and do it right.</p><p>I’ve implemented a lot of custom cursors in personal and client projects in the past few years. I initially imagined custom cursors as simply glorified divs forced to follow the user’s cursor — something easily achieved with the following few lines of code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ae8fdad99698623fced1f6808b4421b/href">https://medium.com/media/9ae8fdad99698623fced1f6808b4421b/href</a></iframe><p>Set your cursor to position fixed, style it up, and you are good to go if all you want is some added flair for your site.</p><blockquote>But a custom cursor can and <em>should </em>be so much more!</blockquote><p>Achieving a custom cursor that not only looks cool but adds to the user interactions in a seamless and intuitive way is much more difficult to implement and time-consuming to write from scratch across multiple projects.</p><p>I wrote <a href="https://www.npmjs.com/package/custom-cursor.js">custom-cursor.js</a> to help developers easily implement custom-cursors with interaction across the web.</p><h3>custom-cursor.js</h3><p>Let’s get started by installing the package.</p><pre>npm i custom-cursor.js</pre><p>Before we write any JS, we need to set up some basic markup and styles for our cursor to function correctly. As the custom cursor will be following behind our true cursor we need to make sure pointer events are disabled and user-select is turned off so we can still interact with the webpage. We also need to fix the element so it can move freely.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b3a6615e05a066b5c5a89fdb0a81d8b/href">https://medium.com/media/4b3a6615e05a066b5c5a89fdb0a81d8b/href</a></iframe><p>With the core styles ready to go, JS is up next! Import the package and initialize it with some basic options.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9f217a605d92d8d2273e7acbb535662/href">https://medium.com/media/a9f217a605d92d8d2273e7acbb535662/href</a></iframe><p>In the options object, focus-elements are an array of selectors that will apply the focus-class on hover. We then create a new CustomCursor class and initialize it right away. That sets up all our required event listeners and starts an animation frame loop that updates the cursor when we move our mouse.</p><p>Right now we don’t see the custom cursor because it has no visible styles — let’s add them now in a sub-element of the cursor.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f645170e743d296ed625ca6c9e8d4bb/href">https://medium.com/media/0f645170e743d296ed625ca6c9e8d4bb/href</a></iframe><p>If you are curious we style the sub-element to make use of the transform property — the wrapper’s transform property is being overridden on mouse move. Without transform: translate(-50%, -50%), the true cursor would sit at the top left of our custom cursor but we want it in the center.</p><p>But wait! We still need to add the interaction styles. A simple size increase on hover should do just fine for this example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb2e468b4f8d9ef8fdbf75ee683be78e/href">https://medium.com/media/eb2e468b4f8d9ef8fdbf75ee683be78e/href</a></iframe><p>With this, we have a functional custom cursor that has some basic UI interaction.</p><blockquote>But we can still do a whole lot better!</blockquote><h3>Let’s have a little more fun!</h3><p>Custom-cursor.js allows us to specify different focus classes and custom interactions for each different focus element. For example, we can apply ‘cursor — link-hovered’ when hoving links, and ‘cursor — button-hovered’ when hoving buttons.</p><p>Classes are also added to the cursor in the background which gives us some extra control. We are also exposed to .disable() and .enable() functions, allowing us to kill the cursor over specific elements if it gets in the way</p><ul><li>“cursor — initialized” (when initialized)</li><li>“cursor — off-screen” (when the true cursor has left window)</li><li>“cursor — disabled” (when the cursor has been disabled)</li></ul><p>Using everything above, here is an example that disables the cursor when hovering over images so it doesn’t get in the way.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58d8749fc09c7263a57507311c298586/href">https://medium.com/media/58d8749fc09c7263a57507311c298586/href</a></iframe><p>Check this example version out live:</p><p><a href="https://seangrindal.github.io/custom-cursor-disable-example/">custom-cursor.js | example</a></p><p>For more information check out the full docs on NPM. Enjoy creating your custom cursors!</p><p><a href="https://www.npmjs.com/package/custom-cursor.js">custom-cursor.js</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d296cbd9ac7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/easily-create-an-interactive-custom-cursor-with-js-custom-cursor-js-8d296cbd9ac7">Easily Create an Interactive Custom Cursor With JS — Custom-Cursor.JS</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>