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

Lab flask branch #217

Open
wants to merge 6 commits into
base: master
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
23 changes: 23 additions & 0 deletions Assignment/HW3-JS_ToDo_List/_js/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}


$(document).ready(
$("#new-item").on('click', function() {
// console.log("haiiii");
// once the document loads, create new item with this function
var user_input = $('#todo-item-input').val();
// alert(user_input);
$('#list_todo').prepend("<li>"+ user_input + " <button> Yasss! Add to Completed List </button>" + "</li>").css('color', 'red');
})
);

$("#list_todo").on('click', "button", function() {
// move from list_todo container to list_completed container
$(this).html("Oops. Add Back to To-Do List");
var completedItem = $(this).parent()
$("#list_completed").prepend(completedItem);
$(completedItem).css('color', getRandomColor());
});

$("#list_completed").on('click', "button", function() {
// move back from list_completed container to list_todo container
$(this).html("Finally! Add to Completed List");
var todoItem = $(this).parent()
$("#list_todo").prepend(todoItem);
$(todoItem).css('color', 'red');

});
10 changes: 7 additions & 3 deletions Assignment/HW3-JS_ToDo_List/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@

<title> Homework4 Javascript and jQuery </title>
<link rel="stylesheet" href="_css/style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>

</head>
<body>
<header>
<h1 id="site-title">Emily's Giant List of Shit To Do</h1>
<!-- create input tag for user input -->
<input>
<input id = "todo-item-input">

<!-- button takes input and adds a new element with content to 'list_do' -->
<button id="new-item"> </button>

<button id="new-item"> Add to To-Do List! </button>

<h1> To-Do List </h1>
<!-- ability to move items between list_todo and list_completed -->
<div id="list_todo"> </div>
<h1> Completed List </h1>
<div id="list_completed"> </div>

<script type="text/javascript" src="_js/main.js"> </script>
Expand Down
Binary file not shown.
Empty file.
51 changes: 51 additions & 0 deletions Assignment/Homework_1 - HTML/Emily_pokedex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>Pokedex</title>
</head>
<body BGCOLOR="FFFFFF">
<!-- <center><img src="Afraid-To-Ask-Andy.jpg" align="BOTTOM"> </center>
<hr>
<p><a href="http://google.com">Link Name</a> is a link to another nifty site</p> -->
<header>
<button id="Dropdown">Dropdown</button>
<h1 id="Pokedex">Pokedex</h1>
</header>
<article>
<section>
<input placeholder="SearchPokemon"></input>
<p id="Poke ID">No.001 Pikachu</p>
<ul id="listaboutpokes">
<li>Electric type</li>
<li>Gentle temperment</li>
<li>Grasslands</li>
</ul>
<p id="pokescription">Pickahu can be seen napping in a bright sunlight. It has two red dots on its cheeks. By practicing html and css Pikachu can learn confusion. Pikachu likes to steal computer chargers from sleeping college students.</p>
</section>
</article>
<section>
<img src="assets/images/abra.png">
<img src="assets/images/charmander.png">
<img src="assets/images/charmeleon.png">
<img src="assets/images/clafary.png">
<img src="assets/images/firething.png">
<img src="assets/images/horsea.png">
</section>
<section>
<img src="assets/images/jigglyppuff.png">
<img src="assets/images/nidorino.png">
<img src="assets/images/whatisthat.png">
<img src="assets/images/pidgey.png">
<img src="assets/images/vulpix.png">
<img src="assets/images/wartortle.png">
</section>
<footer>
<nav>
<button><a href="#Pokedex">BACK</a></button>
<button><a href="map.html">MAP</a></button>
<button><a href="area.html">AREA</a></button>
<button><a href="#pokescription">NEXT</a></button>
</nav>
</footer>
</body>
</html>
10 changes: 10 additions & 0 deletions Assignment/Homework_1 - HTML/area.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Area</title>
</head>
<body BGCOLOR="FFFFFF">
<p><a href="map.html">Map</a> is a link to the Map site!</p>
<p><a href="Emily_pokedex.html">Pokedex</a> is a link to the Pokedex!</p>
</body>
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8,582 changes: 0 additions & 8,582 deletions Assignment/Homework_2 - CSS_ResponsiveDesign/pokedex_ipad.ai

This file was deleted.

Binary file not shown.
8,180 changes: 0 additions & 8,180 deletions Assignment/Homework_2 - CSS_ResponsiveDesign/pokedex_iphone6.ai

This file was deleted.

Binary file not shown.
8,585 changes: 0 additions & 8,585 deletions Assignment/Homework_2 - CSS_ResponsiveDesign/pokedex_laptop.ai

This file was deleted.

Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions Labs/Lab 4 - Responsive Design/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Carlo Liquido</title>
<title>Emily Witt</title>
<!-- Load stylesheets based on viewport -->
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" type="text/css" media="(max-width: 667px)" href="small.css">
<link rel="stylesheet" type="text/css" media="(min-width: 668px) and (max-width: 800px)" href="medium.css">
<link rel="stylesheet" type="text/css" media="(min-width: 500px) and (max-width: 700px)" href="small.css">
<link rel="stylesheet" type="text/css" media="(min-width: 500px) and (max-width: 700px)" href="medium.css">
<!-- Load in custom fonts -->
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Arimo' rel='stylesheet' type='text/css'>
</head>

<body>
<header>
<h1 id="site-title"> Disney gone Kareoke </h1>
<h1 id="site-title"> Wonderful World of KaraOKE! </h1>
<nav id="navigation">
<a class="nav-button" href="#">Mulan</a>
<a class="nav-button" href="#projects">Beauty and the Beast</a>
Expand Down Expand Up @@ -147,7 +147,7 @@ <h3 class="project-title">Tweetday</h3>
</div>

<footer>
<span>Contact me: meow@berkeley.edu</span>
<span>Contact me: woof@ischool.berkeley.edu</span>
</footer>
</body>
</html>
162 changes: 162 additions & 0 deletions Labs/Lab3 - CSS/grid-style-emily.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*----------------- CSS RESET ------------------*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
font-family: Arial, Helvetica, sans-serif;
color:#4d94ff;

}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

/*----------------- CSS RESET ------------------*/

body {
font-size: 18px;
}

header, footer {
width: 100%;
background: #4d94ff;
color: #ffffff;
box-sizing: border-box;
height: 50px;
line-height: 50px;
text-align: center;
}

header {
display: inline-block;
}

footer {
/* float: left;*/
margin-top: 2em;
clear: both;
color: #ffffff;
position: fixed;
bottom: 0;
}

nav {
width: 50%;
margin-left: 25%;
}

img {
max-width: 100%;
max-height: 100%;
border: 1px solid #adadad;
}

h2 {
font-size: 1.5em;
color: #ffffff;
}

h3 {
font-size: 1.33em;
font-weight: bold;
padding: 20px;
}

a {
text-decoration: none;
}

#site-title {
float: left;
width: 25%;
text-align: center;
}

.nav-button {
color: #ffffff;
display: inline-block;
background: none;
height: 100%;
width: 150px;
border-left: 1px solid #ffffff;
border-right: 1px solid #ffffff;
margin-left: -5px;
}

.nav-button:hover {
background: #80b3ff;
}

a.nav-button:visited {
color: #ffffff;
}


/*START HERE*/

.other-news-container {
display: inline-block;
width: 25%; /* sets to 25% of body tag, because other-news-container is in body */

}

.main-container {
/*float: left;*/
display: inline-block;
width: 58%;

}

.ib-grid-item { /* styles all the ib-grid-items using a single element in the css */
display: inline-block;
width: 33%;
margin-bottom: 10%; /* 5% of .main-container */
}

.ib-grid-item img {
max-width: 66.67%;
max-height: 66.67%; /* of div class ib-grid-item */
}

.other-news-item {
box-sizing: border-box;
padding: 0 10%;
margin-bottom: 10%;

}
Binary file added Labs/flaskLab2/.spyderworkspace
Binary file not shown.
4 changes: 4 additions & 0 deletions Labs/flaskLab2/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from flask import Flask

myapp = Flask(__name__)
from app import views
Binary file added Labs/flaskLab2/app/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions Labs/flaskLab2/app/static/interactions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$('#submit-survey').on('click', function submitSurvey() {
var color = $("input[name=color]").val();
var food = $("input[name=food]").val();
var vacation = $("input[name=vacation]").val();
var feBefore = $("input[name=front-end-before]").val();
var feAfter = $("input[name=front-end-after]").val();
$.post("submit-survey",
{color:color,
food:food,
vacation:vacation,
feBefore:feBefore,
feAfter:feAfter},
function(data){
$("html").html(data);
}
)
});

$("#results-email-container").on('click', '#email-results-button', function emailResults() {
console.log($(this));
});

$("#site-title-wrapper").on('click', function goHome() {
window.location.href = '/';
});

$(document).ready(function applySliderLabels() {
var currentValue = $("#fe-before").val();
$("#fe-before").next().html(currentValue);

currentValue = $("#fe-after").val();
$("#fe-after").next().html(currentValue);
});


$("input[type='range']").on('change', function updateLabel() {
var currentValue = $(this).val();
$(this).next().html(currentValue);
});
Loading