Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

William velichko #1260

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
82 changes: 70 additions & 12 deletions components/Article.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const data = [
{
title: 'BloomTech Students: "We\'re the best!"',
date: 'Nov 5th, 2018',
date: "Nov 5th, 2018",
firstParagraph: `Lucas ipsum dolor sit amet ben twi'lek padmé darth darth darth moff hutt organa twi'lek. Ben amidala secura skywalker lando
moff wicket tatooine luke.Solo wampa wampa calrissian yoda moff.Darth grievous darth gonk darth hutt.Darth baba skywalker
watto fett jango maul han.Mon ewok sidious sidious lando kenobi grievous gamorrean solo.Yoda wedge utapau darth calamari.
Expand All @@ -21,11 +21,11 @@ const data = [
thirdParagraph: `Dagobah hutt jawa leia calamari ventress skywalker yoda. Binks wicket hutt coruscant sidious
naboo ackbar tatooine. Hutt lars padmé darth. Maul solo darth darth jabba qui-gon chewbacca darth maul. Moff baba wicket
han. C-3po antilles moff qui-gon ahsoka aayla dooku amidala. Palpatine droid amidala droid k-3po twi'lek padmé wookiee. Leia
moff calamari mon obi-wan. Solo grievous lando coruscant. Jinn darth palpatine obi-wan mon.`
moff calamari mon obi-wan. Solo grievous lando coruscant. Jinn darth palpatine obi-wan mon.`,
},
{
title: 'Javascript and You, ES6',
date: 'May 7th, 2019',
title: "Javascript and You, ES6",
date: "May 7th, 2019",
firstParagraph: `Alohamora wand elf parchment, Wingardium Leviosa hippogriff, house dementors betrayal. Holly, Snape centaur portkey ghost
Hermione spell bezoar Scabbers. Peruvian-Night-Powder werewolf, Dobby pear-tickle half-moon-glasses, Knight-Bus. Padfoot
snargaluff seeker: Hagrid broomstick mischief managed. Snitch Fluffy rock-cake, 9 ¾ dress robes I must not tell lies. Mudbloods
Expand All @@ -41,11 +41,11 @@ const data = [
thirdParagraph: `Toad-like smile Flourish and Blotts he knew I’d come back Quidditch World Cup. Fat Lady baubles banana fritters fairy lights
Petrificus Totalus. So thirsty, deluminator firs’ years follow me 12 inches of parchment. Head Boy start-of-term banquet Cleansweep Seven
roaring lion hat. Unicorn blood crossbow mars is bright tonight, feast Norwegian Ridgeback. Come seek us where our voices sound, we cannot
sing above the ground, Ginny Weasley bright red. Fanged frisbees, phoenix tears good clean match.`
sing above the ground, Ginny Weasley bright red. Fanged frisbees, phoenix tears good clean match.`,
},
{
title: 'React vs Angular vs Vue',
date: 'June 7th, 2019',
title: "React vs Angular vs Vue",
date: "June 7th, 2019",
firstParagraph: `Bulbasaur Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ivysaur Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Venusaur Lorem ipsum dolor sit amet, consectetur adipiscing elit. Charmander Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Charmeleon Lorem ipsum dolor sit amet, consectetur adipiscing elit. Charizard Lorem ipsum dolor sit amet,
Expand All @@ -69,11 +69,11 @@ const data = [

thirdParagraph: `Gotta catch 'em all Horsea gym Ninjask Absol Sinnoh Poliwag. Gotta catch 'em all Youngster wants to fight Soda Pop Floatzel
Leech Life Seismitoad Ariados. Earthquake Pokemon Glitch City Tail Whip Skitty Ekans Dialga. Ut aliquip ex ea commodo consequat James
Castform Lotad the power that's inside Burnt Berry Makuhita. Ghost Ariados Corphish Dusclops Golbat Gligar Zweilous.`
Castform Lotad the power that's inside Burnt Berry Makuhita. Ghost Ariados Corphish Dusclops Golbat Gligar Zweilous.`,
},
{
title: 'Professional Software Development in 2019',
date: 'Jan 1st, 2019',
title: "Professional Software Development in 2019",
date: "Jan 1st, 2019",
firstParagraph: `Hodor hodor HODOR! Hodor hodor - hodor, hodor. Hodor hodor... Hodor hodor hodor; hodor hodor. Hodor hodor hodor, hodor, hodor
hodor. Hodor, hodor. Hodor. Hodor, hodor - hodor... Hodor hodor hodor; hodor HODOR hodor, hodor hodor?! Hodor hodor, hodor.
Hodor hodor hodor hodor hodor! Hodor hodor - HODOR hodor, hodor hodor hodor hodor hodor; hodor hodor? `,
Expand All @@ -85,10 +85,68 @@ const data = [

thirdParagraph: `Hodor hodor - hodor... Hodor hodor hodor hodor. Hodor. Hodor! Hodor hodor, hodor hodor hodor hodor hodor; hodor hodor? Hodor!
Hodor hodor, HODOR hodor, hodor hodor?! Hodor! Hodor hodor, HODOR hodor, hodor hodor, hodor, hodor hodor. Hodor, hodor.
Hodor. Hodor, hodor, hodor. Hodor hodor... Hodor hodor hodor?! Hodor, hodor... Hodor hodor HODOR hodor, hodor hodor. Hodor.`
}
Hodor. Hodor, hodor, hodor. Hodor hodor... Hodor hodor hodor?! Hodor, hodor... Hodor hodor HODOR hodor, hodor hodor. Hodor.`,
},
{
title: "Career life changing stories",
date: "March 13, 2020",
firstParagraph: `Hodor hodor HODOR! Hodor hodor - hodor, hodor. Hodor hodor... Hodor hodor hodor; hodor hodor. Hodor hodor hodor, hodor, hodor
hodor. Hodor, hodor. Hodor. Hodor, hodor - hodor... Hodor hodor hodor; hodor HODOR hodor, hodor hodor?! Hodor hodor, hodor.
Hodor hodor hodor hodor hodor! Hodor hodor - HODOR hodor, hodor hodor hodor hodor hodor; hodor hodor? `,

secondParagraph: `Hodor, hodor. Hodor. Hodor, hodor, hodor. Hodor hodor, hodor. Hodor hodor, hodor, hodor hodor. Hodor! Hodor hodor, hodor;
hodor hodor hodor? Hodor, hodor. Hodor. Hodor, hodor - HODOR hodor, hodor hodor hodor! Hodor, hodor. Hodor. Hodor, HODOR
hodor, hodor hodor, hodor, hodor hodor. Hodor hodor - hodor - hodor... Hodor hodor hodor hodor hodor hodor hodor?! Hodor
hodor - hodor hodor hodor. Hodor. Hodor hodor... Hodor hodor hodor hodor hodor? `,

thirdParagraph: `Hodor hodor - hodor... Hodor hodor hodor hodor. Hodor. Hodor! Hodor hodor, hodor hodor hodor hodor hodor; hodor hodor? Hodor!
Hodor hodor, HODOR hodor, hodor hodor?! Hodor! Hodor hodor, HODOR hodor, hodor hodor, hodor, hodor hodor. Hodor, hodor.
Hodor. Hodor, hodor, hodor. Hodor hodor... Hodor hodor hodor?! Hodor, hodor... Hodor hodor HODOR hodor, hodor hodor. Hodor.`,
},
];

function articleMaker(obj) {
const wrappedDiv = document.createElement("article");
const title = document.createElement("h2");
const par = document.createElement("p");
const par1 = document.createElement("p");
const par2 = document.createElement("p");
const par3 = document.createElement("p");
const expandElem = document.createElement("span");

wrappedDiv.appendChild(title);
wrappedDiv.appendChild(par);
wrappedDiv.appendChild(par1);
wrappedDiv.appendChild(par2);
wrappedDiv.appendChild(par3);
wrappedDiv.appendChild(expandElem);

wrappedDiv.classList.add("article");
title.textContent = obj.title;
par.classList.add("date");
par.textContent = obj.date;
par1.textContent = obj.firstParagraph;
par2.textContent = obj.secondParagraph;
par3.textContent = obj.thirdParagraph;
expandElem.classList.add("expandButton");
expandElem.textContent = "+";

expandElem.addEventListener("click", () => {
wrappedDiv.classList.toggle("article-open");
});

return wrappedDiv;
}

const mainArticle = document.querySelector(".articles");

data.forEach((item) => {
const loop = articleMaker(item);
mainArticle.appendChild(loop);
});

console.log(articleMaker(data));

/*
Step 1: Write a component called 'articleMaker' to create an article.
Your component is a function that takes an article object as its only argument,
Expand Down
68 changes: 63 additions & 5 deletions components/Menu.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,51 @@
// This is the data we will be using, study it but don't change anything, yet.

let menuItems = [
'Students',
'Faculty',
"Students",
"Faculty",
"What's New",
'Tech Trends',
'Music',
'Log Out'
"Tech Trends",
"Music",
"Log Out",
];

function menuMaker(items) {
const table = document.createElement("div");
const list = document.createElement("ul");
//const stuff = document.createElement("li");

//const itemButton = document.createElement("button");

table.appendChild(list);
table.classList.add("menu");
//list.appendChild(stuff);
//stuff.appendChild(itemButton);

items.forEach((linkText) => {
const link = document.createElement("li");
link.textContent = linkText;
list.appendChild(link);
});

//uli.classList.add("menu--open");

//stuff.textContent = items;

const menuButton = document.querySelector(".menu-button");
menuButton.addEventListener("click", () => {
table.classList.toggle("menu--open");
});

return table;
}
console.log(menuMaker(menuItems));

document.querySelector(".header").appendChild(menuMaker(menuItems));
// menuItems.forEach((elem) => {
// let newElem = menuMaker(elem);
// document.querySelector(".header").appendChild(newElem);
// });

/*
Step 1: Write a component called 'menuMaker' to create a menu like the markup below:

Expand All @@ -31,3 +68,24 @@ let menuItems = [

Step 6: Use 'menuMaker' to create a menu using the 'menuItems' array, and append the returned menu to the header.
*/

//const head = document.querySelector(".header");
const mainTitle = document.querySelector("h1");

mainTitle.addEventListener("mouseover", (evt) => {
evt.target.style.fontSize = "60px";
});

mainTitle.addEventListener("mouseleave", (evt) => {
evt.target.style.fontSize = "57px";
});

const button = document.querySelector("img");

button.addEventListener("mouseover", (evt) => {
evt.target.style.width = "55px";
});

button.addEventListener("mouseleave", (evt) => {
evt.target.style.width = "48px";
});
Loading