Quiz published successfully at
diff --git a/public/main.js b/public/main.js
index 2d52783..a66ce29 100644
--- a/public/main.js
+++ b/public/main.js
@@ -529,7 +529,6 @@ function displaySheetCards(sheets) {
let sheetDescription = document.createElement("p");
sheetDescription.className = "card-text";
-
if (sheet.modifiedTime) {
sheetDescription.innerHTML =
"Modified
" +
@@ -546,6 +545,9 @@ function displaySheetCards(sheets) {
sheetCard.addEventListener("click", function () {
// On card click, fetch data for the particular spreadsheet
fetchDataForSpreadsheet(sheet.id);
+ if (window.user) {
+ displaySaveQuiz();
+ }
window.sheetId = sheet.id;
});
@@ -567,7 +569,7 @@ function displayQuizCards(quizzes) {
if (!quizzes.length) {
let noResults = document.createElement("div");
noResults.className = "col-md-12 my-4";
- noResults.innerHTML = "No results found - try another search term.";
+ noResults.innerHTML = "No quizzes. Fetch a spreadsheet to create a quiz.";
quizzesContainer.appendChild(noResults);
return;
}
@@ -598,7 +600,7 @@ function displayQuizCards(quizzes) {
last_published_at
? (quizDescription.innerHTML =
"Published " +
- formatRelativeTime(new Date(last_published_at)) +
+ formatRelativeTime(new Date(last_published_at.seconds * 1000)) +
"")
: (quizDescription.innerHTML = "Draft");
@@ -610,7 +612,7 @@ function displayQuizCards(quizzes) {
// Add click event listener to each card
quizCard.addEventListener("click", function () {
// On card click, fetch data for the particular spreadsheet
- window.open(`http://localhost:5500/final/public/?id=${id}&mode=edit`);
+ window.open(`https://quizgen.app/?id=${id}&mode=edit`);
});
row.appendChild(quizCard);
@@ -694,16 +696,17 @@ function displayRefreshQuiz() {
function hideSaveQuiz() {
let saveQuiz = document.getElementById("saveQuiz");
- saveQuiz.classList.remove("opacity-1");
- saveQuiz.classList.add("opacity-0");
+ saveQuiz.classList.add("disabled");
+ let saveLabel = document.getElementById("save-label");
+ saveLabel.innerText = "Published";
}
function displayPublishedLink() {
let publishedLink = document.getElementById("publishedLink");
publishedLink.classList.remove("d-none");
let publishedLinkURL = document.getElementById("publishedLinkURL");
- publishedLinkURL.href = `http://localhost:5500/final/public/?id=${window.sheetId}`;
- publishedLinkURL.innerText = `http://localhost:5500/final/public/?id=${window.sheetId}`;
+ publishedLinkURL.href = `https://quizgen.app/?id=${window.sheetId}`;
+ publishedLinkURL.innerText = `https://quizgen.app/?id=${window.sheetId}`;
publishedLink.classList.remove("opacity-0");
publishedLink.classList.add("opacity-1");
}
diff --git a/public/style.css b/public/style.css
index aea7a1d..f1839a4 100644
--- a/public/style.css
+++ b/public/style.css
@@ -232,33 +232,7 @@ button.pushable.disabled {
.visible {
opacity: 1;
}
-@media screen and (max-width: 576px) {
- html {
- font-size: 12px;
- }
- .init {
- margin: 7vh 0;
- }
- #subheading-maj {
- margin: 4vh 0;
- }
- #subheading-ming {
- margin: 2vh 0;
- }
- #slideshow {
- margin: 4vh 0;
- }
-
- #slideshow .slide {
- width: 100%;
- left: 0;
- }
- .tut-elem {
- flex: 0 0 100% !important;
- max-width: 100% !important;
- }
-}
.tut-intro {
font-family: "Inter", sans-serif;
}
@@ -561,7 +535,6 @@ a:hover {
#publishedLink,
#error,
-#saveQuiz,
#quizzes,
#subheading-maj,
#subheading-min {
@@ -572,6 +545,11 @@ a:hover {
-o-transition: opacity 0.6s ease-in-out;
}
+#publishedLinkURL {
+ white-space: nowrap;
+}
+
+#saveQuiz,
#refreshQuiz {
transition: opacity 3s ease-in-out;
-webkit-transition: opacity 3s ease-in-out;
@@ -587,3 +565,35 @@ a:hover {
.opacity-0 {
opacity: 0 !important;
}
+
+@media screen and (max-width: 576px) {
+ html {
+ font-size: 12px;
+ }
+ .init {
+ margin: 7vh 0;
+ }
+ #subheading-maj {
+ margin: 4vh 0;
+ }
+ #subheading-ming {
+ margin: 2vh 0;
+ }
+ #slideshow {
+ margin: 4vh 0;
+ }
+
+ #slideshow .slide {
+ width: 100%;
+ left: 0;
+ }
+
+ .tut-elem {
+ flex: 0 0 100% !important;
+ max-width: 100% !important;
+ }
+
+ #publishedLinkURL {
+ white-space: normal;
+ }
+}