<?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: mistafisha</title>
    <description>The latest articles on DEV Community by mistafisha (@mistafisha).</description>
    <link>https://dev.to/mistafisha</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%2F95507%2F6d6ae6b6-175b-4e74-ac42-e91079564983.jpg</url>
      <title>DEV Community: mistafisha</title>
      <link>https://dev.to/mistafisha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mistafisha"/>
    <language>en</language>
    <item>
      <title>Line Connects 2 boxes (ChatGPT)</title>
      <dc:creator>mistafisha</dc:creator>
      <pubDate>Mon, 23 Jan 2023 05:00:00 +0000</pubDate>
      <link>https://dev.to/mistafisha/line-connects-2-boxes-chatgpt-3oph</link>
      <guid>https://dev.to/mistafisha/line-connects-2-boxes-chatgpt-3oph</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/mistafisha/embed/OJwvPLv?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
ChatGPT Prompt: &lt;br&gt;
Write HTML (only body inner contents), CSS, and javascript (without canvas) separately to create the following:&lt;br&gt;
Add a black background. &lt;br&gt;
Add a container with a teal background that fills the screen. Everything below goes in the container.&lt;br&gt;
Place a red start box in the center of the screen.&lt;br&gt;
Place a blue end box in random position on the screen.&lt;br&gt;
Create a yellow line that connects start box to end box. The line could be made with a div.&lt;br&gt;
Create a 'redo' button that moves the end box to a new random position on the screen and reconnects the line.&lt;/p&gt;

&lt;p&gt;ChatGPT Correction: &lt;br&gt;
The container should use viewport units to fill the screen.&lt;br&gt;
set the line height to 3px and give it a red outline.&lt;br&gt;
Bug: The line is the correct angle and width, but it is not aligned with either the start or end square.&lt;/p&gt;

&lt;p&gt;Manual Correction:&lt;br&gt;
&lt;code&gt;// var x1 = startBox.offsetLeft + startBox.offsetWidth / 2;&lt;br&gt;
    var x1 = startBox.offsetLeft;&lt;br&gt;
    // var y1 = startBox.offsetTop + startBox.offsetHeight / 2;&lt;br&gt;
    var y1 = startBox.offsetTop;&lt;/code&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tooling</category>
      <category>productivity</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
