Merge branch 'main' of https://github.com/jottocraft/dtps into dev
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index e577477..2ee1c3d 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -7,19 +7,32 @@
branches: [ dev ]
jobs:
- deploy:
+ dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
+
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- - run: |
+
+ - name: Configure git
+ env:
+ SSH_AUTH_SOCK: /tmp/ssh_agent.sock
+ run: |
+ mkdir -p ~/.ssh
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
+ ssh-agent -a $SSH_AUTH_SOCK > /dev/null
+ ssh-add - <<< "${{ secrets.DTPS_DEV_PRIVATE_KEY }}"
git config user.name github-actions
git config user.email [email protected]
- git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- - run: npm ci
- - run: npm run dev --if-present
+
+ - name: Run npm scripts
+ env:
+ SSH_AUTH_SOCK: /tmp/ssh_agent.sock
+ run: |
+ npm ci
+ npm run dev --if-present
diff --git a/build.js b/build.js
index 0d5a3e9..bd34d0c 100644
--- a/build.js
+++ b/build.js
@@ -19,12 +19,18 @@
const mkdirp = require('mkdirp');
const rimraf = require("rimraf");
const ncp = require('ncp').ncp;
+const dev = process.argv.includes("--dev");
//Delete existing build folder
rimraf.sync("./build/*");
//Run functions
-minifyJS();
+if (dev) {
+ console.log("\n[1/3] Skipping minification (dev)");
+ copyStatic();
+} else {
+ minifyJS();
+}
//[1/3] Minify JavaScript
function minifyJS() {
@@ -71,10 +77,22 @@
//Copy dtps.css
fs.copyFileSync("dtps.css", "build/dtps.css");
+ //Write CNAME
+ fs.writeFileSync(path.join("build", "CNAME"), dev ? "dev.dtps.jottocraft.com" : "powerplus.app", "utf8");
+
//Copy www
ncp("www", "build", function () {
- console.log("[2/3] Done");
- generateDocs();
+ //If dev, copy JS files without minifying
+ if (dev) {
+ fs.copyFileSync("init.js", "build/init.js");
+ ncp("scripts", "build/scripts", function () {
+ console.log("[2/3] Done");
+ generateDocs();
+ });
+ } else {
+ console.log("[2/3] Done");
+ generateDocs();
+ }
});
}
diff --git a/dtps.css b/dtps.css
index 49d07c2..c6f54a5 100644
--- a/dtps.css
+++ b/dtps.css
@@ -3,6 +3,16 @@
(c) jottocraft 2018-2020
*/
+[data-theme-type=light] {
+ --theme: #ccac56 !important;
+ --themeText: #ffffff !important;
+}
+
+[data-theme-type=dark] {
+ --theme: #8c793e !important;
+ --themeText: #ffffff !important;
+}
+
.dashboardItem {
text-align: center;
padding: 20px;
@@ -190,7 +200,7 @@
}
.discussionReply {
- border-left: 2px solid var(--darker);
+ border-left: 2px solid var(--elementHover);
padding: 10px 0px;
padding-left: 30px;
}
@@ -200,25 +210,25 @@
color: var(--lightText);
}
-.dash .card .colorBar {
+.dash .colorBar {
width: 7px;
- height: calc(100% - 40px);
+ height: calc(100% - 32px);
position: absolute;
- top: 20px;
+ top: 16px;
left: 14px;
border-radius: 10px;
display: block !important;
}
-body.dark .dash .card .colorBar {
+body.dark .dash .colorBar {
background: var(--classColor);
}
-body.light .dash .card .colorBar {
+body.light .dash .colorBar {
background: var(--classColor);
}
-.card .colorBar {
+.colorBar {
display: none;
}
@@ -228,14 +238,19 @@
font-size: 16px;
}
-.dropped {
- filter: opacity(0.4);
+
+.assessmentWrapper.dropped span.assessmentTitle, .assessmentWrapper.dropped .editableScore:not(.focused) {
+ opacity: 0.4;
}
-.dropped span.assessmentTitle {
+.assessmentWrapper.dropped span.assessmentTitle {
text-decoration: line-through;
}
+.assessmentWrapper span.assessmentTitle {
+ transition: opacity 0.2s;
+}
+
/* POWERPOINTS THEME */
body.darkPowerpoints, body.showThemeWindows .themeWindow.darkPowerpoints {
--flex-light: #b39a46; --flex-bg: #a78e3a; --flex-text: #ffffff; --flex-sectext: #e4d8ae; --flex-layer1: #867027; --flex-layer2: #726021; --flex-layer3: #5f4f1c; --theme-color: #6d6d6d; --theme-text-color: #b39a46; --links: #686868; --acrylic: black; }
@@ -267,14 +282,6 @@
color: var(--secText);
}
-/* Fluid UI theme prefs */
-:root {
- --icons: "Material Icons Outlined", "Material Icons Extended" !important; }
-
-.blur * {
- pointer-events: none !important;
-}
-
.numFont {
font-family: Cascadia Code,Consolas,Andale Mono WT,Andale Mono,Lucida Console,Lucida Sans Typewriter,DejaVu Sans Mono,Bitstream Vera Sans Mono,Liberation Mono,Nimbus Mono L,Monaco,Courier New,Courier,monospace !important;
}
@@ -284,46 +291,18 @@
}
.classContent .card.collapsed h4 {
- font-size: 24px !important;
+ font-size: 18px !important;
font-weight: normal !important;
}
.classContent .card.collapsed h4 i {
- margin-top: -6px;
+ margin-top: -3px;
}
.classContent .card.collapsed .moduleContents {
display: none;
}
-table.dtpsTable {
- border-collapse: collapse;
-}
-
-table.dtpsTable, table.dtpsTable * {
- border-color: transparent !important;
-}
-
-table.dtpsTable tr, table.dtpsTable td {
- height: 32px !important;
- padding: 0px;
-}
-
-table.dtpsTable th {
- padding-left: 0px;
- padding-right: 0px;
-}
-
-table.dtpsTable td:first-child {
- border-top-left-radius: 10px;
- border-bottom-left-radius: 10px;
-}
-
-table.dtpsTable td:last-child {
- border-top-right-radius: 10px;
- border-bottom-right-radius: 10px;
-}
-
.classGradeCircle {
display: inline-block;
height: 60px;
@@ -512,13 +491,6 @@
background: linear-gradient(to right bottom, rgb(177, 168, 35), rgb(8, 101, 59)) !important;
}
-@media (min-width: 1001px) {
- .card.focus {
- max-height: calc(100vh - 50px);
- top: 25px !important;
- }
-}
-
.announcement:not(.open) {
max-height: 200px;
}
@@ -573,19 +545,6 @@
color: white;
}
-.card .dot {
- right: 0;
- background-color: #e9e8e8;
- border-radius: 20px;
- display: inline-block;
- position: absolute;
- margin-top: 10px;
- height: 35px;
- padding: 0px 10px;
- line-height: 35px;
- font-size: 20px;
-}
-
body.dark .card .dot {
background-color: #181b1d;
}
@@ -595,13 +554,6 @@
top: 75;
}
-.sidebar .item .label {
- max-width: calc(100% - 40px);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
.sidebar .item:not(.active) {
filter: none !important;
}
@@ -610,16 +562,10 @@
filter: brightness(1.2) !important;
}
-body.collapsedSidebar .sidebar .bigLogo {
- display: none;
-}
-
-.sidebar {
- box-shadow: 10px 0px 30px rgba(0, 0, 0, 0.03) !important;
-}
-
-body.hasSidebar {
- padding: 0px !important;
+.sidebar .item .label {
+ max-width: calc(100% - 32px);
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.classDivider {
@@ -631,8 +577,17 @@
margin: 15px 0;
}
-.hidegrades .class .grade.val {
- display: none !important;
+.sidebar .item .grade {
+ text-align: center;
+ width: 22px;
+ font-size: 18px;
+ font-family: var(--textFont);
+ font-weight: bold;
+}
+
+.hidegrades .sidebar .item .grade {
+ visibility: hidden !important;
+ width: 0px;
}
.class .icon {
@@ -675,11 +630,6 @@
margin-left: 0px;
}
-body.collapsedSidebar .header {
- width: calc(100% - 80px);
- margin-left: 80px;
-}
-
body.titlebar .background, body.titlebar .cover.image {
position: fixed;
height: 75px;
@@ -708,11 +658,6 @@
width: 100%;
}
-body.collapsedSidebar .classContent {
- margin-left: 80px;
- width: calc(100% - 80px);
-}
-
body.titlebar .header h1 {
font-size: 40px;
line-height: 75px;
@@ -735,17 +680,8 @@
}
.classContent {
- margin-left: 275px;
- padding-top: 300px;
z-index: 100;
top: 0;
- width: calc(100% - 275px);
-}
-
-body.titlebar .classContent {
- position: absolute;
- top: 0;
- margin-top: 321px;
}
.tabs.btns {
@@ -780,10 +716,6 @@
transition: all 0.5s;
}
-.classContent {
- transition: all 0.5s, color 0s, background-color 0s, background 0s;
-}
-
.dot {
display: none;
}
@@ -803,7 +735,6 @@
.header {
margin-left: 275px;
text-align: center;
- color: white;
padding-top: 132px;
z-index: 200;
position: absolute;
@@ -812,7 +743,7 @@
}
.classContent .card {
- margin: 25px 75px;
+ margin: 12px 20px;
text-align: left;
border-radius: 25px;
}
@@ -829,14 +760,6 @@
margin: 25px;
}
-#headText {
- -webkit-transition: opacity .5s ease-in-out;
- -moz-transition: opacity .5s ease-in-out;
- -ms-transition: opacity .5s ease-in-out;
- -o-transition: opacity .5s ease-in-out;
- transition: opacity .5s ease-in-out;
-}
-
.spinner {
width: 40px;
height: 40px;
@@ -879,24 +802,24 @@
flex-shrink: 0;
}
-.classContent .card .points.spinner {
+.classContent .points.spinner {
top: 25px;
margin-top: 0px;
}
-.classContent .card .points .earned {
+.classContent .points .earned {
font-size: 24px;
display: inline-block;
font-weight: bold;
}
-.classContent .card .points .total {
+.classContent .points .total {
font-size: 14px;
display: inline-block;
color: var(--secText);
}
-.classContent .card:not(.color) .points .total, .assignment:not(.color) .weighted {
+.classContent .assignment:not(.color) .points .total, .assignment:not(.color) .weighted {
color: var(--secText);
}
@@ -982,14 +905,24 @@
display: none;
}
-.card.assignment {
+.assignment {
cursor: pointer;
- padding: 18px 25px;
+ padding: 15px 18px;
+ position: relative;
+ border-radius: var(--cardRadius);
+ border: 2px solid transparent;
+ transition: border 0.2s, background-color 0.2s;
+ user-select: none;
}
-.classContent .card.assignment h5 {
+.assignment:hover {
+ background-color: var(--elements);
+ border-color: var(--highlight);
+}
+
+.classContent .assignment h5 {
margin: 0px;
- margin-top: 10px;
+ margin-top: 6px;
font-size: 1rem !important;
min-height: 20px;
}
@@ -1009,7 +942,7 @@
text-overflow: ellipsis;
}
-.card.assignment .statusIcon {
+.assignment .statusIcon {
float: right;
font-size: 16px;
vertical-align: middle;
@@ -1026,7 +959,7 @@
--light: var(--flex-light, #949494); --norm: var(--flex-layer1, #444444); --dark: var(--flex-layer3, #292929); --grad: linear-gradient(to bottom right, var(--cards), var(--background)); }
body:not(.dark) .background, body:not(.dark) .header h1 {
- --grad: linear-gradient(to bottom right, var(--darker), var(--background)) !important; color: black !important;
+ --grad: linear-gradient(to bottom right, var(--elementHover), var(--background)) !important; color: black !important;
}
#whatIfResults {
@@ -1158,8 +1091,8 @@
}
.card.module h4 {
- margin: 5px 2px;
- font-size: 32px;
+ margin: 0px 2px;
+ font-size: 24px;
font-weight: bold;
}
@@ -1171,8 +1104,8 @@
.moduleItem {
color: var(--lightText);
- padding:10px;
- font-size:17px;
+ padding:5px;
+ font-size:14px;
border-radius:15px;
margin:5px 0;
cursor: pointer;
@@ -1180,7 +1113,8 @@
.moduleItem i {
vertical-align: middle;
- margin-right: 10px;
+ margin-right: 4px;
+ font-size: 20px;
}
.background, .cover.image {
@@ -1217,15 +1151,15 @@
transition: all 0.5s;
}
-.dash .card.assignment {
+.dash .assignment {
padding-left: 34px;
}
-.dash .card .weighted {
+.dash .weighted {
color: var(--classColor) !important;
}
-.dash .card .weighted {
+.dash .weighted {
opacity: 0.7;
}
@@ -1233,72 +1167,6 @@
display: none !important;
}
-body.titlebar .items.toolbar {
- display: none !important;
-}
-
-.items.toolbar {
- position: absolute;
- right: 0;
- top: 0;
- margin: 12px;
- color: white;
- padding-right: 10px;
- z-index: 300;
-}
-
-.items.toolbar .itemButton {
- display: inline-block;
- font-size: 12px;
- padding: 5px;
- margin: 0px 4px;
- border-radius: 12px;
- cursor: pointer;
- color: var(--text);
-}
-
-.items.toolbar .itemButton i {
- font-size: 18px;
- margin: 0px;
- margin-right: 5px;
- vertical-align: middle;
-}
-
-.items.toolbar .itemButton img {
- width: 18px;
- height: 18px;
- margin: 0px;
- margin-right: 5px;
- vertical-align: middle;
-}
-
-body:not(.dark) .items.toolbar, body:not(.dark) .items.toolbar i, body:not(.dark) .items.toolbar h4, body:not(.dark) #timeRemaining {
- color: black !important;
-}
-
-body:not(.dark) #headText {
- color: black !important;
-}
-
-body:not(.dark) .items.toolbar.black, body:not(.dark) .items.toolbar.black i, body:not(.dark) .items.toolbar.black h4 {
- color: black !important;
-}
-
-.items.toolbar h4 {
- vertical-align: middle;
- display: inline-block;
- margin: 0;
- margin-right: 5px;
-}
-
-.items.toolbar i {
- cursor: pointer;
- vertical-align: middle;
- margin-left: 7px;
- margin-right: 7px;
- margin-top: 3px;
-}
-
.item.link {
font-size: 20px;
cursor: pointer;
@@ -1472,13 +1340,35 @@
vertical-align: middle;
}
+#calendar .fc-daygrid-day {
+ border-radius: 5px;
+ transition: background-color 0.4s;
+ cursor: pointer;
+}
+
+#calendar .fc-daygrid-day:hover {
+ background-color: var(--elements);
+}
+
+#calendar .fc-daygrid-day.active {
+ background-color: var(--elementHover);
+}
+
#calendar .fc-event-title span {
vertical-align: middle;
}
#calendar .fc-daygrid-day.fc-day-today {
background-color: var(--theme);
- border-radius: 5px;
+}
+
+#calendar.dateSelected .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
+ border-radius: 50%;
+ background-color: var(--theme);
+}
+
+#calendar.dateSelected .fc-daygrid-day.fc-day-today {
+ background-color: transparent;
}
#calendar .fc-daygrid-day.fc-day-today a {
@@ -1514,10 +1404,185 @@
}
.classToolChip:hover {
- background-color: var(--darker);
+ background-color: var(--elementHover);
transition: background-color 0.2s;
}
body {
- --cardShadow: 0 5px 15px rgb(0 0 0 / 0.1) !important;
+ --cardShadow: 0 5px 15px rgb(0 0 0 / 0.08) !important;
+}
+
+.headerArea {
+ margin: 10px 20px;
+ width: auto;
+ height: 250px;
+}
+
+body.themeImage .headerArea .content {
+ background: none !important;
+}
+
+#dtpsUnstable {
+ position: absolute;
+ color: #ff4e4e;
+ cursor: auto;
+}
+
+@media(max-width: 1550px) {
+ #dtpsUnstable {
+ top: 55px;
+ right: 5px;
+ }
+}
+
+body:not(.themeImage) .headerArea:not(.classImage) h1 {
+ text-shadow: none !important;
+}
+
+body.themeImage .headerArea img {
+ display: none !important;
+}
+
+.headerArea img {
+ opacity: 0.3;
+}
+
+body.dark .headerArea img {
+ opacity: 0.2;
+}
+
+#headText {
+ transition: color 0.2s;
+}
+
+.gradeSummaryShowHide {
+ margin: 10px 0px;
+ cursor: pointer;
+ text-align: center;
+}
+
+.gradeSummaryShowHide i, .gradeSummaryShowHide span {
+ vertical-align: middle;
+}
+
+.gradeSummaryShowHide i {
+ margin-right: 5px;
+}
+
+#classGradeMore {
+ margin: 0px 20px;
+ padding: 20px;
+}
+
+.block.status .bottom {
+ font-size: 18px;
+}
+
+.block .previousGrade {
+ font-size: 14px;
+ opacity: 0.5;
+ position: absolute;
+ top: 50px;
+}
+
+.fixedGradeSummary #gradeSummary {
+ box-shadow: var(--lightShadow);
+ left: 275px;
+ padding: 20px;
+ position: fixed;
+ top: 60px;
+ z-index: 99;
+ width: calc(100% - 275px);
+ margin: 0px !important;
+ background: var(--navbar);
+ backdrop-filter: blur(20px);
+}
+
+.classContent.fixedGradeSummary {
+ padding-top: 160px;
+}
+
+.block .showActualGrades {
+ font-size: 14px;
+ position: absolute;
+ top: 50px;
+ color: var(--secText);
+ cursor: pointer;
+}
+
+#classGradeMore .table tr.active {
+ background-color: var(--classColor);
+}
+
+#classGradeMore .table tr.active, #classGradeMore .table tr.active * {
+ color: white;
+ font-weight: bold;
+}
+
+#classGradeMore.whatIf .table tr.active {
+ background-color: var(--elements);
+}
+
+#classGradeMore.whatIf .table tr.active, #classGradeMore.whatIf .table tr.active * {
+ color: var(--classColor);
+}
+
+.editableScore {
+ outline: none;
+ font-size: 20px;
+ vertical-align: middle;
+ display: inline-block;
+ padding: 2px 5px;
+ border-radius: 5px;
+ margin-right: 5px;
+ transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
+ border: 2px solid transparent;
+ width: 45px;
+ text-align: center;
+}
+
+.editableScore.modified, .editableScore.focused {
+ background-color: var(--inputColor);
+ border-color: var(--elements);
+}
+
+.teacherName {
+ color: var(--text);
+ font-size: 18px;
+}
+
+.teacherImage {
+ margin-right: 4px;
+ height: 32px;
+ width: 32px;
+ border-radius: 50%;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-size: cover;
+ background-color: var(--elements);
+ vertical-align: middle;
+}
+
+#dtpsSearchResults {
+ position: fixed;
+ z-index: 100;
+ width: 500px;
+ top: 70px;
+ left: calc(50% - 250px);
+ box-shadow: 0px 0px 20px rgb(0 0 0 / 0.5);
+ border: 2px solid var(--elements);
+}
+
+#dtpsSearchResults h5 {
+ margin-top: 0px;
+}
+
+#dtpsSearchResults h5 i {
+ vertical-align: middle;
+}
+
+#dtpsSearchResults h5 span {
+ font-size: 18px;
+ font-weight: bold;
+ vertical-align: middle;
}
\ No newline at end of file
diff --git a/package.json b/package.json
index 4d32ecf..acc2ca6 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,8 @@
"build": "node build.js",
"predeploy": "npm run build",
"deploy": "gh-pages -d build -m \"npm deploy\"",
+ "predev": "npm run build -- --dev",
+ "dev": "gh-pages -d build -m \"npm dev\" -r [email protected]:jottocraft/dtps-dev.git -b main",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
diff --git a/scripts/assignments.js b/scripts/assignments.js
index 5dadc93..903b432 100644
--- a/scripts/assignments.js
+++ b/scripts/assignments.js
@@ -10,15 +10,16 @@
* Renders HTML for an assignment item in a list
*
* @param {Assignment} assignment The assignment object to render
+ * @param {string} [childDisplay] Text to display for specifying the child or children this assignment is for
* @return {string} Assignment HTML for use in a list
*/
-dtps.renderAssignment = function (assignment) {
+dtps.renderAssignment = function (assignment, childDisplay) {
//Render points/letter score
var scoreHTML = dtps.renderAssignmentScore(assignment);
var HTML = /*html*/`
<div
- onclick="${`dtps.assignment('` + assignment.id + `', ` + assignment.class + `)`}"
+ onclick="${`dtps.assignment('` + assignment.id + `', ` + assignment.class + `, ` + (!isNaN(childDisplay) ? true : false) + `)`}"
class="card ${scoreHTML ? "graded assignment" : "assignment"}"
style="${'--classColor: ' + dtps.classes[assignment.class].color}"
>
@@ -39,12 +40,13 @@
${assignment.dueAt ? `<div class="infoChip"><i style="margin-top: -2px;" class="material-icons">alarm</i> Due ` + dtps.formatDate(assignment.dueAt) + `</div>` : ""}
${assignment.outcomes ? `<div class="infoChip weighted"><i class="material-icons">adjust</i>` + assignment.outcomes.length + `</div>` : ""}
${assignment.category ? `<div class="infoChip weighted"><i class="material-icons">category</i> ` + assignment.category + `</div>` : ""}
+ ${childDisplay ? `<div class="infoChip weighted"><i class="material-icons">person</i> ` + childDisplay + `</div>` : ""}
<!-- Status icons -->
${assignment.turnedIn ? `<i title="Assignment submitted" class="material-icons statusIcon" style="color: #0bb75b;">assignment_turned_in</i>` : ``}
${assignment.missing ? `<i title="Assignment is missing" class="material-icons statusIcon" style="color: #c44848;">remove_circle_outline</i>` : ``}
${assignment.late ? `<i title="Assignment is late" class="material-icons statusIcon" style="color: #c44848;">assignment_late</i>` : ``}
- ${assignment.locked ? `<i title="Assignment submissions are locked" class="material-icons statusIcon" style="font-family: 'Material Icons Extended'; color: var(--secText, gray);">lock_outline</i>` : ``}
+ ${assignment.locked ? `<i title="Assignment submissions are locked" class="material-icons statusIcon" style="color: var(--secText, gray);">lock_outline</i>` : ``}
${assignment.pending ? `<i title="Grade is pending review" class="material-icons statusIcon" style="color: #b3b70b;">rate_review</i>` : ``}
</h5>
</div>
@@ -67,7 +69,7 @@
var rubricHTML = [];
assignment.rubric.forEach(rubricItem => {
- if (rubricItem.score) {
+ if (rubricItem.score !== undefined) {
rubricHTML.push(/*html*/`
<div title="${rubricItem.title}" style="color: ${rubricItem.color || "var(--text)"};">
${rubricItem.score}
@@ -93,9 +95,46 @@
}
/**
+* Merges and renders assignments for children in the same class
+*
+* @param {Assignment[]} assignments An array of assignment objects to merge
+* @return {string} HTML with the assignments merged and labelled
+*/
+dtps.mergeAndRenderChildAssignments = function(assignments) {
+ var assignmentGroups = [];
+
+ assignments.forEach(assignment => {
+ var matchedGroup = false;
+ assignmentGroups.forEach(group => {
+ var groupAssignment = group[0];
+
+ //Check if assignment matches group assignment
+ var matchKeys = ["id", "dueAt", "locked", "category", "turnedIn", "late", "missing", "grade", "value", "letter"];
+ var matches = 0;
+ matchKeys.forEach(k => {
+ if (assignment[k] == groupAssignment[k]) matches++;
+ });
+
+ if (matches == matchKeys.length) {
+ matchedGroup = true;
+ group.push(assignment);
+ }
+ });
+
+ if (!matchedGroup) {
+ assignmentGroups.push( [ assignment ] );
+ }
+ });
+
+ return assignmentGroups.map(g => {
+ return dtps.renderAssignment(g[0], g.length == 1 ? dtps.user.children.find(c => c.id == dtps.classes[g[0].class].userID).name : g.length);
+ }).join("");
+}
+
+/**
* Renders the DTPS dashboard and calls dtps.renderCalendar, dtps.renderUpdates, and dtps.renderUpcoming
*/
-dtps.masterStream = function () {
+dtps.mainStream = function () {
//Ensure classes are rendered in the sidebar
dtps.presentClass("dash");
dtps.showClasses();
@@ -128,17 +167,19 @@
//Render HTML with loading placeholder
if (dtps.selectedClass == "dash") {
jQuery(".classContent").html(/*html*/`
- <div class="dash cal" style="width: 40%;display: inline-block; vertical-align: top;">
- ${dtps.leftDashboard.map(dashboardItem => {
+ <div style="letter-spacing: 0px;">
+ <div style="float: left; width: 45%; display: inline-block;" class="dash">
+ ${dtps.leftDashboard.map(dashboardItem => {
return dashboardContainerHTML(dashboardItem);
}).join("")}
- </div>
+ </div>
- <div style="width: 59%; display: inline-block;" class="dash stream">
- ${!doneLoading ? `<div style="margin: 75px 25px 10px 75px;"><div class="spinner"></div></div>` : ""}
- ${dtps.rightDashboard.map(dashboardItem => {
+ <div style="float: left; width: 55%; display: inline-block;" class="dash">
+ ${!doneLoading ? `<div style="margin: 75px 25px 10px 75px;"><div class="spinner"></div></div>` : ""}
+ ${dtps.rightDashboard.map(dashboardItem => {
return dashboardContainerHTML(dashboardItem);
}).join("")}
+ </div>
</div>
`);
}
@@ -147,21 +188,46 @@
dtps.renderUpdates();
//Render upcoming assignments stream
- dtps.renderUpcoming(doneLoading);
+ dtps.renderUpcoming();
//Render calendar
- dtps.calendar();
+ dtps.calendar(doneLoading);
//Render due today
dtps.renderDueToday(doneLoading);
}
/**
+ * Checks if a due date is on a date
+ *
+ * @param {Date} date Date to check
+ * @param {Date} [onDate] Date checked against (defaults to today)
+ */
+dtps.isDueOnDate = function (date, onDate) {
+ var today = onDate ? new Date(onDate) : new Date();
+ var tomorrow = new Date(today.getTime() + 86400000);
+ var d1 = new Date(date);
+
+ var isActuallyTodayAfter9 = d1.getFullYear() === today.getFullYear() &&
+ d1.getMonth() === today.getMonth() &&
+ d1.getDate() === today.getDate() &&
+ d1.getHours() >= 9;
+
+ var isTomorrowBefore9 = d1.getFullYear() === tomorrow.getFullYear() &&
+ d1.getMonth() === tomorrow.getMonth() &&
+ d1.getDate() === tomorrow.getDate() &&
+ d1.getHours() < 9;
+
+ return isActuallyTodayAfter9 || isTomorrowBefore9;
+}
+
+/**
* Compiles and displays due today / to-do stream
*
* @param {boolean} doneLoading True if all classes have finished loading their assignment lists
+ * @param {Date} [fromDate] The date to display assignments from. Defaults to the current date.
*/
-dtps.renderDueToday = function (doneLoading) {
+dtps.renderDueToday = function (doneLoading, fromDate) {
//Combine class stream arrays
var combinedStream = [];
if (dtps.classes) {
@@ -170,7 +236,7 @@
//If course has assignments, add them to the combined stream array
course.assignments.forEach(assignment => {
//Only assignments that are due today
- if (dtps.isToday(assignment.dueAt)) {
+ if (dtps.isDueOnDate(assignment.dueAt, fromDate)) {
combinedStream.push(assignment);
}
})
@@ -190,21 +256,25 @@
});
//Get due today stream HTML
- var combinedHTML = combinedStream.map(assignment => {
- return dtps.renderAssignment(assignment);
- }).join("");
+ if (dtps.user.parent) {
+ var combinedHTML = dtps.mergeAndRenderChildAssignments(combinedStream);
+ } else {
+ var combinedHTML = combinedStream.map(assignment => {
+ return dtps.renderAssignment(assignment);
+ }).join("");
+ }
if (combinedStream.length == 0) {
//Nothing due today
if (doneLoading) {
- combinedHTML = `<p style="text-align: center;margin: 10px 25px 10px 75px; font-size: 18px;"><i class="material-icons">done</i> Nothing due today</p>`;
+ combinedHTML = `<p style="text-align: center;margin: 10px 0px; font-size: 18px;"><i class="material-icons">done</i> ${fromDate ? "Nothing is due on " + fromDate.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }) : "Nothing is due today"}</p>`;
} else {
combinedHTML = ``;
}
} else {
//Add header
combinedHTML = /*html*/`
- <h5 style="text-align: center; margin: 10px 25px 10px 75px; font-weight: bold;">Due today</h5>
+ <h5 style="text-align: center; margin: 10px 0px; font-weight: bold;">${fromDate ? "Due on " + fromDate.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }) : "Due Today"}</h5>
` + combinedHTML;
}
@@ -215,9 +285,12 @@
/**
* Compiles and displays upcoming assignments stream
+ *
+ * @param {Date} [fromDate] The date to display assignments from. Defaults to the current date.
*/
-dtps.renderUpcoming = function () {
+dtps.renderUpcoming = function (fromDate) {
//Combine class stream arrays
+ var today = fromDate ? new Date(fromDate) : new Date();
var combinedStream = [];
if (dtps.classes) {
dtps.classes.forEach(course => {
@@ -225,7 +298,7 @@
//If course has assignments, add them to the combined stream array
course.assignments.forEach(assignment => {
//Only include upcoming assignments that aren't due today
- if ((new Date(assignment.dueAt) > new Date()) && !dtps.isToday(assignment.dueAt)) {
+ if ((new Date(assignment.dueAt).getTime() > today.getTime()) && !dtps.isDueOnDate(assignment.dueAt, today)) {
combinedStream.push(assignment);
}
})
@@ -244,10 +317,19 @@
return 0;
});
+ //Limit stream length to 30 assignments
+ if (combinedStream.length > 30) {
+ combinedStream.length = 30;
+ }
+
//Render upcoming assignments stream
- var combinedHTML = combinedStream.map(assignment => {
- return dtps.renderAssignment(assignment);
- }).join("");
+ if (dtps.user.parent) {
+ var combinedHTML = dtps.mergeAndRenderChildAssignments(combinedStream);
+ } else {
+ var combinedHTML = combinedStream.map(assignment => {
+ return dtps.renderAssignment(assignment);
+ }).join("");
+ }
//No upcoming assignments
if (combinedStream.length == 0) {
@@ -261,11 +343,22 @@
/**
* Renders updates stream (recently graded & announcements)
+ *
+ * @param {boolean} [dateSelected] True if a date is selected in the dashboard
*/
-dtps.renderUpdates = function () {
+dtps.renderUpdates = function (dateSelected) {
//Get updates HTML
var updatesHTML = "";
+ if (dateSelected && (dtps.selectedClass == "dash")) {
+ return jQuery(".classContent .dash .updatesStream").html(/*html*/`
+ <div style="cursor: auto; padding: 20px; --classColor: var(--secText);" class="announcement card open">
+ <div class="className">Date Selected</div>
+ <p>Updates are not shown while a date is selected</p>
+ </div>
+ `);
+ }
+
dtps.updates.forEach(update => {
if (update.type == "announcement") {
updatesHTML += /*html*/`
@@ -285,7 +378,7 @@
${scoreHTML ? `<div class="points">${scoreHTML}</div>` : ``}
</h5>
- <p>Graded at ${dtps.formatDate(update.gradedAt)}</p>
+ <p>${dtps.user.parent ? "Graded for " + dtps.user.children.find(c => c.id == dtps.classes[update.class].userID).name : "Graded"} at ${dtps.formatDate(update.gradedAt)}</p>
</div>
`;
}
@@ -299,8 +392,10 @@
/**
* Compiles and displays the assignment calendar
+ *
+ * @param {boolean} doneLoading True if all classes have finished loading their assignment lists
*/
-dtps.calendar = function () {
+dtps.calendar = function (doneLoading) {
if (dtps.selectedClass == "dash") {
//Calendar events array
var calEvents = [];
@@ -310,18 +405,36 @@
if (course.assignments) {
//Class has assignments
course.assignments.forEach(assignment => {
- calEvents.push({
- title: assignment.title,
- start: assignment.dueAt,
- id: assignment.id,
- allDay: true,
- backgroundColor: course.color,
- borderColor: (assignment.missing === true) ? '#c44848' : 'transparent',
- textColor: "white",
- classNum: courseIndex,
- assignmentID: assignment.id,
- missing: assignment.missing
- });
+ //Show assignments due before 9AM on the previous day
+ var date = new Date(assignment.dueAt);
+ if (date.getHours() < 9) {
+ //Set the date to 23:59 the previous day for calendar display
+ date.setTime(date.getTime() - 86400000);
+ date.setHours(23);
+ date.setMinutes(59);
+ }
+
+ var existingEvent = calEvents.find(e => e.id == assignment.id);
+ if (existingEvent && assignment.missing) {
+ //Mark existing event as missing and link to missing assignment
+ existingEvent.missing = true;
+ existingEvent.borderColor = "#c44848";
+ existingEvent.assignmentID = assignment.id;
+ existingEvent.classNum = courseIndex;
+ } else if (!existingEvent) {
+ calEvents.push({
+ title: assignment.title,
+ start: date,
+ id: assignment.id,
+ allDay: true,
+ backgroundColor: course.color,
+ borderColor: (assignment.missing === true) ? '#c44848' : 'transparent',
+ textColor: "white",
+ classNum: courseIndex,
+ assignmentID: assignment.id,
+ missing: assignment.missing
+ });
+ }
});
}
});
@@ -355,7 +468,21 @@
end: 'prev,next'
},
dateClick: function (info) {
- // Set the current day and update the upcoming assignments based on that
+ if ($(info.dayEl).hasClass("fc-day-today")) return fluid.screen();
+
+ //Update calendar
+ $("#calendar .fc-daygrid-day").removeClass("active");
+ $(info.dayEl).addClass("active");
+ $("#calendar").addClass("dateSelected");
+
+ //Display selected date
+ $(".headerArea .dashboardStartDate span").text("Showing assignments from " + info.date.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }));
+ $(".headerArea .dashboardStartDate").show();
+
+ //Re-render dashboard from the selected date
+ dtps.renderDueToday(doneLoading, info.date);
+ dtps.renderUpcoming(info.date);
+ dtps.renderUpdates(true);
},
eventClick: function (info) {
dtps.assignment(info.event.extendedProps.assignmentID, info.event.extendedProps.classNum);
@@ -371,9 +498,8 @@
*
* @param {string} classID The class ID to show assignments for
* @param {Assignment[]} [searchResults] An array of assignemnts to render instead of course.assignments. Used for assignment search.
- * @param {string} [searchText] Text to render in the search box. Used for assignment search.
*/
-dtps.classStream = function (classID, searchResults, searchText) {
+dtps.classStream = function (classID, searchResults) {
//Get class index and set as selected class
var classNum = dtps.classes.map(course => course.id).indexOf(classID);
dtps.selectedClass = classNum;
@@ -401,25 +527,26 @@
if (!assignments) {
//Assignments are still loading
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
- jQuery(".classContent").html(dtps.renderClassTools(classNum, "stream", searchText) + `<div class="spinner"></div>`);
+ jQuery(".classContent").html(dtps.renderStreamTools(classNum, "stream") + [1, 2, 3, 4].map(() => (
+ /*html*/`
+ <div class="card assignment graded">
+ <h4>
+ <span style="width: 450px;" class="shimmer">Assignment Title</span>
+ <div class="points shimmer">00/00</div>
+ </h4>
+
+ <h5 style="white-space: nowrap; overflow: hidden;">
+ <div style="width: 200px;" class="infoChip shimmer"></div>
+ <i class="material-icons statusIcon shimmer">more_horiz</i>
+ </h5>
+ </div>
+ `
+ )).join(""));
}
} else if (assignments.length == 0) {
- if (searchText) {
- //No search results
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
- $(".classContent").html(/*html*/ dtps.renderClassTools(classNum, "stream", searchText) + `
- <div style="cursor: auto;" class="card assignment">
- <h4>No results</h4>
- <p>There weren't any search results</p>
- <button onclick="fluid.screen()" class="btn"><i class="material-icons">arrow_back</i> Back</button>
- </div>
- `);
- }
- } else {
- //This class doesn't have any assignments
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
- $(".classContent").html(dtps.renderClassTools(classNum, "stream", searchText) + `<div style="cursor: auto;" class="card assignment"><h4>No assignments</h4><p>There aren't any assignments in this class yet</p></div>`);
- }
+ //This class doesn't have any assignments
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
+ $(".classContent").html(dtps.renderStreamTools(classNum, "stream") + `<div style="cursor: auto;" class="card"><h4>No assignments</h4><p>There aren't any assignments in this class yet</p></div>`);
}
} else {
//Sort assignments
@@ -454,13 +581,13 @@
if (!assignment.dueAt) {
if (prevAssignment && (prevAssignment !== "undated")) {
- divider = `<h5 style="margin: 75px 75px 10px 75px;font-weight: bold;">Undated Assignments</h5>`;
+ divider = `<h5 style="margin: 75px 20px 10px 20px;font-weight: bold;">Undated Assignments</h5>`;
}
prevAssignment = "undated";
} else if (new Date(assignment.dueAt) < new Date()) {
if (prevAssignment && (prevAssignment !== "old")) {
- divider = `<h5 style="margin: 75px 75px 10px 75px;font-weight: bold;">Old Assignments</h5>`;
+ divider = `<h5 style="margin: 75px 20px 10px 20px;font-weight: bold;">Old Assignments</h5>`;
}
prevAssignment = "old";
@@ -472,7 +599,7 @@
}).join("");
//Add stream header with class info buttons and search box
- streamHTML = dtps.renderClassTools(classNum, "stream", searchText) + streamHTML;
+ streamHTML = dtps.renderStreamTools(classNum, "stream") + streamHTML;
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
$(".classContent").html(streamHTML);
@@ -485,8 +612,9 @@
*
* @param {string} id Assignment ID
* @param {number} classNum Assignment class number
+ * @param {boolean} [generic] True if user-specific details, such as grades, should not be displayed
*/
-dtps.assignment = function (id, classNum) {
+dtps.assignment = function (id, classNum, generic) {
//Get assignment from the id prop
var assignmentIDs = dtps.classes[classNum].assignments.map(assignment => assignment.id);
var assignment = dtps.classes[classNum].assignments[assignmentIDs.indexOf(id)];
@@ -563,11 +691,11 @@
<div class="dtpsAssignmentRubricItem">
<h5>${rubricItem.title}</h5>
<div class="score">
- <p style="color: ${rubricItem.color ? rubricItem.color : "var(--secText)"};" class="scoreName">
- ${rubricItem.score ? rubricItem.scoreName || "" : "Not assessed"}
+ <p style="color: ${(!generic && rubricItem.color) ? rubricItem.color : "var(--secText)"};" class="scoreName">
+ ${generic ? "" : (rubricItem.score !== undefined ? rubricItem.scoreName || "" : "Not assessed")}
<div class="points">
- <p class="earned">${rubricItem.score || "-"}</p>
+ <p class="earned">${generic ? "" : rubricItem.score ?? "-"}</p>
<p class="possible">${"/" + rubricItem.value}</p>
</div>
</p>
@@ -605,11 +733,12 @@
<div>
${assignment.dueAt ? `<div class="assignmentChip"><i class="material-icons">alarm</i><span>Due ${dtps.formatDate(assignment.dueAt)}</span></div>` : ""}
- ${assignment.turnedIn ? `<div title="Assignment submitted" class="assignmentChip" style="color: #0bb75b"><i class="material-icons">assignment_turned_in</i></div>` : ""}
- ${assignment.missing ? `<div title="Assignment is missing" class="assignmentChip" style="color: #c44848"><i class="material-icons">remove_circle_outline</i></div>` : ""}
- ${assignment.late ? `<div title="Assignment is late" class="assignmentChip" style="color: #c44848"><i class="material-icons">assignment_late</i></div>` : ""}
- ${assignment.locked ? `<div title="Assignment submissions are locked" class="assignmentChip" style="color: var(--secText, gray);"><i style="font-family: 'Material Icons Extended';" class="material-icons">lock_outline</i></div>` : ""}
- ${scoreHTML}
+ ${assignment.turnedIn && !generic ? `<div title="Assignment submitted" class="assignmentChip" style="color: #0bb75b"><i class="material-icons">assignment_turned_in</i></div>` : ""}
+ ${assignment.missing && !generic ? `<div title="Assignment is missing" class="assignmentChip" style="color: #c44848"><i class="material-icons">remove_circle_outline</i></div>` : ""}
+ ${assignment.late && !generic ? `<div title="Assignment is late" class="assignmentChip" style="color: #c44848"><i class="material-icons">assignment_late</i></div>` : ""}
+ ${assignment.locked && !generic ? `<div title="Assignment submissions are locked" class="assignmentChip" style="color: var(--secText, gray);"><i class="material-icons">lock_outline</i></div>` : ""}
+ ${(dtps.user.parent && !generic) ? `<div class="assignmentChip"><i class="material-icons">person</i><span>${dtps.user.children.find(c => c.id == dtps.classes[assignment.class].userID).name}</span></div>` : ""}
+ ${generic ? "" : scoreHTML}
</div>
<div style="margin-top: 20px;" class="assignmentBody">
@@ -622,8 +751,8 @@
${assignment.publishedAt ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">add_box</i> Published: ${dtps.formatDate(assignment.publishedAt)}</p>` : ""}
${assignment.dueAt ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">alarm</i> Due: ${dtps.formatDate(assignment.dueAt)}</p>` : ""}
${assignment.value ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">bar_chart</i> Point value: ${assignment.value}</p>` : ""}
- ${(assignment.grade || (assignment.grade == 0)) ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">assessment</i> Points earned: ${assignment.grade}</p>` : ""}
- ${assignment.letter ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">font_download</i> Letter grade: ${assignment.letter}</p>` : ""}
+ ${(assignment.grade || (assignment.grade == 0)) && !generic ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">assessment</i> Points earned: ${assignment.grade}</p>` : ""}
+ ${assignment.letter && !generic ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">font_download</i> Letter grade: ${assignment.letter}</p>` : ""}
${assignment.category ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">category</i> Category: ${assignment.category}</p>` : ""}
${assignment.rubric ? assignment.rubric.map(function (rubricItem) { return `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">adjust</i> ${rubricItem.title}</p>`; }).join("") : ""}
<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">class</i> Class: ${dtps.classes[assignment.class].subject}</p>
@@ -631,12 +760,12 @@
<br />
<div class="row">
- ${assignment.url ? `<div class="btn small outline" onclick="window.open('${assignment.url}')"><i class="material-icons">open_in_new</i> Open in ${dtpsLMS.shortName || dtpsLMS.name}</div>` : ``}
+ ${assignment.url ? `<button class="btn small outline" onclick="window.open('${assignment.url}')"><i class="material-icons">open_in_new</i> Open in ${dtpsLMS.shortName || dtpsLMS.name}</button>` : ``}
</div>
</div>
<div style="width: calc(60% - 7px); margin-top: 20px; margin-left: 5px; display: inline-block; overflow: hidden; vertical-align: middle;">
- ${assignmentFeedbackHTML}
+ ${!generic ? assignmentFeedbackHTML : ""}
${assignmentRubricHTML}
</div>
@@ -644,7 +773,7 @@
//Close other active cards and open the assignment details card
fluid.cards.close(".card.focus");
- fluid.modal(".card.details");
+ fluid.cards(".card.details");
}
/**
@@ -690,20 +819,42 @@
//Show loading indicator
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "moduleStream")) {
- jQuery(".classContent").html(dtps.renderClassTools(classNum, "modules") + `<div class="spinner"></div>`);
+ jQuery(".classContent").html(dtps.renderStreamTools(classNum, "modules") + /*html*/`
+ <div class="module card collapsed">
+ <h4>
+ <i class="material-icons collapseIcon shimmer">star</i>
+ <span class="shimmer">[SHIMMER] Module title (collapsed)</span>
+ </h4>
+ <div class="moduleContents" style="padding-top: 10px;"></div>
+ </div>
+ <div class="module card">
+ <h4>
+ <i class="material-icons collapseIcon shimmer">star</i>
+ <span class="shimmer">[SHIMMER] Module title</span>
+ </h4>
+
+ <div class="moduleContents" style="padding-top: 10px;">
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ </div>
+ </div>
+ `);
}
new Promise(resolve => {
if (dtps.classes[classNum].modules && (dtps.classes[classNum].modules !== true)) {
resolve(dtps.classes[classNum].modules);
} else {
- dtpsLMS.fetchModules(dtps.classes[classNum].id).then(data => resolve(data));
+ dtpsLMS.fetchModules(dtps.user.id, dtps.classes[classNum].lmsID).then(data => resolve(data));
}
}).then(data => {
//Save modules data in the class object for future use
dtps.classes[classNum].modules = data;
- var modulesHTML = dtps.renderClassTools(classNum, "modules");
+ var modulesHTML = dtps.renderStreamTools(classNum, "modules");
data.forEach(module => {
var moduleItemHTML = "";
@@ -734,7 +885,7 @@
//Get module HTML
if (item.type == "header") {
- moduleItemHTML += `<h5 style="font-size: 22px;padding: 2px 10px;">${item.title}</h5>`;
+ moduleItemHTML += `<h5 style="font-size: 16px;padding: 0px 10px; text-decoration: underline;">${item.title}</h5>`;
} else {
moduleItemHTML += `
<div class="moduleItem" onclick="${action}" style="margin-left: ${item.indent * 15}px;">
@@ -789,9 +940,11 @@
if ($(ele).parents('.card').hasClass('collapsed')) {
if (dtpsLMS.collapseModule) dtpsLMS.collapseModule(classID, modID, true);
$(ele).html('keyboard_arrow_right');
+ dtps.classes[dtps.selectedClass].modules.find(m => m.id == modID).collapsed = true;
} else {
if (dtpsLMS.collapseModule) dtpsLMS.collapseModule(classID, modID, false);
$(ele).html('keyboard_arrow_down');
+ dtps.classes[dtps.selectedClass].modules.find(m => m.id == modID).collapsed = false;
}
}
@@ -801,47 +954,15 @@
*
* @param {number} num Class number
* @param {string} type Class content these tools are for (e.g. "stream")
- * @param {string} [searchText] Text to render in the search box for assignment search
* @return {string} Stream tools HTML
*/
-dtps.renderClassTools = function (num, type, searchText) {
+dtps.renderStreamTools = function (num, type) {
var modulesSelector = dtps.classes[num].modules;
return /*html*/`
- <div style="position: absolute;display:inline-block;margin: ${modulesSelector ? "82px" : "38px 82px"};">
-
- ${dtps.classes[num].teacher ? /*html*/`
- <div style="background-color: var(--elements); border-radius: 20px; display: inline-block; margin-right: 5px;">
- <img src="${dtps.classes[num].teacher.photoURL}" style="width: 40px; height: 40px; border-radius: 50%;vertical-align: middle;">
- <div style="font-size: 16px;display: inline-block;vertical-align: middle;margin: 0px 10px;">${dtps.classes[num].teacher.name}</div>
- </div>` : ``
- }
-
- <div onclick="dtps.classInfo(${num})" class="classToolChip">
- <i style="line-height: 40px;" class="material-icons">${dtps.classes[num].id == dtps.remoteConfig.debugClassID ? "bug_report" : "info"}</i>
- </div>
-
- ${dtps.classes[num].homepage ? /*html*/`
- <div onclick="dtps.classHome(${num})" class="classToolChip">
- <i style="line-height: 40px;" class="material-icons">home</i>
- </div>` : ""
- }
-
- ${dtps.classes[num].videoMeetingURL ? /*html*/`
- <div onclick="window.open('${dtps.classes[num].videoMeetingURL}')" class="classToolChip">
- <i style="line-height: 40px;" class="material-icons">videocam</i>
- </div>` : ""
- }
-
- </div>
-
${(type == "modules") || (type == "stream") ? /*html*/`
<div style="text-align: right;${modulesSelector ? "" : "margin-top: 20px;"}">
-
- ${type == "stream" ? `<i class="inputIcon material-icons">search</i><input ${searchText ? `value="${searchText}"` : ``} onchange="dtps.search()" class="search inputIcon filled shadow" placeholder="Search assignments" type="search" />` : ""}
-
- <br />
${modulesSelector ? /*html*/`
- <div class="btns row small acrylicMaterial assignmentPicker" style="margin: ${type == "stream" ? `20px 80px 20px 0px !important` : `63px 80px 20px 0px !important`};">
+ <div class="btns row small acrylicMaterial assignmentPicker" style="margin: 5px 20px 5px 0px !important;">
<button class="btn ${type == "stream" ? "active" : ""}" onclick="fluid.screen('stream', dtps.classes[dtps.selectedClass].id);"><i class="material-icons">assignment</i>Assignments</button>
<button class="btn ${type == "modules" ? "active" : ""}" onclick="fluid.screen('moduleStream', dtps.classes[dtps.selectedClass].id);"><i class="material-icons">view_module</i>Modules</button>
</div>
@@ -881,7 +1002,7 @@
<h4 style="font-weight: bold;">${dtps.classes[num].name}</h4>
<p style="color: var(--secText)">${dtps.classes[num].description || ""}</p>
- ${dtps.classes[num].numStudents ? `<div class="assignmentChip"><i class="material-icons">group</i><span>${dtps.classes[num].numStudents} students</span></div>` : ``}
+ ${dtps.classes[num].numStudents ? `<div class="assignmentChip"><i class="material-icons">people</i><span>${dtps.classes[num].numStudents} students</span></div>` : ``}
${dtps.env == "dev" ? `<div class="assignmentChip"><i class="material-icons">code</i><span>Class ID: ${dtps.classes[num].id}</span></div>` : ``}
${dtps.classes[num].id == dtps.remoteConfig.debugClassID ? `<div class="assignmentChip"><i class="material-icons">bug_report</i><span>Debug class</span></div>` : ``}
@@ -894,7 +1015,7 @@
`)
//Show the class info card
- fluid.modal(".card.details")
+ fluid.cards(".card.details")
}
/**
@@ -906,14 +1027,14 @@
//Render loading screen
$(".card.details").html(/*html*/`
<i onclick="fluid.cards.close('.card.details')" class="material-icons close">close</i>
- <h4 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h4>
+ <h3 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h3>
<br />
<p>Loading...</p>
`);
//Fetch homepage from the LMS
- dtpsLMS.fetchHomepage(dtps.classes[num].id).then(homepage => {
+ dtpsLMS.fetchHomepage(dtps.classes[num].lmsID).then(homepage => {
if (homepage) {
//Get computed background and text color to style the iFrame with
var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
@@ -995,7 +1116,7 @@
`);
}
- fluid.modal(".card.details");
+ fluid.cards(".card.details");
} else {
fluid.cards.close('.card.details');
dtps.error("Homepage unavailable", "homepage is either empty or undefined @ dtps.classHome");
@@ -1140,7 +1261,7 @@
//Fluid UI screen definitions
fluid.externalScreens.dashboard = () => {
- dtps.masterStream();
+ dtps.mainStream();
}
fluid.externalScreens.stream = (courseID) => {
diff --git a/scripts/core.js b/scripts/core.js
index 9c6d597..4884762 100644
--- a/scripts/core.js
+++ b/scripts/core.js
@@ -1,7 +1,7 @@
/**
* @file DTPS Core functions and module loader
* @author jottocraft
- * @version v3.0.6
+ * @version v3.1.0
*
* @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
* @license GPL-2.0-only
@@ -35,8 +35,8 @@
* @property {object} remoteConfig Configuration variables that can be remotely changed
*/
var dtps = {
- ver: 306,
- readableVer: "v3.0.6",
+ ver: 310,
+ readableVer: "v3.1.0",
env: new URL(window.dtpsBaseURL || "https://powerplus.app").hostname == "localhost" ? "dev" : window.jottocraftSatEnv || "prod",
classes: [],
baseURL: window.dtpsBaseURL || "https://powerplus.app",
@@ -80,49 +80,22 @@
dtechCleanUpAssignments: true,
dtechCurrentTerm: "20-21",
debugClassID: "1098",
- feedbackButtonUsesEmail: false,
- topSneaky: false
+ topSneaky: false,
+ topSneakyUI: false,
+ remoteUpdate: null
}
};
//Load jQuery ASAP
jQuery.getScript("https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js");
-//Fluid UI theme listener (for changing background color)
-document.addEventListener("fluidTheme", function (data) {
- if (dtps.oldTheme !== data.detail) {
- //Theme has changed
- dtps.oldTheme = data.detail;
-
- //Update background gradient
- var next = window.getComputedStyle(document.getElementsByClassName("background")[0]).getPropertyValue("--grad")
- if (dtps.selectedClass !== "dash") next = "linear-gradient(to bottom right, " + (dtps.classes[dtps.selectedClass] && dtps.classes[dtps.selectedClass].color) + ", var(--background))"
- if (dtps.selectedClass !== "dash") $('body').removeClass('dashboard');
- $(".background").css("background", next);
- }
-});
-
/**
* Debugging shortcut for getting the selected class. This should only be used in the web inspector and not in actual code.
*
* @return {object|undefined} The selected class
*/
dtps.class = function () {
- return dtps.classes[dtps.selectedClass]
-}
-
-/**
- * Checks if a Date is today
- *
- * @param {Date} date Date string to check
- */
-dtps.isToday = function (date) {
- var today = new Date();
- var d1 = new Date(date);
-
- return d1.getFullYear() === today.getFullYear() &&
- d1.getMonth() === today.getMonth() &&
- d1.getDate() === today.getDate();
+ return dtps.classes[dtps.selectedClass];
}
/**
@@ -226,9 +199,9 @@
`}
<br />
- <div onclick="window.localStorage.setItem('dtpsInstalled', 'true'); fluid.cards.close('.card.changelog');" class="btn">
+ <button onclick="window.localStorage.setItem('dtpsInstalled', 'true'); fluid.cards.close('.card.changelog');" class="btn">
<i class="material-icons">arrow_forward</i> Continue
- </div>
+ </button>
`);
//Show Welcome to DTPS card
@@ -275,7 +248,7 @@
//dtao/nearest-color is used for finding the nearest class color
jQuery.getScript("https://cdn.jottocraft.com/nearest-color.dtao.js", () => {
//Fluid UI for core UI elements
- jQuery.getScript('https://cdn.jottocraft.com/fluid/v4.min.js', cb);
+ jQuery.getScript('https://cdn.jottocraft.com/fluid/v5.min.js', cb);
})
});
}
@@ -287,7 +260,7 @@
jQuery("<link/>", {
rel: "stylesheet",
type: "text/css",
- href: "https://cdn.jottocraft.com/fluid/v4.min.css",
+ href: "https://cdn.jottocraft.com/fluid/v5.min.css",
class: "dtpsHeadItem"
}).appendTo("head");
@@ -301,7 +274,7 @@
jQuery("<link/>", {
rel: "stylesheet",
type: "text/css",
- href: "https://fonts.googleapis.com/css?family=Material+Icons+Outlined",
+ href: "https://fonts.googleapis.com/css?family=Material+Icons+Round",
class: "dtpsHeadItem"
}).appendTo("head");
@@ -315,13 +288,6 @@
jQuery("<link/>", {
rel: "stylesheet",
type: "text/css",
- href: "https://fonts.googleapis.com/icon?family=Material+Icons+Extended",
- class: "dtpsHeadItem"
- }).appendTo("head");
-
- jQuery("<link/>", {
- rel: "stylesheet",
- type: "text/css",
href: "https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css",
class: "dtpsHeadItem"
}).appendTo("head");
@@ -358,8 +324,12 @@
if (Array.from(urlParams).length) window.history.replaceState(null, null, window.location.pathname);
//Fluid UI settings
- fluidThemes = [["midnight", "tome"], ["rainbow"]];
- fluidAutoLoad = false;
+ window.fluidConfig = {
+ config: {
+ autoLoad: false,
+ allowThemeMenu: false //This is false because Power+ uses its own theme settings UI
+ }
+ };
//Set env discovery
window.localStorage.setItem("jottocraftEnv", true);
@@ -404,20 +374,38 @@
return dtpsLMS.fetchUser();
}).then(data => {
//Prevent resetting the user if the user is already set (for parent accounts)
- if (!dtps.user) {
- dtps.user = data;
+ dtps.user = data;
- //Set lmsID as current user ID by default
- dtps.user.lmsID = dtps.user.id;
+ //If this is a parent account, show the parent UI
+ if (dtps.user.children && dtps.user.children.length) {
+ dtps.user.parent = true;
- //If this is a parent account, show the parent UI
- if (dtps.user.children && dtps.user.children.length) {
- dtps.user.lmsID = dtps.user.children[0].id;
- dtps.user.parent = true;
- }
+ //Fetch classes for all students
+ return new Promise((resolve, reject) => {
+ var allClasses = [];
+ var promises = [];
+
+ dtps.user.children.forEach(child => {
+ promises.push(new Promise(function(resolve, reject) {
+ dtpsLMS.fetchClasses(child.id).then((data) => {
+ //Prepend child ID to class ID
+ data.forEach(course => {
+ course.id = child.id + "-" + course.id;
+ });
+
+ allClasses = allClasses.concat(data);
+ resolve();
+ }).catch(reject);
+ }));
+ });
+
+ Promise.all(promises).then(() => {
+ resolve(allClasses);
+ });
+ });
+ } else {
+ return dtpsLMS.fetchClasses(dtps.user.id);
}
-
- return dtpsLMS.fetchClasses();
}).then((rawClasses) => {
return new Promise(resolve => {
if (dtpsLMS.institutionSpecific && dtpsLMS.updateClasses) {
@@ -505,8 +493,9 @@
}
//Begin fetching class assignments
+ var fetchedAnnouncements = [];
dtps.classes.forEach((course, courseIndex) => {
- dtpsLMS.fetchAssignments(course.id).then((rawAssignments) => {
+ dtpsLMS.fetchAssignments(course.userID, course.lmsID).then((rawAssignments) => {
return new Promise(resolve => {
if (dtpsLMS.institutionSpecific && dtpsLMS.updateAssignments) {
//Using an institution-specific script, make any nessasary changes and return updated assignments
@@ -600,36 +589,40 @@
if (dtps.remoteConfig.showGradesInSettings) dtps.renderGradesInSettings();
//Re-render screen if the dashboard or stream is selected
- if ((dtps.selectedClass == "dash") || (dtps.selectedContent == "stream")) {
+ if ((dtps.selectedClass == "dash") || ((dtps.selectedContent == "stream") && (dtps.selectedClass == course.num))) {
fluid.screen();
}
});
- dtpsLMS.fetchAnnouncements(course.id).then(announcements => {
- //Add announcements to updates array
- announcements.forEach(announcement => {
- //Add class number and type to object
- dtps.updates.push({
- class: course.num,
- type: "announcement",
- ...announcement
- })
+ if (!fetchedAnnouncements.includes(course.lmsID)) {
+ //Add lmsID to list of fetched announcements to prevent duplicates
+ fetchedAnnouncements.push(course.lmsID);
+
+ dtpsLMS.fetchAnnouncements(course.lmsID).then(announcements => {
+ //Add announcements to updates array
+ announcements.forEach(announcement => {
+ //Add class number and type to object
+ dtps.updates.push({
+ class: course.num,
+ type: "announcement",
+ ...announcement
+ });
+ });
+
+ //Sort updates array from newest -> oldest
+ dtps.updates.sort(function (a, b) {
+ //Sort by postedAt (announcements) or gradedAt (assignments)
+ return new Date(b.gradedAt || b.postedAt).getTime() - new Date(a.gradedAt || a.postedAt).getTime()
+ });
+
+ //Keep only the 15 most recent updates
+ if (dtps.updates.length > 15) dtps.updates.length = 15;
+
+ if (dtps.selectedClass == "dash") {
+ fluid.screen();
+ }
});
-
- //Sort updates array from newest -> oldest
- dtps.updates.sort(function (a, b) {
- //Sort by postedAt (announcements) or gradedAt (assignments)
- return new Date(b.gradedAt || b.postedAt).getTime() - new Date(a.gradedAt || a.postedAt).getTime()
- });
-
- //Keep only the 15 most recent updates
- if (dtps.updates.length > 15) dtps.updates.length = 15;
-
- if (dtps.selectedClass == "dash") {
- fluid.screen();
- }
-
- });
+ }
});
//Render remaining HTML
@@ -665,10 +658,10 @@
//Web request error
console.error("[DTPS] Error fetching user and classes at dtps.init", err);
- //404 Error means the user isn't logged in
- if (err.status == 404) {
+ //Check for login redirect
+ if ((err.action == "login") && err.redirectURL) {
//Redirect to login page
- window.location.href = "/?dtpsLogin=true";
+ window.location.href = err.redirectURL;
} else {
dtps.error("Failed to get user and/or course data", "Exception in promise @ dtps.init");
}
@@ -693,26 +686,6 @@
}
/**
- * Switches the current child account being observed
- *
- * @param {Element} ele The dropdown element used to switch accounts
- */
-dtps.obsSwitch = function (ele) {
- //Reset URL state
- history.replaceState(null, null, ' ');
-
- //Change user LMS id based on dropdown value
- dtps.user.lmsID = $(ele).val();
-
- //Clear data
- dtps.classes = [];
- dtps.updates = [];
-
- //Reload Power+
- dtps.init();
-}
-
-/**
* Adjusts the height of an iFrame to match its content
*
* @param {string} iframeID The ID of the iFrame element to adjust
@@ -744,12 +717,25 @@
//Array of class HTML for the sidebar
dtps.classlist = [];
+ var previousClassUser = null;
for (var i = 0; i < dtps.classes.length; i++) {
//Determine letter grade HTML
var letterGradeHTML = "";
if (dtps.classes[i].letter) letterGradeHTML = dtps.classes[i].letter;
if (dtps.classes[i].letter == null) letterGradeHTML = "--";
- if (dtps.classes[i].letter == "...") letterGradeHTML = `<div class="spinner" style="background-color: var(--norm); margin: -8px -10px;"></div>`; //Show loading indicator for ...
+ if (dtps.classes[i].letter == "...") letterGradeHTML = `<div class="shimmer" style="width: 100%;height: 22px;border-radius: 8px;"></div>`; //Show loading indicator for ...
+
+ if (dtps.user.parent && (dtps.classes[i].userID !== previousClassUser)) {
+ if (previousClassUser) dtps.classlist.push(`</div></div>`);
+ dtps.classlist.push(/*html*/`
+ <div id="dtpsClassListGroup-${dtps.classes[i].userID}" class="group">
+ <div class="name item">
+ <i class="material-icons"></i> <span class="label">${dtps.user.children.find(c => c.id == dtps.classes[i].userID).name}</span>
+ </div>
+
+ <div class="items">
+ `);
+ }
//Add class HTML to array
dtps.classlist.push(/*html*/`
@@ -758,29 +744,28 @@
class="${'class item ' + i + ' ' + (dtps.selectedClass == i ? " active" : "")}"
style="${'--classColor: ' + dtps.classes[i].color}"
>
- <span class="label name">${dtps.classes[i].subject}</span>
- <div ${dtps.classes[i].letter == null ? `style="letter-spacing:2px;"` : ""} class="icon grade val">
- ${letterGradeHTML}
- </div>
+ <i class="material-icons grade">${letterGradeHTML}</i>
+ <span class="label">${dtps.classes[i].subject}</span>
</div>
`);
+
+ previousClassUser = dtps.classes[i].userID;
}
+ if (dtps.user.parent) dtps.classlist.push(`</div></div>`);
+
//Only render HTML if the sidebar doesn't already have the classes rendered, or if override is true
if (!jQuery(".sidebar .class.dash")[0] || override) {
jQuery(".sidebar").html(/*html*/`
- <div class="bigLogo" style="text-align: center; margin: 10px 0 20px; white-space: nowrap; overflow: hidden;">
- <img style="width: 28px; margin-right: 7px; vertical-align: middle;" src="${dtps.baseURL + "/icon.svg"}" />
- <h4 style="color: var(--text); display: inline-block; font-size: 28px; vertical-align: middle; margin: 0px;">Power+</h4>
+ <div class="title">
+ <img src="${dtps.baseURL + "/icon.svg"}" />
+ <h4>Power+</h4>
</div>
- <img class="logo" src="${dtps.baseURL + "/favicon.png"}" />
-
<div class="items">
-
<div onclick="dtps.selectedClass = 'dash';" class="class item main dash ${dtps.selectedClass == "dash" ? "active" : ""}">
- <span class="label name">Dashboard</span>
- <div class="icon"><i class="material-icons">dashboard</i></div>
+ <i class="material-icons">dashboard</i>
+ <span class="label">Dashboard</span>
</div>
<div class="divider"></div>
@@ -788,10 +773,11 @@
${dtps.classlist.join("")}
</div>
- <div onclick="$('body').toggleClass('collapsedSidebar'); if ($('body').hasClass('collapsedSidebar')) { $(this).children('i').html('keyboard_arrow_right'); } else {$(this).children('i').html('keyboard_arrow_left');}" init="true" class="collapse">
- <i class="material-icons">keyboard_arrow_left</i>
+ <div class="collapse">
+ <i class="material-icons"></i>
</div>
`);
+ fluid.init();
//Change view to stream if coming from pages or discussions, since those tabs change the sidebar
if ((dtps.selectedContent == "pages") || (dtps.selectedContent == "discuss")) {
@@ -847,46 +833,14 @@
document.title = "Power+";
}
- //Set dashboard body class for CSS styles
- if (classNum == "dash") {
- $('body').addClass('dashboard');
+ //Set the class image
+ if ((fluid.get("pref-showClassImages") !== "false") && dtps.classes[classNum] && dtps.classes[classNum].image) {
+ $(".headerArea").addClass("classImage");
+ $(".headerArea img").attr("src", dtps.classes[classNum].image);
+ $(".headerArea img").show();
} else {
- $('body').removeClass('dashboard');
- }
-
- //Set the default imageURL to an empty PNG to make the CSS transition work
- var imageURL = "https://i.imgur.com/SpqHCNo.png";
-
- if (fluid.get("pref-hideClassImages") !== "true") {
- //Class images are not disabled
- if (dtps.classes[classNum] && dtps.classes[classNum].image) {
- //Class has image
- imageURL = dtps.classes[classNum].image;
- }
- }
-
- //Run CSS animation for class transition
- $(".background").addClass("trans");
- $(".cover.image").css("background-image", 'url("' + imageURL + '")');
- $(".background").css("opacity", '0.6');
- $(".background").css("filter", 'none');
-
- //Clear any existing background animation timeout
- clearTimeout(dtps.bgTimeout);
-
- //Set 500ms transition
- dtps.bgTimeout = setTimeout(function () {
- //Set theme to something random to force the theme change listener to update
- dtps.oldTheme = "nklfsdlflsdajflks";
- document.dispatchEvent(new CustomEvent('fluidTheme'));
-
- //Remove transition
- $(".background").removeClass("trans");
- }, 500);
-
- //Set background color
- if (dtps.classes[classNum]) {
- $(".background").css("--classColor", dtps.classes[classNum].color);
+ $(".headerArea").removeClass("classImage");
+ $(".headerArea img").hide();
}
//Remove active class from other classes in the sidebar, add the active class to the selected class
@@ -896,15 +850,20 @@
//Update title to show class name
//If the dashboard is selected, this is just "Dashboard". Otherwise, this is Class.subject
$("#headText").html(classNum == "dash" ? "Dashboard" : dtps.classes[classNum] && dtps.classes[classNum].subject);
+ $("#headText").css("color", classNum == "dash" ? "var(--text)" : dtps.classes[classNum] && dtps.classes[classNum].color);
//If the class doesn't exist, hide the tabs
//Otherwise, show the tabs
if (!dtps.classes[classNum]) {
- $(".header .btns").hide();
+ $("#dtpsTabBar").hide();
+ $("#classInfo p").hide();
} else {
- $(".header .btns").show();
+ $("#dtpsTabBar").show();
}
+ //Hide dashboard start date
+ $(".headerArea .dashboardStartDate").hide();
+
if (dtps.classes[classNum]) {
//Show pages tab if the class supports it, otherwise, hide it
if (dtps.classes[classNum].pages) {
@@ -914,7 +873,7 @@
}
//Show people tab if the LMS supports it, otherwise, hide it
- if (dtpsLMS.fetchUsers) {
+ if (dtpsLMS.fetchUsers && !dtps.user.parent) {
$(".btns .btn.people").show();
} else {
$(".btns .btn.people").hide();
@@ -938,6 +897,28 @@
if ($("#dtpsTabBar .btn:visible").length < 2) {
$("#dtpsTabBar").hide();
}
+
+ //Show teacher
+ if (dtps.classes[classNum].teacher) {
+ $("#classInfo .teacher .teacherName").text(dtps.classes[classNum].teacher.name);
+ $("#classInfo .teacher .teacherImage").css("background-image", "url('" + dtps.classes[classNum].teacher.photoURL + "')");
+ $("#classInfo .teacher").show();
+ } else {
+ $("#classInfo .teacher").hide();
+ }
+
+ if (dtps.classes[classNum].homepage) {
+ $("#classInfo .homepage").show();
+ } else {
+ $("#classInfo .homepage").hide();
+ }
+
+ if (dtps.classes[classNum].videoMeetingURL) {
+ $("#classInfo .videoMeeting").attr("onclick", "window.open('" + dtps.classes[classNum].videoMeetingURL + "')");
+ $("#classInfo .videoMeeting").show();
+ } else {
+ $("#classInfo .videoMeeting").hide();
+ }
}
}
@@ -1112,7 +1093,7 @@
//Render grades tab in settings
if (dtps.remoteConfig.showGradesInSettings) dtps.renderGradesInSettings();
- fluid.modal('.settingsCard');
+ fluid.cards('.settingsCard');
}
/**
@@ -1208,6 +1189,24 @@
}
/**
+ * Redirects to DTPS classic edition
+ */
+dtps.classicEntry = function () {
+ var classicName = ["P", "r", "o", "j", "e", "c", "t", " ", "D", "T", "P", "S"];
+ var overwrittenHTML = ["P", "o", "w", "e", "r", "+"];
+ if (dtps.classicStep == undefined) dtps.classicStep = -10;
+ dtps.classicStep++;
+
+ if (dtps.classicStep == 12) window.location.href = "/power+?classicEdition=true";
+
+ for (var i = 0; i < dtps.classicStep; i++) {
+ overwrittenHTML[i] = classicName[i];
+ }
+
+ $("#dtpsAboutName").html(overwrittenHTML.join(""));
+}
+
+/**
* Loads dashboard prefrences
*/
dtps.loadDashboardPrefs = function () {
@@ -1263,7 +1262,7 @@
$("head *:not(.dtpsHeadItem)").remove();
//Set default body classes
- $("body").attr("class", "dark showThemeWindows hasSidebar dashboard");
+ $("body").attr("class", "dark showThemeWindows hasSidebar hasNavbar dashboard");
//Set document title and favicon
document.title = "Power+";
@@ -1278,27 +1277,102 @@
//Render HTML
jQuery("body").append(/*html*/`
- <div class="sidebar acrylicMaterial"></div>
+ <div class="sidebar acrylicMaterial"></div>
- <!-- Header background elements -->
- <div class="cover image"></div>
- <div class="background"></div>
+ <div class="navbar">
+ <div class="logo">
+ <img src="https://powerplus.app/icon.svg" />
+ <h4>${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
+ </div>
+
+ ${dtps.unstable ? `
+ <div id="dtpsUnstable" class="navitem">
+ <i style="font-size: 16px;" class="material-icons">warning</i>
+ <span style="font-weight: bold; font-size: 10px;">THIS IS AN UNSTABLE VERSION OF POWER+. USE AT YOUR OWN RISK.</span>
+ </div>
+ ` : ""}
+
+ <div class="items" style="position: fixed; left: calc(50% - 250px); margin: 0px;">
+ <i class="inputIcon material-icons">search</i>
+ <input id="dtpsMainSearchBox" style="margin: 0px; width: 500px;" type="search" class="inputIcon filled" placeholder="Search" />
+ </div>
- <!-- Header with class name and tabs -->
- <div class="header">
- <p id="timeRemaining" style="position: absolute;top:${dtps.unstable ? "2px" : "14px"};margin-left: 20px;"></p>
- ${dtps.unstable ? `<p style="position: absolute;top: 45px;margin-left: 20px; color: red;font-weight: bold;background-color: black; font-size: 12px;">THIS IS AN UNSTABLE VERSION OF POWER+. USE AT YOUR OWN RISK.</p>` : ""}
-
- <h2 id="headText">Dashboard</h2>
-
- <!-- Class tabs. Each button has init=true to prevent Fluid UI from automatically managing their states -->
- <div style="display: none;" id="dtpsTabBar" class="btns row tabs">
+ <div class="profile">
+ <div class="profileImage"></div>
+ </div>
+ </div>
+
+ <div class="card close focus profileMenu">
+ <div class="person">
+ <div class="profileImage"></div>
+ <div class="info">
+ <h5 class="name">Logged out</h5>
+ </div>
+ </div>
+
+ <div class="actions">
+ <div class="item">
+ <i class="material-icons">feedback</i>
+ <span class="label">Feedback</span>
+ </div>
+ <div class="item">
+ <i class="material-icons">bug_report</i>
+ <span class="label">Bug Report</span>
+ </div>
+ <div onclick="dtps.settings();" class="item">
+ <i class="material-icons">settings</i>
+ <span class="label">Settings</span>
+ </div>
+ <div class="divider"></div>
+ <a style="color: var(--text);" href="/">
+ <div class="item">
+ <i class="material-icons">exit_to_app</i>
+ <span class="label">Go to Canvas</span>
+ </div>
+ </a>
+ </div>
+ </div>
+
+ <div id="dtpsSearchResults" class="card acrylicMaterial" style="display: none;">
+ <h5 id="dtpsSearchStatus"><i class="material-icons">search</i> <span>Search (Not yet implemented)</span></h5>
+ <div id="dtpsSearchData" style="display: none;"></div>
+ <div id="dtpsSearchInfo">
+ <p>Power+ will search across all of your classes. You can search for:</p>
+ <p><i class="material-icons">assignment</i> Assignments</p>
+ <p><i class="material-icons">assessment</i> Grades</p>
+ <p><i class="material-icons">home</i> Homepage content</p>
+ <p><i class="material-icons">view_module</i> Modules</p>
+ <p><i class="material-icons">insert_drive_file</i> Pages</p>
+ <p><i class="material-icons">forum</i> Discussions</p>
+ <p><i class="material-icons">people</i> People</p>
+ </div>
+ </div>
+
+ <div class="headerArea classImage">
+ <img style="display: none;" />
+ <div class="content">
+ <h1 id="headText">Dashboard</h1>
+ <div id="classInfo" style="min-height: 18px;">
+ <p class="teacher" style="display: none;">
+ <span class="teacherImage"></span> <span class="teacherName"></span>
+ </p>
+ <p onclick="dtps.classHome(dtps.selectedClass);" class="homepage" style="cursor: pointer; display: none;">
+ <i class="material-icons">home</i> <span>Homepage</span>
+ </p>
+ <p class="videoMeeting" style="cursor: pointer; display: none;">
+ <i class="material-icons">videocam</i> <span>Meeting</span>
+ </p>
+ <p onclick="fluid.screen();" class="dashboardStartDate" style="cursor: pointer; display: none;">
+ <i class="material-icons">event</i> <span>Viewing from Fri, Dec 11</span>
+ </p>
+ </div>
+ <div style="display: none;" id="dtpsTabBar" class="btns">
<button init="true" onclick="fluid.screen('stream', dtps.classes[dtps.selectedClass].id);" class="btn stream">
<i class="material-icons">library_books</i>
Coursework
</button>
<button init="true" onclick="fluid.screen('people', dtps.classes[dtps.selectedClass].id);" class="btn people">
- <i class="material-icons">group</i>
+ <i class="material-icons">people</i>
People
</button>
<button init="true" onclick="fluid.screen('discussions', dtps.classes[dtps.selectedClass].id);" class="btn discuss">
@@ -1314,6 +1388,7 @@
${dtpsLMS.gradebook ? "Grades" : "Gradebook"}
</button>
</div>
+ </div>
</div>
<!-- Class content area -->
@@ -1322,10 +1397,7 @@
</div>
<!-- Settings card (its inner HTML is added later) -->
- <div style="height: calc(100vh - 50px); overflow: auto !important;" class="card withnav focus close container settingsCard"></div>
-
- <!-- Toolbar (the thing at the top-right with your name, profile picture, and buttons. its inner HTML is also added later) -->
- <div class="toolbar items"></div>
+ <div style="height: 100%; overflow: auto !important;" class="card withnav focus close container settingsCard"></div>
<!-- Changelog card -->
<div style="border-radius: 30px;" class="card focus changelog close container">
@@ -1347,6 +1419,24 @@
<iframe style="width: 100%; height: calc(100vh - 175px); border: none;" id="CardIFrame"></iframe>
</div>
`);
+
+ $("#dtpsMainSearchBox").on("focus", function () {
+ $("#dtpsSearchResults").show();
+ });
+
+ $("#dtpsMainSearchBox").on("blur", function () {
+ $("#dtpsSearchResults").hide();
+ });
+
+ $("#dtpsMainSearchBox").on("input", function () {
+ if ($("#dtpsMainSearchBox").val()) {
+ $("#dtpsSearchStatus i").text("keyboard_return");
+ $("#dtpsSearchStatus span").text("Press enter to search");
+ } else {
+ $("#dtpsSearchStatus i").text("search");
+ $("#dtpsSearchStatus span").text("Search");
+ }
+ });
}
/**
@@ -1370,12 +1460,12 @@
jQuery(".card.settingsCard").html(/*html*/`
<i onclick="fluid.cards.close('.card.settingsCard')" class="material-icons close">close</i>
- <div class="sidenav" style="position: fixed; height: calc(100% - 50px); border-radius: 20px 0px 0px 20px;">
+ <div style="position: fixed; height: calc(100% - 100px);" class="sidenav">
<div class="title">
<img src="${dtps.baseURL + "/icon.svg"}" style="width: 50px;vertical-align: middle;padding: 7px; padding-top: 14px;" />
<div style="vertical-align: middle; display: inline-block;">
<h5 style="font-weight: bold;display: inline-block;vertical-align: middle;">Power+</h5>
- <p>${dtps.readableVer + (dtps.unstable ? ` <span style="font-size: 12px;">(unstable)</span>` : "")}</p>
+ <p>${dtps.readableVer + (dtps.unstable ? ` <span style="font-size: 12px; color: red;">(unstable)</span>` : "")}</p>
</div>
</div>
@@ -1431,8 +1521,7 @@
<div onclick="fluid.set('pref-hideClassImages')" class="switch pref-hideClassImages"><span class="head"></span></div>
<div class="label"><i class="material-icons">image</i> Hide class images</div>
- ${
- dtpsLMS.dtech && dtps.remoteConfig.dtechCleanUpAssignments ? `
+ ${dtpsLMS.dtech && dtps.remoteConfig.dtechCleanUpAssignments ? `
<br /><br />
<div onclick="fluid.set('pref-formatAssignmentContent')" class="switch pref-formatAssignmentContent active"><span class="head"></span></div>
<div class="label"><i class="material-icons">format_paint</i> Reformat assignment content</div>
@@ -1572,7 +1661,7 @@
<img src="${dtps.baseURL + "/icon.svg"}" style="height: 50px; margin-right: 10px; vertical-align: middle; margin-top: 20px;" />
<div style="display: inline-block; vertical-align: middle;">
- <h4 style="font-weight: bold; font-size: 32px; margin-bottom: 0px;">Power+</h4>
+ <h4 id="dtpsAboutName" onclick="dtps.classicEntry()" style="font-weight: bold; font-size: 32px; margin-bottom: 0px; user-select: none;">Power+</h4>
<div style="font-size: 16px; margin-top: 5px;">
${dtps.readableVer}
<div style="display: inline-block;margin: 0px 5px;font-size: 12px;">${baseHost !== "powerplus.app" ? `(from ${baseHost})` : ""}</div>
@@ -1637,27 +1726,9 @@
</div>
`);
- //Render toolbar (the thing with the name and settings button at the top-right)
- jQuery(".toolbar.items").html(/*html*/`
- <div style="text-align: right;">
- ${dtps.user.parent ? /*html*/`
- <select onchange="dtps.obsSwitch(this)">
- ${dtps.user.children.map(child => {
- return `<option ${dtps.user.lmsID == child.id ? "selected" : ""} value = "${child.id}">${child.name}</option>`;
- }).join("")}
- </select>
- ` : /*html*/`
- <h4 style="font-size: 22px;">${dtps.user.name}</h4>
- `}
- <img src="${dtps.user.photoURL}" style="height: 34px; margin: 0px; margin-right: 10px; border-radius: 50%; vertical-align: middle;" />
- </div>
-
- <div style="margin-top: 5px; display: inline-block; text-align: right; float: right;">
- <a href="/" target="_blank" class="itemButton"><i class="material-icons">exit_to_app</i> ${dtpsLMS.isDemoLMS ? "Exit demo" : "Go to " + (dtpsLMS.shortName || dtpsLMS.name)}</a>
- ${dtps.remoteConfig.showFeedbackButton || dtps.unstable ? `<a target="_blank" href="${dtps.remoteConfig.feedbackButtonUsesEmail ? "mailto:[email protected]" : "https://github.com/jottocraft/dtps/issues/new/choose"}" class="itemButton"><i class="material-icons">feedback</i> Feedback</a>` : ""}
- <div onclick="dtps.settings();" class="itemButton"><i class="material-icons">settings</i> Settings</div>
- </div>
- `);
+ //Set profile image
+ jQuery(".profileImage").css("background-image", "url('" + dtps.user.photoURL + "')");
+ jQuery(".profileMenu .name").text(dtps.user.name);
//Load Fluid UI
fluid.onLoad();
@@ -1665,9 +1736,6 @@
//Render sidebar
dtps.showClasses();
- //Load header background gradient
- document.dispatchEvent(new CustomEvent('fluidTheme'));
-
//Remove loading screen styles
jQuery("#dtpsNativeOverlay style").remove();
@@ -1702,7 +1770,7 @@
/**
* @name dtpsLMS.fetchUser
- * @description [REQUIRED] Fetches user data from the LMS
+ * @description [REQUIRED] Fetches data for the current user from the LMS. If the user is not signed in, reject with an object that looks like {action: "login", redirectURL: "..."} to login the user.
* @kind function
* @return {Promise<User>} A promise which resolves to a User object
*/
@@ -1711,6 +1779,7 @@
* @name dtpsLMS.fetchClasses
* @description [REQUIRED] Fetches class data from the LMS
* @kind function
+* @param {string} userID The user ID to fetch classes for
* @return {Promise<Class[]>} A promise which resolves to an array of Class objects
*/
@@ -1718,6 +1787,7 @@
* @name dtpsLMS.fetchAssignments
* @description [REQUIRED] Fetches assignment data for a course from the LMS
* @kind function
+* @param {string} userID The user ID to fetch assignments for
* @param {string} classID The class ID to fetch assignments for
* @return {Promise<Assignment[]>} A promise which resolves to an array of Assignment objects
*/
@@ -1726,6 +1796,7 @@
* @name dtpsLMS.fetchModules
* @description [OPTIONAL] Fetches module data for a course from the LMS
* @kind function
+* @param {string} userID The user ID to fetch modules for
* @param {string} classID The class ID to fetch modules for
* @return {Promise<Module[]>} A promise which resolves to an array of Module objects
*/
@@ -1841,8 +1912,8 @@
//Type definitions -------------------------------------------------------------------------------------
/**
- * @typedef {string} Date
- * @description A date string recognized by {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse|Date.parse}
+ * @typedef {string|Date} Date
+ * @description A date string recognized by {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse|Date.parse} or an actual {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date|Date} object
*/
/**
@@ -1854,14 +1925,15 @@
* @property {string} url [ONLY FOR DTPSLMS.FETCHUSERS] The URL to this user's profile. Only used when displaying users in the people tab.
* @property {User[]} [children] [ONLY FOR DTPS.USER] Array of child users. If this is defined, the user is treated as a parent account. Sub-children are not allowed.
* @property {boolean} parent [ONLY FOR DTPS.USER] Automatically managed by DTPS. True if the user is a parent account.
- * @property {string} lmsID [ONLY FOR DTPS.USER] Automatically managed by DTPS. This is the user ID that all LMS web requests should use. Can change when a parent account changes the selected child.
*/
/**
* @typedef {Object} Class
* @description Defines class objects in DTPS
* @property {string} name Name of the class
-* @property {string} id Class ID
+* @property {string} id Class ID used by Power+
+* @property {string} lmsID Class ID used for LMS API calls
+* @property {string} userID The ID of the user this class is associated with (from the parameter of dtpsLMS.fetchClasses)
* @property {number} num Index of the class in the dtps.classes array
* @property {string} subject Class subject
* @property {Date} [endDate] The end date for this course
@@ -1880,7 +1952,7 @@
* @property {string} [letter] Current letter grade in the class
* @property {string} [previousLetter] Automatically managed by DTPS. The previous letter grade in this class, based on local grade history.
* @property {string} [image] URL to the class background image
-* @property {User} [teacher] Class teacher
+* @property {User} [teacher] Class teacher. If the class has multiple teachers, this is the primary teacher.
* @property {boolean} [hasGradebook] Automatically managed by DTPS. True if the class should show the gradebook tab.
* @property {object} [gradeCalculation] Automatically managed by DTPS. If custom grade calculation is implemented, this will be the results from custom grade calculation returned by dtpsLMS.calculateGrade.
* @property {string} [videoMeetingURL] The URL used to join this class' online meeting
diff --git a/scripts/lms/canvas.js b/scripts/lms/canvas.js
index 0b0680b..7bee3ee 100644
--- a/scripts/lms/canvas.js
+++ b/scripts/lms/canvas.js
@@ -27,65 +27,68 @@
*/
dtpsLMS.commonHeaders = { Accept: "application/json+canvas-string-ids, application/json" };
+/**
+ * List of teachers from dtpsLMS.fetchClasses for use in other methods
+ * This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.
+ */
+dtpsLMS.teacherCache = {};
+
//Fetch userdata from Canvas
dtpsLMS.fetchUser = function () {
return new Promise(function (resolve, reject) {
- jQuery.ajax({
- url: "/api/v1/users/self",
- type: "GET",
- headers: dtpsLMS.commonHeaders,
- success: function (userData) {
- jQuery.ajax({
- url: "/api/v1/users/self/observees?include[]=avatar_url",
- type: "GET",
- headers: dtpsLMS.commonHeaders,
- success: function (childrenData) {
- var user = {
- name: userData.name,
- id: userData.id,
- photoURL: userData.avatar_url
- };
+ if (!window.ENV || !window.ENV.current_user.id) reject({ action: "login", redirectURL: "/?dtpsLogin=true" });
- if (childrenData && childrenData.length) {
- //Parent account
- user.children = childrenData.map(child => {
- return {
- name: child.name,
- id: child.id,
- photoURL: child.avatar_url
- }
- });
- }
+ var user = {
+ name: window.ENV.current_user.display_name,
+ id: window.ENV.current_user.id,
+ photoURL: ENV.current_user.avatar_image_url
+ };
- resolve(user);
- },
- error: function (err) {
- reject(err);
+ if (window.ENV.current_user_roles.includes("observer")) {
+ jQuery.ajax({
+ url: "/api/v1/users/self/observees?include[]=avatar_url",
+ type: "GET",
+ headers: dtpsLMS.commonHeaders,
+ success: function (childrenData) {
+
+ if (childrenData && childrenData.length) {
+ //Parent account
+ user.children = childrenData.map(child => {
+ return {
+ name: child.name.split(" ")[0],
+ id: child.id,
+ photoURL: child.avatar_url
+ }
+ });
}
- });
- },
- error: function (err) {
- reject(err);
- }
- });
+
+ resolve(user);
+ },
+ error: function (err) {
+ reject(err);
+ }
+ });
+ } else {
+ resolve(user);
+ }
})
}
//Fetch class data from Canvas
-dtpsLMS.fetchClasses = function () {
+dtpsLMS.fetchClasses = function (userID) {
return new Promise(function (resolve, reject) {
jQuery.ajax({
- url: "/api/v1/users/self/colors",
+ url: "/api/v1/users/" + dtps.user.id + "/colors",
type: "GET",
headers: dtpsLMS.commonHeaders,
success: function (colorData) {
jQuery.ajax({
- url: "/api/v1/users/self/dashboard_positions",
+ url: "/api/v1/users/" + userID + "/dashboard_positions",
type: "GET",
headers: dtpsLMS.commonHeaders,
success: function (dashboardData) {
jQuery.ajax({
- url: "/api/v1/users/" + dtps.user.lmsID + "/courses?per_page=100&enrollment_state=active&include[]=term&include[]=total_scores&include[]=public_description&include[]=total_students&include[]=account&include[]=teachers&include[]=course_image&include[]=syllabus_body&include[]=tabs",
+ url: "/api/v1/users/" + userID + "/courses?per_page=100&enrollment_state=active&include[]=term&include[]=total_scores&include[]=public_description&include[]=total_students&include[]=account&include[]=teachers&include[]=course_image&include[]=syllabus_body&include[]=tabs",
type: "GET",
headers: dtpsLMS.commonHeaders,
success: function (courseData) {
@@ -98,6 +101,8 @@
var dtpsCourse = {
name: course.course_code,
id: course.id,
+ lmsID: course.id,
+ userID: userID,
subject: window.localStorage["pref-fullNames"] == "true" ? course.course_code : course.course_code.split(" - ")[0],
syllabus: course.syllabus_body,
homepage: course.default_view == "wiki",
@@ -115,6 +120,9 @@
endDate: course.end_at
};
+ //Save teachers in cache
+ dtpsLMS.teacherCache[course.id] = course.teachers;
+
if (course.teachers[0]) {
dtpsCourse.teacher = {
name: course.teachers[0] && course.teachers[0].display_name,
@@ -156,15 +164,15 @@
}
//Fetches assignment data from Canvas
-dtpsLMS.fetchAssignments = function (classID) {
+dtpsLMS.fetchAssignments = function (userID, classID) {
return new Promise(function (resolve, reject) {
jQuery.ajax({
- url: "/api/v1/courses/" + classID + "/students/submissions?include[]=rubric_assessment&include[]=submission_comments&per_page=100&student_ids[]=" + dtps.user.lmsID,
+ url: "/api/v1/courses/" + classID + "/students/submissions?include[]=rubric_assessment&include[]=submission_comments&per_page=100&student_ids[]=" + userID,
type: "GET",
headers: dtpsLMS.commonHeaders,
success: function (submissionData) {
jQuery.ajax({
- url: "/api/v1/users/" + dtps.user.lmsID + "/courses/" + classID + "/assignments?per_page=100&include[]=submission",
+ url: "/api/v1/users/" + userID + "/courses/" + classID + "/assignments?per_page=100&include[]=submission",
type: "GET",
headers: dtpsLMS.commonHeaders,
success: function (assignmentData) {
@@ -279,7 +287,7 @@
}
//Fetches modules data from Canvas
-dtpsLMS.fetchModules = function (classID) {
+dtpsLMS.fetchModules = function (userID, classID) {
return new Promise(function (resolve, reject) {
jQuery.ajax({
url: "/api/v1/courses/" + classID + "/modules?include[]=items&include[]=content_details",
@@ -393,7 +401,7 @@
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-CSRF-Token": decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
},
- body: "_method=POST&collapse=" + (collapsed ? 1 : 0) + "&authenticity_token=" + decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0],
+ data: "_method=POST&collapse=" + (collapsed ? 1 : 0) + "&authenticity_token=" + decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0],
success: function (data) {
resolve();
},
@@ -433,14 +441,29 @@
dtpsLMS.fetchUsers = function (classID) {
return new Promise(function (resolve, reject) {
jQuery.ajax({
- url: "/api/v1/courses/" + classID + "/sections?include[]=avatar_url&include[]=students",
+ url: "/api/v1/courses/" + classID + "/sections?include[]=avatar_url&include[]=students&per_page=99",
type: "GET",
headers: dtpsLMS.commonHeaders,
success: function (data) {
- var sections = [];
+ var teachers = dtpsLMS.teacherCache[classID];
+ console.log(teachers);
+ var sections = [{
+ title: "Teachers",
+ id: "lms.dtps.canvas-teachers",
+ users: []
+ }];
+
+ teachers.forEach(teacher => {
+ sections[0].users.push({
+ name: teacher.display_name,
+ id: teacher.id,
+ photoURL: teacher.avatar_image_url,
+ url: "/courses/" + classID + "/users/" + teacher.id
+ });
+ });
+
data.forEach(section => {
if (!section.students) return;
-
var users = [];
section.students.forEach(student => {
users.push({
@@ -452,7 +475,7 @@
});
var dtechMatch = section.name.match(/[0-9](?=\(A)/);
if (dtpsLMS.dtech && dtechMatch) {
- section.name = "Period " + dtechMatch[0];
+ section.name = dtechMatch[0] == 7 ? "@d.tech" : "Period " + dtechMatch[0];
}
sections.push({
title: section.name,
diff --git a/scripts/lms/demo.js b/scripts/lms/demo.js
index 6dd2b62..932cd94 100644
--- a/scripts/lms/demo.js
+++ b/scripts/lms/demo.js
@@ -33,7 +33,7 @@
}
//Fetch class data from Canvas
-dtpsLMS.fetchClasses = function () {
+dtpsLMS.fetchClasses = function (userID) {
return new Promise(function (resolve, reject) {
resolve([{
name: "Demo Class",
@@ -60,7 +60,7 @@
}
//Fetches assignment data from Canvas
-dtpsLMS.fetchAssignments = function (classID) {
+dtpsLMS.fetchAssignments = function (userID, classID) {
return new Promise(function (resolve, reject) {
if (classID == "1") {
resolve([
@@ -187,7 +187,7 @@
}
//Fetches modules data from Canvas
-dtpsLMS.fetchModules = function (classID) {
+dtpsLMS.fetchModules = function (userID, classID) {
return new Promise(function (resolve, reject) {
resolve([
{
diff --git a/scripts/lms/dtech.js b/scripts/lms/dtech.js
index 6d12e62..1831613 100644
--- a/scripts/lms/dtech.js
+++ b/scripts/lms/dtech.js
@@ -36,7 +36,7 @@
assignment.rubric.forEach(rubricItem => {
rubricItem.scoreName = shortenDtechRubricScoreName(rubricItem.scoreName);
- if (rubricItem.score) {
+ if (rubricItem.score !== undefined) {
rubricItem.color = dtechRubricColor(rubricItem.score);
}
});
@@ -77,7 +77,7 @@
classes.forEach(course => {
if (course.homepage) {
promises.push(new Promise((resolve, reject) => {
- dtpsLMS.fetchHomepage(course.id).then(homepage => {
+ dtpsLMS.fetchHomepage(course.lmsID).then(homepage => {
//get zoom link
var matches = 0;
for (var i = 0; i < $(homepage).find("a").length; i++) {
@@ -119,7 +119,7 @@
//Get d.tech grade calculation formula
if (course.term == "20-21") {
formula = "2020s1";
- } else if (course.id == dtps.remoteConfig.debugClassID) {
+ } else if (String(course.id).includes(dtps.remoteConfig.debugClassID)) {
formula = "2020s1";
}
@@ -155,11 +155,40 @@
//Get score color from rubric percentage
var dtechRubricColor = function (score) {
- if (score >= 4) return "#4f9e59";
- if (score >= 3) return "#a1b553";
- if (score >= 2) return "#c26d44";
- if (score >= 1) return "#c4474e";
- if (score >= 0) return "#bd3139";
+ if (score > 4.0) return "#20D684";
+ if (score == 4.0) return "#41BA35";
+ if (score >= 3.9) return "#50BC39";
+ if (score >= 3.8) return "#5FBD3D";
+ if (score >= 3.7) return "#6EBF40";
+ if (score >= 3.6) return "#7DC044";
+ if (score >= 3.5) return "#8CC248";
+ if (score >= 3.4) return "#9AC44C";
+ if (score >= 3.3) return "#A9C550";
+ if (score >= 3.2) return "#B8C753";
+ if (score >= 3.1) return "#C7C857";
+ if (score >= 3.0) return "#D6CA5B";
+ if (score >= 2.9) return "#D8C35A";
+ if (score >= 2.8) return "#DABB59";
+ if (score >= 2.7) return "#DCB458";
+ if (score >= 2.6) return "#DEAC57";
+ if (score >= 2.5) return "#E1A556";
+ if (score >= 2.4) return "#E39E55";
+ if (score >= 2.3) return "#E59654";
+ if (score >= 2.2) return "#E78F53";
+ if (score >= 2.1) return "#E98752";
+ if (score >= 2.0) return "#EB8051";
+ if (score >= 1.9) return "#E97A50";
+ if (score >= 1.8) return "#E7744F";
+ if (score >= 1.7) return "#E56F4E";
+ if (score >= 1.6) return "#E3694D";
+ if (score >= 1.5) return "#E1634C";
+ if (score >= 1.4) return "#DE5D4A";
+ if (score >= 1.3) return "#DC5749";
+ if (score >= 1.2) return "#DA5248";
+ if (score >= 1.1) return "#D84C47";
+ if (score >= 1.0) return "#D64646";
+ if (score >= 0.0) return "#D72727";
+ if (score < 0.0) return "#BF0000";
}
/**
@@ -237,7 +266,7 @@
//Assignment has a rubric
assignment.rubric.forEach(rubricItem => {
- if (rubricItem.score && rubricItem.outcome) {
+ if ((rubricItem.score !== undefined) && rubricItem.outcome) {
//Rubric item is assessed and is linked with an outcome
if (!outcomes[rubricItem.outcome]) {
@@ -265,8 +294,8 @@
//Loop over the values of each item in the outcomes object
Object.values(outcomes).forEach(outcome => {
- //Get array of scores for the outcome
- var outcomeScores = outcome.scores.map(RubricItem => RubricItem.score);
+ //Get array of scores for the outcome, remove null scores
+ var outcomeScores = outcome.scores.map(RubricItem => RubricItem.score).filter(score => score !== null);
//Calculate outcome average with all outcome scores
var average = this.average(outcomeScores);
@@ -284,7 +313,7 @@
if (droppedAverage > average) {
//The dropped score was higher
outcome.scoreType = "dropped";
- outcome.droppedScore = outcomeScores.indexOf(lowestScore);
+ outcome.droppedScore = outcome.scores.map(RubricItem => RubricItem.score).indexOf(lowestScore);
outcome.average = droppedAverage;
} else {
//Calculating with all outcome scores was the same or higher
@@ -417,47 +446,25 @@
//RENDERER: RENDER GRADE CALCULATION SUMMARY ------------------------------------
if (course.gradeCalculation.dtech.formula == "2020s1") {
var gradeCalcSummary = /*html*/`
- <div style="--classColor: ${course.color}" class="card">
+ <div id="gradeSummary" style="--size: 250px; margin: 0px 20px; --classColor: ${course.color};" class="grid flex">
+ <div style="background-color: var(--classColor); color: white;" class="block status letterGrade card">
+ <h2 class="main">${course.letter}</h2>
+ ${course.previousLetter ? `<h5 class="previousGrade">Previous grade: ${course.previousLetter}</h5>` : ""}
+ <h5 class="bottom"><i class="material-icons">grade</i> Grade</h5>
+ </div>
+ <div class="block status number75">
+ <h2 class="main numFont">${course.gradeCalculation.dtech.results.parameters.number75.toFixed(2)}</h2>
+ <h5 class="bottom"><i class="material-icons">functions</i> 75% of outcomes (${course.gradeCalculation.dtech.results.parameters.number75thresh}) ≥</h5>
+ </div>
+ <div class="block status lowestScore">
+ <h2 class="main numFont">${course.gradeCalculation.dtech.results.parameters.lowestScore.toFixed(2)}</h2>
+ <h5 class="bottom"><i class="material-icons">leaderboard</i> Lowest outcome</h5>
+ </div>
+ </div>
- <h3 class="gradeTitle">
- Grades
-
- <div class="classGradeCircle">
- <div class="letter">${course.letter}</div>
- </div>
-
- </h3>
-
- <h5 class="gradeStat">
- 75% (rounded down) of outcome scores are ≥
- <div class="numFont">${course.gradeCalculation.dtech.results.parameters.number75.toFixed(1)}</div>
- </h5>
-
- <h5 class="gradeStat">
- No outcome scores are lower than
- <div class="numFont">${course.gradeCalculation.dtech.results.parameters.lowestScore.toFixed(1)}</div>
- </h5>
-
- <div style="${dtps.gradebookExpanded ? "" : "display: none;"}" id="classGradeMore">
+ <div style="--classColor: ${course.color};${dtps.gradebookExpanded ? "" : "display: none;"}" id="classGradeMore">
<br />
-
- ${course.previousLetter ? /*html*/`
- <h5 class="smallStat">
- Previous Grade
- <div class="numFont">${course.previousLetter}</div>
- </h5>
- ` : ``}
-
- ${course.gradeCalculation.dtech.results.parameters.number75thresh ? /*html*/`
- <h5 class="smallStat">
- 75% of outcomes (rounded down) is
- <div class="numFont">${course.gradeCalculation.dtech.results.parameters.number75thresh}</div>
- </h5>
- ` : ``}
-
- <br />
-
- <table class="u-full-width dtpsTable">
+ <table class="table">
<thead>
<tr>
<th> Final Letter</th>
@@ -469,7 +476,7 @@
<tbody>
${dtechGradeCalc.letters.map(letter => {
return /*html*/`
- <tr ${course.letter == letter ? `style="background-color: var(--classColor); color: white; font-size:20px; font-weight: bold;"` : ``}>
+ <tr class="letter${letter} ${course.letter == letter ? `active` : ``}">
<td> ${letter}</td>
<td>${dtechGradeCalc.params[course.gradeCalculation.dtech.formula].percentage[letter]}</td>
<td>${dtechGradeCalc.params[course.gradeCalculation.dtech.formula].lowest[letter]}</td>
@@ -480,12 +487,8 @@
</table>
</div>
- <br />
-
- <br />
- <a onclick="$('#classGradeMore').toggle(); if ($('#classGradeMore').is(':visible')) {$(this).html('Show less'); dtps.gradebookExpanded = true;} else {$(this).html('Show more'); dtps.gradebookExpanded = false;}"
- style="color: var(--secText, gray); cursor: pointer; margin-right: 10px;">${dtps.gradebookExpanded ? "Show less" : "Show more"}</a>
- <a href="https://docs.google.com/document/d/1g4-aYZ_BS5_I4Ie64WGCwXeArl1K_pHbBbebDHra_sM/edit" style="color: var(--secText, gray);">Using 2020-21 grade calculation</a>
+ <div onclick="$('#classGradeMore').toggle(); if ($('#classGradeMore').is(':visible')) {$(this).children('i').text('keyboard_arrow_up'); $(this).children('span').text('Show less'); dtps.gradebookExpanded = true;} else {$(this).children('i').text('keyboard_arrow_down'); $(this).children('span').text('Show more'); dtps.gradebookExpanded = false;}" class="gradeSummaryShowHide">
+ ${dtps.gradebookExpanded ? `<i class="material-icons">keyboard_arrow_up</i> <span>Show less</span>` : `<i class="material-icons">keyboard_arrow_down</i> <span>Show more</span>`}
</div>
`;
} else {
@@ -517,7 +520,7 @@
<h5 style="max-width: calc(100% - 50px); font-size: 24px; margin: 0px; margin-bottom: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;">${outcome.title}</h5>
${outcome.average !== undefined ? `
- <div id="outcomeScore${outcomeID}" style="position: absolute; top: 20px; right: 20px; font-size: 26px; font-weight: bold; display: inline-block; color: ${dtechRubricColor(outcome.average)}">${outcome.average.toFixed(2)}</div>
+ <div id="outcomeScore${outcomeID}" class="numFont" style="position: absolute; top: 20px; right: 20px; font-size: 26px; font-weight: bold; display: inline-block; color: ${dtechRubricColor(outcome.average)}">${outcome.average.toFixed(2)}</div>
` : ``}
<div class="assessments">
@@ -526,11 +529,10 @@
` :
outcome.scores.map((assessment, aIndex) => {
return /*html*/`
- <p id="outcome${assessment.outcome}assessment${aIndex}" class="${aIndex == outcome.droppedScore ? "dropped" : ""}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
- <span aIndex="${aIndex}" outcomeID="${outcomeID}"
- style="outline: none;margin-right: 5px; font-size: 20px; vertical-align: middle; color: ${assessment.color}" class="editableScore" ${dtps.remoteConfig.allowWhatIfGrades ? `contenteditable` : ""}>${assessment.score}</span>
+ <div class="assessmentWrapper ${aIndex == outcome.droppedScore ? "dropped" : ""}" id="outcome${assessment.outcome}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
+ <div style="color: ${assessment.color};" aIndex="${aIndex}" outcomeID="${outcomeID}" class="editableScore" ${dtps.remoteConfig.allowWhatIfGrades ? `contenteditable` : ""}>${assessment.score}</div>
<span class="assessmentTitle" style="cursor: pointer;" onclick="dtps.assignment('${assessment.assignmentID}', ${course.num});">${assessment.assignmentTitle}</span>
- </p>
+ </div>
`;
}).join("")
}
@@ -570,6 +572,7 @@
}
//Enable What-If grades
+ var scrollListenerAdded = false;
dtpsLMS.gradebookDidRender = function (course) {
//Add event listeners for every editable score in the gradebook
$(".card.outcomeResults .assessments .editableScore").toArray().forEach(ele => {
@@ -579,7 +582,21 @@
//Add event listeners for the "Add a What-If grade" buttons
$("p.addWhatIf").click(function () {
addWhatIf(course, $(this).attr("outcomeID"));
- })
+ });
+
+ //Keep the grade summary on top
+ if (!scrollListenerAdded) {
+ scrollListenerAdded = true;
+ var gradeSummary = document.getElementById("gradeSummary");
+ var sticky = gradeSummary.offsetTop - parseFloat($("body").css("padding-top")) - 10;
+ window.onscroll = function () {
+ if ((window.pageYOffset >= sticky) && ((dtps.classes[dtps.selectedClass]) && (dtps.selectedContent == "grades"))) {
+ $(".classContent").addClass("fixedGradeSummary");
+ } else {
+ $(".classContent").removeClass("fixedGradeSummary");
+ }
+ };
+ }
}
//Adds a What-If grade listener to the provided element
@@ -592,9 +609,17 @@
var typedScore = Number($(ele).text());
//Check if score is valid
- if ($(ele).text() && ($(ele).text().length < 4) && !isNaN(typedScore) && (typedScore >= 1) && (typedScore <= 4)) {
+ if ($(ele).text() && ($(ele).text().length < 4) && !isNaN(typedScore) && (typedScore >= 0) && (typedScore <= 4)) {
//Valid outcome score, update color to match
- $(ele).css("color", dtechRubricColor(typedScore))
+ $(ele).css("color", dtechRubricColor(typedScore));
+
+ //Check if score is modified
+ var isWhatIf = course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].whatIfGrade;
+ if (isWhatIf || (typedScore !== course.gradeCalculation.dtech.outcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score)) {
+ $(ele).addClass("modified");
+ } else {
+ $(ele).removeClass("modified");
+ }
//Update score in the what-if outcomes
course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = typedScore;
@@ -602,29 +627,84 @@
//Calculate what-if grade
calcWhatIf(course);
} else {
- //Invalid outcome score, gray out and reset what-if letter
+ //Invalid outcome score, gray out and calculate without this score
$(ele).css("color", "var(--secText)");
- $("#outcomeScore" + Number($(ele).attr("outcomeID"))).html("--");
- $("#outcomeScore" + Number($(ele).attr("outcomeID"))).css("color", "var(--secText)");
- $(".card#whatIfResults .resultLetter").html("--");
- $(".card#whatIfResults .resultLetter").css("color", "var(--secText)");
+ $(ele).addClass("modified");
+
+ //Update score in the what-if outcomes
+ course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = null;
+
+ //Calculate what-if grade
+ calcWhatIf(course);
}
}, false);
+
+ ele.addEventListener("focus", function () {
+ $(ele).addClass("focused");
+ }, false);
+
+ ele.addEventListener("blur", function () {
+ if ($(ele).hasClass("whatIf") && ($(ele).text() == "")) {
+ $(ele).parent().remove();
+ course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = null;
+ } else {
+ $(ele).removeClass("focused");
+ }
+ }, false);
+
+ ele.addEventListener("keydown", function (e) {
+ function placeCaretAtEnd(el) {
+ el.focus();
+ if (typeof window.getSelection != "undefined"
+ && typeof document.createRange != "undefined") {
+ var range = document.createRange();
+ range.selectNodeContents(el);
+ range.collapse(false);
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+ } else if (typeof document.body.createTextRange != "undefined") {
+ var textRange = document.body.createTextRange();
+ textRange.moveToElementText(el);
+ textRange.collapse(false);
+ textRange.select();
+ }
+ }
+
+ if (e.key == "ArrowDown") {
+ e.preventDefault();
+ var scores = $(".editableScore").toArray();
+ if (scores[scores.indexOf(ele) + 1]) {
+ placeCaretAtEnd(scores[scores.indexOf(ele) + 1]);
+ }
+ } else if (e.key == "ArrowUp") {
+ e.preventDefault();
+ var scores = $(".editableScore").toArray();
+ if (scores[scores.indexOf(ele) - 1]) {
+ placeCaretAtEnd(scores[scores.indexOf(ele) - 1]);
+ }
+ }
+ }, false);
}
//Copies outcomes for modification, shows what-if UI
var initWhatIf = function (course) {
- if (!$(".card#whatIfResults").is(":visible")) {
+ if (!$("#gradeSummary").hasClass("whatIf")) {
//Initialize what-if grades
//Copy outcomes for modification
course.gradeCalculation.dtech.whatIfOutcomes = JSON.parse(JSON.stringify(course.gradeCalculation.dtech.outcomes));
- //Show what-if card, reset state
- $(".card#whatIfResults").show();
- $(".card#whatIfResults .resultLetter").html("--");
- $(".card#whatIfResults .resultLetter").css("color", "var(--secText)");
+ //Show what-if mode for grade summary
+ $("#gradeSummary .block.card").css("background-color", "");
+ $("#gradeSummary .block.card").css("color", "var(--classColor)");
+ $("#gradeSummary .block.card h5.bottom").html(`<i class="material-icons">analytics</i> What-If Grade`);
+ $("#gradeSummary .block.card .previousGrade").remove();
+ $("#gradeSummary .block.card h2.main").after(`<h5 onclick="fluid.screen();" class="showActualGrades">Show actual grades</h5>`);
+
+ $("#gradeSummary").addClass("whatIf");
+ $("#classGradeMore").addClass("whatIf");
}
}
@@ -640,13 +720,11 @@
course.gradeCalculation.dtech.whatIfOutcomes = results.outcomes;
//Update what-if results card with the grade calculation results
- $(".card#whatIfResults .resultLetter").html(results.results.letter);
- if (results.results.percentage) {
- $(".card#whatIfResults .resultPercentage").html("Percentage: " + Number(results.results.percentage).toFixed(2) + "%");
- } else {
- $(".card#whatIfResults .resultPercentage").html("");
- }
- $(".card#whatIfResults .resultLetter").css("color", "var(--classColor)");
+ $("#gradeSummary .block.letterGrade h2.main").html(results.results.letter);
+ $("#gradeSummary .block.number75 h2.main").html(results.results.parameters.number75.toFixed(2));
+ $("#gradeSummary .block.lowestScore h2.main").html(results.results.parameters.lowestScore.toFixed(2));
+ $("#classGradeMore .table tr").removeClass("active");
+ $("#classGradeMore .table tr.letter" + results.results.letter).addClass("active");
//Remove dropped state
$(".card.outcomeResults .dropped").removeClass("dropped");
@@ -655,7 +733,7 @@
var outcome = course.gradeCalculation.dtech.whatIfOutcomes[outcomeID];
//Update outcome average
- if (outcome.average) {
+ if (outcome.average !== undefined) {
$("#outcomeScore" + outcomeID).html(outcome.average.toFixed(2));
$("#outcomeScore" + outcomeID).css("color", dtechRubricColor(outcome.average));
}
@@ -679,7 +757,7 @@
//Add new assessment to the outcome
course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].scores.push({ //most of the stuff in this object is optional but I'm adding it anyways
id: "whatIf" + aIndex, //if changing this, update the id for the rendered what-if grade assessment as well
- score: "--",
+ score: null,
value: 4,
whatIfGrade: true,
outcome: outcomeID,
@@ -692,17 +770,12 @@
//Add a new What-If assessment to the UI
$(".card.outcomeResults.outcome-" + outcomeID + " .assessments").append(/*html*/`
- <p id="outcome${outcomeID}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
- <span aIndex="${aIndex}" outcomeID="${outcomeID}"
- style="outline: none;margin-right: 5px; font-size: 20px; vertical-align: middle; color: var(--secText);" class="editableScore" contenteditable>-</span>
+ <div class="assessmentWrapper" id="outcome${outcomeID}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
+ <div style="color: var(--secText);" aIndex="${aIndex}" outcomeID="${outcomeID}" class="editableScore modified whatIf" contenteditable></div>
<span class="assessmentTitle">What-If Grade</span>
- </p>
+ </div>
`);
- //Reset what-if results card
- $(".card#whatIfResults .resultLetter").html("--");
- $(".card#whatIfResults .resultLetter").css("color", "var(--secText)");
-
//Add an event listener for the new score
listenForWhatIf($(`#outcome${outcomeID}assessment${aIndex} .editableScore`)[0], course);
}
diff --git a/scripts/pages-discussions.js b/scripts/pages-discussions.js
index 9fd6679..b31a405 100644
--- a/scripts/pages-discussions.js
+++ b/scripts/pages-discussions.js
@@ -44,13 +44,30 @@
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
//Render sidebar
jQuery(".sidebar").html(/*html*/`
- <div class="bigLogo" style="text-align: center; margin: 10px 0 20px; height: 38px;">
+ <div class="title">
<i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="material-icons">forum</i>
- <h4 style="color: var(--text); display: inline-block; font-size: 26px; vertical-align: middle; margin: 0px;">Discussions</h4>
- </div>
+ <h4>Discussions</h4>
+ </div>
<div class="items">
- <div class="spinner"></div>
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="item shimmerParent">
+ <i class="material-icons">star</i>
+ <span class="label">Discussion thread Title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="material-icons">star</i>
+ <span class="label">Discussion thread Title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="material-icons">star</i>
+ <span class="label">Discussion thread Title</span>
+ </div>
</div>
`);
@@ -59,18 +76,15 @@
}
//Fetch discussion thread data
- dtpsLMS.fetchDiscussionThreads(dtps.classes[classNum].id).then(function (threadData) {
+ dtpsLMS.fetchDiscussionThreads(dtps.classes[classNum].lmsID).then(function (threadData) {
//Store fetched data to the selected class
dtps.classes[classNum].discussions = threadData;
if (dtps.classes[classNum].discussions.length == 0) {
//No discussion topics in this class
jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="class item main back">
- <span class="label">Classes</span>
- <div class="icon">
- <i class="material-icons">keyboard_arrow_left</i>
- </div>
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
</div>
<p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No discussions found</p>
@@ -81,10 +95,8 @@
var discussionHTML = dtps.classes[classNum].discussions.map(discussionThread => {
return /*html*/`
<div data-threadID="${discussionThread.id}" class="item">
+ <i class="material-icons">${discussionThread.locked ? "lock_outline" : "chat_bubble_outline"}</i>
<span class="label">${discussionThread.title}</span>
- <div class="icon">
- <i style="font-family: 'Material Icons Extended';" class="material-icons">${discussionThread.locked ? "lock_outline" : "chat_bubble_outline"}</i>
- </div>
</div>
`;
}).join("");
@@ -92,20 +104,15 @@
//Render discussion threads in the sidebar
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="class item main back">
- <span class="label">Classes</span>
- <div class="icon">
- <i class="material-icons">keyboard_arrow_left</i>
- </div>
- </div>
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
${
dtps.classes[classNum].newDiscussionThreadURL ? (/*html*/`
- <div onclick="window.open('${dtps.classes[classNum].newDiscussionThreadURL}')" class="class item back">
+ <div onclick="window.open('${dtps.classes[classNum].newDiscussionThreadURL}')" class="item back">
+ <i class="material-icons">add</i>
<span class="label">New discussion</span>
- <div class="icon">
- <i class="material-icons">add</i>
- </div>
</div>
`) : ""
}
@@ -150,11 +157,28 @@
dtps.loadThreadPosts = function (classNum, threadID, fromModules) {
//Show loading indicator
if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
- jQuery(".classContent").html(`<div class="spinner"></div>`);
+ jQuery(".classContent").html(/*html*/`
+ <div class="card" style="margin-top: 20px;margin-bottom: 75px;">
+ <h4><span class="shimmer">[SHIMMER] Thread Title</span></h4>
+
+ <div style="margin-bottom: 32px;" class="discussionHeader">
+ <h5 ><span class="shimmer">Discussion author name</span></h5>
+
+ <i class="material-icons shimmer">calendar_today</i>
+ <span class="shimmer">Discussion date</span>
+ </div>
+
+ <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 400px; border: none; outline: none;"></div>
+
+ <div style="margin-top: 32px;" class="discussionFooter">
+ <button class="btn small shimmer"><i class="material-icons">post_add</i> Add Post</button>
+ </div>
+ </div>
+ `);
}
//Fetch discussion posts from the LMS
- dtpsLMS.fetchDiscussionPosts(dtps.classes[classNum].id, threadID).then(function (thread) {
+ dtpsLMS.fetchDiscussionPosts(dtps.classes[classNum].lmsID, threadID).then(function (thread) {
//Post HTML array
var postHTML = [];
@@ -255,9 +279,9 @@
//Render HTML
if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
jQuery(".classContent").html((fromModules ? /*html*/`
- <div class="acrylicMaterial" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')" style="line-height: 40px;display: inline-block;border-radius: 20px;margin: 82px 0px 0px 82px; cursor: pointer;">
- <div style="font-size: 16px;display: inline-block;vertical-align: middle;margin: 0px 20px;"><i style="vertical-align: middle;" class="material-icons">keyboard_arrow_left</i> Back</div>
- </div>
+ <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
+ <i class="material-icons">keyboard_arrow_left</i> Back
+ </button>
` : "") + postHTML.join(""));
}
}).catch(function (err) {
@@ -302,13 +326,30 @@
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
//Render sidebar
jQuery(".sidebar").html(/*html*/`
- <div class="bigLogo" style="text-align: center; margin: 10px 0 20px; height: 38px;">
+ <div class="title">
<i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="material-icons">insert_drive_file</i>
- <h4 style="color: var(--text); display: inline-block; font-size: 26px; vertical-align: middle; margin: 0px;">Pages</h4>
- </div>
-
- <div class="items">
- <div class="spinner"></div>
+ <h4>Pages</h4>
+ </div>
+
+ <div class="items">
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="item shimmerParent">
+ <i class="material-icons">star</i>
+ <span class="label">Class page title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="material-icons">star</i>
+ <span class="label">Class page title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="material-icons">star</i>
+ <span class="label">Class page title</span>
+ </div>
</div>
`);
@@ -316,18 +357,16 @@
jQuery(".classContent").html("");
}
- dtpsLMS.fetchPages(dtps.classes[classNum].id).then(function (pagesData) {
+ dtpsLMS.fetchPages(dtps.classes[classNum].lmsID).then(function (pagesData) {
//Store fetched pages data to the class
dtps.classes[classNum].pages = pagesData;
if (pagesData.length == 0) {
//No pages in this class
jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="class item main back">
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="material-icons">keyboard_arrow_left</i>
<span class="label">Classes</span>
- <div class="icon">
- <i class="material-icons">keyboard_arrow_left</i>
- </div>
</div>
<p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No pages found</p>
@@ -338,10 +377,8 @@
var pageHTML = dtps.classes[classNum].pages.map(page => {
return /*html*/`
<div data-pageID="${page.id}" class="item ${(defaultPage && (page.id == defaultPage)) ? "active" : ""}">
+ <i class="material-icons">insert_drive_file</i>
<span class="label">${page.title}</span>
- <div class="icon">
- <i class="material-icons">insert_drive_file</i>
- </div>
</div>
`;
}).join("");
@@ -349,11 +386,9 @@
//Render discussion threads in the sidebar
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="class item main back">
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="material-icons">keyboard_arrow_left</i>
<span class="label">Classes</span>
- <div class="icon">
- <i class="material-icons">keyboard_arrow_left</i>
- </div>
</div>
<div class="divider"></div>
@@ -395,14 +430,29 @@
dtps.loadPage = function (classNum, pageID, fromModules) {
//Show loading indicator
if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
- jQuery(".classContent").html(`<div class="spinner"></div>`);
+ jQuery(".classContent").html(/*html*/`
+ <div style="margin: 20px; padding: 20px;">
+ <h4><span class="shimmer">[SHIMMER] Class page title</span></h4>
+
+ <div style="margin-bottom: 32px;" class="discussionHeader">
+ <h5 class="shimmer">Page author name</h5>
+
+ <i class="material-icons shimmer">calendar_today</i>
+ <span class="shimmer">[SHIMMER] Last updated at</span>
+ </div>
+
+ <!-- Page content -->
+ <br />
+ <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 600px; border: none; outline: none;"></div>
+ </div>
+ `);
}
//Fetch page content
- dtpsLMS.fetchPageContent(dtps.classes[classNum].id, pageID).then(function (page) {
+ dtpsLMS.fetchPageContent(dtps.classes[classNum].lmsID, pageID).then(function (page) {
if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
//Get computed background and text color to style the iFrame with
- var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
+ var computedBackgroundColor = getComputedStyle($(".classContent")[0]).getPropertyValue("--background");
var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
//Generate a blob with the page content and get its data URL
@@ -419,11 +469,11 @@
//Render page card in the class content
jQuery(".classContent").html(/*html*/`
${fromModules ? /*html*/`
- <div class="acrylicMaterial" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')" style="line-height: 40px;display: inline-block;border-radius: 20px;margin: 82px 0px 0px 82px; cursor: pointer;">
- <div style="font-size: 16px;display: inline-block;vertical-align: middle;margin: 0px 20px;"><i style="vertical-align: middle;" class="material-icons">keyboard_arrow_left</i> Back</div>
- </div>
+ <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
+ <i class="material-icons">keyboard_arrow_left</i> Back
+ </button>
` : ""}
- <div class="card">
+ <div style="margin: 20px; padding: 20px;">
<!-- Page title -->
<h4 style="font-weight: bold;">${page.title}</h4>
diff --git a/scripts/people.js b/scripts/people.js
index 7760e90..cb0f55e 100644
--- a/scripts/people.js
+++ b/scripts/people.js
@@ -34,11 +34,57 @@
}
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "people")) {
- jQuery(".classContent").html(`<div class="spinner"></div>`);
+ jQuery(".classContent").html(/*html*/`
+ <div style="--size: 250px; margin: 0px 20px;" class="grid flex">
+ <div class="block status card">
+ <h2 class="main"><span class="shimmer">--</span></h2>
+ <h5 class="bottom"><i class="material-icons">contact_page</i> Your section</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont"><span class="shimmer">--</span></h2>
+ <h5 class="bottom"><i class="material-icons">groups</i> Total Students</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont"><span class="shimmer">--</span></h2>
+ <h5 class="bottom"><i class="material-icons">school</i> Teachers</h5>
+ </div>
+ </div>
+ <div class="card">
+ <h5><b style="width: 300px; display: inline-block;" class="shimmer">Title</b></h5>
+ ${[1, 2, 3, 4, 5, 6].map(() => (
+ /*html*/`
+ <div>
+ <p class="shimmerParent">
+ <span style="width: 30px; height: 30px; outline: none; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 5px;"></span>
+ <a style="color: var(--text); vertical-align: middle;">User name</a>
+ </p>
+ </div>
+ `
+ )).join("")}
+ </div>
+ `);
}
//Fetch users list
- dtpsLMS.fetchUsers(dtps.classes[classNum].id).then(function (sections) {
+ dtpsLMS.fetchUsers(dtps.classes[classNum].lmsID).then(function (sections) {
+ //Count students and teachers by user ID
+ var allStudents = [];
+ var allTeachers = [];
+ var currentSection = null;
+ sections.forEach(section => {
+ section.users.forEach(user => {
+ if ((section.title == "Teachers") && !allTeachers.includes(user.id)) {
+ allTeachers.push(user.id);
+ } else if (!allStudents.includes(user.id)) {
+ allStudents.push(user.id);
+ }
+
+ if (!currentSection && (user.id == dtps.user.id)) {
+ currentSection = section.title;
+ }
+ });
+ });
+
if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "people")) {
if (!sections || (sections.length == 0)) {
//No people in this class? (this shouldn't be possible)
@@ -49,7 +95,22 @@
</div>
`);
} else {
- jQuery(".classContent").html(sections.map(section => (
+ jQuery(".classContent").html(/*html*/`
+ <div style="--size: 250px; margin: 0px 20px;" class="grid flex">
+ <div class="block status card">
+ <h2 class="main">${currentSection || "--"}</h2>
+ <h5 class="bottom"><i class="material-icons">contact_page</i> Your section</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont">${allStudents.length}</h2>
+ <h5 class="bottom"><i class="material-icons">groups</i> Total Students</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont">${allTeachers.length}</h2>
+ <h5 class="bottom"><i class="material-icons">school</i> ${allTeachers.length == 1 ? "Teacher" : "Teachers"}</h5>
+ </div>
+ </div>
+ ` + sections.map(section => (
/*html*/`
<div class="card">
<h5><b>${section.title}</b></h5>
@@ -62,7 +123,7 @@
</p>
</div>
`
- )).join("")}
+ )).join("")}
</div>
`
)).join(""));
diff --git a/www/CNAME b/www/CNAME
deleted file mode 100644
index c53b96c..0000000
--- a/www/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-powerplus.app
\ No newline at end of file
diff --git a/www/assets/dev.svg b/www/assets/dev.svg
new file mode 100644
index 0000000..7f86520
--- /dev/null
+++ b/www/assets/dev.svg
@@ -0,0 +1 @@
+<svg id="e7dedc5b-fca6-4313-b5a0-e6297481e8ae" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1022.7" height="785.81" viewBox="0 0 1022.7 785.81"><defs><linearGradient id="af83dc26-9572-4816-b7a1-1af4f72ff554" x1="678.2" y1="821.79" x2="678.2" y2="493.4" gradientTransform="translate(-20.24 29.65) rotate(-2.31)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="gray" stop-opacity="0.25"/><stop offset="0.54" stop-color="gray" stop-opacity="0.12"/><stop offset="1" stop-color="gray" stop-opacity="0.1"/></linearGradient></defs><title>bug fixing</title><ellipse cx="468.63" cy="660.88" rx="425" ry="33" fill="#e3ba4b" opacity="0.1"/><g opacity="0.1"><path d="M933.7,529.93c-2.54-7.71-12.84-11.26-23-7.92a24.76,24.76,0,0,0-4.23,1.83c-.65-.18-1.32-.34-2-.46a22.42,22.42,0,0,0,.63-6.79A24.6,24.6,0,0,0,916,495.12a24.63,24.63,0,0,0,10.86-21.47,23.76,23.76,0,0,0,8.23-9.32c4.9-9.7,2.87-20.6-4.54-24.35s-17.4,1.08-22.3,10.78a23.69,23.69,0,0,0-2.63,12.15,24.63,24.63,0,0,0-10.86,21.47,24.63,24.63,0,0,0-10.86,21.47A24.64,24.64,0,0,0,873,527.33a23.76,23.76,0,0,0-8.23,9.32,25.46,25.46,0,0,0-2.08,5.74,21.18,21.18,0,0,0-4.44-4.73,25.38,25.38,0,0,0-1-4.5c-3.34-10.17-12.3-16.37-20-13.83s-11.26,12.83-7.92,23a23.07,23.07,0,0,0,7.56,11.08,25.38,25.38,0,0,0,1,4.5c1.94,5.9,5.77,10.46,10.15,12.75a23.23,23.23,0,0,0-.83,3.9,25.29,25.29,0,0,0-7.54,14.91,25.27,25.27,0,0,0-7.54,14.92,24.63,24.63,0,0,0-5,6.81c-4.91,9.7-2.88,20.61,4.53,24.35s17.4-1.07,22.31-10.78a24.62,24.62,0,0,0,2.5-8.09,25.29,25.29,0,0,0,7.54-14.91,25.27,25.27,0,0,0,7.54-14.92A25.21,25.21,0,0,0,879,571.94,25.21,25.21,0,0,0,886.56,557a24.11,24.11,0,0,0,3.39-4,23.46,23.46,0,0,0,12.27-.77,24.76,24.76,0,0,0,4.23-1.83,23.2,23.2,0,0,0,13.42-.48C930,546.61,936.23,537.65,933.7,529.93Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><g opacity="0.1"><path d="M915.77,499.53a21.5,21.5,0,0,1-3.44,2.75,23,23,0,0,1-1.11,8.43,26.18,26.18,0,0,0,2.1-3.43A24.64,24.64,0,0,0,915.77,499.53Z" transform="translate(-88.65 -57.09)"/><path d="M926.63,478.06a21.5,21.5,0,0,1-3.44,2.75,23,23,0,0,1-1.11,8.43,25.65,25.65,0,0,0,2.1-3.44A24.85,24.85,0,0,0,926.63,478.06Z" transform="translate(-88.65 -57.09)"/><path d="M902,470.07a21.91,21.91,0,0,1,.17-4.41,24.93,24.93,0,0,0-4.78,6.57,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,902,470.07Z" transform="translate(-88.65 -57.09)"/><path d="M833.07,600a23.59,23.59,0,0,1,2.95-3.38,22.92,22.92,0,0,1,.87-4,25.09,25.09,0,0,0-2.29,3.71A25.59,25.59,0,0,0,833.07,600Z" transform="translate(-88.65 -57.09)"/><path d="M840.61,585.1a23.59,23.59,0,0,1,2.95-3.38,23,23,0,0,1,.83-3.9l0,0a25.68,25.68,0,0,0-2.2,3.59A26.76,26.76,0,0,0,840.61,585.1Z" transform="translate(-88.65 -57.09)"/><path d="M904.9,521a20.82,20.82,0,0,1-3.43,2.74,22.45,22.45,0,0,1-.63,6.79,18.75,18.75,0,0,1,2,.46,24.76,24.76,0,0,1,4.23-1.83c10.18-3.34,20.47.21,23,7.92a11.68,11.68,0,0,1,.32,6c3.35-3.94,4.74-8.74,3.3-13.14-2.54-7.71-12.84-11.26-23-7.92a24.76,24.76,0,0,0-4.23,1.83c-.65-.18-1.32-.34-2-.46C904.65,522.59,904.79,521.8,904.9,521Z" transform="translate(-88.65 -57.09)"/><path d="M829.35,607.49a25.09,25.09,0,0,0-2.29,3.71,26.56,26.56,0,0,0-1.54,3.74,24.48,24.48,0,0,1,3-3.4A22.92,22.92,0,0,1,829.35,607.49Z" transform="translate(-88.65 -57.09)"/><path d="M891.09,491.54a22,22,0,0,1,.17-4.41,24.93,24.93,0,0,0-4.78,6.57,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,891.09,491.54Z" transform="translate(-88.65 -57.09)"/><path d="M875.4,579.1a24.29,24.29,0,0,1-1,4.38,26.67,26.67,0,0,0,2.09-3.44,25.49,25.49,0,0,0,1.63-4A24.23,24.23,0,0,1,875.4,579.1Z" transform="translate(-88.65 -57.09)"/><path d="M860.32,608.92a24.15,24.15,0,0,1-1,4.38,25.65,25.65,0,0,0,2.1-3.44,26.47,26.47,0,0,0,1.63-4A23.57,23.57,0,0,1,860.32,608.92Z" transform="translate(-88.65 -57.09)"/><path d="M867.86,594a24.11,24.11,0,0,1-1,4.38A26.67,26.67,0,0,0,869,595a25.49,25.49,0,0,0,1.63-4A24.23,24.23,0,0,1,867.86,594Z" transform="translate(-88.65 -57.09)"/><path d="M882.94,564.19a24,24,0,0,1-1,4.37,25.89,25.89,0,0,0,2.09-3.43,25.48,25.48,0,0,0,1.64-4.07A23.22,23.22,0,0,1,882.94,564.19Z" transform="translate(-88.65 -57.09)"/><path d="M833.57,526.48c7.72-2.53,16.68,3.66,20,13.83a25.68,25.68,0,0,1,1,4.51,21.18,21.18,0,0,1,4.44,4.73,25.53,25.53,0,0,1,2.08-5.75c.35-.68.73-1.33,1.12-2a21.07,21.07,0,0,0-4-4.18,25.38,25.38,0,0,0-1-4.5c-3.34-10.17-12.3-16.37-20-13.83-4.4,1.44-7.44,5.41-8.62,10.43A11.69,11.69,0,0,1,833.57,526.48Z" transform="translate(-88.65 -57.09)"/><path d="M869.37,534.48a21.85,21.85,0,0,1,.18-4.4,24.73,24.73,0,0,0-4.79,6.57,25.07,25.07,0,0,0-1.52,3.72A23,23,0,0,1,869.37,534.48Z" transform="translate(-88.65 -57.09)"/><path d="M880.23,513a21.85,21.85,0,0,1,.18-4.4,24.52,24.52,0,0,0-4.79,6.56,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,880.23,513Z" transform="translate(-88.65 -57.09)"/><path d="M852.78,623.83a24.25,24.25,0,0,1-1,4.39,25.73,25.73,0,0,0,3.73-7.49A23.57,23.57,0,0,1,852.78,623.83Z" transform="translate(-88.65 -57.09)"/></g><path d="M948.52,430.71a23.68,23.68,0,0,0,8.23-9.32c4.91-9.7,2.88-20.61-4.53-24.36s-17.4,1.08-22.31,10.79A23.68,23.68,0,0,0,927.29,420a24.63,24.63,0,0,0-10.86,21.47,23.61,23.61,0,0,0-8.23,9.32,24.69,24.69,0,0,0-1.51,3.69,20.85,20.85,0,0,1,10.77-8A12.24,12.24,0,0,0,933,454.32a20.85,20.85,0,0,1,0,13.41,25.48,25.48,0,0,0,2.08-3.4,23.68,23.68,0,0,0,2.62-12.15,24.57,24.57,0,0,0,10.86-21.47Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><path d="M1067.88,293.07a72,72,0,0,0,8.72-4.83l-32.33-23.62,38,19.57a72.13,72.13,0,0,0,27-50.31l-64.58.66,64.72-10.82A72,72,0,1,0,966.83,242a72.09,72.09,0,0,0-13.26,8l33.75,46.93L946.8,255.85a72.08,72.08,0,0,0-20.17,65.61,72,72,0,1,0,101.05,51.1,72,72,0,0,0,40.2-79.49Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M933,274.75a71.77,71.77,0,0,0-6.35,46.71,72,72,0,1,0,101.05,51.1C1041.83,366,936.62,267.54,933,274.75Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><circle cx="925.49" cy="102.72" r="10.69" fill="#e3ba4b"/><circle cx="987.93" cy="109.58" r="10.69" fill="#e3ba4b"/><circle cx="1012.01" cy="205.64" r="10.69" fill="#e3ba4b"/><circle cx="979.51" cy="253.61" r="10.69" fill="#e3ba4b"/><circle cx="935.11" cy="353.24" r="10.69" fill="#e3ba4b"/><circle cx="935.11" cy="353.24" r="10.69" opacity="0.1"/><circle cx="836.39" cy="240.4" r="10.69" fill="#e3ba4b"/><circle cx="836.39" cy="240.4" r="10.69" opacity="0.1"/><path d="M913.64,473.32c-7.11-3.59-9.26-13.76-5.11-23.14-.22.38-.43.77-.63,1.18-4.91,9.7-2.88,20.6,4.53,24.35s17.4-1.08,22.3-10.78c.21-.4.39-.81.57-1.21C930.21,472.63,920.74,476.92,913.64,473.32Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M903.08,494.2c-7.1-3.59-9.26-13.76-5.1-23.15-.22.39-.44.78-.64,1.18-4.91,9.7-2.88,20.61,4.53,24.35s17.4-1.07,22.31-10.78c.2-.4.39-.8.57-1.21C919.65,493.5,910.19,497.79,903.08,494.2Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M892.52,515.07c-7.1-3.59-9.26-13.76-5.1-23.14-.22.38-.44.77-.64,1.18-4.91,9.7-2.87,20.6,4.54,24.35s17.39-1.08,22.3-10.78c.2-.4.39-.81.57-1.21C909.1,514.38,899.63,518.67,892.52,515.07Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M882,536c-7.11-3.59-9.26-13.76-5.11-23.14-.22.38-.43.77-.64,1.17-4.9,9.7-2.87,20.61,4.54,24.36s17.4-1.08,22.3-10.79c.21-.4.39-.8.57-1.21C898.54,535.25,889.07,539.54,882,536Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M871.41,556.82c-7.11-3.59-9.26-13.76-5.11-23.14-.22.38-.43.77-.63,1.18-4.91,9.7-2.88,20.6,4.53,24.35s17.4-1.08,22.31-10.78c.2-.4.39-.81.57-1.21C888,556.13,878.51,560.42,871.41,556.82Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M860.85,577.7c-7.1-3.59-9.26-13.76-5.1-23.14-.22.38-.44.77-.64,1.17-4.91,9.7-2.88,20.61,4.54,24.36S877,579,882,569.3c.2-.4.39-.8.57-1.21C877.42,577,868,581.29,860.85,577.7Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M850.29,598.57c-7.1-3.59-9.26-13.76-5.1-23.14-.22.39-.43.77-.64,1.18-4.9,9.7-2.87,20.6,4.54,24.35s17.4-1.08,22.3-10.78c.21-.4.39-.81.57-1.21C866.87,597.88,857.4,602.17,850.29,598.57Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M839.74,619.45c-7.11-3.59-9.26-13.76-5.11-23.14q-.33.57-.63,1.17c-4.91,9.7-2.88,20.61,4.53,24.36s17.4-1.08,22.31-10.79c.2-.4.38-.8.56-1.21C856.31,618.75,846.84,623,839.74,619.45Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M832.8,633.17c-7.1-3.6-9.26-13.76-5.1-23.15-.22.39-.44.78-.64,1.18-4.91,9.7-2.88,20.61,4.53,24.35s17.4-1.07,22.31-10.78c.2-.4.39-.8.57-1.21C849.37,632.47,839.9,636.76,832.8,633.17Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M1023.59,540.26a37.4,37.4,0,0,0,2-9.79,5.34,5.34,0,1,0-.81-10.62,37.31,37.31,0,0,0-19.64-25.31,5.34,5.34,0,1,0-9.54-4.82,5,5,0,0,0-.48,1.43A37.49,37.49,0,0,0,962.25,501a37.64,37.64,0,0,0-9.82-.29l-4.33,19.71-.26-19a37.42,37.42,0,1,0,20,72,5.28,5.28,0,0,0,2.25,2.16,5.34,5.34,0,0,0,7.32-6.88,37.35,37.35,0,0,0,4.8-3.92,37.45,37.45,0,0,0,39.31-19.83l-20.15-3.39Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><g opacity="0.1"><path d="M992.46,549.83c-7.44-9.82-12-21.45-17.25-32.61a136.38,136.38,0,0,0-7.07-13.36l-3.94-4.59c-.66.56-1.32,1.14-2,1.75a37.64,37.64,0,0,0-9.82-.29l-4.33,19.71-.26-19a37.42,37.42,0,1,0,20,72,5.28,5.28,0,0,0,2.25,2.16,5.34,5.34,0,0,0,7.32-6.88,37.35,37.35,0,0,0,4.8-3.92,37.49,37.49,0,0,0,22.44-3.32A52.71,52.71,0,0,1,992.46,549.83Z" transform="translate(-88.65 -57.09)"/></g><path d="M860.71,507.63a5.34,5.34,0,0,0-4.78-7.75,37.37,37.37,0,0,0-11.7-20.83,37.52,37.52,0,0,0,1.1-11.7L825.68,464l19.08-1.2a38,38,0,0,0-1.41-5.28,5.46,5.46,0,0,0,1.76-2,5.35,5.35,0,0,0-6.59-7.44A37.42,37.42,0,0,0,771.73,479a5.25,5.25,0,0,0-2.66,2.5,5.34,5.34,0,0,0,6.75,7.37,37.53,37.53,0,0,0,7.09,8.65,37.4,37.4,0,0,0,1.74,23.76L811,514.44,787.5,526.8a37.42,37.42,0,0,0,68.91-16.26A5.33,5.33,0,0,0,860.71,507.63Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M860.71,507.63a5.34,5.34,0,0,0-4.78-7.75,37.37,37.37,0,0,0-11.7-20.83c.16-.63.3-1.25.42-1.88a13.18,13.18,0,0,0-1.93,1.71c-3.55,3.89-5.37,9.12-8.88,13.05-4.14,4.64-10.34,7.06-16.53,7.71s-12.42-.3-18.53-1.49c-5.06-1-10.19-2.16-15.32-1.67-.5,0-1,.11-1.46.19.3.29.6.58.91.86a37.4,37.4,0,0,0,1.74,23.76L811,514.44,787.5,526.8a37.42,37.42,0,0,0,68.91-16.26A5.33,5.33,0,0,0,860.71,507.63Z" transform="translate(-88.65 -57.09)" opacity="0.1"/></g><g opacity="0.1"><path d="M178.14,568.33c1.28-3.89,6.47-5.68,11.59-4a12.78,12.78,0,0,1,2.13.92c.33-.09.67-.17,1-.23a11.26,11.26,0,0,1-.32-3.42,12.46,12.46,0,0,1-5.47-10.82,11.92,11.92,0,0,1-4.14-4.69,12,12,0,0,1-1.33-6.12,12,12,0,0,1-4.14-4.7C175,530.39,176,524.9,179.75,523s8.77.55,11.24,5.43a12,12,0,0,1,1.32,6.13,12.37,12.37,0,0,1,5.47,10.81,12.4,12.4,0,0,1,5.47,10.82A12.37,12.37,0,0,1,208.72,567a12,12,0,0,1,4.15,4.7,12.66,12.66,0,0,1,1,2.9,10.66,10.66,0,0,1,2.23-2.39,12.58,12.58,0,0,1,.52-2.27c1.69-5.12,6.2-8.24,10.09-7s5.67,6.47,4,11.59a11.67,11.67,0,0,1-3.81,5.59,12.67,12.67,0,0,1-.52,2.26,11.1,11.1,0,0,1-5.11,6.42,12.84,12.84,0,0,1,.42,2,12.57,12.57,0,0,1,2.53,3.43,12.32,12.32,0,0,1,1.26,4.08,12.55,12.55,0,0,1,2.54,3.43,12.39,12.39,0,0,1,1.26,4.08,12.45,12.45,0,0,1,2.54,3.44c2.47,4.88,1.45,10.38-2.28,12.26s-8.77-.54-11.24-5.43a12.48,12.48,0,0,1-1.26-4.08,12.7,12.7,0,0,1-3.8-7.51,12.7,12.7,0,0,1-3.8-7.51,12.6,12.6,0,0,1-2.54-3.43,12.73,12.73,0,0,1-1.26-4.08,12.57,12.57,0,0,1-2.53-3.43,12.32,12.32,0,0,1-1.26-4.08,11.63,11.63,0,0,1-1.71-2,11.9,11.9,0,0,1-6.18-.38,13.29,13.29,0,0,1-2.14-.93,11.61,11.61,0,0,1-6.75-.24C180,576.73,176.87,572.22,178.14,568.33Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><g opacity="0.1"><path d="M187.17,553a10.72,10.72,0,0,0,1.74,1.39,11.31,11.31,0,0,0,.56,4.24,11.93,11.93,0,0,1-1.06-1.73A12.46,12.46,0,0,1,187.17,553Z" transform="translate(-88.65 -57.09)"/><path d="M181.7,542.2a11.21,11.21,0,0,0,1.74,1.38,11.39,11.39,0,0,0,.56,4.25,12.7,12.7,0,0,1-2.3-5.63Z" transform="translate(-88.65 -57.09)"/><path d="M194.13,538.17a11.11,11.11,0,0,0-.08-2.22,12.66,12.66,0,0,1,2.41,3.31,13,13,0,0,1,.76,1.88A11.42,11.42,0,0,0,194.13,538.17Z" transform="translate(-88.65 -57.09)"/><path d="M228.83,603.63a11.65,11.65,0,0,0-1.48-1.7,12.4,12.4,0,0,0-.44-2,13.23,13.23,0,0,1,1.15,1.86A13,13,0,0,1,228.83,603.63Z" transform="translate(-88.65 -57.09)"/><path d="M225,596.12a11.65,11.65,0,0,0-1.48-1.7,11.75,11.75,0,0,0-.42-2h0a12.67,12.67,0,0,1,1.88,3.68Z" transform="translate(-88.65 -57.09)"/><path d="M192.65,563.84a10.11,10.11,0,0,0,1.73,1.37,10.9,10.9,0,0,0,.32,3.42,10,10,0,0,0-1,.23,13.26,13.26,0,0,0-2.14-.92c-5.12-1.68-10.31.11-11.58,4a5.82,5.82,0,0,0-.17,3,6.93,6.93,0,0,1-1.66-6.61c1.28-3.89,6.47-5.68,11.59-4a12.78,12.78,0,0,1,2.13.92c.33-.09.67-.17,1-.23A10.32,10.32,0,0,1,192.65,563.84Z" transform="translate(-88.65 -57.09)"/><path d="M230.71,607.4a12.79,12.79,0,0,1,1.15,1.87,13,13,0,0,1,.77,1.88,11.74,11.74,0,0,0-1.48-1.71A12.4,12.4,0,0,0,230.71,607.4Z" transform="translate(-88.65 -57.09)"/><path d="M199.6,549a11.08,11.08,0,0,0-.08-2.22,12.49,12.49,0,0,1,2.41,3.31,12.87,12.87,0,0,1,.76,1.87A11.38,11.38,0,0,0,199.6,549Z" transform="translate(-88.65 -57.09)"/><path d="M207.51,593.1a11.94,11.94,0,0,0,.49,2.2,12.63,12.63,0,0,1-1.88-3.77A11.72,11.72,0,0,0,207.51,593.1Z" transform="translate(-88.65 -57.09)"/><path d="M215.1,608.12a12.66,12.66,0,0,0,.5,2.2,11.93,11.93,0,0,1-1.06-1.73,12.88,12.88,0,0,1-.82-2A13,13,0,0,0,215.1,608.12Z" transform="translate(-88.65 -57.09)"/><path d="M211.31,600.61a11.94,11.94,0,0,0,.49,2.2,12.88,12.88,0,0,1-1.06-1.73,12.6,12.6,0,0,1-.82-2A11.72,11.72,0,0,0,211.31,600.61Z" transform="translate(-88.65 -57.09)"/><path d="M203.71,585.58a11.86,11.86,0,0,0,.49,2.21,12.44,12.44,0,0,1-1-1.73,12.23,12.23,0,0,1-.83-2A11.13,11.13,0,0,0,203.71,585.58Z" transform="translate(-88.65 -57.09)"/><path d="M228.58,566.59c-3.89-1.28-8.4,1.84-10.08,7a12.58,12.58,0,0,0-.52,2.27,10.63,10.63,0,0,0-2.24,2.38,12.83,12.83,0,0,0-1.05-2.9c-.17-.34-.36-.67-.56-1a10.63,10.63,0,0,1,2-2.1,12.58,12.58,0,0,1,.52-2.27c1.69-5.12,6.2-8.24,10.09-7a6.93,6.93,0,0,1,4.34,5.26A5.93,5.93,0,0,0,228.58,566.59Z" transform="translate(-88.65 -57.09)"/><path d="M210.54,570.62a11.11,11.11,0,0,0-.08-2.22,12.49,12.49,0,0,1,2.41,3.31,13,13,0,0,1,.76,1.88A11.28,11.28,0,0,0,210.54,570.62Z" transform="translate(-88.65 -57.09)"/><path d="M205.07,559.8a11.13,11.13,0,0,0-.08-2.22,12.83,12.83,0,0,1,2.41,3.31,13,13,0,0,1,.76,1.88A11.42,11.42,0,0,0,205.07,559.8Z" transform="translate(-88.65 -57.09)"/><path d="M218.9,615.63a11.9,11.9,0,0,0,.5,2.21,12.61,12.61,0,0,1-1.06-1.74,12.88,12.88,0,0,1-.82-2A13,13,0,0,0,218.9,615.63Z" transform="translate(-88.65 -57.09)"/></g><path d="M170.67,518.34a11.92,11.92,0,0,1-4.14-4.69c-2.47-4.89-1.45-10.38,2.28-12.27s8.77.54,11.24,5.43a11.93,11.93,0,0,1,1.32,6.12,12.4,12.4,0,0,1,5.47,10.82,12,12,0,0,1,4.15,4.69,13.23,13.23,0,0,1,.76,1.86,10.57,10.57,0,0,0-5.43-4,6.16,6.16,0,0,1-7.83,4,10.52,10.52,0,0,0,0,6.75,13.19,13.19,0,0,1-1-1.71,12,12,0,0,1-1.33-6.12,12.43,12.43,0,0,1-5.47-10.82Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><path d="M110.55,449a36.81,36.81,0,0,1-4.39-2.43l16.28-11.9-19.14,9.85a36.34,36.34,0,0,1-13.59-25.34l32.54.34-32.61-5.46a36.29,36.29,0,1,1,71.81,9.2,36.73,36.73,0,0,1,6.68,4l-17,23.64,20.41-20.68a36.32,36.32,0,0,1,10.16,33.05,36.29,36.29,0,1,1-50.9,25.74,36.28,36.28,0,0,1-20.25-40Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M178.5,439.78a36.12,36.12,0,0,1,3.2,23.53,36.29,36.29,0,1,1-50.9,25.74C123.67,485.74,176.67,436.15,178.5,439.78Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><circle cx="48.97" cy="324.78" r="5.39" fill="#e3ba4b"/><circle cx="17.51" cy="328.24" r="5.39" fill="#e3ba4b"/><circle cx="5.39" cy="376.63" r="5.39" fill="#e3ba4b"/><circle cx="21.76" cy="400.8" r="5.39" fill="#e3ba4b"/><circle cx="44.12" cy="450.99" r="5.39" fill="#e3ba4b"/><circle cx="44.12" cy="450.99" r="5.39" opacity="0.1"/><circle cx="93.85" cy="394.14" r="5.39" fill="#e3ba4b"/><circle cx="93.85" cy="394.14" r="5.39" opacity="0.1"/><path d="M188.25,539.81c3.58-1.81,4.66-6.93,2.57-11.66.11.2.22.39.32.59,2.47,4.89,1.45,10.38-2.29,12.27s-8.76-.54-11.23-5.43c-.1-.2-.2-.4-.29-.61C179.9,539.46,184.67,541.62,188.25,539.81Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M193.56,550.33c3.58-1.81,4.67-6.94,2.58-11.66.11.19.22.39.32.59,2.47,4.89,1.45,10.38-2.29,12.27s-8.76-.54-11.23-5.43c-.11-.2-.2-.41-.29-.61C185.22,550,190,552.14,193.56,550.33Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M198.88,560.84c3.58-1.81,4.67-6.93,2.57-11.66.12.2.22.39.33.6,2.47,4.88,1.44,10.38-2.29,12.26s-8.76-.54-11.23-5.43c-.11-.2-.2-.4-.29-.61C190.53,560.49,195.3,562.65,198.88,560.84Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M204.2,571.36c3.58-1.81,4.67-6.93,2.57-11.66.11.19.22.39.32.59,2.48,4.89,1.45,10.38-2.28,12.27s-8.77-.54-11.24-5.43c-.1-.2-.19-.41-.28-.61C195.85,571,200.62,573.17,204.2,571.36Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M209.52,581.87c3.58-1.81,4.66-6.93,2.57-11.65.11.19.22.39.32.59,2.47,4.89,1.45,10.38-2.28,12.27s-8.77-.55-11.24-5.43c-.1-.21-.19-.41-.29-.61C201.17,581.52,205.94,583.68,209.52,581.87Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M214.84,592.39c3.58-1.81,4.66-6.93,2.57-11.66.11.2.22.39.32.59,2.47,4.89,1.45,10.38-2.28,12.27s-8.77-.54-11.24-5.43c-.1-.2-.2-.4-.29-.61C206.49,592,211.26,594.2,214.84,592.39Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M220.16,602.91c3.57-1.81,4.66-6.94,2.57-11.66.11.19.22.39.32.59,2.47,4.89,1.45,10.38-2.29,12.27s-8.76-.55-11.23-5.43c-.1-.21-.2-.41-.29-.61C211.81,602.55,216.58,604.72,220.16,602.91Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M225.47,613.42c3.58-1.81,4.67-6.93,2.57-11.66.12.2.22.39.33.6,2.47,4.88,1.44,10.38-2.29,12.26s-8.76-.54-11.23-5.43c-.11-.2-.2-.4-.29-.61C217.13,613.07,221.89,615.23,225.47,613.42Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M229,620.33c3.58-1.81,4.66-6.93,2.57-11.66.11.2.22.39.32.6,2.47,4.88,1.45,10.38-2.28,12.26s-8.77-.54-11.24-5.43c-.1-.2-.2-.4-.29-.61C220.62,620,225.39,622.14,229,620.33Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M132.86,573.53a18.57,18.57,0,0,1-1-4.93,2.69,2.69,0,1,1,.41-5.35,18.82,18.82,0,0,1,9.89-12.75,2.69,2.69,0,1,1,4.81-2.43,2.44,2.44,0,0,1,.24.72,18.92,18.92,0,0,1,16.56,5,18.68,18.68,0,0,1,5-.14l2.18,9.92L171,554a18.85,18.85,0,1,1-10.08,36.29,2.76,2.76,0,0,1-1.13,1.09,2.7,2.7,0,0,1-3.7-3.47,18.84,18.84,0,0,1-2.41-2,18.87,18.87,0,0,1-19.8-10l10.15-1.71Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><g opacity="0.1"><path d="M148.54,578.35c3.75-5,6.05-10.8,8.69-16.42a66.7,66.7,0,0,1,3.56-6.74l2-2.31c.34.29.67.58,1,.88a18.68,18.68,0,0,1,5-.14l2.18,9.92L171,554a18.85,18.85,0,1,1-10.08,36.29,2.76,2.76,0,0,1-1.13,1.09,2.7,2.7,0,0,1-3.7-3.47,18.84,18.84,0,0,1-2.41-2,19,19,0,0,1-11.31-1.67A26.59,26.59,0,0,0,148.54,578.35Z" transform="translate(-88.65 -57.09)"/></g><path d="M214.91,557.09a2.68,2.68,0,0,1,1.19-3.61,2.64,2.64,0,0,1,1.22-.29,18.85,18.85,0,0,1,5.89-10.5,18.71,18.71,0,0,1-.55-5.89l9.89-1.66-9.61-.61a18.65,18.65,0,0,1,.72-2.66,2.64,2.64,0,0,1-.89-1,2.7,2.7,0,0,1,3.32-3.75,18.63,18.63,0,0,1,6.87-5.93,18.84,18.84,0,0,1,26.77,21.5,2.69,2.69,0,0,1,.16,4.87,2.7,2.7,0,0,1-2.22.1A18.74,18.74,0,0,1,254.1,552a18.9,18.9,0,0,1-.87,12L240,560.52l11.83,6.23A18.86,18.86,0,0,1,219,565.21a19.11,19.11,0,0,1-1.94-6.65A2.67,2.67,0,0,1,214.91,557.09Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M214.91,557.09a2.68,2.68,0,0,1,1.19-3.61,2.64,2.64,0,0,1,1.22-.29,18.85,18.85,0,0,1,5.89-10.5c-.08-.31-.15-.63-.21-.94a7.27,7.27,0,0,1,1,.86c1.79,2,2.71,4.59,4.47,6.57a12.91,12.91,0,0,0,8.33,3.89,31.54,31.54,0,0,0,9.33-.75,27.35,27.35,0,0,1,7.72-.85l.74.1-.46.43a18.9,18.9,0,0,1-.87,12L240,560.52l11.83,6.23A18.86,18.86,0,0,1,219,565.21a19.11,19.11,0,0,1-1.94-6.65A2.67,2.67,0,0,1,214.91,557.09Z" transform="translate(-88.65 -57.09)" opacity="0.1"/></g><path d="M435,109a20.23,20.23,0,0,0-11.74,1.28,17.32,17.32,0,0,1-14.1,0,19.76,19.76,0,0,0-16.58.33,10.28,10.28,0,0,1-4.77,1.19c-6.72,0-12.31-6.77-13.47-15.7a13.07,13.07,0,0,0,3.36-3.62c3.94-6.35,10-10.43,16.89-10.43s12.89,4,16.83,10.31a13,13,0,0,0,11.16,6.14h.18C428.06,98.47,432.69,102.76,435,109Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b" opacity="0.1"/><path d="M455.42,81l-10.86,6.89,6.59-12a10.74,10.74,0,0,0-6.57-2.34h-.17a12.89,12.89,0,0,1-2.25-.17l-3.69,2.34,1.58-2.87A13.19,13.19,0,0,1,433.61,68L427,72.13l4.16-7.57c-3.85-4.63-9.05-7.47-14.76-7.47-6.85,0-13,4.08-16.9,10.43a12.62,12.62,0,0,1-11.17,6H388c-7.56,0-13.7,8.57-13.7,19.16s6.14,19.15,13.7,19.15a10.28,10.28,0,0,0,4.77-1.19,19.72,19.72,0,0,1,16.58-.32,17.37,17.37,0,0,0,14.1,0,19.75,19.75,0,0,1,16.43.32,10.35,10.35,0,0,0,4.72,1.16c7.57,0,13.7-8.57,13.7-19.15A24.36,24.36,0,0,0,455.42,81Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b" opacity="0.1"/><path d="M209,247.54a29,29,0,0,0-16.77,1.82,24.71,24.71,0,0,1-20.14-.05,28.22,28.22,0,0,0-23.68.47,14.75,14.75,0,0,1-6.82,1.7c-9.6,0-17.59-9.67-19.25-22.43a18.41,18.41,0,0,0,4.8-5.17c5.63-9.07,14.35-14.9,24.14-14.9s18.4,5.76,24,14.73a18.52,18.52,0,0,0,16,8.77h.25C199.11,232.47,205.73,238.6,209,247.54Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b" opacity="0.1"/><path d="M238.2,207.49l-15.52,9.84,9.42-17.13a15.34,15.34,0,0,0-9.39-3.35h-.25a18.16,18.16,0,0,1-3.22-.24L214,200l2.26-4.1a18.7,18.7,0,0,1-9.2-7l-9.42,6L203.57,184c-5.51-6.61-12.93-10.66-21.09-10.66-9.79,0-18.51,5.82-24.14,14.89a18.05,18.05,0,0,1-16,8.61h-.53c-10.81,0-19.57,12.25-19.57,27.37s8.76,27.37,19.57,27.37a14.61,14.61,0,0,0,6.82-1.71,28.22,28.22,0,0,1,23.68-.46,24.71,24.71,0,0,0,20.14.05,28.25,28.25,0,0,1,23.48.45,14.65,14.65,0,0,0,6.74,1.67c10.81,0,19.57-12.26,19.57-27.37A34.76,34.76,0,0,0,238.2,207.49Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b" opacity="0.1"/><path d="M836.62,148a20.24,20.24,0,0,1,11.74,1.28,17.29,17.29,0,0,0,14.09,0,19.76,19.76,0,0,1,16.58.33,10.31,10.31,0,0,0,4.77,1.19c6.72,0,12.32-6.77,13.48-15.7a12.93,12.93,0,0,1-3.36-3.62C890,125.11,883.87,121,877,121s-12.88,4-16.82,10.31A13,13,0,0,1,849,137.48h-.17C843.51,137.47,838.87,141.76,836.62,148Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b" opacity="0.1"/><path d="M816.14,120,827,126.87l-6.6-12a10.76,10.76,0,0,1,6.57-2.34h.18a13,13,0,0,0,2.25-.17l3.68,2.34-1.58-2.87A13.21,13.21,0,0,0,838,107l6.59,4.18-4.17-7.57c3.86-4.63,9-7.47,14.77-7.47,6.85,0,13,4.08,16.9,10.43a12.61,12.61,0,0,0,11.17,6h.36c7.57,0,13.7,8.57,13.7,19.16s-6.13,19.15-13.7,19.15a10.34,10.34,0,0,1-4.77-1.19,19.72,19.72,0,0,0-16.58-.32,17.35,17.35,0,0,1-14.09,0,19.77,19.77,0,0,0-16.44.32,10.32,10.32,0,0,1-4.72,1.16c-7.56,0-13.7-8.57-13.7-19.15A24.36,24.36,0,0,1,816.14,120Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b" opacity="0.1"/><ellipse cx="615.63" cy="756.88" rx="115" ry="20" fill="#e3ba4b" opacity="0.1"/><polygon points="555.44 661.88 377.25 659.59 377.78 655.02 386.39 579.63 542.88 579.63 554.39 655.02 555.27 660.74 555.44 661.88" fill="#d0d2d5"/><polygon points="555.27 660.74 466.35 660.74 377.25 659.59 377.78 655.02 554.39 655.02 555.27 660.74" opacity="0.1"/><rect x="347.55" y="656.17" width="236.45" height="5.71" fill="#d0d2d5"/><path d="M898.24,183.92A14.87,14.87,0,0,0,883.44,169H223.12a14.87,14.87,0,0,0-14.8,14.94V584.19H898.24Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><path d="M208.32,580.19v46.88a14.8,14.8,0,0,0,14.8,14.8H883.44a14.8,14.8,0,0,0,14.8-14.8V580.19Z" transform="translate(-88.65 -57.09)" fill="#d0d2d5"/><rect x="148.23" y="137.01" width="636.23" height="359.81" fill="#fff"/><path d="M556.71,624.08a15.4,15.4,0,0,0,12.13-5.89h0a16.06,16.06,0,0,0,1.2-1.76L561.57,615l9.15.06a15.42,15.42,0,0,0,.29-12.21l-12.27,6.36,11.32-8.32a15.42,15.42,0,1,0-25.47,17.26h0A15.4,15.4,0,0,0,556.71,624.08Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><polygon points="483.48 584.77 554.57 656.17 543.66 584.77 483.48 584.77" opacity="0.1"/><rect x="147.73" y="137.05" width="636.92" height="21.02" fill="#444053" opacity="0.1"/><rect x="368.87" y="140.71" width="191.9" height="12.79" rx="0.58" fill="#e3ba4b" opacity="0.3"/><path d="M643.72,205.52h-.47l-.17-.15a3.89,3.89,0,0,0,.9-2.49,3.78,3.78,0,1,0-3.77,3.81,3.9,3.9,0,0,0,2.49-.91l.17.15v.47l2.93,2.93.87-.88Zm-3.51,0a2.64,2.64,0,1,1,2.63-2.64A2.62,2.62,0,0,1,640.21,205.52Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><circle cx="159.18" cy="147.56" r="3.85" fill="#fa5959" opacity="0.8"/><circle cx="169.77" cy="147.56" r="3.85" fill="#fed253" opacity="0.8"/><circle cx="180.37" cy="147.56" r="3.85" fill="#8ccf4d" opacity="0.8"/><path d="M588.7,348.49c-8.73-11.6-21.38-18.92-35.46-18.92s-26.73,7.32-35.46,18.92a38.39,38.39,0,0,0,8.4,12.65,38.28,38.28,0,0,0,62.52-12.65Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M513.17,355.28a9.17,9.17,0,0,1-1.76-1,7.06,7.06,0,0,1-1.94-2.51,7.18,7.18,0,1,0-11.72,1.74,8,8,0,0,0,1.7,1.37,4.94,4.94,0,0,1,1.91,2,14.44,14.44,0,0,0,3.32,4.36,29,29,0,0,0,4.55,3.2A66.31,66.31,0,0,0,505.49,384a27.05,27.05,0,0,0-7.62,1.23,12.29,12.29,0,0,0-3.53,1.76,8.48,8.48,0,0,0-.87-.06,7.19,7.19,0,1,0,6.73,9.72,4.59,4.59,0,0,1,3.71-3,16.75,16.75,0,0,1,1.85-.12,64.4,64.4,0,0,0,8.55,26.67c-4.24,3.29-6.85,6.88-7.95,10.86a3,3,0,0,0-.57.41,6.81,6.81,0,0,0-.84.78A7.18,7.18,0,1,0,517,434.6a4.71,4.71,0,0,1,1.17-5.08c.48-.45,1-.93,1.7-1.46,8.11,9.47,17.76,15.54,29.81,16.26V380.07C533.75,379.2,519.87,368.83,513.17,355.28ZM613,387a7.93,7.93,0,0,0-.87.06,13.56,13.56,0,0,0-3.53-1.76,26.86,26.86,0,0,0-7.62-1.23,67.76,67.76,0,0,0-3.74-19.55,29,29,0,0,0,4.55-3.2,15.58,15.58,0,0,0,3.44-4.57A4.22,4.22,0,0,1,607,355a0,0,0,0,0,0,0,7.18,7.18,0,1,0-10-3.17,6.82,6.82,0,0,1-1.94,2.51,18.85,18.85,0,0,1-1.76,1.29c-6.7,13.54-20.57,23.62-36.48,24.49v64.31c12-.72,21.71-6.82,29.81-16.26.63.5,1.16.95,1.61,1.37a4.86,4.86,0,0,1,1.26,5.23,7.18,7.18,0,1,0,12.08-2.33,6.81,6.81,0,0,0-.84-.78c-.33-.26-.57-.41-.57-.41-1.1-4-3.7-7.57-8-10.86a64.4,64.4,0,0,0,8.55-26.67,15.9,15.9,0,0,1,1.77.12,4.8,4.8,0,0,1,3.85,3,7.18,7.18,0,0,0,13.85-2.18A7.29,7.29,0,0,0,613,387Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M769.65,802.31a9.56,9.56,0,0,0-2.17-2.41c-4.37-4.13-6.4-10.19-7.48-16.13s-1.39-12-3.12-17.81a58.74,58.74,0,0,0-3.52-8.67c-1-2.14-2.26-6.33-4.09-7.83a2.7,2.7,0,0,0-1.26-.61,14.85,14.85,0,0,0-3.62-4.82c-2.86-2.59-6.35-4.65-8.26-8a18,18,0,0,0-1.93-3.29c-1.29-1.42-3.33-2-4.52-3.5-1.55-1.94-1.2-4.72-1-7.19s0-5.43-2.14-6.73c-1.28-.79-2.93-.71-4.26-1.41-2-1-2.79-3.52-2.75-5.77s.74-4.44.92-6.69c.56-7.16-4.16-14.28-2.34-21.22.69-2.63,2.27-4.91,3.44-7.36a15.37,15.37,0,0,0,1-2.54,35.73,35.73,0,0,0,9.74,2.35c-5.51-12.36-4.11-26.72-6.68-40l.33-.45a20.84,20.84,0,0,0,4.22-11.86c0-4.94-2.31-9.56-3.35-14.4-.89-4.11-.85-8.41-2-12.45a37.65,37.65,0,0,0-3.16-7.22q-1.87-3.47-3.93-6.83-1.92-6.36-3.85-12.72c-1.8-5.95-3.65-12-7.15-17.14-1.28-1.88-1.67-5.7-3.64-6.84a8.81,8.81,0,0,0-5.2-.91c-2.78-1.56-5.22-3.81-5.57-6.89a6.68,6.68,0,0,1,.2-2l.34,0c4.4-.4,6.63-4.28,8.92-7.68,3.7-5.5,2.29-12.94,0-19.2a13,13,0,0,0-3-5.29c-3.21-3-8.29-2.34-12.43-3.79-1.39-.48-2.69-1.21-4.11-1.55-2.75-.64-5.63.26-8.15,1.53s-4.87,2.91-7.51,3.91-5.9,1.79-6.55,4.5a5,5,0,0,0,.22,2.73,10.18,10.18,0,0,0,3.09,4.46,17.81,17.81,0,0,0,10.87,24.82c.76,1.22,1.47,2.46,2.12,3.73,1.16,2.24,2.14,4.88,1.74,7.28a22.45,22.45,0,0,0-2,2.45c-2.87,4-4.5,8.69-6,13.37a141.65,141.65,0,0,0-4.83,18.27c-2.44,5.19-5.42,10.15-7.19,15.6a35.21,35.21,0,0,1-9.38-1.26l-8.44-1.91c-2.94-.67-6-1.39-8.3-3.33-1.22-1-2.17-2.33-3.41-3.32s-3.73-2.15-5.09-1.33a4,4,0,0,0-.69.53c-1.24-2.51-2.42-5-3.86-7.43-2.07-3.4-5.15-6.51-9.05-7.16a9.21,9.21,0,0,0-6.79,1.58c-2.28,1.62-3.71,5-2,7.28a13.29,13.29,0,0,0,1.39,1.42,29.2,29.2,0,0,1,3.09,4.29A21.91,21.91,0,0,0,619,596.23l-.35,1c-.71,2.08-2.22,4.59-1.84,6.75l37.54,12.85a23.13,23.13,0,0,0,7.56,1.67,12.21,12.21,0,0,0,3-.4l0,1.92v.08c.1,13.19-2,26.29-2.39,39.47-.07,2.41,0,5,1.52,6.88,1.7,2.06,4.72,2.47,7.35,2q.95-.16,1.86-.42a69.33,69.33,0,0,1,1.92,10.11L677.65,696a27.14,27.14,0,0,1,.39,5.54c-.29,4.19-2.5,7.94-4.1,11.81s-2.55,8.5-.45,12.12c.66,1.12,1.57,2.07,2.16,3.23a13.14,13.14,0,0,1,1,5.68q.23,8.08.44,16.18a1.83,1.83,0,0,0-1.26.25c-2.08,1.62-1.85,9.33-2,11.72-.16,4,0,8.08-.22,12.12A72.22,72.22,0,0,1,671,790.74a10.29,10.29,0,0,1-2.29,4.61,9.74,9.74,0,0,1-4.07,2.11,46.49,46.49,0,0,1-15.41,2.1c-2.11-.07-4.31-.27-6.27.53s-3.54,3-2.83,5c.61,1.68,2.46,2.48,4.13,3.11a65.53,65.53,0,0,1,11,5.06,29.74,29.74,0,0,0,4.25,2.41,21.91,21.91,0,0,0,4.38,1.08l17.73,3.06c3.63.62,8,1,10.31-2,1.25-1.62,1.43-3.82,1.37-5.88-.1-4-.9-8.07-.38-12.07a37.14,37.14,0,0,1,1.86-6.93q2.65-7.87,5.32-15.73c1.78-5.26,3.58-10.57,4.27-16.09.25-2,.23-4.28-1.3-5.53a3.54,3.54,0,0,0-1.32-.68c-.06-4.82-.69-9.65-.42-14.47.07-1.2.19-2.4.29-3.61a17.61,17.61,0,0,1,2.47,2.92c1.71,2.68,2.34,6.22,4.95,8,2.22,1.52,5.51,1.44,7.07,3.64a10.26,10.26,0,0,1,1.12,2.71,19.32,19.32,0,0,0,4,6.35,32,32,0,0,0,2.47,6.34q2.21,4.67,4.4,9.31a108.59,108.59,0,0,0,5,9.77,27.55,27.55,0,0,1,3.35,6.46c1.41,4.94-.89,10.36-4.53,14s-8.44,5.73-13.17,7.68a3.71,3.71,0,0,0-1.34.8,2.59,2.59,0,0,0-.61,1.74c0,2.31,1.9,4.29,4.08,5a15.26,15.26,0,0,0,6.83.25c12.78-1.55,25.52-4.67,36.82-10.88a13,13,0,0,0,4.39-3.39A5.13,5.13,0,0,0,769.65,802.31Z" transform="translate(-88.65 -57.09)" fill="url(#af83dc26-9572-4816-b7a1-1af4f72ff554)"/><path d="M715.64,578.06q3.2,4.91,6,10.06a37,37,0,0,1,3.17,7.17c1.16,4,1.13,8.27,2,12.35,1,4.8,3.34,9.38,3.34,14.3a20.56,20.56,0,0,1-4.22,11.76,55.82,55.82,0,0,1-8.82,9.1,187.62,187.62,0,0,1-12.48-61.21c-.1-2.9-.12-5.89.94-8.6.65-1.7,3.77-6.36,5.78-4.53.73.67.92,3.69,1.37,4.7A36.13,36.13,0,0,0,715.64,578.06Z" transform="translate(-88.65 -57.09)" fill="#2f2e41"/><path d="M715.64,578.06q3.2,4.91,6,10.06a37,37,0,0,1,3.17,7.17c1.16,4,1.13,8.27,2,12.35,1,4.8,3.34,9.38,3.34,14.3a20.56,20.56,0,0,1-4.22,11.76,55.82,55.82,0,0,1-8.82,9.1,187.62,187.62,0,0,1-12.48-61.21c-.1-2.9-.12-5.89.94-8.6.65-1.7,3.77-6.36,5.78-4.53.73.67.92,3.69,1.37,4.7A36.13,36.13,0,0,0,715.64,578.06Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M452,441.63c-7.91,7.9-8.86,11.38-13.61,12.95S416.55,465,421.92,474.81l14.44,9.54.42.28,2.21,6.64-21.84,38.88s-36-16.46-39.53,7.89-1.29,31-2.24,44,.31,16.76-2.86,16.76-4.42-8.54-4.42-8.54-.2-.39-.55-1.12c-4.71-9.79-36.68-81.66,14.53-131.06,0,0,23.72-1.56,29.43-28.76,3.94-18.8,17.72-17.18,26.88-13.35a30.38,30.38,0,0,1,8.22,4.83,40.48,40.48,0,0,1,5.89,7C455.11,431.92,456.53,437.09,452,441.63Z" transform="translate(-88.65 -57.09)" fill="#d0d2d5"/><path d="M436.78,484.63l2.21,6.64-21.84,38.88s-36-16.46-39.53,7.89-1.29,31-2.24,44,.31,16.76-2.86,16.76-4.42-8.54-4.42-8.54-.2-.39-.55-1.12c-1.59-12.16-9.65-83.29,19.57-79.51,0,0,23.71,11.08,27.5,6.66,3-3.5,16.32-23.63,21.74-31.89Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M452.5,427.74l-14.44,16.41s-16.77,22.44-20.25,21.49a16.23,16.23,0,0,0-3.17-.37,6.16,6.16,0,0,1-4-10.38c5.72-6,16.26-17.39,16.95-19.92s7.4-13.62,10.76-19.05a30.38,30.38,0,0,1,8.22,4.83A40.48,40.48,0,0,1,452.5,427.74Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M861.06,663.83c-2.45,4.9-15,23.28-20.49,31.31L838,698.92s-1,6.64-17.39-1.59S419.13,526.61,419.13,526.61l-2.61-7.84,19-28.45L857.59,653.39S864.23,657.5,861.06,663.83Z" transform="translate(-88.65 -57.09)" fill="#454b69"/><path d="M840.57,695.14,838,698.92s-1,6.64-17.39-1.59S419.13,526.61,419.13,526.61l-2.61-7.84Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M608.29,589c-3.91-.64-8.25-.33-11.29,2.21a9.29,9.29,0,0,0-3.24,6.16c-.26,2.77,1.35,6.06,4.13,6.27a13.17,13.17,0,0,0,2-.13,29.89,29.89,0,0,1,5.24.44,21.39,21.39,0,0,0,18.23-7.36c2.39-3-.76-4.3-3.58-4.9C615.92,590.87,612.15,589.62,608.29,589Z" transform="translate(-88.65 -57.09)" fill="#fbbebe"/><path d="M675.17,679.31l2.48,17.62a26.84,26.84,0,0,1,.38,5.51c-.29,4.15-2.5,7.87-4.09,11.71s-2.56,8.44-.45,12c.65,1.11,1.56,2.06,2.15,3.21a12.92,12.92,0,0,1,1,5.63l.68,25a157.33,157.33,0,0,0,23.18-.13,1.29,1.29,0,0,0,.84-.26,1.36,1.36,0,0,0,.29-.91c.34-5.85-.68-11.71-.35-17.56.12-2.14.42-4.27.46-6.42.12-8.71-4.18-17.24-2.88-25.85a57,57,0,0,1,1.6-6.43c4.11-15,3.24-30.76,2.33-46.25a1.09,1.09,0,0,0-.2-.7,1.06,1.06,0,0,0-.54-.29,28.45,28.45,0,0,0-25.78,4.9c-1.09.88-3.84,1.73-4.56,2.78-1,1.46.31,2.92.89,4.47A56.89,56.89,0,0,1,675.17,679.31Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><path d="M675.17,679.31l2.48,17.62a26.84,26.84,0,0,1,.38,5.51c-.29,4.15-2.5,7.87-4.09,11.71s-2.56,8.44-.45,12c.65,1.11,1.56,2.06,2.15,3.21a12.92,12.92,0,0,1,1,5.63l.68,25a157.33,157.33,0,0,0,23.18-.13,1.29,1.29,0,0,0,.84-.26,1.36,1.36,0,0,0,.29-.91c.34-5.85-.68-11.71-.35-17.56.12-2.14.42-4.27.46-6.42.12-8.71-4.18-17.24-2.88-25.85a57,57,0,0,1,1.6-6.43c4.11-15,3.24-30.76,2.33-46.25a1.09,1.09,0,0,0-.2-.7,1.06,1.06,0,0,0-.54-.29,28.45,28.45,0,0,0-25.78,4.9c-1.09.88-3.84,1.73-4.56,2.78-1,1.46.31,2.92.89,4.47A56.89,56.89,0,0,1,675.17,679.31Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M721.54,674c-1.17,2.43-2.74,4.69-3.44,7.3-1.82,6.89,2.89,14,2.33,21.06-.18,2.23-.87,4.4-.92,6.63s.77,4.71,2.75,5.74c1.33.68,3,.61,4.25,1.39,2.11,1.29,2.35,4.22,2.14,6.68s-.56,5.21,1,7.13c1.19,1.49,3.23,2.07,4.51,3.48a17.17,17.17,0,0,1,1.93,3.26c1.91,3.34,5.4,5.38,8.26,8s5.28,6.46,4,10.09c-.94,2.66-3.58,4.3-6.12,5.55a64.93,64.93,0,0,1-14.57,5.15,3.52,3.52,0,0,1-1.67.09,3.57,3.57,0,0,1-1.46-1c-2.95-2.89-6-5.92-7.36-9.81a10.07,10.07,0,0,0-1.12-2.68c-1.56-2.19-4.85-2.11-7.07-3.62-2.6-1.77-3.23-5.28-4.93-7.93s-4.19-4.23-6-6.56c-3.06-3.88-3.81-9.06-6-13.49-.93-1.88-2.12-3.64-2.86-5.6a30.58,30.58,0,0,1-1.37-7.24c-1.41-11.68-5-23.44-2.74-35,.5-2.54,1.27-5,1.59-7.62.55-4.53-.32-9.17.35-13.69a3.77,3.77,0,0,1,1.51-2.91,4,4,0,0,1,1.72-.35,117.28,117.28,0,0,1,17.78.4c3,.29,6.36.9,8.16,3.35,1.53,2.1,1.45,4.91,1.94,7.46.61,3.14,2.2,4.85,3.87,7.31S722.77,671.46,721.54,674Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><path d="M698.47,755.26c1.58,0,3.33-.1,4.55.9,1.52,1.25,1.54,3.54,1.3,5.49-.7,5.48-2.49,10.75-4.28,16l-5.32,15.61a36.65,36.65,0,0,0-1.86,6.88c-.52,4,.28,8,.38,12,0,2-.13,4.22-1.38,5.83-2.26,2.91-6.67,2.57-10.3,2l-17.71-3a21.07,21.07,0,0,1-4.38-1.07,30.61,30.61,0,0,1-4.25-2.39,65.42,65.42,0,0,0-11-5c-1.66-.62-3.52-1.41-4.12-3.08-.71-2,.87-4.2,2.83-5s4.15-.6,6.27-.54a47,47,0,0,0,15.4-2.08,9.74,9.74,0,0,0,4.06-2.1A10,10,0,0,0,671,791a70.17,70.17,0,0,0,2.68-16c.21-4,.07-8,.23-12,.1-2.37-.13-10,1.95-11.63,1.59-1.22,8.13,2.15,10.28,2.64A50,50,0,0,0,698.47,755.26Z" transform="translate(-88.65 -57.09)" fill="#2f2e41"/><path d="M756.81,766.38c1.73,5.73,2,11.79,3.12,17.68s3.1,11.9,7.47,16a9.87,9.87,0,0,1,2.17,2.4,5.06,5.06,0,0,1-.75,5.23,13.13,13.13,0,0,1-4.39,3.37c-11.29,6.16-24,9.27-36.81,10.81a15.51,15.51,0,0,1-6.82-.25c-2.18-.74-4.11-2.7-4.07-5a2.55,2.55,0,0,1,.6-1.73,3.73,3.73,0,0,1,1.35-.79c4.72-1.94,9.51-4.05,13.16-7.63s5.94-9,4.53-13.86A27.42,27.42,0,0,0,733,786.2a108.35,108.35,0,0,1-5-9.69l-4.4-9.23c-1.29-2.7-2.59-5.48-2.81-8.46a40.6,40.6,0,0,0,16.22-2.6,25.51,25.51,0,0,0,6.67-4c1.7-1.42,3.25-4.07,5.54-2.22,1.84,1.48,3,5.65,4.08,7.76A57,57,0,0,1,756.81,766.38Z" transform="translate(-88.65 -57.09)" fill="#2f2e41"/><path d="M692.33,537.19c.44,3.84,4.16,6.37,7.71,7.89l-22.47,7.17c1.45-2.78.28-6.18-1.16-9a50.93,50.93,0,0,0-4-6.41c-.22-.31-.47-.7-.31-1.06a1.12,1.12,0,0,1,.63-.49c4.62-2.06,9.38-4.19,14.43-4.94,1.46-.21,4.22-.79,5.31.69S692.12,535.42,692.33,537.19Z" transform="translate(-88.65 -57.09)" fill="#fbbebe"/><path d="M692.33,537.19c.44,3.84,4.16,6.37,7.71,7.89l-22.47,7.17c1.45-2.78.28-6.18-1.16-9a50.93,50.93,0,0,0-4-6.41c-.22-.31-.47-.7-.31-1.06a1.12,1.12,0,0,1,.63-.49c4.62-2.06,9.38-4.19,14.43-4.94,1.46-.21,4.22-.79,5.31.69S692.12,535.42,692.33,537.19Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><circle cx="590.62" cy="465.59" r="17.62" fill="#fbbebe"/><path d="M664,667.68c1.71,2.05,4.72,2.45,7.35,2,6.15-1,11.18-5.53,17.2-7.16,7.38-2,15.19.57,22.16,3.72s13.9,7,21.52,7.54c-6.89-15.36-2.95-33.84-9.54-49.33-1.61-3.79-3.86-7.44-4.22-11.54-.45-5.09,2.09-10,2.48-15.06.36-4.51-1-9-2.3-13.3q-2.41-7.92-4.82-15.84c-1.8-5.91-3.65-11.92-7.14-17-1.29-1.87-1.68-5.66-3.64-6.79-4.28-2.47-10.77.64-15.41.81s-8.87,3.47-11.58,7.2c-2.87,3.94-4.5,8.63-6,13.27a126.15,126.15,0,0,0-5.33,21.23c-.15,1.08-.28,2.16-.38,3.25-1,10.27.46,20.6.54,30.92v.07c.1,13.09-2,26.1-2.39,39.18C662.46,663.24,662.52,665.85,664,667.68Z" transform="translate(-88.65 -57.09)" fill="#2f2e41"/><path d="M664.92,621.61c3.45-.87,6.57-3.1,9.25-5.54a38.67,38.67,0,0,0,6.14-7A49.86,49.86,0,0,0,685.6,598a129.36,129.36,0,0,0,7-32.27c.26-3,.34-6.22-1.45-8.6a7.24,7.24,0,0,0-8.75-2.12c-2.36,1.15-3.89,3.48-5.31,5.71-2.81,4.42-5.64,8.9-7.45,13.82-.8,2.18-1.39,4.42-2.17,6.61a61,61,0,0,1-2.74,6.33c-.15,1.08-.28,2.16-.38,3.25C663.42,601,664.84,611.29,664.92,621.61Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><path d="M691.1,555.2c1.79,2.38,1.71,5.63,1.46,8.59a129.18,129.18,0,0,1-7,32.27,49.43,49.43,0,0,1-5.29,11.16,39.07,39.07,0,0,1-6.14,7c-3.4,3.1-7.54,5.87-12.15,5.91a23.16,23.16,0,0,1-7.56-1.65L616.87,605.7c-.38-2.14,1.13-4.64,1.84-6.7l2-5.93c.57-1.64,1.23-3.41,2.72-4.3s3.85.33,5.09,1.32,2.18,2.29,3.4,3.3c2.31,1.92,5.36,2.64,8.3,3.3l8.43,1.89a35.2,35.2,0,0,0,9.38,1.25c2.35-7.18,6.82-13.5,9.35-20.62.78-2.18,1.37-4.43,2.18-6.61,1.8-4.92,4.64-9.39,7.45-13.82,1.41-2.22,2.94-4.55,5.31-5.71A7.23,7.23,0,0,1,691.1,555.2Z" transform="translate(-88.65 -57.09)" fill="#2f2e41"/><path d="M684.89,526.66a8.89,8.89,0,0,0-1.06-3.3,2.77,2.77,0,0,0-3-1.32c-1.76.55-2.35,3.27-4.19,3.36-1.24.06-2.13-1.2-2.52-2.38s-.6-2.53-1.53-3.36a5.7,5.7,0,0,0-2.18-1c-4.27-1.35-8.68-3.84-10.1-8.09a4.84,4.84,0,0,1-.23-2.71c.65-2.69,4-3.5,6.55-4.47s5-2.63,7.5-3.89,5.4-2.15,8.15-1.51a42.47,42.47,0,0,1,4.11,1.53c4.14,1.44,9.21.77,12.42,3.76a12.83,12.83,0,0,1,3,5.24c2.24,6.22,3.66,13.6-.05,19.06-2.29,3.37-4.51,7.22-8.91,7.63C687.73,535.64,685.7,531,684.89,526.66Z" transform="translate(-88.65 -57.09)" fill="#2f2e41"/><g opacity="0.1"><path d="M677.07,520.9c-.39-1.18-.6-2.53-1.52-3.36a5.7,5.7,0,0,0-2.18-1c-4.28-1.35-8.68-3.84-10.11-8.09a4.93,4.93,0,0,1-.22-2.71,3.39,3.39,0,0,1,.53-1.19c-1.63.71-3.05,1.65-3.45,3.31a4.84,4.84,0,0,0,.23,2.71c1.42,4.25,5.83,6.74,10.1,8.09a5.7,5.7,0,0,1,2.18,1c.93.83,1.13,2.17,1.53,3.36s1.28,2.44,2.52,2.38,1.84-1.19,2.63-2.14C678.22,523.12,677.43,522,677.07,520.9Z" transform="translate(-88.65 -57.09)"/><path d="M695.79,533.06c-5.14.47-7.17-4.21-8-8.52a8.7,8.7,0,0,0-1-3.3,2.78,2.78,0,0,0-3-1.32,5.32,5.32,0,0,0-2.21,2,3,3,0,0,1,2.26,1.4,8.89,8.89,0,0,1,1.06,3.3c.81,4.31,2.84,9,8,8.52a8.25,8.25,0,0,0,5.28-2.74A7.46,7.46,0,0,1,695.79,533.06Z" transform="translate(-88.65 -57.09)"/></g><ellipse cx="813.11" cy="655.78" rx="32.29" ry="6.21" fill="#e3ba4b"/><ellipse cx="812.57" cy="653.14" rx="3.76" ry="4.92" fill="#3f3d56"/><ellipse cx="812.57" cy="647.12" rx="3.76" ry="4.92" fill="#3f3d56"/><ellipse cx="812.57" cy="641.11" rx="3.76" ry="4.92" fill="#3f3d56"/><ellipse cx="812.57" cy="635.09" rx="3.76" ry="4.92" fill="#3f3d56"/><ellipse cx="812.57" cy="629.07" rx="3.76" ry="4.92" fill="#3f3d56"/><ellipse cx="812.57" cy="623.06" rx="3.76" ry="4.92" fill="#3f3d56"/><ellipse cx="812.57" cy="617.04" rx="3.76" ry="4.92" fill="#3f3d56"/><path d="M915.29,633a18.19,18.19,0,0,0,1.4-2.06l-9.88-1.62,10.69.07a18.11,18.11,0,0,0,.34-14.27l-14.34,7.44,13.22-9.72A18,18,0,1,0,887,633a17.92,17.92,0,0,0-2.06,3.28l12.83,6.67-13.68-4.59A18,18,0,0,0,887,655.24a18,18,0,1,0,28.31,0,18,18,0,0,0,0-22.27Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M883.12,644.1A17.91,17.91,0,0,0,887,655.24a18,18,0,1,0,28.31,0C917.7,652.17,883.12,642.08,883.12,644.1Z" transform="translate(-88.65 -57.09)" opacity="0.1"/><ellipse cx="148.42" cy="776.87" rx="46.49" ry="8.94" fill="#e3ba4b"/><ellipse cx="147.64" cy="773.07" rx="5.41" ry="7.09" fill="#3f3d56"/><ellipse cx="147.64" cy="764.41" rx="5.41" ry="7.09" fill="#3f3d56"/><ellipse cx="147.64" cy="755.75" rx="5.41" ry="7.09" fill="#3f3d56"/><ellipse cx="147.64" cy="747.09" rx="5.41" ry="7.09" fill="#3f3d56"/><ellipse cx="147.64" cy="738.43" rx="5.41" ry="7.09" fill="#3f3d56"/><ellipse cx="147.64" cy="729.76" rx="5.41" ry="7.09" fill="#3f3d56"/><ellipse cx="147.64" cy="721.1" rx="5.41" ry="7.09" fill="#3f3d56"/><path d="M256.55,718.93a27.23,27.23,0,0,0,2-3l-14.22-2.34,15.38.12a26,26,0,0,0,.49-20.55L239.58,703.9l19-14a25.93,25.93,0,1,0-42.83,29,25.83,25.83,0,0,0-3,4.72l18.47,9.6-19.69-6.61A25.93,25.93,0,0,0,215.79,751a25.93,25.93,0,1,0,40.76,0,25.92,25.92,0,0,0,0-32.06Z" transform="translate(-88.65 -57.09)" fill="#e3ba4b"/><path d="M210.24,735a25.85,25.85,0,0,0,5.55,16,25.93,25.93,0,1,0,40.76,0C260,746.58,210.24,732.05,210.24,735Z" transform="translate(-88.65 -57.09)" opacity="0.1"/></svg>
\ No newline at end of file
diff --git a/www/index.html b/www/index.html
index 9aa9a65..7bfaa0c 100644
--- a/www/index.html
+++ b/www/index.html
@@ -118,15 +118,18 @@
<body>
- <script>
- $(document).ready(() => {
- if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
- if ($("#dtpsInstallBtn").text().includes("extension")) {
- $("#dtpsInstallBtn").attr("onclick", "window.location.href = 'https://powerplus.app/firefox.xpi';");
- }
- }
- })
- </script>
+ <script>
+ $(document).ready(() => {
+ if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
+ if ($("#dtpsInstallBtn").text().includes("extension")) {
+ $("#dtpsInstallBtn").attr("onclick", "window.location.href = 'https://powerplus.app/firefox.xpi';");
+ }
+ }
+ if (window.location.host == "dev.dtps.jottocraft.com") {
+ $("#devContainer").show();
+ }
+ })
+ </script>
<div id="header">
<div class="content">
@@ -138,8 +141,7 @@
<button id="dtpsInstallBtn"
onclick="window.location.href = 'https://chrome.google.com/webstore/detail/power%20/pakgdifknldaiglefmpkkgfjndemfapo';"
class="btn"><i class="material-icons">extension</i> Add the extension</button>
- <button class="btn outline"
- onclick="window.location.href = '/demo';"><i
+ <button class="btn outline" onclick="window.location.href = '/demo';"><i
class="material-icons">exit_to_app</i> Demo</button>
<button class="btn outline" onclick="window.location.href = 'https://github.com/jottocraft/dtps';"><i
class="material-icons">code</i> Source code</button>
@@ -148,6 +150,33 @@
</div>
<div class="container">
+ <div id="devContainer" style="display: none;">
+ <div style="background: var(--elements); padding: 40px; border-radius: var(--cardRadius);" class="block left">
+ <img src="assets/dev.svg" />
+ <div class="description">
+ <h3>Power+ (dev)</h3>
+ <p>This website contains the latest development version of Power+ before it is released. The dev
+ version
+ of Power+ is often untested and can contain major bugs. Follow the steps below to get started
+ with
+ Power+ (dev).</p>
+ <ol>
+ <li>Open Power+ and navigate to Settings -> About -> Advanced Options, then click on "Test
+ prerelease versions"</li>
+ <li>Once prerelease versions have been enabled, go to Settings -> Prerelease testing and select
+ "Dev"</li>
+ <li>Reload Power+ to load the dev version. You'll see a banner near the top of the screen
+ warning
+ you about using an unstable version of Power+.
+ <br /><br />
+ You can switch back to the stable version of Power+ at any time by going to Settings ->
+ Prerelease testing and selecting "Production".
+ </li>
+ </ol>
+ </div>
+ </div>
+ </div>
+
<div class="row">
<div class="block small six columns">
<img src="assets/todo.svg" />