<?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: Soledad Unda</title>
    <description>The latest articles on Forem by Soledad Unda (@asoledadu).</description>
    <link>https://forem.com/asoledadu</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%2F204541%2Fe127b598-10f9-42d2-ae08-b540fe3b50ab.jpeg</url>
      <title>Forem: Soledad Unda</title>
      <link>https://forem.com/asoledadu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/asoledadu"/>
    <language>en</language>
    <item>
      <title>Star Wars Intro Explanation (yes, again)</title>
      <dc:creator>Soledad Unda</dc:creator>
      <pubDate>Mon, 02 Dec 2019 17:09:48 +0000</pubDate>
      <link>https://forem.com/asoledadu/star-wars-intro-explanation-yes-again-4hk5</link>
      <guid>https://forem.com/asoledadu/star-wars-intro-explanation-yes-again-4hk5</guid>
      <description>&lt;p&gt;To start, I have been coding for about 6 months now, (so take anything I say with a grain of salt and know I would love any feedback). Now, on to the content! &lt;/p&gt;

&lt;p&gt;Let’s begin with why I decided to write this blog post. I got into programming to solve common problems through the means of technology. After being introduced to HTML and CSS I wanted to learn how to re-make the famous Star Wars Intro. Little did I know everyone has posted the code for it. So here is my take on an explanation :)&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s Talk HTML and CSS
&lt;/h2&gt;

&lt;p&gt;If you have not seen Star Wars Episode III for some reason then:&lt;br&gt;
SPOILER ALERT, you’re about to see the intro!&lt;br&gt;
Let’s start with taking a look at this code:&lt;/p&gt;

&lt;p&gt;Here is the code pen with the work I reference:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/asoledadu/embed/yLBXMOo?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;One of my mottos I follow when it comes to HTML is "When in doubt, div".&lt;br&gt;
If it is unclear what tag to use I just div. I like to separate my pieces with a div so all my contents are in their respective little boxes. The classes aren’t too special I just used them to help me grab a specific div later down the line for my CSS. I keep my class names relevant and clear to understand, just in case someone not in my brain wants to understand my work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.star-wars-intro-block&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;250px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#feda4a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Pathway Gothic One'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;600%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;font-spacing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;150%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;perspective&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&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;the &lt;code&gt;.star-wars-intro-block&lt;/code&gt; class selector changes the color and the size of the text from a regular text to look like the intro format.. I centered the content with &lt;code&gt;justify-content&lt;/code&gt; and consistently &lt;code&gt;position&lt;/code&gt; the content &lt;code&gt;relative&lt;/code&gt; to the rest. For the most part it’s pretty self explanatory but I will cover &lt;code&gt;perspective&lt;/code&gt;. This gives the text a 3-D look of being tilted at an angle to the viewer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.scroll&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;scroll&lt;/span&gt; &lt;span class="m"&gt;70s&lt;/span&gt; &lt;span class="n"&gt;linear&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;the &lt;code&gt;.scroll&lt;/code&gt; class selector begins our text animation and this class will also be used for our keyframes. The most interesting piece of these 2 lines of code is that we can alter the direction and speed of the &lt;code&gt;animation&lt;/code&gt; without having to write JavaScript. It does the work for us!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="nb"&gt;scroll&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;20deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;translateZ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-6000px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;25deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;translateZ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-2500px&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;With &lt;code&gt;@keyframes&lt;/code&gt; might seem odd here, so let me explain. So let's talk about why there are what looks like a &lt;code&gt;0%&lt;/code&gt; and &lt;code&gt;100%&lt;/code&gt; as a selector with their own properties. For simplicity let us just associate &lt;code&gt;0%&lt;/code&gt; as secret code for "from" and &lt;code&gt;100%&lt;/code&gt; as secret code for "to". So in human terms, "Do some stuff here and by the end of it you should have this done". This is what gives us the bottom to the top movement of the text that is so iconic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.gradient&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt; &lt;span class="m"&gt;75%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-25px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&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;Hey you are almost done reading my first blog post!&lt;br&gt;
I'll briefly cover the &lt;code&gt;.gradient&lt;/code&gt; class selector so you can go back to looking at memes. This is the final piece that lets the words fade into the dark and cold void of a galaxy far far away. I wanted to make it look even so I stretched it to &lt;code&gt;100%&lt;/code&gt; on the &lt;code&gt;width&lt;/code&gt; and made the &lt;code&gt;position&lt;/code&gt; &lt;code&gt;relative&lt;/code&gt; to the element. To add the fade-out I used a gradient through &lt;code&gt;background-image&lt;/code&gt;. I let the color be transparent black at 0 degrees for 75%. The &lt;code&gt;min-height&lt;/code&gt; adjusts the height of the fade. To ensure that the newly made fade is on top of the text I used &lt;code&gt;z-index&lt;/code&gt; to customize in what order I want my content to stack.&lt;/p&gt;

&lt;p&gt;That’s it!  If you are in the "crawling stage" of HTML and CSS, hopefully, this was an "Oh! A piece of candy!" moment and you keep following the trail to dive deeper into the depths of these languages.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"May the force be with you"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Angie S. Unda&lt;/p&gt;

&lt;p&gt;If you have any questions and/or feedback for growth DM me @a.soledad.u on Instagram.&lt;/p&gt;

&lt;p&gt;credit: @carmencodes on Instagram and google of course.&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
