Skip to content

Commit

Permalink
initial commit for final
Browse files Browse the repository at this point in the history
  • Loading branch information
clr14003 committed May 1, 2020
1 parent 1e804b6 commit f00d1d7
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 0 deletions.
1 change: 1 addition & 0 deletions web-three-twitter-boilerplate
Submodule web-three-twitter-boilerplate added at fdceac
Empty file added week-3/js/test.js
Empty file.
Binary file added week-6.zip
Binary file not shown.
64 changes: 64 additions & 0 deletions week-6/week-6/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* CSS files add styling rules to your content */

* {
box-sizing: border-box;
}

:root {
--board-size: 200px;
--line-color: grey;
--gap: 5px;
}

body {
font-family: Arial, Helvetica, sans-serif;

}

main {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}


.gameboard {
width: calc( (3 * var(--board-size)) + (2 * var(--gap)) );
display: grid;
grid-template-columns: repeat(3, var(--board-size) );
grid-template-rows: repeat(3, var(--board-size) );
place-items: stretch;
background-color: var(--line-color);
grid-gap: 5px;

}

.square {
display: flex;
justify-content: center;
align-items: center;
background-color: white;
color: #333;
font-size: var(--board-size);
line-height: var(--board-size);
text-transform: uppercase;
margin:0;
padding:0;
cursor: pointer;

}

.square:hover {
background-color: #eee;
}


.banner {
background-color: lightblue;
position: absolute;
top: 0px;
padding: 1em;
width: 100%;
text-align: center;
}
40 changes: 40 additions & 0 deletions week-6/week-6/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tic Tac Toe</title>
<link rel="stylesheet" href="css/style.css">



</head>
<body>


<main id="vue-app">

<div class="banner">
It's your turn, {{turn}}.
</div>

<div class="gameboard">

<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>

</div>

</main>

<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
<script src="js/tic-tac-toe.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions week-6/week-6/js/tic-tac-toe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var app = new Vue({
el: '#vue-app',
data: {
turn: 'x'
}
});
25 changes: 25 additions & 0 deletions week-7/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">

<title>Cocktail Browser</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

</head>

<body>
<div id="app">
<input type="text" v-model=searchValue placeholder="Search Query"><button @click="search">Search</button>
<ol>
<li v-for="drink in drinks">
<img v-bind:src="drink.strDrinkThumb" height="100" width="100"> {{ drink.strDrink }}
</li>
</ol>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="vue.js"></script>
</body>
</html>
24 changes: 24 additions & 0 deletions week-7/vue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//fetch('https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita').then(margarita => console.log(margarita))


var app = new Vue({
el: '#app',
data: {
drinks: [],
searchValue: null,
},
methods: {
search(){
fetch(`https://www.thecocktaildb.com/api/json/v1/1/search.php?s=${this.searchValue}`)
.then((response) => {
return response.json();
})
.then((data) => {
console.log(data)
this.drinks = data.drinks;
})


}
}
})

0 comments on commit f00d1d7

Please sign in to comment.