From 18f0492f161353b72c0e3c1e11f7df07a845fd3f Mon Sep 17 00:00:00 2001 From: Sean Edmunds Date: Tue, 14 Dec 2021 16:45:45 -0600 Subject: [PATCH] fixing backgrounds --- node_modules/.cache/.eslintcache | 2 +- package.json | 1 + src/index.css | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/.cache/.eslintcache b/node_modules/.cache/.eslintcache index 1bf34210..7406debe 100644 --- a/node_modules/.cache/.eslintcache +++ b/node_modules/.cache/.eslintcache @@ -1 +1 @@ -[{"/home/seanedmunds/dev/home-page/src/index.js":"1"},{"size":19454,"mtime":1639516153474,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"szjdbt","/home/seanedmunds/dev/home-page/src/index.js",["6","7"],{"ruleId":"8","severity":1,"message":"9","line":206,"column":11,"nodeType":"10","endLine":206,"endColumn":61},{"ruleId":"11","severity":1,"message":"12","line":607,"column":1,"nodeType":"13","messageId":"14","endLine":610,"endColumn":2},"jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-extend-native","String prototype is read only, properties should not be added.","AssignmentExpression","unexpected"] \ No newline at end of file +[{"/home/seanedmunds/dev/home-page/src/index.js":"1"},{"size":19454,"mtime":1639516153474,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"6"},"szjdbt","/home/seanedmunds/dev/home-page/src/index.js",["7","8"],"import React from 'react';\nimport { useState, useEffect } from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\n\nconst setValueFromLocalStorage = property => {\n let value = localStorage.getItem(property);\n setValue(property, value);\n};\nconst setValue = (property, value) => {\n if (value) {\n document.documentElement.style.setProperty(`--${property}`, value);\n\n const input = document.querySelector(`#${property}`);\n if (input) {\n value = value.replace('px', '');\n input.value = value;\n }\n }\n};\n\nfunction Homepage() {\n setTheme();\n \n return (\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n );\n}\n\nfunction Search() {\n return (\n
\n
\n \n \n
\n
\n )\n}\n\nfunction Header(props) {\n return (\n
\n
\n

{props.greet}

\n
\n
\n

{props.date}

\n \n
\n
\n );\n}\n\nfunction Applications() {\n let appList = getApps();\n var items = [];\n for (var i = 0; i < appList.apps.length; i++) {\n var safe = appList.apps[i].NSFW;\n var NSFWEnabled = localStorage.getItem(\"contenttype\");\n if (safe === \"SAFE\") {\n items.push(\n \n );\n } else if (safe === \"NSFW\" && NSFWEnabled) {\n items.push(\n \n );\n } else {\n \n }\n \n }\n return (\n
\n

Applications

\n
\n {items}\n
\n
\n );\n}\n\nfunction App(props) {\n \n let classNameType = props.NSFW + \"-content\";\n let hrefUrl = \"https://\" + props.url;\n let iconName = \"mdi-\" + props.icon;\n return (\n
\n \n
\n
\n \n
\n
\n {props.name}\n {props.url}\n
\n
\n
\n
\n );\n}\n\nfunction Bookmarks() {\n let bookmarkList = getLinks();\n var items = [];\n for (var i = 0; i < bookmarkList.bookmarks.length; i++) {\n items.push(\n \n );\n }\n return (\n
\n

Bookmarks

\n \n
\n );\n}\n\nfunction LinkGroups(props) {\n var items = [];\n for (var i = 0; i < props.links.length; i++) {\n items.push(\n \n );\n }\n return (\n \n );\n}\n\nfunction LinkItem(props) {\n return (\n \n );\n}\n\nfunction ModalMenu() {\n var providers = getProviders();\n var items = [];\n var isChecked = localStorage.getItem(\"contenttype\");\n console.log(localStorage.getItem(\"contenttype\"));\n for (var i = 0; i < providers.providers.length; i++) {\n items.push(\n \n );\n }\n return (\n
\n
\n
\n

Options

\n \n \n \n
\n\n

Color themes

\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n

Search options

\n
\n \n \n \n \n \n \n {items}\n \n
WebsitePrefix
\n
\n\n
\n \n \n \n
\n
\n
\n );\n}\n\nfunction HideButton(props) {\n console.log(props.checked);\n if(props.checked === \"true\") {\n console.log(\"icon should be grey\");\n return (\n
\n
\n );\n } else {\n console.log(\"icon should be white\");\n return (\n
\n
\n );\n }\n}\n\nfunction Provider(props) {\n return (\n \n {props.provider.name}\n {props.provider.prefix}\n \n );\n}\n\nfunction ModalInit() {\n setDisplayedItems();\n return (\n
\n \n \n \n
\n );\n}\n\nReactDOM.render(\n ,\n document.getElementById('root')\n);\n\n//Functions below this line are for calculating data for\n//other functions\n\nfunction date() {\n let currentDate = new Date();\n let dateOptions = {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\"\n };\n let date = currentDate.toLocaleDateString(\"en-GB\", dateOptions);\n return date;\n}\nfunction fixDigits(k) {\n if (k < 10) {\n return \"0\" + k;\n }\n else {\n return k;\n }\n}\nfunction greet() {\n let currentTime = new Date();\n let greet = Math.floor(currentTime.getHours() / 6);\n let easterEggChance = Math.floor(Math.random() * 100);\n let greetings = require('./messages.json');\n let timeBased = [];\n let easterEggs = [];\n for (var i = 0; i < greetings.messages.length; i++) {\n if (greetings.messages[i].easteregg === \"FALSE\") {\n timeBased = timeBased.concat(greetings.messages[i]);\n } else {\n easterEggs = easterEggs.concat(greetings.messages[i]);\n }\n }\n if (easterEggChance > 10) {\n return timeBased[greet].message;\n } else {\n let easterEggText = Math.floor(Math.random() * easterEggs.length);\n return easterEggs[easterEggText].message;\n }\n}\nfunction Clock() {\n const [date, setDate] = useState(new Date());\n\n function refreshClock() {\n setDate(new Date());\n }\n useEffect(() => {\n const timerId = setInterval(refreshClock, 1000);\n return function cleanup() {\n clearInterval(timerId);\n };\n }, []);\n\n var hour = date.getHours();\n var minutes = date.getMinutes();\n //var seconds = date.getSeconds();\n var midday = \"AM\";\n midday = (hour >= 12) ? \"PM\" : \"AM\";\n hour = (hour === 0) ? 12 : ((hour > 12) ? (hour - 12) : hour);\n minutes = fixDigits(minutes);\n //seconds = fixDigits(seconds);\n let time = hour + \":\" + minutes + \" \" + midday;\n\n return (\n

{time}

\n\n );\n}\nfunction getApps() {\n let applications = require('./apps.json');\n return applications;\n}\nfunction getLinks() {\n let links = require('./links.json');\n return links;\n}\nfunction getProviders() {\n let providers = require('./providers.json');\n return providers;\n}\nfunction getThemes() {\n let themes = require('./themes.json');\n return themes;\n}\nfunction updateTheme(e) {\n var themes = getThemes();\n var themeName = e.target.innerHTML.toLowerCase();\n var index = themes.themes.findIndex(function(item, i){\n return item.name === themeName;\n });\n localStorage.setItem(\"image-background\", themes.themes[index].imagebackground);\n localStorage.setItem(\"color-background\", themes.themes[index].colorbackground);\n localStorage.setItem(\"color-search-background\", themes.themes[index].colorserachbackground);\n localStorage.setItem(\"color-text-pri\",themes.themes[index].colortextpri);\n localStorage.setItem(\"color-text-acc\", themes.themes[index].colortextacc);\n localStorage.setItem(\"color-border\", themes.themes[index].colorborder);\n \n //document.documentElement.style.setProperty(prop, `var(--${themeName}${prop.substring(10)})`);\n setTheme();\n}\nfunction setTheme() {\n setValueFromLocalStorage('image-background');\n setValueFromLocalStorage('color-background');\n setValueFromLocalStorage('color-search-background');\n setValueFromLocalStorage('color-text-pri');\n setValueFromLocalStorage('color-text-acc');\n setValueFromLocalStorage('color-border');\n setValueFromLocalStorage('content-display');\n}\nfunction handleKeyPress(e) {\n var sindex = 0;\n var cycle = false;\n var key = e.keyCode || e.which;\n var text = e.target.value.replaceAll(\"+\", \"%2B\");\n var option = text.substr(1, text.indexOf(' ') - 1) || text.substr(1);\n var subtext = text.substr(2 + option.length);\n if (key === 13) { // Search functions\n search(text);\n }\n if (key === 9) { // Tab Completion Functions\n e.preventDefault();\n e.stopPropagation();\n if (text[0] === ';') {\n switch (option) {\n case 't':\n var streamers = ['admiralbahroo', 'moonmoon_ow', 'witwix'];\n if (!subtext || cycle) {\n cycle = true;\n if (sindex > streamers.length - 1) sindex = 0;\n document.getElementById(\"keywords\").value = ';t ' + streamers[sindex++];\n return;\n }\n for (var streamer of streamers) {\n if (subtext === streamer.substr(0, subtext.length)) {\n document.getElementById(\"keywords\").value = ';t ' + streamer;\n return;\n }\n }\n break;\n default :\n break;\n }\n }\n }\n if(key === 32){ //Space to go to search\n updateLabel(text);\n }\n sindex = 0;\n cycle = false;\n updateLabel(text);\n}\nfunction updateLabel(text) {\n var option = text.substr(1, text.indexOf(' ') - 1) || text.substr(1);\n if (text[0] === '/') {\n// if (text.indexOf(' ') > -1) {\n switch (option) {\n case \"am\":\n document.getElementById(\"searchType\").innerHTML = \"Allmusic search\";\n break;\n case \"d\":\n document.getElementById(\"searchType\").innerHTML = \"Duck Duck Go search\";\n break;\n case \"di\":\n document.getElementById(\"searchType\").innerHTML = \"Discogs search\";\n break;\n case \"i\":\n document.getElementById(\"searchType\").innerHTML = \"IMDB search\";\n break;\n case \"m\":\n document.getElementById(\"searchType\").innerHTML = \"TheMovieDB search\";\n break;\n case \"r\":\n document.getElementById(\"searchType\").innerHTML = \"Reddit search\";\n break;\n case \"q\":\n document.getElementById(\"searchType\").innerHTML = \"Qwant search\";\n break;\n case \"so\":\n document.getElementById(\"searchType\").innerHTML = \"Soundcloud search\";\n break;\n case \"s\":\n document.getElementById(\"searchType\").innerHTML = \"Spotify search\";\n break;\n case \"tv\":\n document.getElementById(\"searchType\").innerHTML = \"TheTVDB search\";\n break;\n case \"t\":\n document.getElementById(\"searchType\").innerHTML = \"Trakt search\";\n break;\n case \"y\":\n document.getElementById(\"searchType\").innerHTML = \"YouTube search\";\n break;\n case \"w\":\n document.getElementById(\"searchType\").innerHTML = \"Wikipedia search\";\n break;\n case \"p\":\n document.getElementById(\"searchType\").innerHTML = \"Plex search\";\n break;\n case \"rt\":\n document.getElementById(\"searchType\").innerHTML = \"Rotten Tomatoes search\";\n break;\n default:\n document.getElementById(\"searchType\").innerHTML = \"Invalid search\";\n break;\n }\n}else {\n document.getElementById(\"searchType\").innerHTML = \"Google search\";\n }\n}\nfunction search(text) {\n if (text[0] === '/') {\n if (text.indexOf(' ') > -1) {\n let option = text.substr(1, text.indexOf(' ') - 1) || text.substr(1);\n var subtext = text.substr(2 + option.length);\n switch (option) {\n case \"am\":\n window.location = \"https://www.allmusic.com/search/all/\" + subtext;\n break;\n case \"d\":\n window.location = \"https://duckduckgo.com/?q=\" + subtext;\n break;\n case \"di\":\n window.location = \"https://www.discogs.com/search/?q=\" + subtext;\n break;\n case \"i\":\n window.location = \"https://www.imdb.com/find?q=\" + subtext;\n break;\n case \"m\":\n window.location = \"https://www.themoviedb.org/search?query=\" + subtext;\n break;\n case \"r\":\n window.location = \"https://www.reddit.com/search?q=\" + subtext;\n break;\n case \"q\":\n window.location = \"https://www.qwant.com/?q=\" + subtext;\n break;\n case \"so\":\n window.location = \"https://soundcloud.com/search?q=\" + subtext;\n break;\n case \"s\":\n window.location = \"https://open.spotify.com/search/results/\" + subtext;\n break;\n case \"t\":\n window.location = \"https://trakt.tv/search?query=\" + subtext;\n break;\n case \"tv\":\n window.location = \"https://www.thetvdb.com/search?query=\" + subtext;\n break;\n case \"y\":\n window.location = \"https://www.youtube.com/results?search_query=\" + subtext;\n break;\n case \"w\":\n window.location = \"https://en.wikipedia.org/w/index.php?search=\" + subtext;\n break;\n case \"p\":\n window.location = \"https://app.plex.tv/desktop/#!/search?query=\" + subtext;\n break;\n case \"rt\":\n window.location = \"https://www.rottentomatoes.com/search?search=\" + subtext;\n break;\n default :\n break;\n }\n } else {\n let option = text.substr(1);\n switch (option) {\n case \"d\":\n window.location = \"https://www.duckduckgo.com\";\n break;\n case \"y\":\n window.location = \"https://www.youtube.com\";\n break;\n case \"r\":\n window.location = \"https://reddit.com\";\n break;\n case \"s\":\n window.location = \"https://open.spotify.com\";\n break;\n default :\n break;\n }\n }\n } else if (validURL(text)) {\n if (containsProtocol(text))\n window.location = text;\n else\n window.location = \"https://\" + text;\n } else {\n window.location = \"https://www.google.com/search?q=\" + text;\n }\n}\nfunction validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?' + // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))' + // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*' + // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?' + // query string\n '(\\\\#[-a-z\\\\d_]*)?$', 'i'); // fragment locator\n return !!pattern.test(str);\n}\nfunction containsProtocol(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/){1}.*', 'i');\n return !!pattern.test(str);\n}\nString.prototype.replaceAll = function(search, replacement) {\n var target = this;\n return target.split(search).join(replacement);\n};\nfunction udpateDisplayedItems(e) {\n localStorage.setItem('contenttype', e.target.checked);\n if (e.target.checked) {\n localStorage.setItem('content-display', 'none');\n } else {\n localStorage.setItem('content-display', 'block');\n }\n setDisplayedItems();\n}\nfunction setDisplayedItems() {\n setValueFromLocalStorage('contenttype');\n setValueFromLocalStorage('content-display');\n}",{"ruleId":"9","severity":1,"message":"10","line":206,"column":11,"nodeType":"11","endLine":206,"endColumn":61},{"ruleId":"12","severity":1,"message":"13","line":607,"column":1,"nodeType":"14","messageId":"15","endLine":610,"endColumn":2},"jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-extend-native","String prototype is read only, properties should not be added.","AssignmentExpression","unexpected"] \ No newline at end of file diff --git a/package.json b/package.json index 6088a40f..b335c5bc 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "home-page", "version": "0.1.0", "private": true, + "homepage": ".", "dependencies": { "@testing-library/jest-dom": "^5.16.1", "@testing-library/react": "^11.2.7", diff --git a/src/index.css b/src/index.css index 4dfecc70..e565b691 100644 --- a/src/index.css +++ b/src/index.css @@ -154,7 +154,6 @@ a:hover #app-address{ z-index: 1; position: absolute; text-align: center; - color: red; } .keyword:focus:not(:placeholder-shown) + .Input-label{ visibility: visible;