-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from columbiaspace/shirley
- Loading branch information
Showing
3 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const fs = require('fs'); // import 'fs' module ot work with file system | ||
|
||
// converts image to Base64 | ||
function imageToBase64(imagePath) { | ||
const imageBuffer = fs.readFileSync(imagePath); // read image file | ||
const base64Image = imageBuffer.toString('base64'); // convert image file to Base64 | ||
return base64Image; | ||
} | ||
|
||
export const RockData = [ | ||
|
||
{ | ||
id: "rock1", | ||
name: "Rock 1", | ||
location: "1°N 1°W", | ||
color: "red", | ||
photo: imageToBase64("https://static.wikia.nocookie.net/minecraft_gamepedia/images/e/e1/Redstone_Dust_JE2_BE2.png/revision/latest?cb=20210427032319") | ||
|
||
}, | ||
|
||
{ | ||
id: "rock2", | ||
name: "Rock 2", | ||
location: "2°N 2°W", | ||
color: "orange", | ||
photo: imageToBase64("") | ||
}, | ||
|
||
{ | ||
id: "rock3", | ||
name: "Rock 3", | ||
location: "3°N 3°W", | ||
color: "yellow", | ||
photo: imageToBase64("") | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters