diff --git a/.gitignore b/.gitignore index 16ed0f8..49df477 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ # VS code .vscode/settings.json -.vscode/launch.json \ No newline at end of file +.vscode/launch.json + +# Tests +/coverage \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ef9b868..f15a391 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.3.3", "license": "GPL-3.0", "devDependencies": { - "eslint": "^9.9.1", + "eslint": "^9.10.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "globals": "^15.9.0", @@ -1923,9 +1923,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", - "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", + "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", "dev": true, "license": "MIT", "engines": { @@ -1942,6 +1942,19 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/plugin-kit": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", + "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -3455,9 +3468,9 @@ } }, "node_modules/eslint": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", - "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", + "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", "dev": true, "license": "MIT", "dependencies": { @@ -3465,7 +3478,8 @@ "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.9.1", + "@eslint/js": "9.10.0", + "@eslint/plugin-kit": "^0.1.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -3488,7 +3502,6 @@ "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", @@ -8901,9 +8914,9 @@ } }, "@eslint/js": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", - "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", + "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", "dev": true }, "@eslint/object-schema": { @@ -8912,6 +8925,15 @@ "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true }, + "@eslint/plugin-kit": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", + "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "dev": true, + "requires": { + "levn": "^0.4.1" + } + }, "@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -9991,16 +10013,17 @@ "dev": true }, "eslint": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", - "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", + "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.9.1", + "@eslint/js": "9.10.0", + "@eslint/plugin-kit": "^0.1.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -10023,7 +10046,6 @@ "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", diff --git a/package.json b/package.json index 9e9391f..2f19990 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "main": "index.html", "type": "module", "devDependencies": { - "eslint": "^9.9.1", + "eslint": "^9.10.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "globals": "^15.9.0", diff --git a/src/scripts/index.js b/src/scripts/index.js index 0260795..81d99d0 100644 --- a/src/scripts/index.js +++ b/src/scripts/index.js @@ -434,21 +434,21 @@ class ArticleFiller { // Change indicators const appendStr = ` -
-
+
+ -
`; diff --git a/src/scripts/index.min.js b/src/scripts/index.min.js index c23b76f..4da5161 100644 --- a/src/scripts/index.min.js +++ b/src/scripts/index.min.js @@ -1 +1 @@ -const converter=new showdown.Converter;class ArticleFiller{constructor(){this.articleData,this.articleMd,this.article,this.pageData,this.pageURL,this.callPageDisplay=!0,this.whatPageDisplay="index"}static retrieveArticleData(){fetch("/src/articleArchive/articleData.json").then((t=>t.json())).then((t=>{ArticleFiller.articleData=t,ArticleFiller.callArticle()})).catch((t=>{console.error("Error retrieving article data:",t)}))}static callArticle(){const t=document.URL,[,e]=t.split("?");if(!e)return void ArticleFiller.callDisplay();const[l]=e.split("&");if(1===e.split("&").length){ArticleFiller.grabArticle(l);const t=document.getElementById("featuredArticles"),e=document.getElementById("displayArticles"),i=document.getElementById("articleBody");t&&t.setAttribute("hidden",!0),e&&e.setAttribute("hidden",!0),i&&i.removeAttribute("hidden")}else ArticleFiller.callDisplay()}static grabArticle(t){const e=t.split(" ");t="";for(const l of e){t+=l[0].toUpperCase()+l.slice(1)}if(ArticleFiller.articleData&&t){const e=ArticleFiller.articleData[t];if(e){this.updateMetaData(e,t);const l=`author${e.author.replace(/\s/g,"")}`,i=`${e.date}_${t}`;fetch(`/src/articleArchive/${l}/${i}/${t}.md`).then((t=>t.text())).then((t=>{ArticleFiller.articleMd=t,ArticleFiller.addToPage()})).catch((t=>{console.error(t),ArticleFiller.articleMd="Error retrieving article",ArticleFiller.addToPage()}))}else ArticleFiller.articleMd="Error retrieving article",ArticleFiller.addToPage()}}static updateMetaData(t,e){if(Object.keys(t)?.length>0){let l=document?.querySelector("script[type='application/ld+json']")?.textContent;if(l=l?JSON.parse(l):void 0,t?.title){const e=`${t.title} | Small Dev Talk`;document.title=e,document.querySelector("meta[property='og:title']").setAttribute("content",e),document.querySelector("meta[property='twitter:title']").setAttribute("content",e),l?.name&&(l.name=e)}if(t?.summary){const e=`${t.summary} | Small Dev Talk`;document.querySelector("meta[name='description']").setAttribute("content",e),document.querySelector("meta[property='og:description']").setAttribute("content",e),document.querySelector("meta[property='twitter:description']").setAttribute("content",e),l?.description&&(l.description=e)}if(t?.thumbnail&&t?.author&&t?.date&&e){const i=`https://smalldevtalk.net/src/articleArchive/author${t.author.split(" ").join("")}/${t.date}_${e}/${t.thumbnail}`;document.querySelector("meta[property='og:image']").setAttribute("content",i),document.querySelector("meta[property='twitter:image']").setAttribute("content",i),l?.image&&(l.image=i)}l&&(document.querySelector("script[type='application/ld+json']").textContent=JSON.stringify(l))}}static addToPage(){ArticleFiller.article=converter.makeHtml(ArticleFiller.articleMd),document.getElementById("articleBody")&&(document.getElementById("articleBody").innerHTML=ArticleFiller.article)}static retrievePageData(){const t=new XMLHttpRequest;t.responseType="json",t.onreadystatechange=()=>{t.readyState===XMLHttpRequest.DONE&&200===t.status&&(ArticleFiller.pageData=t.response,ArticleFiller.callArticle())},t.open("GET","/src/legacyPages/legacyPagesDisplay.json"),t.send()}static callDisplay(){let t=[];const e=document.URL.split("?");e.length>1?(t=e[1].split("&"),ArticleFiller.whatPageDisplay=t[1]):(t=[],ArticleFiller.whatPageDisplay="index"),ArticleFiller.pageURL=t,1===ArticleFiller.pageURL.length?ArticleFiller.callPageDisplay=!1:(ArticleFiller.callPageDisplay=!0,"archive"===ArticleFiller.whatPageDisplay?ArticleFiller.displayArchive():ArticleFiller.changeCarousel())}static displayArchive(){document.getElementById("featuredArticles")&&document.getElementById("featuredArticles").setAttribute("hidden",!0),document.getElementById("articleBody")&&document.getElementById("articleBody").removeAttribute("hidden");let t="";const{articleData:e}=ArticleFiller;if(e)for(const[l,i]of Object.entries(e))if(i&&i.title&&i.author&&i.date&&i.thumbnail){t.trim().length<1&&(t+='\n\t\t\t\t\t\t",document.getElementById("displayArticles").innerHTML+=t)}static changeCarousel(){const t=ArticleFiller.whatPageDisplay[0].toUpperCase()+ArticleFiller.whatPageDisplay.substring(1,ArticleFiller.whatPageDisplay.length);if(document.getElementById("pageTitle")&&(document.getElementById("pageTitle").innerText=`Small Dev Talk: ${t}`),ArticleFiller&&ArticleFiller.pageData&&ArticleFiller.articleData&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay]&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay].carousel&&document.getElementById("carouselInner")){const t=ArticleFiller.pageData[ArticleFiller.whatPageDisplay].carousel;document.getElementById("carouselIndicator")&&(document.getElementById("carouselIndicator").innerHTML=""),document.getElementById("carouselInner").innerHTML="";for(let e=0;e\n\t\t\t\t`;document.getElementById("carouselIndicator")&&(document.getElementById("carouselIndicator").innerHTML+=s),s=`\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t`,document.getElementById("carouselInner").innerHTML+=s}}ArticleFiller.ArticleFiller()}static ArticleFiller(){if(ArticleFiller&&ArticleFiller.pageData&&ArticleFiller.articleData&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay]&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay].displayArticles){const t=ArticleFiller.pageData[ArticleFiller.whatPageDisplay].displayArticles;if(document.getElementById("displayArticles").innerHTML="",t&&t.length>0)for(const e in t)if(ArticleFiller.articleData[t[e]]){const l=`author${ArticleFiller.articleData[t[e]].author.split(" ").join("")}`,i=`${ArticleFiller.articleData[t[e]].date}_${t[e]}`,r=ArticleFiller.articleData[t[e]].thumbnail,a=ArticleFiller.articleData[t[e]].title,c=ArticleFiller.articleData[t[e]].summary,n=ArticleFiller.articleData[t[e]].date,s=`/src/articleArchive/${l}/${i}/${r}`,o=`\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t${a}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t${c}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t${n}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t`;document.getElementById("displayArticles").innerHTML+=o}}}}function init(){ArticleFiller.retrievePageData(),ArticleFiller.retrieveArticleData()}function changeCarouselSlide(t){const e="active",l=document.getElementsByClassName("carousel-item");if(!l||!l.length)return;const i=Array.from(l).find((t=>t.classList.contains(e)));if(!i)return void l[0].classList.add(e);const r="next"===t?(Array.from(l).indexOf(i)+1)%l.length:(Array.from(l).indexOf(i)-1+l.length)%l.length;i.classList.remove(e),l[r].classList.add(e)}window.onload=init; \ No newline at end of file +const converter=new showdown.Converter;class ArticleFiller{constructor(){this.articleData,this.articleMd,this.article,this.pageData,this.pageURL,this.callPageDisplay=!0,this.whatPageDisplay="index"}static retrieveArticleData(){fetch("/src/articleArchive/articleData.json").then((response=>response.json())).then((articleData=>{ArticleFiller.articleData=articleData,ArticleFiller.callArticle()})).catch((error=>{console.error("Error retrieving article data:",error)}))}static callArticle(){const docURL=document.URL,[,query]=docURL.split("?");if(!query)return void ArticleFiller.callDisplay();const[articleTitle]=query.split("&");if(1===query.split("&").length){ArticleFiller.grabArticle(articleTitle);const featuredArticles=document.getElementById("featuredArticles"),displayArticles=document.getElementById("displayArticles"),articleBody=document.getElementById("articleBody");featuredArticles&&featuredArticles.setAttribute("hidden",!0),displayArticles&&displayArticles.setAttribute("hidden",!0),articleBody&&articleBody.removeAttribute("hidden")}else ArticleFiller.callDisplay()}static grabArticle(articleName){const tempName=articleName.split(" ");articleName="";for(const name of tempName){articleName+=name[0].toUpperCase()+name.slice(1)}if(ArticleFiller.articleData&&articleName){const articleData=ArticleFiller.articleData[articleName];if(articleData){this.updateMetaData(articleData,articleName);const authorFolder=`author${articleData.author.replace(/\s/g,"")}`,articleFolder=`${articleData.date}_${articleName}`;fetch(`/src/articleArchive/${authorFolder}/${articleFolder}/${articleName}.md`).then((response=>response.text())).then((articleMd=>{ArticleFiller.articleMd=articleMd,ArticleFiller.addToPage()})).catch((error=>{console.error(error),ArticleFiller.articleMd="Error retrieving article",ArticleFiller.addToPage()}))}else ArticleFiller.articleMd="Error retrieving article",ArticleFiller.addToPage()}}static updateMetaData(articleData,articleKey){if(Object.keys(articleData)?.length>0){let structuredData=document?.querySelector("script[type='application/ld+json']")?.textContent;if(structuredData=structuredData?JSON.parse(structuredData):void 0,articleData?.title){const title=`${articleData.title} | Small Dev Talk`;document.title=title,document.querySelector("meta[property='og:title']").setAttribute("content",title),document.querySelector("meta[property='twitter:title']").setAttribute("content",title),structuredData?.name&&(structuredData.name=title)}if(articleData?.summary){const description=`${articleData.summary} | Small Dev Talk`;document.querySelector("meta[name='description']").setAttribute("content",description),document.querySelector("meta[property='og:description']").setAttribute("content",description),document.querySelector("meta[property='twitter:description']").setAttribute("content",description),structuredData?.description&&(structuredData.description=description)}if(articleData?.thumbnail&&articleData?.author&&articleData?.date&&articleKey){const imgURL=`https://smalldevtalk.net/src/articleArchive/author${articleData.author.split(" ").join("")}/${articleData.date}_${articleKey}/${articleData.thumbnail}`;document.querySelector("meta[property='og:image']").setAttribute("content",imgURL),document.querySelector("meta[property='twitter:image']").setAttribute("content",imgURL),structuredData?.image&&(structuredData.image=imgURL)}structuredData&&(document.querySelector("script[type='application/ld+json']").textContent=JSON.stringify(structuredData))}}static addToPage(){ArticleFiller.article=converter.makeHtml(ArticleFiller.articleMd),document.getElementById("articleBody")&&(document.getElementById("articleBody").innerHTML=ArticleFiller.article)}static retrievePageData(){const xhr=new XMLHttpRequest;xhr.responseType="json",xhr.onreadystatechange=()=>{xhr.readyState===XMLHttpRequest.DONE&&200===xhr.status&&(ArticleFiller.pageData=xhr.response,ArticleFiller.callArticle())},xhr.open("GET","/src/legacyPages/legacyPagesDisplay.json"),xhr.send()}static callDisplay(){let useURL=[];const sep=document.URL.split("?");sep.length>1?(useURL=sep[1].split("&"),ArticleFiller.whatPageDisplay=useURL[1]):(useURL=[],ArticleFiller.whatPageDisplay="index"),ArticleFiller.pageURL=useURL,1===ArticleFiller.pageURL.length?ArticleFiller.callPageDisplay=!1:(ArticleFiller.callPageDisplay=!0,"archive"===ArticleFiller.whatPageDisplay?ArticleFiller.displayArchive():ArticleFiller.changeCarousel())}static displayArchive(){document.getElementById("featuredArticles")&&document.getElementById("featuredArticles").setAttribute("hidden",!0),document.getElementById("articleBody")&&document.getElementById("articleBody").removeAttribute("hidden");let archiveDisplay="";const{articleData:articleData}=ArticleFiller;if(articleData)for(const[key,value]of Object.entries(articleData))if(value&&value.title&&value.author&&value.date&&value.thumbnail){archiveDisplay.trim().length<1&&(archiveDisplay+='\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t');const imgURL=`src/articleArchive/author${value.author.split(" ").join("")}/${value.date}_${key}/${value.thumbnail}`;archiveDisplay+=`\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t

${value.title}

\n\t\t\t\t\t\t\t${value.title}'s thumbnail\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t`}archiveDisplay.trim().length>0&&(archiveDisplay+="
",document.getElementById("displayArticles").innerHTML+=archiveDisplay)}static changeCarousel(){const docTitle=ArticleFiller.whatPageDisplay[0].toUpperCase()+ArticleFiller.whatPageDisplay.substring(1,ArticleFiller.whatPageDisplay.length);if(document.getElementById("pageTitle")&&(document.getElementById("pageTitle").innerText=`Small Dev Talk: ${docTitle}`),ArticleFiller&&ArticleFiller.pageData&&ArticleFiller.articleData&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay]&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay].carousel&&document.getElementById("carouselInner")){const carouselList=ArticleFiller.pageData[ArticleFiller.whatPageDisplay].carousel;document.getElementById("carouselIndicator")&&(document.getElementById("carouselIndicator").innerHTML=""),document.getElementById("carouselInner").innerHTML="";for(let c=0;c\n\t\t\t\t`;document.getElementById("carouselIndicator")&&(document.getElementById("carouselIndicator").innerHTML+=appendStr),appendStr=`\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t`,document.getElementById("carouselInner").innerHTML+=appendStr}}ArticleFiller.ArticleFiller()}static ArticleFiller(){if(ArticleFiller&&ArticleFiller.pageData&&ArticleFiller.articleData&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay]&&ArticleFiller.pageData[ArticleFiller.whatPageDisplay].displayArticles){const displayList=ArticleFiller.pageData[ArticleFiller.whatPageDisplay].displayArticles;if(document.getElementById("displayArticles").innerHTML="",displayList&&displayList.length>0)for(const d in displayList)if(ArticleFiller.articleData[displayList[d]]){const authorFolder=`author${ArticleFiller.articleData[displayList[d]].author.split(" ").join("")}`,articleFolder=`${ArticleFiller.articleData[displayList[d]].date}_${displayList[d]}`,articleThumbnail=ArticleFiller.articleData[displayList[d]].thumbnail,articleTitle=ArticleFiller.articleData[displayList[d]].title,articleSummary=ArticleFiller.articleData[displayList[d]].summary,articleDate=ArticleFiller.articleData[displayList[d]].date,url=`/src/articleArchive/${authorFolder}/${articleFolder}/${articleThumbnail}`,appendStr=`\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t${articleTitle}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t${articleSummary}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t${articleDate}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`;document.getElementById("displayArticles").innerHTML+=appendStr}}}}function init(){ArticleFiller.retrievePageData(),ArticleFiller.retrieveArticleData()}function changeCarouselSlide(direction){const carouselItems=document.getElementsByClassName("carousel-item");if(!carouselItems||!carouselItems.length)return;const activeItem=Array.from(carouselItems).find((item=>item.classList.contains("active")));if(!activeItem)return void carouselItems[0].classList.add("active");const nextIndex="next"===direction?(Array.from(carouselItems).indexOf(activeItem)+1)%carouselItems.length:(Array.from(carouselItems).indexOf(activeItem)-1+carouselItems.length)%carouselItems.length;activeItem.classList.remove("active"),carouselItems[nextIndex].classList.add("active")}window.onload=init; \ No newline at end of file diff --git a/src/style.css b/src/style.css index 16ed966..c269c53 100644 --- a/src/style.css +++ b/src/style.css @@ -43,6 +43,7 @@ img { display: flex; float: left; margin-bottom: 0; + width: 100%; } #header .pages li { @@ -131,7 +132,7 @@ img { #header h1 { clear: both; float: left; - padding: min(1%, 10px); + padding: min(1%, 10px) 2%; } #header .ad { @@ -302,7 +303,6 @@ img { #content .post .r { padding: 15px 0; width: 100%; - max-width: 430px; } #content .post h2 { diff --git a/src/style.min.css b/src/style.min.css index d587fe9..cc2ba9e 100644 --- a/src/style.min.css +++ b/src/style.min.css @@ -1 +1 @@ -#header h1,#header nav ul li,#header ul li{float:left}#content .featured .photo,#content .featured .text,#content .postnav ul,#header ul,#sidebar ul{list-style-type:none}#content .atitle,#content .featured .text .readmore,#content .featured h2.title{font-size:.9em;text-transform:uppercase}#sidebar .ads,.archive-title,body{text-align:center}#footer p,#wrapper{margin:auto;text-align:left}body{color:#000;font:12px Verdana;margin:0;padding:0}img{border:0}.break{clear:both;font-size:0;height:0;width:0}#wrapper{max-width:100%}#header{height:200px}#header ul{clear:both}#header .pages{display:flex;float:left;margin-bottom:0}#header .pages li{font-size:.7em;font-weight:700;text-transform:uppercase}#header .pages li a{color:#fff;display:block;padding:8px 10px;text-decoration:none}#content .details a:hover,#footer a:hover,#header .pages li a:hover{text-decoration:underline}#header nav{width:100%;background-color:#000;overflow-x:auto;white-space:nowrap}#header nav ul li:hover>ul{display:block}#header nav ul{background:-moz-linear-gradient;background:-webkit-linear-gradient;box-shadow:0 0 9px rgba (0,0,0,.15);display:inline-table;list-style:none;padding:0 2%;position:relative}#header nav ul li:hover{background:-moz-linear-gradient(top,#4f5964 0,#5f6975 40%);background:-webkit-linear-gradient(top,#4f5964 0,#5f6975 40%);background:linear-gradient(top,#4f5964 0,#5f6975 40%)}#header nav ul li a{color:#000;display:block;padding:25px 40px;text-decoration:none}#header nav ul ul{display:none;background:#5f6975;border-radius:0;padding:0;position:absolute;top:100%}#content .featured .thumb,#content .post img,.articleBody img{background-color:#f2f2f1;border:1px solid #e9e9e9;padding:5px}#header nav ul ul li{border-bottom:1px solid #575f6a;border-top:1px solid #6b727c;float:none;position:relative}#header nav ul ul li a{color:#fff;padding:15px 40px}#header nav ul ul ul{left:100%;position:absolute;top:0}#header h1{clear:both;padding:min(1%,10px)}#header .ad{float:right;padding-top:30px}#body{padding:10px 8px;display:flex;justify-content:center;gap:min(20px,10%)}.articleBody{margin-left:3%;margin-right:3%}.articleBody img{vertical-align:middle;width:100%}#content{border:1px solid #afafaf;box-shadow:0 0 10px rgba(0,0,0,.5);clear:both;float:left;font-family:Arial;max-width:676px;width:100%}#content .foot{padding:25px 8px}#content .atitle,#content .featured h2.title,#sidebar h2{font-weight:400;padding:5px 8px}#content .atitle{float:left;margin:10px 30px}#content .featured{padding:5px 30px 10px}#content .featured h2.title{background-color:#212121;color:#fff;float:left;margin-bottom:10px}#content .featured .thumb{clear:both;height:315px;width:590px}#content .featured .b{height:315px;overflow:hidden;position:relative;width:589px}#content .photo li{left:0;position:absolute;top:0;z-index:0}#content .photo li.first{z-index:2}#content .photo li img{width:589px}#content .featured .text li{background:url(images/shade.png);color:#fff;font-family:Verdana;height:285px;padding:15px;position:absolute;right:-270px;top:0;width:230px;z-index:4}#content .featured .text li.first{right:0}#content .featured .text h2{font-size:1.6em;margin-bottom:15px}#content .featured .text p,#content .post p{line-height:1.6em;margin-bottom:15px}#content .featured .text a,#footer a{color:#fff;text-decoration:none}#content .featured .text .readmore{font-weight:700}#content .post{border-top:1px solid #e9e9e9;clear:both;margin:0 30px}#content .first{border-top:0}#content .post .l{float:left;padding:15px 0}#content .post .r{padding:15px 0;width:100%;max-width:430px}#content .post h2{font-size:1.8em;font-weight:400;margin-bottom:15px}#content .post h2 a,#sidebar ul li a{color:#191919;text-decoration:none}#content .details{float:left;font-size:.85em;margin-bottom:0!important;text-transform:uppercase}#content .details a{color:#191919;margin:0 5px;text-decoration:none}#content .comments a{background-color:#212121;color:#fff;display:block;font-family:Verdana;font-size:.9em;padding:2px 6px;text-decoration:none}#content .single li,#sidebar ul li{line-height:1.5em;padding:2px 0}#content .postnav{clear:both;float:right;padding:0 2%}#content .postnav ul li{float:left;font-family:Arial;padding:0 4px}#content .postnav ul li a{border:1px solid #e1e1e1;color:#4f4f4f;display:block;padding:4px 8px;text-decoration:none}#content .postnav ul li a:hover{border-color:#fff}#content .single{padding:10px 30px}#content .single h2{font-size:1.4em;margin-bottom:10px;text-transform:none}#content .single p{line-height:1.5em;margin-bottom:10px}#content .single ol,#content .single ul{list-style-position:inside;margin-bottom:10px}#content .single blockquote{background-color:#eee;border-color:#e0e0e0;border-style:solid;border-width:1px 0;margin-bottom:10px;padding:10px 10px 5px}#footer,#sidebar .search button,#sidebar h2{background-color:#212121;color:#fff}#content .single h3,#content .single h4,#content .single h5,#content .single h6{font-size:1.2em;margin-bottom:5px}.archive-title{color:#000;text-decoration:none}.archive-link{text-decoration:none}.archive-display{border:1px solid rgba(0,0,0,.342);margin:auto auto 2%;max-width:30%!important;min-width:200px}.archive-display img{margin:auto;width:100%}#sidebar{float:right;width:330px}@media screen and (max-width:900px){#body{display:block}#sidebar{margin-top:1%;width:100%}#content{max-width:100%}}#sidebar .box{border:2px solid #e1e1e1;margin-bottom:15px;padding:10px}#sidebar h2{font-size:.9em;margin-bottom:10px;text-transform:uppercase;width:130px}#sidebar ul li{border-bottom:1px solid #e9e9e9}#sidebar .ads{margin-bottom:10px}#sidebar .ads img{margin:4px}#sidebar .search{border:2px solid #e1e1e1;height:29px;margin-bottom:10px}#sidebar .search input{border:0;float:left;margin:6px 4px;width:220px}#sidebar .search button{border:0;float:right;font-size:.8em;font-weight:700;height:29px;text-transform:uppercase;width:38px}#footer{clear:both}#footer p{font-size:.9em;padding:15px 0;width:940px}input:user-valid,select:user-valid,textarea:user-valid{border:1px solid #28a745}input:user-invalid,select:user-invalid,textarea:user-invalid{border:1px solid #dc3545} \ No newline at end of file +#header h1,#header nav ul li,#header ul li{float:left}#content .featured .photo,#content .featured .text,#content .postnav ul,#header ul,#sidebar ul{list-style-type:none}#content .atitle,#content .featured .text .readmore,#content .featured h2.title{font-size:.9em;text-transform:uppercase}#sidebar .ads,.archive-title,body{text-align:center}#footer p,#wrapper{margin:auto;text-align:left}body{color:#000;font:12px Verdana;margin:0;padding:0}img{border:0}.break{clear:both;font-size:0;height:0;width:0}#wrapper{max-width:100%}#header{height:200px}#header ul{clear:both}#header .pages{display:flex;float:left;margin-bottom:0;width:100%}#header .pages li{font-size:.7em;font-weight:700;text-transform:uppercase}#header .pages li a{color:#fff;display:block;padding:8px 10px;text-decoration:none}#content .details a:hover,#footer a:hover,#header .pages li a:hover{text-decoration:underline}#header nav{width:100%;background-color:#000;overflow-x:auto;white-space:nowrap}#header nav ul li:hover>ul{display:block}#header nav ul{background:-moz-linear-gradient;background:-webkit-linear-gradient;box-shadow:0 0 9px rgba (0,0,0,.15);display:inline-table;list-style:none;padding:0 2%;position:relative}#header nav ul li:hover{background:-moz-linear-gradient(top,#4f5964 0,#5f6975 40%);background:-webkit-linear-gradient(top,#4f5964 0,#5f6975 40%);background:linear-gradient(top,#4f5964 0,#5f6975 40%)}#header nav ul li a{color:#000;display:block;padding:25px 40px;text-decoration:none}#header nav ul ul{display:none;background:#5f6975;border-radius:0;padding:0;position:absolute;top:100%}#content .featured .thumb,#content .post img,.articleBody img{background-color:#f2f2f1;border:1px solid #e9e9e9;padding:5px}#header nav ul ul li{border-bottom:1px solid #575f6a;border-top:1px solid #6b727c;float:none;position:relative}#header nav ul ul li a{color:#fff;padding:15px 40px}#header nav ul ul ul{left:100%;position:absolute;top:0}#header h1{clear:both;padding:min(1%,10px) 2%}#header .ad{float:right;padding-top:30px}#body{padding:10px 8px;display:flex;justify-content:center;gap:min(20px,10%)}.articleBody{margin-left:3%;margin-right:3%}.articleBody img{vertical-align:middle;width:100%}#content{border:1px solid #afafaf;box-shadow:0 0 10px rgba(0,0,0,.5);clear:both;float:left;font-family:Arial;max-width:676px;width:100%}#content .foot{padding:25px 8px}#content .atitle,#content .featured h2.title,#sidebar h2{font-weight:400;padding:5px 8px}#content .atitle{float:left;margin:10px 30px}#content .featured{padding:5px 30px 10px}#content .featured h2.title{background-color:#212121;color:#fff;float:left;margin-bottom:10px}#content .featured .thumb{clear:both;height:315px;width:590px}#content .featured .b{height:315px;overflow:hidden;position:relative;width:589px}#content .photo li{left:0;position:absolute;top:0;z-index:0}#content .photo li.first{z-index:2}#content .photo li img{width:589px}#content .featured .text li{background:url(images/shade.png);color:#fff;font-family:Verdana;height:285px;padding:15px;position:absolute;right:-270px;top:0;width:230px;z-index:4}#content .featured .text li.first{right:0}#content .featured .text h2{font-size:1.6em;margin-bottom:15px}#content .featured .text p,#content .post p{line-height:1.6em;margin-bottom:15px}#content .featured .text a,#footer a{color:#fff;text-decoration:none}#content .featured .text .readmore{font-weight:700}#content .post{border-top:1px solid #e9e9e9;clear:both;margin:0 30px}#content .first{border-top:0}#content .post .l{float:left;padding:15px 0}#content .post .r{padding:15px 0;width:100%}#content .post h2{font-size:1.8em;font-weight:400;margin-bottom:15px}#content .post h2 a,#sidebar ul li a{color:#191919;text-decoration:none}#content .details{float:left;font-size:.85em;margin-bottom:0!important;text-transform:uppercase}#content .details a{color:#191919;margin:0 5px;text-decoration:none}#content .comments a{background-color:#212121;color:#fff;display:block;font-family:Verdana;font-size:.9em;padding:2px 6px;text-decoration:none}#content .single li,#sidebar ul li{line-height:1.5em;padding:2px 0}#content .postnav{clear:both;float:right;padding:0 2%}#content .postnav ul li{float:left;font-family:Arial;padding:0 4px}#content .postnav ul li a{border:1px solid #e1e1e1;color:#4f4f4f;display:block;padding:4px 8px;text-decoration:none}#content .postnav ul li a:hover{border-color:#fff}#content .single{padding:10px 30px}#content .single h2{font-size:1.4em;margin-bottom:10px;text-transform:none}#content .single p{line-height:1.5em;margin-bottom:10px}#content .single ol,#content .single ul{list-style-position:inside;margin-bottom:10px}#content .single blockquote{background-color:#eee;border-color:#e0e0e0;border-style:solid;border-width:1px 0;margin-bottom:10px;padding:10px 10px 5px}#footer,#sidebar .search button,#sidebar h2{background-color:#212121;color:#fff}#content .single h3,#content .single h4,#content .single h5,#content .single h6{font-size:1.2em;margin-bottom:5px}.archive-title{color:#000;text-decoration:none}.archive-link{text-decoration:none}.archive-display{border:1px solid rgba(0,0,0,.342);margin:auto auto 2%;max-width:30%!important;min-width:200px}.archive-display img{margin:auto;width:100%}#sidebar{float:right;width:330px}@media screen and (max-width:900px){#body{display:block}#sidebar{margin-top:1%;width:100%}#content{max-width:100%}}#sidebar .box{border:2px solid #e1e1e1;margin-bottom:15px;padding:10px}#sidebar h2{font-size:.9em;margin-bottom:10px;text-transform:uppercase;width:130px}#sidebar ul li{border-bottom:1px solid #e9e9e9}#sidebar .ads{margin-bottom:10px}#sidebar .ads img{margin:4px}#sidebar .search{border:2px solid #e1e1e1;height:29px;margin-bottom:10px}#sidebar .search input{border:0;float:left;margin:6px 4px;width:220px}#sidebar .search button{border:0;float:right;font-size:.8em;font-weight:700;height:29px;text-transform:uppercase;width:38px}#footer{clear:both}#footer p{font-size:.9em;padding:15px 0;width:940px}input:user-valid,select:user-valid,textarea:user-valid{border:1px solid #28a745}input:user-invalid,select:user-invalid,textarea:user-invalid{border:1px solid #dc3545} \ No newline at end of file