Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "airbnb-base",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer simple and less opinionated eslint:recommended in this project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I would leave all formatting on Prettier without any ESLint overrides, so if you add https://github.com/prettier/eslint-config-prettier as next config it overrides any rules that Prettier uses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prichodko Yeah, I think eslint:recommended would be a far less aggressive pick. Hm, I didn't pick eslint-config-prettier because it might class with Airbnb but if we're going to lean more on Prettier, then it's desirable I guess.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's why I am trying to make a clear distinction between ESLint (catching bugs) and Prettier (code style), because it makes the whole configuration much easier.


"env": {
"browser": true,
"node": true
}
}
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"editor.formatOnSave": true
"editor.formatOnSave": true,

"javascript.format.enable": false,

"prettier.eslintIntegration": true,

"[html]": {
"editor.formatOnSave": false
}
}
11 changes: 5 additions & 6 deletions docs/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
html {
position: relative;
font-size: 125%;
font-family: Inconsolata, Consolas, "SFMono-Regular", Menlo,
"DejaVu Sans Mono", monospace;
font-family: Inconsolata, Consolas, 'SFMono-Regular', Menlo, 'DejaVu Sans Mono', monospace;
line-height: 1.25;
background-color: var(--page-background);
}
Expand All @@ -90,7 +89,7 @@ html[data-loaded] {
}

html:before {
content: "";
content: '';
position: absolute;
display: block;
top: 0;
Expand Down Expand Up @@ -189,7 +188,7 @@ h1 {
width: 45%;
height: 45%;
margin: 2.5%;
outline : 1px solid transparent;
outline: 1px solid transparent;
animation: var(--logo-tiles-in-animation);
}

Expand Down Expand Up @@ -261,8 +260,8 @@ footer p {
animation-delay: calc(var(--move-in-base-delay) * 11);
}

footer [href*="github"]:hover,
footer [href*="github"]:focus {
footer [href*='github']:hover,
footer [href*='github']:focus {
color: var(--green);
}

Expand Down
6 changes: 3 additions & 3 deletions docs/theme/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
border-radius: 0.6rem;
}

.theme__button[value="dark"] {
.theme__button[value='dark'] {
background: black;
}

.theme__button[value="light"] {
.theme__button[value='light'] {
background: white;
}

Expand Down Expand Up @@ -109,7 +109,7 @@ body.js-theme-light {

body.js-theme-code {
color: lightslategrey;
font-family: "Courier New", Courier, monospace;
font-family: 'Courier New', Courier, monospace;
}

.js-theme-light .theme__button {
Expand Down
26 changes: 14 additions & 12 deletions docs/theme/theme.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
var $body = document.body;
var $themeBtns = document.querySelectorAll(".js-theme-button");
const $body = document.body;
const $themeBtns = document.querySelectorAll('.js-theme-button');

$themeBtns[0].setAttribute("disabled", true);
$themeBtns[0].setAttribute('disabled', true);

$themeBtns.forEach(function(ele) {
ele.onclick = function(e) {
var selectedName = e.target.value;
$themeBtns.forEach((ele) => {
const element = ele;

$themeBtns.forEach(function(ele) {
var themeName = ele.value;
element.onclick = function onClick(e) {
const selectedName = e.target.value;

$themeBtns.forEach((btn) => {
const themeName = btn.value;
if (themeName === selectedName) return;
$body.classList.remove("js-theme-" + themeName);
ele.removeAttribute("disabled");
$body.classList.remove(`js-theme-${themeName}`);
ele.removeAttribute('disabled');
});

$body.classList.add("js-theme-" + selectedName);
ele.setAttribute("disabled", true);
$body.classList.add(`js-theme-${selectedName}`);
ele.setAttribute('disabled', true);
};
});
Loading