<?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: Andreas Ströberg</title>
    <description>The latest articles on DEV Community by Andreas Ströberg (@antonstroberg).</description>
    <link>https://dev.to/antonstroberg</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%2F291745%2Fa56c6f62-b270-4930-a807-44b182fe46a8.png</url>
      <title>DEV Community: Andreas Ströberg</title>
      <link>https://dev.to/antonstroberg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antonstroberg"/>
    <language>en</language>
    <item>
      <title>Single Page Applications in the cloud!</title>
      <dc:creator>Andreas Ströberg</dc:creator>
      <pubDate>Thu, 07 May 2020 12:37:11 +0000</pubDate>
      <link>https://dev.to/antonstroberg/no-more-tears-single-page-applications-in-the-cloud-8a7</link>
      <guid>https://dev.to/antonstroberg/no-more-tears-single-page-applications-in-the-cloud-8a7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Step up and become a SPA superhero. Follow these four easy steps to SPA success without any need for backend programming. This article includes a cloud-based tool called &lt;a href="https://stackend.com"&gt;Stackend.com&lt;/a&gt; - but it's freemium&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Single page apps (SPA) aim to improve website performance and increase conversions. Some of the benefits: Fast and responsive design (if done correctly). Since a SPA updates the desired content only, it dramatically improves the loading time.&lt;/p&gt;

&lt;p&gt;So — could this be for you? Let’s find out.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why should I build a single page application?
&lt;/h1&gt;

&lt;p&gt;A single-page application doesn’t need to reload the page during its use and works within a browser. You probably used Facebook, Google Maps, Gmail, Twitter, Google Drive, or even GitHub. All these are examples of a SPA.&lt;/p&gt;

&lt;p&gt;The main reason for building a SPA is, however — speed. And speed is money. Studies done by Google and key findings by companies such as Amazon and Wal*Mart show that if a page takes more than 200 milliseconds to load, it has the potential to actually mess up your business or, at the very least, cost you much money.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why shouldn’t I build a single page application?
&lt;/h1&gt;

&lt;p&gt;Some stuff gets a bit more complicated. SEO needs to be done a bit different and some third party integration that relies on the complete page content being available on load may not work. Also, it (typically) increases the load on the browser.&lt;/p&gt;

&lt;p&gt;As for now — Google is the only search engine that kind of works with javascript rendered SPA. Bing claims to, &lt;a href="http://screamingfrog.co.uk/bing-javascript/"&gt;but according to tests&lt;/a&gt; does not.&lt;/p&gt;

&lt;h1&gt;
  
  
  Ok - I want to build a Single Page Application"
&lt;/h1&gt;

&lt;p&gt;What we will look at here is a super simple way of building a SPA without the need for an application server such as node.js BUT if you want to take it to the next level and do server-side-rendering— you can still use whatever you create here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First Step&lt;/strong&gt; - &lt;a href="https://stackend.com/login"&gt;Register&lt;/a&gt; (free) or login to Stackend.com and create a Stack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DQDWEUGI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/1050/1%2AZtpOdHOVHkosumm9zXDwGg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DQDWEUGI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/1050/1%2AZtpOdHOVHkosumm9zXDwGg.gif" alt="Create a stack"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here’s the important part to just add what domains you want this stack to be available from. For this demo, we will use codepen.io — you can do the same when testing or use just about anything that can render HTML.&lt;/p&gt;

&lt;p&gt;** Second Step** - Create three &lt;a href="https://stackend.com/product/codebin"&gt;Code Bins&lt;/a&gt; and add some HTML.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/UAGzZanbYXU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Really, you’re that lazy? Ok…. here’s the HTML for this:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;div class=”blue”&amp;gt;
&amp;lt;h1&amp;gt;It’s wonderful in the SPA — Page 1&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;Fun family entertainment everyone can enjoy&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;p&gt;and CSS:&lt;/p&gt;

&lt;pre&gt;
.blue {
 width:100%;
 background:lightblue;
}
h1 {
 text-align:center;
 font-family:helvetica;
 padding:20px;
 color:white;
 font-weight: 700;
}
p {
 text-align:center;
 font-family:helvetica;
 padding-bottom:40px;
 color:white;
 font-weight: 300;
}
&lt;/pre&gt;

&lt;p&gt;Create three code bins with different colors and change the &amp;lt;h1&amp;gt; text to Page 1 and Page 3. It’s just so you can see the difference later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third Step&lt;/strong&gt; — Create three &lt;a href="https://stackend.com/product/pages"&gt;Pages&lt;/a&gt; and add your &lt;a href="https://stackend.com/product/codebin"&gt;Code Bins&lt;/a&gt; to each Page.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/N8odqLwel7M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Now create three pages. Process being: Create the page and add the created code bin. The name will be the link in the next step but you can change this later. To make it simple I’ll just stick to the colors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fourth Step&lt;/strong&gt; — Create a &lt;a href="https://stackend.com/product/sites"&gt;Site&lt;/a&gt; and see your SPA in all its glory!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zpy8-9xQZQI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Simply Create a site, name it whatever you want, and add page red, page blue, and page green to your site. Once done click &amp;lt;&amp;gt;copy and paste the site code to your codepen or page. Voila! A single page application!&lt;/p&gt;

&lt;p&gt;Now — get creative and start clicking around. For example, you can add a header to your site, change to verticle menus, or create your own. Read the &lt;a href="https://stackend.com/docs"&gt;doc&lt;/a&gt; for more info (that will get better - promise)&lt;/p&gt;

&lt;p&gt;Here's the test-site created above:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/stackend/embed/mdeXgKd?height=600&amp;amp;default-tab=html,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Here's a site with &lt;/p&gt;

&lt;p&gt;Hope you had fun!&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>Create a carousel without Javascript</title>
      <dc:creator>Andreas Ströberg</dc:creator>
      <pubDate>Tue, 17 Dec 2019 13:10:03 +0000</pubDate>
      <link>https://dev.to/antonstroberg/create-a-carousel-without-javascript-2pg2</link>
      <guid>https://dev.to/antonstroberg/create-a-carousel-without-javascript-2pg2</guid>
      <description>&lt;p&gt;There are many installable slideshows out there like OWL, glide.js, bootstrap js and a bunch of others but all these need some kind of installation.&lt;/p&gt;

&lt;p&gt;This guide will show you how to not only get a slideshow up and running but also with the benefit of having it headless.&lt;/p&gt;

&lt;p&gt;You will need the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Basic skills in HTML / CSS or you can copy-paste my code.&lt;/li&gt;
&lt;li&gt;A pen on &lt;a href="https://codepen.io/pen"&gt;https://codepen.io/pen&lt;/a&gt; (For demo purpose)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 1 — Get your environment ready
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://stackend.com"&gt;https://stackend.com&lt;/a&gt; and log in. The first step is to create a stack (if you already have one you can use that) — Do this by clicking on “My Stacks” in the top left corner and then “Add new stack”.&lt;br&gt;
Give the stack a name. I named mine “Stackend Demo” but you can name it whatever you want.&lt;/p&gt;

&lt;p&gt;Click on settings in the bottom of the left menu if you’re not already on the settings page. In the “ALLOWED DOMAINS” field add s.codepen.io &amp;amp; cdpn.io — if you want to use something else then make sure to add the correct domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Create your slides
&lt;/h2&gt;

&lt;p&gt;Click on the "create new" button after Code Bins in the left menu to create a new module.&lt;br&gt;
Name it Slide 1.&lt;/p&gt;

&lt;p&gt;Add this to the HTML field (or whatever you want):&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="slide1"&amp;gt;
 Hello World - this is my first slide!
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Click Save.&lt;br&gt;
Once again, click on the "create new" button after Code Bins in the left menu to create a new module. Name it Slide 2. Add this to the HTML field (or whatever you want):&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="slide2"&amp;gt;
 Hello World - this is my second slide!
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Click Save.&lt;/p&gt;

&lt;p&gt;Once again click on the "create new" button after Code Bins in the left menu to create a new module. Name it Slide CSS.&lt;br&gt;
Add this to the CSS field (or whatever CSS you want):&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.slide1 {
background-image: url(https://api.stackend.com/media/get/c71/cms/mitchell-orr-389605-unsplash-jpg.jpg);
color:white;
height:500px;
width:100%;
background-size:cover;
background-repeat:no-repeat;
background-position:center center;
}

.slide2 {
background-image: url(https://api.stackend.com/media/get/c71/cms/wade-austin-ellis-677123-unsplash-jpg.jpg);
color:white;
height:500px;
width:100%;
background-size:cover;
background-repeat:no-repeat;
background-position:center center;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Ok, That’s it. Now you have 2 slides and some simple styling to make them look stylish (well.. kind of).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 — Create the slideshow/carousel
&lt;/h3&gt;

&lt;p&gt;Head over to &lt;a href="https://stackend.com/docs"&gt;https://stackend.com/docs&lt;/a&gt; and look for Slideshow in the left menu under modules. There you can see the attributes for the slideshow module but if you copy the code below it’s a good start for the demo.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- This is your stackend launch script --&amp;gt;
&amp;lt;script defer type="text/javascript" src="https://stackend.com/launch.js&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;div data-stackend-type="stackend-slideshow" data-stackend-indicators="true&amp;gt;

&amp;lt;!-- your slideshow goes here --&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Copy this code and create a new pen on &lt;a href="https://codepen.io/pen/"&gt;https://codepen.io/pen/&lt;/a&gt;&lt;br&gt;
Paste the Stackend code into the HTML field on codepen.&lt;br&gt;
The first line is the basic stackend setup.&lt;br&gt;
The second line is the start of your slideshow. Any code bins you add between here and the closing div will be in your slideshow.&lt;br&gt;
Now let’s add the 3 code bins. Let’s start by adding the CSS.&lt;br&gt;
In stackend, click on Code Bins in the left menu and locate Slide CSS on your right side. Click on it. In the top left corner, you will see a button that says &amp;lt;&amp;gt; COPY. Click on that and a popup will appear. Click the &amp;lt;&amp;gt; copy button for the first row (the module code). In my case it looks like this (yours will be different):&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div data-stackend-type="stackend-cms" data-stackend-id="71:5"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Go to your codepen and paste it in the top or bottom, just not in the actual slideshow div.&lt;br&gt;
Now, do the same for the code bin modules slide 1 and slide 2 but paste them between the slideshow divs.&lt;br&gt;
So, when done you should end up with something like this:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- This is the stackend launch script --&amp;gt;
&amp;lt;script defer type="text/javascript" src="https://stackend.com/launch.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;!-- This is the css for the slideshows --&amp;gt;
&amp;lt;div data-stackend-type="stackend-cms" data-stackend-id="71:5"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;!--This is the actual slideshow--&amp;gt;
&amp;lt;div data-stackend-type="stackend-slideshow" data-stackend-indicators="true&amp;gt; 
&amp;lt;!-- This is the code bins slide1 and slide2 --&amp;gt;
&amp;lt;div data-stackend-type="stackend-cms" data-stackend-id="71:21"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div data-stackend-type="stackend-cms" data-stackend-id="71:22"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;!-- This closes the slideshow --&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can view this example on codepen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/stackend/pen/xxKZgQX"&gt;https://codepen.io/stackend/pen/xxKZgQX&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See the Pen &lt;a href="https://codepen.io/stackend/pen/xxKZgQX"&gt;Create a carousel / slideshow witout Javascript (local css)&lt;/a&gt; by Stackend&lt;br&gt;
  (&lt;a href="https://codepen.io/stackend"&gt;@stackend&lt;/a&gt;) on &lt;a href="https://codepen.io"&gt;CodePen&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>headless</category>
    </item>
  </channel>
</rss>
