Skip to content

Commit

Permalink
Merge pull request #1 from AlexanderChernyshev/main
Browse files Browse the repository at this point in the history
Readme and images
  • Loading branch information
sergeychernyshev authored Mar 26, 2024
2 parents 0038303 + d21401a commit a7d9a0f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

# GitTerra

<div style="display: flex; flex-direction: column; align-items: center; margin-bottom: 2em">
<img src="https://gitterra.com/images/background_and_menus/logobanner.svg" alt="Gitterra Guide Title Pic" style="height: 10em">
</div>

A git-based game running in CI/CD and played by coding!

Every time you push to your repository, GitTerra will analyze your code and generate the game map.

You can see generated map of your city / code in the pipeline's artifacts - deploy it to GitHub / GitLab Pages, a web server of your choice or download to a local machine, it is up to you.

See instructions below on how to play GitTerra on your GitHub or GitLab repositories.
See instructions below on how to play GitTerra on your [GitHub](#in-github-repo) or [GitLab](#in-gitlab-repo) repositories.

![A built map](/docs/generated_map.png)

## In GitHub repo

Expand Down
Binary file added docs/generated_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getMapTileCoordinates(n) {
// boolean representing the side of the diamond, e.g. left (false) or right (true)
const direction =
Math.ceil((n - Math.pow(Math.floor(Math.sqrt(n)), 2)) / 2) -
Math.floor((n - Math.pow(Math.floor(Math.sqrt(n)), 2)) / 2) ===
Math.floor((n - Math.pow(Math.floor(Math.sqrt(n)), 2)) / 2) ===
0;

if (direction) {
Expand Down Expand Up @@ -98,6 +98,13 @@ export const generateMapHTML = function (gameConfig, total) {
return `<!doctype html>
<html>
<head>
<meta
property="og:image"
content="https://gitterra.com/images/background_and_menus/logobanner.svg"
/>
<meta property="og:image:type" content="image/svg" />
<link rel="icon" type="image/png" href="https://gitterra.com/images/logo.png" />
<title>Your Repo Map | GitTerra</title>
<style>
h1,
#feedback {
Expand All @@ -118,7 +125,7 @@ export const generateMapHTML = function (gameConfig, total) {
max-width: 15em;
}
</style>
<title>Your Repo Map | GitTerra</title>
</head>
<body>
<h1>
Expand Down

0 comments on commit a7d9a0f

Please sign in to comment.