<?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: John Ross Valderama</title>
    <description>The latest articles on DEV Community by John Ross Valderama (@codecharms).</description>
    <link>https://dev.to/codecharms</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%2F1019122%2F4e1da9f0-e2eb-42b8-8ff9-13058c4e98c4.jpeg</url>
      <title>DEV Community: John Ross Valderama</title>
      <link>https://dev.to/codecharms</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codecharms"/>
    <language>en</language>
    <item>
      <title>Creating Annoying Popups Part 1</title>
      <dc:creator>John Ross Valderama</dc:creator>
      <pubDate>Thu, 02 Feb 2023 02:44:56 +0000</pubDate>
      <link>https://dev.to/codecharms/creating-annoying-popups-part-1-33nc</link>
      <guid>https://dev.to/codecharms/creating-annoying-popups-part-1-33nc</guid>
      <description>&lt;p&gt;I've seen a few tutorial videos on web development, so I'm hooked. But I'm in a place that developers call tutorial hell. Tutorial limbo? Regardless, it's a bad place to be. So I'll need to start working on some projects to see if I can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Recall&lt;/li&gt;
&lt;li&gt;Understand&lt;/li&gt;
&lt;li&gt;Apply&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If I can get through this, I'll be officially out of tutorial limbo.&lt;/p&gt;

&lt;p&gt;First thing first, let's set up the HTML boilerplate. &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/codecharms/embed/BaPGPKx?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next, let's make it look pretty, so people will be more willing to sell us their souls. &lt;/p&gt;

&lt;h2&gt;
  
  
  Set the site aesthetics
&lt;/h2&gt;

&lt;p&gt;During the setup of the page's colors, I wanted to try having a lighter background, so I found a CSS property that would have a way to adjust the transparency of a color. The first property I saw was &lt;code&gt;opacity,&lt;/code&gt; but this did &lt;em&gt;too&lt;/em&gt; much. Not only did it  change the background's transparency, but everything in the container did.&lt;/p&gt;

&lt;p&gt;The second was &lt;code&gt;rgba&lt;/code&gt;. This had a fourth value, &lt;code&gt;alpha&lt;/code&gt; that set the transparency of the text from 0 to 1. I finally sat at 0.6 for the final value. &lt;/p&gt;

&lt;h2&gt;
  
  
  Setup the Portal of Souls
&lt;/h2&gt;

&lt;p&gt;Currently, the layout isn't annoying; the popup is at the bottom of the page, and it needs to be in the middle so that viewers can only view the content if they sell their souls. To do that, we'll need to make some classes for the popup. The particular property it'll have will be &lt;code&gt;position: fixed&lt;/code&gt;. This will remove the popup from the flow and set it to a fixed position on the page. Hence the name "fixed."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.pop-up {
    position: fixed;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Currently, there is no effect on the popup, but if we add the following properties: &lt;code&gt;top, right, bottom, left&lt;/code&gt;, we can set the position of the popup. You'll only need to use one horizontal and one vertical property. Using all four won't affect the positioning but will have other unintended circumstances.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.pop-up {
    position: fixed;
    top: 500px;
    bottom: 500px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is an issue when setting pixels. There will be a point when you resize the window that the popup will disappear. We don't want free souls looking at our content. We'll need to make it, so the popup stays in the middle of the page. This can be done by setting the &lt;code&gt;top, bottom, left, right&lt;/code&gt; properties to 0 and adding the &lt;code&gt;margin&lt;/code&gt; property, and putting it to auto will have the popup stay in the center regardless of the size of the window.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.pop-up {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/codecharms/embed/dyjQaeo?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Alright, this is pretty triggering. In part 2, we'll review some javascript to make the site interactive by adding some buttons and making the popup appear a few seconds after the viewer has tasted the content; then, we'll steal their soul!&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
