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

Mywork/branch #20

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7d319a7
worked on passanger counter, set up css and html, added variable in j…
veronika-pomy Nov 3, 2022
de00ad8
made clicker function in passanger counter app
veronika-pomy Nov 3, 2022
fb401d9
Merge pull request #1 from veronika-pomy/app/passanger-counter
veronika-pomy Nov 3, 2022
ce3cbd3
added save btn functionality to counter
veronika-pomy Nov 5, 2022
fc7394e
Merge pull request #2 from veronika-pomy/app/passanger-counter
veronika-pomy Nov 5, 2022
65ec360
finished passanger counter
veronika-pomy Nov 6, 2022
3d970ce
Merge pull request #3 from veronika-pomy/app/passanger-counter
veronika-pomy Nov 6, 2022
2aae59f
started blackjack app, worked with conditionals and booleans
veronika-pomy Nov 10, 2022
eabac77
Merge pull request #4 from veronika-pomy/app/blackjack
veronika-pomy Nov 10, 2022
71bf439
styled blackjack app with css, add button in html, added dom manipula…
veronika-pomy Nov 11, 2022
60f0c5d
styled blackjack app with css, add button in html, added dom manipula…
veronika-pomy Nov 11, 2022
39203fb
styled blackjack app with css, add button in html, added dom manipula…
veronika-pomy Nov 11, 2022
a07e294
Merge pull request #5 from veronika-pomy/app/blackjack
veronika-pomy Nov 11, 2022
7cf2457
rendered cards in JS file using for loop, arrays and .push()
veronika-pomy Nov 11, 2022
bd3ac13
Merge pull request #6 from veronika-pomy/app/blackjack
veronika-pomy Nov 11, 2022
b82f1e1
finished blackjack app, learned conditional logic, objects, and math …
veronika-pomy Nov 13, 2022
cc1cc90
Merge pull request #7 from veronika-pomy/app/blackjack
veronika-pomy Nov 13, 2022
bf49f0c
finished practice exercies
veronika-pomy Nov 16, 2022
3ef00f2
Merge pull request #8 from veronika-pomy/app/blackjack
veronika-pomy Nov 16, 2022
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
93 changes: 93 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Edge",
"port": 9222,
"request": "attach",
"type": "msedge",
"webRoot": "${workspaceFolder}"
},
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}"
},
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
},
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
},
{
"type": "pwa-msedge",
"name": "Launch Microsoft Edge",
"request": "launch",
"runtimeArgs": [
"--remote-debugging-port=9222"
],
"url": "/Users/veronika/.vscode/extensions/ms-edgedevtools.vscode-edge-devtools-2.1.1/out/startpage/index.html", // Provide your project's url to finish configuring
"presentation": {
"hidden": true
}
},
{
"type": "pwa-msedge",
"name": "Launch Microsoft Edge in headless mode",
"request": "launch",
"runtimeArgs": [
"--headless",
"--remote-debugging-port=9222"
],
"url": "/Users/veronika/.vscode/extensions/ms-edgedevtools.vscode-edge-devtools-2.1.1/out/startpage/index.html", // Provide your project's url to finish configuring
"presentation": {
"hidden": true
}
},
{
"type": "vscode-edge-devtools.debug",
"name": "Open Edge DevTools",
"request": "attach",
"url": "/Users/veronika/.vscode/extensions/ms-edgedevtools.vscode-edge-devtools-2.1.1/out/startpage/index.html", // Provide your project's url to finish configuring
"presentation": {
"hidden": true
}
}
],
"compounds": [
{
"name": "Launch Edge Headless and attach DevTools",
"configurations": [
"Launch Microsoft Edge in headless mode",
"Open Edge DevTools"
]
},
{
"name": "Launch Edge and attach DevTools",
"configurations": [
"Launch Microsoft Edge",
"Open Edge DevTools"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
html, body {
margin: 0;
padding: 0;
text-align: center;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<html>
<head><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
<link rel="stylesheet" href="index.css">
<title>Passanger Counter</title>
</head>
<body>
<h1>index.html</h1>
<script src="index.js"></script>
<h1>People Entered:</h1>
<h2 id="people-count">0</h2>
<script src="./index.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// javascript
document.getElementById("people-count").innerText = 80;
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
// Grab the welcome-el paragraph and store it in a variable called welcomeEl
let welcomeEl = document.getElementById("welcome-el");

// Create two variables (name & greeting) that contains your name
// and the greeting we want to render on the page
let name = "Wendy"
let greeting = "Welcome back"


// Render the welcome message using welcomeEl.innerText
welcomeEl.innerText = greeting + ", " + name;

// Add emoji to the end of the welcome message

welcomeEl.innerText += "😎";




37 changes: 37 additions & 0 deletions 1. Build a Passenger Counter App/my-work/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
body {
background-image: url("./station.jpg");
background-size: cover;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
font-weight: bold;
text-align: center;
}

h1 {
margin-top: 10px;
margin-bottom: 10px;
}

h2 {
font-size: 50px;
margin-top: 0;
margin-bottom: 20px;
}

button {
border: none;
padding-top: 10px;
padding-bottom: 10px;
color: white;
font-weight: bold;
width: 200px;
margin-bottom: 5px;
border-radius: 5px;
}

#increment-btn {
background: darkred;
}

#save-btn {
background: darkgreen;
}
15 changes: 15 additions & 0 deletions 1. Build a Passenger Counter App/my-work/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
<link rel="stylesheet" href="index.css">
<title>Passanger Counter</title>
</head>
<body>
<h1>People Entered:</h1>
<h2 id="count-el">0</h2>
<button id="increment-btn" onclick="incrementButtonClick()">INCREMENT</button>
<button id="save-btn" onclick="saveButtonClick()">SAVE</button>
<p id="save-el">Previous entries: </p>
<script src="./index.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions 1. Build a Passenger Counter App/my-work/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let saveEl = document.getElementById("save-el");
let countEl = document.getElementById("count-el");
let count = 0;
console.log(7);

function incrementButtonClick() {
count += 1;
countEl.textContent = count;
}

function saveButtonClick() {
let previousEntries = count + " - ";
saveEl.textContent += previousEntries;
count = 0;
countEl.textContent = count;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion 2. Practice time - part 1/1. Variables practice/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Create two variables, firstName and lastName
let firstName = "Wendy";
let lastName = "Jade";

// Concatenate the two variables into a third variable called fullName
let fullName = firstName + " " + lastName;

// Log fullName to the console

console.log(fullName);

Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ let greeting = "Hi there"

// Create a function that logs out "Hi there, Linda!" when called

function myGreeting() {
console.log(greeting + ", " + name + "!");
}

myGreeting();
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@ let myPoints = 3
// Create two functions, add3Points() and remove1Point(), and have them
// add/remove points to/from the myPoints variable

function add3Points() {
myPoints += 3;
}

function remove1Point() {
myPoints -= 1;
}

for (i = 0; i < 3; i++) {
add3Points()
}

for (x = 0; x < 2; x++) {
remove1Point()
}

// Call the functions to that the line below logs out 10
console.log(myPoints)
12 changes: 6 additions & 6 deletions 2. Practice time - part 1/4. Strings and numbers/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Try to predict what each of the lines will log out
console.log("2" + 2) //
console.log(11 + 7) //
console.log(6 + "5") //
console.log("My points: " + 5 + 9) //
console.log(2 + 2) //
console.log("11" + "14") //
console.log("2" + 2) // 22
console.log(11 + 7) // 18
console.log(6 + "5") // 65
console.log("My points: " + 5 + 9) // 59
console.log(2 + 2) // 4
console.log("11" + "14") // 1114
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<body>
<img src="images/shoe.jpeg" alt="Nike shoe">
<p>Nike shoe</p>
<button>Purchase - $149</button>
<button onclick="displayMessage()">Purchase - $149</button>
<p id="error"></p>
<script src="index.js"></script>
</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// When the user clicks the purchase button, render out
// "Something went wrong, please try again" in the paragraph
// that has the id="error".
// that has the id="error"

let errorEl = document.getElementById("error");
console.log(errorEl);

function displayMessage() {
errorEl.textContent = "Something went wrong, please try again";
}



10 changes: 5 additions & 5 deletions 2. Practice time - part 1/6. Calculator challenge/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<span id="num1-el"></span>
<span id="num2-el"></span>
<br>
<button>Add</button>
<button>Subtract</button>
<button>Divide</button>
<button>Multiply</button>
<button onclick = "add()" >Add</button>
<button onclick = "subtract()" >Subtract</button>
<button onclick = "divide()" >Divide</button>
<button onclick = "multiply()" >Multiply</button>
<br>
<span id="sum-el">Sum: </span>
<span id="sum-el"></span>
<script src="index.js"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions 2. Practice time - part 1/6. Calculator challenge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ document.getElementById("num1-el").textContent = num1
document.getElementById("num2-el").textContent = num2

// Create four functions: add(), subtract(), divide(), multiply()

let sumEl = document.getElementById("sum-el");

function add() {
numSum = num1 + num2;
sumEl.textContent = "Result: " + numSum;
}

function subtract() {
numSub = num1 - num2;
sumEl.textContent = "Result: " + numSub;
}

function divide() {
numDiv = num1 / num2;
sumEl.textContent = "Result: " + numDiv;
}

function multiply() {
numMult = num1 * num2;
sumEl.textContent = "Result: " + numMult;
}

// Call the correct function when the user clicks on one of the buttons
// Perform the given calculation using num1 and num2
// Render the result of the calculation in the paragraph with id="sum-el"
Expand Down
12 changes: 7 additions & 5 deletions 3. Build a Blackjack game/10. Add the message variable/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
let firstCard = 10
let secondCard = 11
let sum = firstCard + secondCard + 4
let secondCard = 4
let sum = firstCard + secondCard
let hasBlackJack = false
let isAlive = true
// 1. Declare a variable called message and assign its value to an empty string
let message = "";

// 2. Reassign the message variable to the string we're logging out
if (sum <= 20) {
console.log("Do you want to draw a new card? 🙂")
message = "Do you want to draw a new card? 🙂";
} else if (sum === 21) {
console.log("Wohoo! You've got Blackjack! 🥳")
message = "Wohoo! You've got Blackjack! 🥳";
hasBlackJack = true
} else {
console.log("You're out of the game! 😭")
message = "You're out of the game! 😭";
isAlive = false
}

// 3. Log it out!
console.log(message);
5 changes: 4 additions & 1 deletion 3. Build a Blackjack game/11. Link to stylesheet/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<html>
<head><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
<head>
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css"> -->
<link rel="stylesheet" href="./index.css">
<!-- Link to the index.css file
E.g. search for "how to link to css from html" -->

</head>
<body>
<h1>Blackjack</h1>
Expand Down
Loading