Jayson's T-Rex Project

AI Crash with Joel, Jayson, and Alex 01-09-2023 using OpenAI ChatGPT

by dixalex

HTML

<!DOCTYPE html>

<body>
  <div class="container">
    <h1>Dinosaur Biographies</h1>
<div class="dinosaur-card">
  <canvas id="fero" width="250" height="250"></canvas>
  <div class="info">
    <h2>T-Rex</h2>
    <p><strong>Scientific Name:</strong> Tyrannosaurus Rex</p>
    <p><strong>Period:</strong> Late Cretaceous</p>
    <p><strong>Size:</strong> 40 feet long, 15 feet tall</p>
    <p><strong>Weight:</strong> 7-8 tons</p>
    <p>The T-Rex was one of the most famous and fearsome dinosaurs that ever lived. Its powerful legs and massive jaws, filled with sharp teeth, made it a formidable predator. Despite its fearsome reputation, some scientists believe that the T-Rex may have been more of a scavenger than a hunter.</p>
    <p><strong>Fun Fact:</strong> The T-Rex had the strongest bite of any land animal in history, with a force of about 12,800 pounds per square inch.</p>
  </div>
</div>


  </div>
</body>

CSS

/* Add your CSS styles here */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f8f8;
}
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}
h1 {
  text-align: center;
  color: #333;
  margin: 20px 0;
  font-size: 28px;
}
.dinosaur-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 10px;
  transition: all 0.3s ease;
}
.dinosaur-card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  transform: translateY(-5px);
}
.dinosaur-card img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px 0 0 10px;
}
.dinosaur-card .info {
  width: 60%;
  margin: 20px;
  padding: 20px;
  box-sizing: border-box;
}
.dinosaur-card h2 {
  margin: 0;
  font-size: 22px;
  color: #333;
}
.dinosaur-card p {
  font-size: 16px;
  line-height: 1.5;
  color: #666;
  margin: 20px 0;
}

.dinosaur-card {
  /* Add your existing styles here */
  overflow: hidden;
}
.dinosaur-card .info {
  /* Add your existing styles here */
  word-wrap: break-word;
}

@media screen and (max-width: 500px) {
  .dinosaur-card {
    /* Add your styles for narrow screens here */
    flex-direction: column;
  }
  .dinosaur-card img {
    /* Add your styles for narrow screens here */
    width: 100%;
    border-radius: 10px 10px 0 0;
  }
  .dinosaur-card .info {
    /* Add your styles for narrow screens here */
    width: 100%;
  }
}

body {
  /* Add your existing styles here */
  background-color: #f0f0f0;
}
h1 {
  /* Add your existing styles here */
  color: #00b8d4;
  font-size: 32px;
  font-weight: 700;
  text-transform: uppercase;
}
.dinosaur-card {
  /* Add your existing styles here */
  background-color: #fafafa;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}
.dinosaur-card:hover {
  /* Add your existing styles here */
  box-shadow: 0...

JavaScript

var canvas = document.getElementById('fero');
var ctx = canvas.getContext('2d');

// Set the fill color to red
ctx.fillStyle = '#FF0000';

// Begin the path
ctx.beginPath();

// Move to the starting point
ctx.moveTo(100, 100);

// Draw a curved line to the right
ctx.quadraticCurveTo(150, 75, 200, 100);

// Draw a straight line down
ctx.lineTo(200, 200);

// Draw a curved line to the left
ctx.quadraticCurveTo(150, 225, 100, 200);

// Draw a straight line up
ctx.lineTo(100, 100);

// Close the path and fill the shape
ctx.closePath();
ctx.fill();

// Set the stroke style and draw the outline of the shape
ctx.strokeStyle = '#000000';
ctx.lineWidth = 3;
ctx.stroke();