Skip to content

Commit

Permalink
Theme and last donation update
Browse files Browse the repository at this point in the history
  • Loading branch information
BozarthPrime committed Nov 1, 2023
1 parent b9ee808 commit 8fa462c
Show file tree
Hide file tree
Showing 22 changed files with 101 additions and 30 deletions.
4 changes: 2 additions & 2 deletions countdown-timer/countdown-timer-settings.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ELT.settings = {
// the date-time that the event will start in yyyy-mm-dd hh:mm+hh:mm format (24 hour with timezone offset)
startTime: "2018-11-03 00:00-05:00",
startTime: "2023-11-03 00:00-05:00",
// the date-time the event will end
endTime: "2018-11-03 23:59-05:00",
endTime: "2023-11-03 23:59-05:00",
// if seconds should be shown
displaySeconds: false,
// if a header should be displayed above the timer
Expand Down
Binary file modified docs/images/Countdown-Timer-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Donation-Rotation-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Last-Donation-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Offline-Screen-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Participant-Goal-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Subteam-Participants-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Team-Goal-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/Team-Last-Donation-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/widgets/donation-rotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Displays the name of the each donator and amount they donated to a specified par

### Static

![Donation Rotation](../images/Last-Donation-Preview.png)
![Donation Rotation](../images/Donation-Rotation-Preview.png)

### Animated with header

Expand Down
8 changes: 4 additions & 4 deletions donation-rotation/donation-rotation-settings.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
ELT.settings = {
// animate each donation instead of persist on screen
animate: true,
animate: false,
// animation pause duration
animationPauseMS: 5000,
// direction of animation (left or right)
animateTo: 'left',
// get donation information for this team
participantIds: [],
participantIds: ["523738"],
// name to show if the donor name is null
unknownDonorName: "Mysterious Hero",
// Message displayed when donation amount it private to the donatee
unknownDonationAmountText: "Private Donation",
// if the header message should be shown
showHeader: false,
showHeader: true,
// header message to display at the top of the widget
headerMessage: "Last Donation",
headerMessage: "Donation",
// if the recipiant of the donation should be shown. This is meant
// for when you have more than one participantID
showRecipient: false,
Expand Down
5 changes: 3 additions & 2 deletions donation-rotation/donation-rotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
ELT.api.participant(participantId, function(result) {
result['donationsSeen'] = 0;
$participants[result.participantID] = result;

checkForNewDonations();
updateDonation();
});
});

checkForNewDonations();
updateDonation();
setInterval(checkForNewDonations, ELT.settings.refreshTimeMS);
setInterval(updateDonation, ELT.settings.donationCycleMS);
}
Expand Down
6 changes: 3 additions & 3 deletions last-donation/last-donation-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ ELT.settings = {
// direction of animation
animateTo: 'left',
// get donation information for these participants
participantIds: [],
participantIds: ["523738"],
// name to show if the donor name is null
unknownDonorName: "Mysterious Hero",
// Message displayed when donation amount it private to the donatee
unknownDonationAmountText: "Private Donation",
// if the header message should be shown
showHeader: false,
showHeader: true,
// header message to display at the top of the widget
headerMessage: "Last Donation",
headerMessage: "New Donation!",
// if the recipiant of the donation should be shown. This is meant
// for when you have more than one participantID
showRecipient: false,
Expand Down
14 changes: 11 additions & 3 deletions last-donation/last-donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,20 @@
ELT.api.participant(participantId, function (result) {
result['lastDonationDate'] = new Date();
$participants[result.participantID] = result;

ELT.api.participantDonations(
result.participantID,
function (results) {
console.log(results);
if (results.length > 0) {
checkForNewDonationsOnSuccess(results.slice(0,1));
updateDonation();
}
}
);
});
});

checkForNewDonations();
updateDonation();
setInterval(checkForNewDonations, ELT.settings.refreshTimeMS);
setInterval(updateDonation, ELT.settings.donationCycleMS);
}
Expand All @@ -64,7 +73,6 @@
function checkForNewDonationsOnSuccess(results) {
if (results.length > 0) {
const curParticipant = $participants[results[0].participantID];
console.log(curParticipant.lastDonationDate);

if (curParticipant != null) {
curParticipant.lastDonationDate = new Date(results[0].createdDateUTC);
Expand Down
2 changes: 1 addition & 1 deletion participant-goal/participant-goal-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ ELT.settings = {
// how often should data be refreshed
refreshTimeMS: 15000,
// Have the progress bar
progressBar: true
progressBar: false
};
48 changes: 48 additions & 0 deletions styles-rounded.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Default rounded theme
*
* To change to this theme copy the contents of this file to style.css
*/

html {
font-size: 1rem;
}

body {
font-family: "Gilroy", "Proxima Nova", arial, sans-serif;
margin: 0;
}

#tracking-container {
border: 2px solid;
position: relative;
background-color: #26C2EB; /* Extra Life Dark Blue */
border: none;
color: #ffffff;
}

#header {
background-color: #1D4C6C; /* Extra Life Light Blue */
display: block;
font-size: 1em;
font-weight: bold;
line-height: 1em;
padding: 3px;
position: relative;
left: -3px;
top: -3px;
width: 100%;
}

.elt {
font-size: 1.4em;
line-height: 1.4em;
padding: 3px;
position: relative;
text-align: center;
}

.small-text {
font-size: 0.6em;
line-height: 0.7em;
}
File renamed without changes.
6 changes: 4 additions & 2 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ html {

body {
font-family: "Gilroy", "Proxima Nova", arial, sans-serif;
margin: 0;
margin: 10px;
}

#tracking-container {
border: 2px solid;
position: relative;
background-color: #26C2EB; /* Extra Life Dark Blue */
border-color: #C73047; /* CMN Hospitals Red */
border: none;
color: #ffffff;
border-radius: 15px;
}

#header {
border-radius: 15px 15px 0 0;
background-color: #1D4C6C; /* Extra Life Light Blue */
display: block;
font-size: 1em;
Expand Down
2 changes: 1 addition & 1 deletion subteam-participants/subteam-participants-settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ELT.settings = {
// array of participants to get data for
participantIds: ["318404", "297208", "297051"],
participantIds: ["523738", "508530"],
// number of participants to display at once.
// If the number of participants is larger than the
// number displayed participants will be cycled
Expand Down
2 changes: 1 addition & 1 deletion team-goal/team-goal-settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ELT.settings = {
// Single team to get information for.
teamId: "38901",
teamId: "64243",
// how often should data be refreshed
refreshTimeMS: 15000,
};
4 changes: 2 additions & 2 deletions team-last-donation/team-last-donation-settings.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ELT.settings = {
// animate the last donation instead of persist on screen
animate: false,
animate: true,
// animation pause duration
animationPauseMS: 5000,
// direction of animation
animateTo: 'left',
// get donation information for this team
teamId: "64013",
teamId: "64243",
// name to show if the donor name is null
unknownDonorName: "Mysterious Hero",
// Message displayed when donation amount it private to the donatee
Expand Down
28 changes: 20 additions & 8 deletions team-last-donation/team-last-donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
$header.remove();
}

if (ELT.settings.animate) {
$trackingContainer.addClass('animate')
// add animation direction
.addClass(`animate-${ELT.settings.animateTo}`);
}

if (ELT.settings.showRecipient) {
$donationConjunction.html(ELT.settings.conjunctionText);
} else {
Expand All @@ -42,8 +36,26 @@
});
});

checkForNewDonations();
updateDonation();
if (ELT.settings.animate) {
$trackingContainer.addClass('animate')
// add animation direction
.addClass(`animate-${ELT.settings.animateTo}`);
} else {
// If we are not animating we should get the most recent donation
// to display
ELT.api.teamDonations(
ELT.settings.teamId,
function (results) {
if (results.length > 0) {
$newDonations = $newDonations.concat(results[0]);
lastDonationDate = new Date(results[0].createdDateUTC);
}

updateDonation();
}
);
}

setInterval(checkForNewDonations, ELT.settings.refreshTimeMS);
setInterval(updateDonation, ELT.settings.donationCycleMS);
}
Expand Down

0 comments on commit 8fa462c

Please sign in to comment.