<?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>DEV Community: Sandbottle</title>
    <description>The latest articles on DEV Community by Sandbottle (@sandbottle).</description>
    <link>https://dev.to/sandbottle</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%2Forganization%2Fprofile_image%2F5198%2Fb309f2f8-8b0f-4a42-8929-d19cb659f8ef.png</url>
      <title>DEV Community: Sandbottle</title>
      <link>https://dev.to/sandbottle</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sandbottle"/>
    <language>en</language>
    <item>
      <title>How We Turn This Bootstrap Based Web Into a Pixel Game-Like</title>
      <dc:creator>manushifva</dc:creator>
      <pubDate>Sun, 23 Jan 2022 03:06:37 +0000</pubDate>
      <link>https://dev.to/sandbottle/how-we-turn-this-bootstrap-based-web-into-a-pixel-game-like-2o77</link>
      <guid>https://dev.to/sandbottle/how-we-turn-this-bootstrap-based-web-into-a-pixel-game-like-2o77</guid>
      <description>&lt;p&gt;Bootstrap is great for building your web. It's simple, fast, and has great mobile support. But, making your site too "bootstrapped" is not a good thing, especially if you are a pixel game studio.&lt;/p&gt;

&lt;p&gt;Let's take a look at this. This is our website's old display.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xij-bAwh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wieqhhcmy187e49cdc3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xij-bAwh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wieqhhcmy187e49cdc3c.png" alt="Our ye olde web's display" width="880" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks nice and clean. But, it has one big problem, too usual. It's a big horrible mistake for us who works in the creative industry (well, this is hyperbole).&lt;/p&gt;

&lt;p&gt;And, here's our new website's display.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--osy05VCO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8q6le6475puv2055b2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--osy05VCO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8q6le6475puv2055b2f.png" alt="Our brand-new shiny web's display" width="880" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not perfect, but we're proud of this shiny-polished new website.&lt;/p&gt;
&lt;h2&gt;
  
  
  Our quest start.
&lt;/h2&gt;

&lt;p&gt;As a game developer, assets size doesn't matter. Because assets can bloat it to the app, clients won't feel the long-loading time for the assets. This is a bit different with the web. We need to keep the file size as low as possible, use as low as possible resources, and keep the load time fast.&lt;/p&gt;
&lt;h2&gt;
  
  
  Designing.
&lt;/h2&gt;

&lt;p&gt;Start with a concept. We use something that relates with our studio's name, Sandbottle;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Beach.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We also design the web like a retro-style game, with that big game title at the top-center, and a play button that can't play anything (lol) at the bottom-center of the page.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start drawing
&lt;/h2&gt;

&lt;p&gt;Drawing isn't a big thing when you are a pixel game studio. Right?&lt;/p&gt;

&lt;p&gt;The answer is no. &lt;/p&gt;

&lt;p&gt;Why? Since we only have one artist, and they are currently unavailable now. We also can't pay another, because we have some lack of cash. So, I need to wear my beret and paint that on my own.&lt;/p&gt;

&lt;p&gt;Start searching for reference, I found this great image for reference: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EzcpZawB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkwrit6zkroq1y63njfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EzcpZawB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkwrit6zkroq1y63njfa.png" alt="Image reference" width="612" height="392"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;That image was perfect like we need it. It has some padding at the sides and centered content exactly was planned before:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q8ls4kVL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtdzu5rvyh00dhn5z7q2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q8ls4kVL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtdzu5rvyh00dhn5z7q2.png" alt="Padded image" width="880" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, I'm starting to redraw that image partially. Remove and add some parts, and hocus pocus, I don't know how I can finish it.&lt;/p&gt;

&lt;p&gt;Don't forget about the button, still to draw it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jgSKRCHI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1963x9hlx8sl36ocfp4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jgSKRCHI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1963x9hlx8sl36ocfp4o.png" alt="Image description" width="880" height="430"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;For the button, I'm using a 32x32 px canvas, and drawing it as a 5 frames animated sprite, like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NQgV4EJy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0r6smzntt81h7509nfv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NQgV4EJy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0r6smzntt81h7509nfv.gif" alt="Button" width="128" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After doing that all, I'm drawing one more thing; the game title. Drawing the game title is the easiest part of my part-time artist journey, because I just simply copy the font and modify a bit of it from &lt;a href="https://opengameart.org/content/pixel-block-font"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;h2&gt;
  
  
  Start coding
&lt;/h2&gt;

&lt;p&gt;In this part, I'm doing some CSSs that centered the images, put the game title at the top and the button down. &lt;/p&gt;

&lt;p&gt;I also want that button can play its animation when hovered. Since (pure) JavaScript can't control gif playback, I'm coding this little function;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function hover() {
    $('#gif').show()
    $('#png').hide()
}

function leave() {
    $('#gif').hide()
    $('#png').show()

    $('#gif').attr('src', '/images/button.gif?x=' + Math.random())
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function will show the static png when the button is unhovered, and the function will change it to gif when it's hovered. &lt;/p&gt;

&lt;h2&gt;
  
  
  Final test
&lt;/h2&gt;

&lt;p&gt;Let's test our web with the lighthouse. Here's the result. Pretty insane right?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wltNQpFh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dw7rb8bsq7nz2j8w9yh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wltNQpFh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dw7rb8bsq7nz2j8w9yh.png" alt='Lighthouse result (tested with "Desktop" device)' width="880" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think that enough for today. Kinda fun to be an artist sometimes. &lt;/p&gt;

&lt;p&gt;Hit also the web here: &lt;a href="https://sandbottle.net"&gt;https://sandbottle.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[ Note ]&lt;br&gt;
This article is reuploaded because it's accidentally removed.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I Make a Dashboard for Our Game Studio Load Faster than a Portfolio Website</title>
      <dc:creator>manushifva</dc:creator>
      <pubDate>Sun, 23 Jan 2022 02:56:18 +0000</pubDate>
      <link>https://dev.to/sandbottle/how-i-make-a-dashboard-for-our-game-studio-faster-than-a-portfolio-website-16p6</link>
      <guid>https://dev.to/sandbottle/how-i-make-a-dashboard-for-our-game-studio-faster-than-a-portfolio-website-16p6</guid>
      <description>&lt;p&gt;Yes. This is real. I have compare our users' dashboard with a &lt;a href="https://github.com/mmgolden/express-portfolio"&gt;portfolio website&lt;/a&gt; and our website is 40% faster. Here's a small lighthouse test that I perform: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PxeOnV-C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdz8uv76cssi6ipd8n5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PxeOnV-C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdz8uv76cssi6ipd8n5k.png" alt="Portfolio website by Melinda Golden" width="880" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2cyojClj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm2by33ttivvs38fa6by.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2cyojClj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm2by33ttivvs38fa6by.png" alt="Our users dashboard" width="880" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Small note: Both tests are run in localhost.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, let me share how we do this.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Using fewer resources.
&lt;/h2&gt;

&lt;p&gt;Of course, we all know this. To load faster, you need to use fewer resources. But, this is not easy as said, especially if you using some library or framework that embeds you a lot of unused CSS or Javascript.&lt;/p&gt;

&lt;p&gt;To make this UI, I'm using modified &lt;a href="https://github.com/manushifva/pasta-css"&gt;Pasta CSS&lt;/a&gt;*, Bootstrap-like lightweight library. &lt;/p&gt;

&lt;p&gt;I also use customized icons from &lt;a href="https://fontello.com"&gt;fontello.com&lt;/a&gt;. So, I can pick what icons I would use, without embedding a whole of them.&lt;/p&gt;

&lt;p&gt;Don't forget about Javascript. We using a minified version of JQuery. JQuery makes my code slimmer. It's also helped me code faster, since it has the build-in function for some tasks, like toggling something, finding the nearest element, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Using pre-rendered content.
&lt;/h2&gt;

&lt;p&gt;Rather than render the page content after loading the page, I'm using this pre-rendered content. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sN7Byhwk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odh0pgdfag61080pw6jc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sN7Byhwk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odh0pgdfag61080pw6jc.png" alt="Pre-rendered area" width="880" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At first, I render the main Html file. Then, I render the pre-rendered content. I'm also using &lt;a href="//swup.js.org"&gt;Swup.js&lt;/a&gt; for swapping pages smoothly. Swup also helps us render fewer things.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Using Koa.
&lt;/h2&gt;

&lt;p&gt;Koa.js is one of the most popular Node.js server libraries. Koa was developed by developers who develop Express. Koa is faster than Express, since it developed to be more modular rather than embedding. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Using fewer images and using lazy load.
&lt;/h2&gt;

&lt;p&gt;These are the final tips. Images are hard and slow to load, especially the larger ones. Using lazy load can help the web render faster, because the lazy load pending the load process of images, and load it after the whole page is successfully loaded. &lt;/p&gt;

&lt;p&gt;That's it. Hopefully, this can help you with speeding up your website too ⚡.&lt;/p&gt;

&lt;p&gt;Disclaimer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pasta CSS was made by me.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>story</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
