-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(front): added a basic admin panel
- Loading branch information
Showing
10 changed files
with
197 additions
and
10 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,5 +10,8 @@ | |
}, | ||
"devDependencies": { | ||
"vite": "^4.1.4" | ||
}, | ||
"dependencies": { | ||
"bulma": "^0.9.4" | ||
} | ||
} | ||
} |
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,77 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Admin Panel</title> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css" | ||
/> | ||
</head> | ||
<body> | ||
<section class="section"> | ||
<div class="container"> | ||
<h1 class="title">Admin Panel</h1> | ||
<h2 class="subtitle">Manage place</h2> | ||
<div class="columns"> | ||
<div class="column"> | ||
<div class="field"> | ||
<label class="label">Secret Token</label> | ||
<div class="control"> | ||
<input id="token" class="input" type="password" /> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="label">Size</label> | ||
<div class="columns"> | ||
<div class="column"> | ||
<div class="control"> | ||
<input | ||
class="input" | ||
id="input-w" | ||
type="text" | ||
placeholder="Width" | ||
/> | ||
<p class="help">Width</p> | ||
</div> | ||
</div> | ||
<div class="column"> | ||
<div class="control"> | ||
<input | ||
class="input" | ||
id="input-h" | ||
type="text" | ||
placeholder="Height" | ||
/> | ||
<p class="help">Height</p> | ||
</div> | ||
</div> | ||
<div class="column"> | ||
<div class="control"> | ||
<a id="ch-size" class="button is-primary"> Change Size </a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="control"> | ||
<a id="save-place" class="button is-primary"> Save the image </a> | ||
</div> | ||
</div> | ||
<div class="column"> | ||
<h2 class="subtitle">Live place</h2> | ||
<iframe | ||
class="box" | ||
src="place.html" | ||
width="100%" | ||
height="100%" | ||
style="min-height: 500px" | ||
></iframe> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</body> | ||
<script type="module" src="js/admin/ui.js"></script> | ||
</html> |
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,15 @@ | ||
export const getMeta = (url) => { | ||
// Return width and height of image | ||
return new Promise((resolve, reject) => { | ||
var img = new Image(); | ||
img.addEventListener("load", function () { | ||
let w = this.naturalWidth; | ||
let h = this.naturalHeight; | ||
resolve({ w, h }); | ||
}); | ||
img.addEventListener("error", function () { | ||
reject("Error loading image"); | ||
}); | ||
img.src = url; | ||
}); | ||
}; |
Oops, something went wrong.