Skip to content

Commit

Permalink
add success message
Browse files Browse the repository at this point in the history
  • Loading branch information
r-carroll committed Aug 13, 2024
1 parent 92a6cd5 commit 6b27c49
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ backend/creds.json
db/data
**/node_modules/**
pi/backend/env.sh
db/env.sh
db/env.sh
public/*
19 changes: 18 additions & 1 deletion content/reading-tracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@
-moz-appearance: textfield;
}

.text-green {
color: green;
}

.mt {
margin-top: 10px;
}

.show {
display: block;
}

.hide {
display: none;
}

#prayer-section button {
position: relative;

Expand Down Expand Up @@ -336,6 +352,7 @@ <h3><span id="tally-display-week-hours"></span> hours and <span id="tally-displa
type="button"
onclick="addTime(event)"
>Add time</button>
<p id="success-message" class="text-green mt hide">Reading added successfully!</p>
</div>
</form>
</div>
Expand All @@ -352,7 +369,7 @@ <h2>Days of the week</h2>
<h2>Minutes spent in each book</h2>
<canvas id="bookChart"></canvas>
</div>

<link rel="stylesheet" href="/toast.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="/reading.js"></script>
<script>
Expand Down
2 changes: 2 additions & 0 deletions static/reading.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ fetch(`${apiUrl}/${tallyType}?minutes=${minutes}&passage=${selectedBook}`, {
{
response.json();
updateTally();
const message = document.getElementById('success-message');
message.classList.replace('hide', 'show');
})
.then((data) => {
console.log('Success:', data);
Expand Down

0 comments on commit 6b27c49

Please sign in to comment.