Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #260 from corquaid/master
Browse files Browse the repository at this point in the history
Added new canvas artwork "Sunrise on Mars"
  • Loading branch information
auxfuse authored Oct 31, 2021
2 parents 0432050 + b6bc76d commit 5654894
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
Binary file added src/art/corquaid_4/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/art/corquaid_4/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<title>Sunrise on Mars</title>
</head>
<body>
<canvas id="canvas" width="500" height="500"> </canvas>
<script type="text/javascript" src="./script.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions src/art/corquaid_4/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"art_name": "Sunrise on Mars",
"author_name": "Cormac Quaid",
"author_github_url": "https://github.com/corquaid/"
}
47 changes: 47 additions & 0 deletions src/art/corquaid_4/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
let canvas = document.getElementById("canvas");
let c = canvas.getContext("2d");

// Sun
c.beginPath();
let radgrad = c.createRadialGradient(200, 325, 6, 200, 325, 200);
radgrad.addColorStop(0, "rgba(255,255,255,1)");
radgrad.addColorStop(0.005, "rgba(92, 140, 179,0.7)");
radgrad.addColorStop(1, "rgba(139, 155, 169,0.2)");
c.fillStyle = radgrad;
c.fillRect(0, 0, 500, 500);
c.closePath();

// Distant mountain ridge
c.beginPath();
c.moveTo(0, 400);
c.lineTo(0, 500);
c.lineTo(500, 500);
c.lineTo(500, 340);
c.lineTo(460, 335);
c.lineTo(450, 335);
c.lineTo(425, 325);
c.lineTo(375, 315);
c.lineTo(300, 320);
c.lineTo(250, 340);
c.lineTo(180, 330);
c.lineTo(120, 320);
c.lineTo(80, 330);
c.lineTo(50, 340);
c.lineTo(0, 350);
c.fillStyle = "#2E3134";
c.fill();
c.closePath();

// Foreground hills
c.beginPath();
c.moveTo(0, 425);
c.lineTo(100, 430);
c.lineTo(200, 420);
c.lineTo(350, 410);
c.lineTo(450, 420);
c.lineTo(500, 400);
c.lineTo(500, 500);
c.lineTo(0, 500);
c.fillStyle = "#0F1113";
c.fill();
c.closePath();
9 changes: 9 additions & 0 deletions src/art/corquaid_4/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
html,
body {
margin: 0;
padding: 0;
}

#canvas {
background-color: #4f555a;
}

0 comments on commit 5654894

Please sign in to comment.