Skip to content

Commit

Permalink
feat: Add interactivity to header buttons and auxiliary pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Starciad committed Jan 24, 2024
1 parent 915030f commit cd22aa9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
11 changes: 11 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🎭 ➥ SCSG - About - Star Character Sheet Generator.</title>
</head>
<body>
Under construction.
</body>
</html>
11 changes: 11 additions & 0 deletions credits.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🎭 ➥ SCSG - Credits - Star Character Sheet Generator.</title>
</head>
<body>
Under construction.
</body>
</html>
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
<body>
<header>
<div id="header-left">
<button class="btn btn-nil">Repository</button>
<button id="scsg-repository-button" class="btn btn-nil">Repository</button>
</div>

<div id="header-right">
<button class="btn btn-nil">Credits</button>
<button class="btn btn-nil">About</button>
<button id="scsg-credits-button" class="btn btn-nil">Credits</button>
<button id="scsg-about-button" class="btn btn-nil">About</button>
</div>
</header>

Expand Down
16 changes: 16 additions & 0 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { SCSGenerator } from "./core/dataGenerator.js";
// Elements
let SCSGGenerateButton = document.querySelector("#scsg-generate-button");

let SCSGRepositoryButton = document.querySelector("#scsg-repository-button");
let SCSGCreditsButton = document.querySelector("#scsg-credits-button");
let SCSGAboutButton = document.querySelector("#scsg-about-button");

// Events
SCSGGenerateButton.addEventListener('click', () => {
let nameStyleType = document.querySelector("#name-style-type").value;
Expand All @@ -14,4 +18,16 @@ SCSGGenerateButton.addEventListener('click', () => {
sexType,
ageRangeType
);
});

SCSGRepositoryButton.addEventListener('click', () => {
window.open("https://github.com/Starciad/SCSG.git", '_blank').focus();
});

SCSGCreditsButton.addEventListener('click', () => {
window.location.href = "./about.html";
});

SCSGAboutButton.addEventListener('click', () => {
window.location.href = "./credits.html";
});

0 comments on commit cd22aa9

Please sign in to comment.