Skip to content

Commit

Permalink
Moved all projects to "challenges" folder
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliodominguez committed Jan 7, 2022
1 parent e9a3ec4 commit a60c3f6
Show file tree
Hide file tree
Showing 88 changed files with 13 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions src/js/sass-compiler.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { readdir } from "fs";
import { execSync } from "child_process";
import chalk from "chalk";
import { resolve } from "path";

const args = process.argv.slice(2);
const challengesFolder = "challenges";

function compileSass(args) {
readdir(process.cwd(), (err, folders) => {
readdir(resolve([process.cwd(), challengesFolder].join("/")), (err, folders) => {
if (err) {
console.log(err);
return;
}

const path = folders.find(folder => folder.toLowerCase().includes(args.toLowerCase()));
const command = `sass ./"${path}"/scss/main.scss ./"${path}"/style.css --watch --style=compressed --no-source-map`;
const folder = `./${challengesFolder}/"${path}"`;
const command = `sass ${folder}/scss/main.scss ${folder}/style.css --watch --style=compressed --no-source-map`;

console.log(chalk.greenBright.bold(`🚀 Compiling SASS on the "${path}" project...`));
execSync(command, { stdio: "inherit" });
Expand Down
15 changes: 8 additions & 7 deletions src/js/scripts.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
const challenges = document.querySelector(".challenges");
const projectsFolder = "./challenges";
const projects = Object.freeze([
{
name: "Clock",
thumbnail: "./src/assets/clock.jpg",
url: "./1 - Clock/index.html"
url: `${projectsFolder}/1 - Clock/index.html`
},
{
name: "Rock, Paper, Scissors, Lizard, Spock",
thumbnail: "./src/assets/rock-paper-scissors-lizard-spock.png",
url: "./2 - Rock, Paper, Scissors, Lizard, Spock/index.html"
url: `${projectsFolder}/2 - Rock, Paper, Scissors, Lizard, Spock/index.html`
},
{
name: "Photo Filters",
thumbnail: "./src/assets/photo-filters.jpg",
url: "./3 - Photo Filters/index.html"
url: `${projectsFolder}/3 - Photo Filters/index.html`
},
{
name: "Pixel Art",
thumbnail: "./src/assets/pixel-art.png",
url: "./4 - Pixel Art/index.html"
url: `${projectsFolder}/4 - Pixel Art/index.html`
},
{
name: "Slider",
thumbnail: "./src/assets/slider.png",
url: "./5 - Slider/index.html"
url: `${projectsFolder}/5 - Slider/index.html`
},
{
name: "Puzzle",
thumbnail: "./src/assets/puzzle.png",
url: "./6 - Puzzle/index.html"
url: `${projectsFolder}/6 - Puzzle/index.html`
},
{
name: "Weather",
thumbnail: "./src/assets/weather.png",
url: "./7 - Weather/index.html"
url: `${projectsFolder}/7 - Weather/index.html`
}
]);

Expand Down

0 comments on commit a60c3f6

Please sign in to comment.