<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Connor Tangney</title>
    <description>The latest articles on Forem by Connor Tangney (@couch3ater).</description>
    <link>https://forem.com/couch3ater</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F164506%2F713ac14b-cbd8-4b80-8e90-042d39a9f9b6.jpg</url>
      <title>Forem: Connor Tangney</title>
      <link>https://forem.com/couch3ater</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/couch3ater"/>
    <language>en</language>
    <item>
      <title>Another Javascript Event Calendar?...</title>
      <dc:creator>Connor Tangney</dc:creator>
      <pubDate>Tue, 01 Oct 2019 13:28:40 +0000</pubDate>
      <link>https://forem.com/couch3ater/another-javascript-event-calendar-496a</link>
      <guid>https://forem.com/couch3ater/another-javascript-event-calendar-496a</guid>
      <description>&lt;p&gt;Yes. &lt;em&gt;Another&lt;/em&gt; Javascript event calendar.&lt;/p&gt;

&lt;p&gt;"But Couch3ater... Why?! There are hundreds, if not thousands, readily available for you to use on the internet!"&lt;/p&gt;

&lt;p&gt;You're right. There sure are. That said, there are a couple reasons I decided that I wanted to go ahead and make yet &lt;em&gt;another&lt;/em&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A lot of the event calendars that support the features I am looking for come with some sort of pay-to-play model, offering a few of the features for free while only offering the "premium" features after paying a one-time or subscription fee. I can't stand these types of "Freemium" models.&lt;/li&gt;
&lt;li&gt;Many of the free event calendars that &lt;em&gt;do&lt;/em&gt; offer all the features I am looking for do not support the ability to apply custom themes, or even make basic color changes. Not altogether useful when I'm trying to drop a free component into a white-label website!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Rationality aside, let's just jump into it. As with any problem that I am aim to solve, I try to break things down into their core elements. At its most basic, an event calendar really only needs a few things to work and look good (at least in this implementation 😅):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data.&lt;/li&gt;
&lt;li&gt;A list view.&lt;/li&gt;
&lt;li&gt;A details view.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's start with the data.
&lt;/h2&gt;

&lt;p&gt;At the end of the day, unless you connect your calendar to some data, it's not really going to be that useful. In my case, this calendar is likely going to be communicating with a JSON document store, so for the sake of example, I will just have a smattering of &lt;code&gt;event&lt;/code&gt; data stored in an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;_EVENTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;PARK EVENT 1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2019/10/20&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Short description of the event here. Displays on event LISTING.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Longer, more verbose description of the event. Displays on event MODAL in the content body.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;park&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;img&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://placehold.it/150x150&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For the sake of brevity, I have only included one &lt;code&gt;event&lt;/code&gt; object, but that should be enough to give you a good idea of how I have structured my data. I am on the fence about adding an additional field labeled "thumbnail" that would allow users to upload a separate image to be used as the thumbnail for the event listing. Right now, the "img" field is used as both the listing thumbnail &lt;em&gt;and&lt;/em&gt; the modal header. Luckily, where I've spun this up myself, changing this is easily accomplished 😁&lt;/p&gt;

&lt;h2&gt;
  
  
  Now on to the looks.
&lt;/h2&gt;

&lt;p&gt;With a rough layout for my data hammered down, it was time to move onto the more exciting part -- designing the actual calendar! As someone who has used event calendars in the past, I have formed some opinions on what I like to see from them, namely that I hate the standard "calendar" view. Nowadays, when I see a calendar interface, my mind immediately defaults to &lt;em&gt;"Oh, this is a DatePicker,"&lt;/em&gt; and I find myself trying to select a range of dates. This is just my personal experience, but I'd be lying if I said it didn't impact my design choice. After all, you're looking at a list view layout, now aren't you?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--axJ5ub04--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Ve7APGB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--axJ5ub04--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Ve7APGB.png" alt="Calendar list view"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was necessary to also inlude a secondary view for the calendar in order to display the expanded details about the event. For this, I just went with a pretty simple modal that opens when a user selects the Learn More button. Through some black-magic trickery (also read: regex), information from the event data is pulled from the array by index...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R0n_8dSE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/hXsjLxB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R0n_8dSE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/hXsjLxB.png" alt="Calendar details view"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;eventId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;closest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;section.event-listing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;eventId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data-event-id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;eventId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\d&lt;/span&gt;&lt;span class="sr"&gt;+/g&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;eventListing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;_EVENTS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;eventId&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then dumped into the modal. You'll notice I'm subtracting one from my &lt;code&gt;eventId&lt;/code&gt; value. This is because my ID's are not zero-indexed. If I were to use this in a production setting, I would almost certainly normalize these indexes to reduce confusion, but for the time being, this footnote will have to be good enough to remind me! 😆&lt;/p&gt;

&lt;h2&gt;
  
  
  Tie it all together...
&lt;/h2&gt;

&lt;p&gt;Once I had everything mostly planned out, I set out to writing the code to make it all work. As I had set the foundations nicely, all I really needed to do was loop through my events and append a new child to the DOM for each one. I made it a goal to not use &lt;code&gt;innerHTML&lt;/code&gt; for anything because I mean, why should I be using that in the first place? Where I am not connecting this to an API for the moment, I won't go over how to fetch your data, nor will I go over any implementation of a "loading" state, but setting something like that up should be child's play if you comfortably read this far!&lt;/p&gt;

&lt;p&gt;If there's any interest, I can certainly do a quick write up of how I went about plugging this in to my current project and tying it to backend data.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/Couch3ater/cg74y032//embedded/result//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>html</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>So I made a website...</title>
      <dc:creator>Connor Tangney</dc:creator>
      <pubDate>Fri, 24 May 2019 00:26:10 +0000</pubDate>
      <link>https://forem.com/couch3ater/01so-i-made-a-website-4cop</link>
      <guid>https://forem.com/couch3ater/01so-i-made-a-website-4cop</guid>
      <description>&lt;h2&gt;
  
  
  hey there!
&lt;/h2&gt;

&lt;p&gt;I feel like I've been lurking around long enough. I've seen all these cool projects and have read all these cool articles and have decided -- "I want to do that too!"&lt;/p&gt;

&lt;p&gt;Now that we've got that out of the way, I'm just going to get right to it. This is my first post, so forgive me if it's a little rough around the edges!&lt;/p&gt;

&lt;p&gt;In sticking with the theme of beginnings, I felt that it would only be appropriate for me to share a little bit about the behind-the-scenes of my &lt;a href="https://cjtangney.me"&gt;homepage&lt;/a&gt;. I don't really have any screenshots (the page can speak for itself), so I'll try to keep things mostly to-the-point.&lt;/p&gt;

&lt;h4&gt;
  
  
  main goal:
&lt;/h4&gt;

&lt;p&gt;Place for me to &lt;em&gt;easily&lt;/em&gt; share and write about my work while also keeping track of my accomplishments as a developer. In honesty, this website was a bit of a departure for me for two main reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I have never published anything (literally, anything...) other than a digital resume...&lt;/li&gt;
&lt;li&gt;I have never published anything built with technologies that &lt;em&gt;weren't&lt;/em&gt; HTML and CSS...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That said, after lurking around here for a bit and seeing everyone talk about how important portfolio sites are, I figured I should probably have one too. But I didn't want to just stick something out there like, "Oh, hey, here's my stuff!"&lt;/p&gt;

&lt;p&gt;I wanted to learn something from this. I wanted it to be an adventure, like all the best things in life!&lt;/p&gt;

&lt;p&gt;When I sat down to think about the site, my main concerns were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy updates. I did not want to spend time fiddling about with various web services, hosts, etc. My existing site was published to GitHub Pages, and I very much wanted to leverage this again. I was not really all that keen to set up a backend somewhere to host my posts, so I had to come up with another solution.&lt;/li&gt;
&lt;li&gt;I wanted the site to be lightweight and performant across &lt;del&gt;all&lt;/del&gt; most devices and on &lt;del&gt;all&lt;/del&gt; most connections. I uploaded my mugshot up there in pretty high resolution, so the load time on that beast can be hit or miss. I've thought about compressing it down a bit but just... haven't? Hrmmm...&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  technologies:
&lt;/h4&gt;

&lt;p&gt;I wanted to keep the tech stack pretty small in order to ensure that things didn't get too out of hand. I can get a little carried away sometimes! Heh...&lt;/p&gt;

&lt;p&gt;I've outlined most everything I used to get this done below and have provided links so you can learn more if you're curious. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;: I think we all know about React 😊&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/axios/axios"&gt;Axios&lt;/a&gt;: This handles getting the data from the GitHub API&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/showdownjs/showdown"&gt;Showdown&lt;/a&gt;: This converts my Markdown to HTML&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pages.github.com/"&gt;GitHub Pages&lt;/a&gt;: This is where my site lives&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  how it works (in a nutshell...)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;In order to save myself the hassle (if you really want to call it that) of setting up a backend somewhere, I decided that I would just serve my posts as JSON directly out of the public directory. &lt;a href="https://github.com/cjtangney/cjt2019/tree/master/public/work"&gt;Take a look here&lt;/a&gt; to see what I mean. This would allow me the ability to serve posts directly out of the application. Neat.&lt;/li&gt;
&lt;li&gt;Once the application was published, I was still going to need a way to connect to the GitHub API and download the raw data. Axios seemed the perfect tool for this!&lt;/li&gt;
&lt;li&gt;After Axios gets the goods, it's all parsed out and passed off to various components so that I don't have to do any work to get a new page or card on my work listing. It all happens when the "post" is added to the public directory. Neat!&lt;/li&gt;
&lt;li&gt;For the posts themselves, I simply store some Markdown right in the JSON file so that I don't have to muck about with any real layout. The whole process is not too unlike what I'm doing right now. Neat-o burrito!&lt;/li&gt;
&lt;li&gt;Once I have everything all set in my public directory, I just push it all to my repo, and the changes happen automagically! Laziness prevails! Huzzah!&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  a note:
&lt;/h4&gt;

&lt;p&gt;Posts load in random order cause I was too lazy to enforce any kind of order for the moment. This is something I may address at a later date, but for the moment, the number of projects that I have listed is low enough that I feel it is unwarranted.&lt;/p&gt;

&lt;h4&gt;
  
  
  closing thoughts:
&lt;/h4&gt;

&lt;p&gt;So, I pretty much failed at keeping this short and sweet, but I feel like that's okay. If you've made it through my ramblings, I applaud you! I'd love to hear what you guys think about the layout of the site, what you think of my solution, and any areas that you feel I could improve in the future.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>intro</category>
    </item>
  </channel>
</rss>
