Skip to content

Commit

Permalink
Style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Linfindel committed Jan 3, 2024
1 parent bdfbd2b commit 3576f25
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 96 deletions.
60 changes: 30 additions & 30 deletions about.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sonnets</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sonnets</title>

<link rel="stylesheet" href="https://linfindel.github.io/nadircss/nadir.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0" />
<link rel="stylesheet" href="https://linfindel.github.io/nadircss/nadir.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0" />
</head>
<body>
<div class="navbar-column">
<div class="navbar">
<h1>Shakespearean Sonnets</h1>
</div>

<button onclick="location.href = 'index.html'">
<span class="material-symbols-rounded">arrow_back</span>
Back
</button>
<div class="navbar-column">
<div class="navbar">
<h1>Shakespearean Sonnets</h1>
</div>

<div id="about-card" class="card column" style="opacity: 0; pointer-events: none;">
<div class="text-center">
<h1 id="version">Loading...</h1>
<p id="whats-new"></p>
</div>
<button onclick="location.href = 'index.html'">
<span class="material-symbols-rounded">arrow_back</span>
Back
</button>
</div>

<div id="about-card" class="card column" style="opacity: 0; pointer-events: none;">
<div class="text-center">
<h1 id="version">Loading...</h1>
<p id="whats-new"></p>
</div>

<div class="row">
<button id="about1" onclick="window.open('https://linfindel.github.io', '_blank')" class="about">
<span class="material-symbols-rounded">home</span>
More projects
</button>
<div class="row">
<button id="about1" onclick="window.open('https://linfindel.github.io', '_blank')" class="about">
<span class="material-symbols-rounded">home</span>
More projects
</button>

<button id="about2" onclick="window.open('https://www.github.com/linfindel/sonnets', '_blank')" class="about">
<span class="material-symbols-rounded">code</span>
View source
</button>
</div>
<button id="about2" onclick="window.open('https://www.github.com/linfindel/sonnets', '_blank')" class="about">
<span class="material-symbols-rounded">code</span>
View source
</button>
</div>
</div>

<script src="version.js"></script>
<script src="version.js"></script>
</body>
</html>
56 changes: 28 additions & 28 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sonnets</title>

<link rel="stylesheet" href="https://linfindel.github.io/nadircss/nadir.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif:wght@300&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sonnets</title>

<link rel="stylesheet" href="https://linfindel.github.io/nadircss/nadir.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif:wght@300&display=swap" rel="stylesheet">
</head>
<body class="column">
<div class="navbar-column">
<div class="navbar">
<h1>Shakespearean Sonnets</h1>
</div>

<button onclick="location.href = 'about.html'">
<span class="material-symbols-rounded">info</span>
About
</button>
<div class="navbar-column">
<div class="navbar">
<h1>Shakespearean Sonnets</h1>
</div>

<div class="search-box">
<span class="material-symbols-rounded">search</span>
<button onclick="location.href = 'about.html'">
<span class="material-symbols-rounded">info</span>
About
</button>
</div>

<input oninput="search(this.value)" class="input-search outline-none" type="number" placeholder="Search for sonnets">
</div>
<div class="search-box">
<span class="material-symbols-rounded">search</span>

<div id="sonnet-container" class="toolbar" style="flex-direction: column; gap: 0; display: none;">
<h3 style="font-family: 'Noto Serif', serif;" id="sonnet-title"></h3>
<input oninput="search(this.value)" class="input-search outline-none" type="number" placeholder="Search for sonnets">
</div>

<div id="sonnet-divider" class="toolbar-divider-horizontal"></div>
<div id="sonnet-container" class="toolbar" style="flex-direction: column; gap: 0; display: none;">
<h3 style="font-family: 'Noto Serif', serif;" id="sonnet-title"></h3>

<p style="font-family: 'Noto Serif', serif;" id="sonnet"></p>
</div>
<div id="sonnet-divider" class="toolbar-divider-horizontal"></div>

<p style="font-family: 'Noto Serif', serif;" id="sonnet"></p>
</div>

<script src="sonnets.js"></script>
<script src="sonnets.js"></script>
</body>
</html>
54 changes: 27 additions & 27 deletions sonnets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3240,40 +3240,40 @@ const sonnetTitleOutput = document.getElementById("sonnet-title");
const sonnetDivider = document.getElementById("sonnet-divider");

function search(sonnetNumber) {
// Check if sonnetNumber is valid
if (sonnetNumber >= 1 && sonnetNumber <= sonnets.length) {
// Subtract 1 from sonnetNumber to match array indexing
const index = sonnetNumber - 1;
// Check if sonnetNumber is valid
if (sonnetNumber >= 1 && sonnetNumber <= sonnets.length) {
// Subtract 1 from sonnetNumber to match array indexing
const index = sonnetNumber - 1;

// Get the relevant sonnet object
const sonnet = sonnets[index];
// Get the relevant sonnet object
const sonnet = sonnets[index];

// Join the lines of the sonnet into a single string with line breaks
const sonnetText = sonnet.lines.join("\n");
// Join the lines of the sonnet into a single string with line breaks
const sonnetText = sonnet.lines.join("\n");

// Format and display title
const sonnetTitle = sonnet.title;
sonnetTitleOutput.innerText = sonnetTitle;
// Format and display title
const sonnetTitle = sonnet.title;
sonnetTitleOutput.innerText = sonnetTitle;

// Set innerText of sonnetOutput to the sonnet text
sonnetOutput.innerText = sonnetText;
// Set innerText of sonnetOutput to the sonnet text
sonnetOutput.innerText = sonnetText;

// Display container
sonnetContainer.style.display = "flex";
sonnetDivider.style.display = "block";
}
// Display container
sonnetContainer.style.display = "flex";
sonnetDivider.style.display = "block";
}

else if (sonnetNumber == "") {
sonnetOutput.innerText = "";
sonnetTitleOutput.innerText = "";
else if (sonnetNumber == "") {
sonnetOutput.innerText = "";
sonnetTitleOutput.innerText = "";

sonnetContainer.style.display = "none";
}
sonnetContainer.style.display = "none";
}

else {
sonnetOutput.innerText = "Invalid sonnet number";
sonnetTitleOutput.innerText = "";
else {
sonnetOutput.innerText = "Invalid sonnet number";
sonnetTitleOutput.innerText = "";

sonnetDivider.style.display = "none";
}
sonnetDivider.style.display = "none";
}
}
22 changes: 11 additions & 11 deletions version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ const username = 'linfindel';
const repo = 'sonnets';

fetch(`https://api.github.com/repos/${username}/${repo}/commits?per_page=1`)
.then(response => {
const totalCount = response.headers.get('Link').match(/page=(\d+)>; rel="last"/)[1] / 100;
return response.json().then(data => {
const latestCommitMessage = data[0].commit.message;
console.log(`Total commit count: ${totalCount}`);
console.log(`Latest commit message: ${latestCommitMessage}`);
.then(response => {
const totalCount = response.headers.get('Link').match(/page=(\d+)>; rel="last"/)[1] / 100;
return response.json().then(data => {
const latestCommitMessage = data[0].commit.message;
console.log(`Total commit count: ${totalCount}`);
console.log(`Latest commit message: ${latestCommitMessage}`);

document.getElementById("version").innerText = `Version ${totalCount} Release Notes`;
document.getElementById("whats-new").innerText = latestCommitMessage;
document.getElementById("version").innerText = `Version ${totalCount} Release Notes`;
document.getElementById("whats-new").innerText = latestCommitMessage;

document.getElementById("about-card").style.opacity = "1";
document.getElementById("about-card").style.pointerEvents = "all";
});
document.getElementById("about-card").style.opacity = "1";
document.getElementById("about-card").style.pointerEvents = "all";
});
})
.catch(error => console.error('Error fetching data:', error));

0 comments on commit 3576f25

Please sign in to comment.