diff --git a/Labs/.DS_Store b/Labs/.DS_Store new file mode 100644 index 0000000..fafaf41 Binary files /dev/null and b/Labs/.DS_Store differ diff --git a/Labs/Lab_Flask/app/.DS_Store b/Labs/Lab_Flask/app/.DS_Store new file mode 100644 index 0000000..9ff4790 Binary files /dev/null and b/Labs/Lab_Flask/app/.DS_Store differ diff --git a/Labs/Lab_Flask/app/__init__.py b/Labs/Lab_Flask/app/__init__.py new file mode 100755 index 0000000..9a4e940 --- /dev/null +++ b/Labs/Lab_Flask/app/__init__.py @@ -0,0 +1,4 @@ +from flask import Flask + +myapp = Flask(__name__) +from app import views diff --git a/Labs/Lab_Flask/app/__init__.pyc b/Labs/Lab_Flask/app/__init__.pyc new file mode 100755 index 0000000..4d4e5ad Binary files /dev/null and b/Labs/Lab_Flask/app/__init__.pyc differ diff --git a/Labs/Lab_Flask/app/__pycache__/__init__.cpython-35.pyc b/Labs/Lab_Flask/app/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..8fdf5b8 Binary files /dev/null and b/Labs/Lab_Flask/app/__pycache__/__init__.cpython-35.pyc differ diff --git a/Labs/Lab_Flask/app/__pycache__/views.cpython-35.pyc b/Labs/Lab_Flask/app/__pycache__/views.cpython-35.pyc new file mode 100644 index 0000000..f624f53 Binary files /dev/null and b/Labs/Lab_Flask/app/__pycache__/views.cpython-35.pyc differ diff --git a/Labs/Lab_Flask/app/static/interactions.js b/Labs/Lab_Flask/app/static/interactions.js new file mode 100755 index 0000000..bc8386b --- /dev/null +++ b/Labs/Lab_Flask/app/static/interactions.js @@ -0,0 +1,38 @@ +$('#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); +}); \ No newline at end of file diff --git a/Labs/Lab_Flask/app/static/main.css b/Labs/Lab_Flask/app/static/main.css new file mode 100755 index 0000000..d5f7b1b --- /dev/null +++ b/Labs/Lab_Flask/app/static/main.css @@ -0,0 +1,231 @@ +/*----------------- 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; +} +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 ------------------*/ + +html, body { + background-color: #f9f9f9; + font-family: 'Open Sans', sans-serif; + font-size: 16px; +} + +header { + background-color: #1abc9c; + box-shadow: 0 2px 6px 1px #a7a7a7; + color: #ecf0f1; + height: 5rem; +} + +footer { + background-color: #16a085; + bottom: 0; + color: #ecf0f1; + height: 7rem; + margin-top: 2em; + text-align: center; + width: 100%; +} + +footer p { + height: 7rem; + line-height: 7rem; +} + +h1, h3 { + padding: 4px; +} + +h1 { + font-size: 2rem; + font-weight: bold; +} + +h3 { + font-size: 1.4rem; +} + +a { + text-decoration: none; +} + +input[type="text"], input[type="range"] { + border: 1px solid #bdc3c7; + border-radius: 2px; + margin-left: 1rem; + vertical-align: middle; +} + +input[type=range]{ + -webkit-appearance: none; +} + +input[type=range]::-webkit-slider-thumb { + -webkit-appearance: none; + border: none; + height: 1.2rem; + width: 1.2rem; + border-radius: 50%; + background: #1abc9c; + margin-top: -.5rem; +} + +input[type=range]::-webkit-slider-runnable-track { + background: #ccc; + height: .2rem; +} + +.action-button { + background-color: #1abc9c; + border: none; + border-bottom: 3px solid #16a085; + border-radius: 2px; + color: #ecf0f1; + display: inline-block; + font-size: 1rem; + font-weight: bold; + height: 3rem; + padding: 4px; + width: 6rem; +} + +.action-button:hover { + background-color: #16a085; +} + +#site-title-wrapper { + display: inline-block; + height: 5rem; + width: 15%; +} + +#site-icon-wrapper { + display: inline-block; + margin-left: 1rem; + margin-top: -.5rem; + vertical-align: middle; + width: 2.5rem; +} + +#site-icon-wrapper img { + display: inline-block; + max-height: 100%; + max-width: 100% +} + +#site-title { + display: inline-block; + font-weight: bold; + height: 5rem; + line-height: 5rem; + margin-left: .1rem; +} + +#username { + margin-right: .7rem; +} + +#logout { + float: right; + height: inherit; + line-height: 5rem; + margin-right: 1rem; +} + +#logout-button { + background-color: #ecf0f1; + border-bottom-color: #bdc3c7; + color: #222222; + height: 2.5rem; + width: 5rem; +} + +#logout-button:hover { + background-color: #bdc3c7; +} + +#content { + margin-top: 2rem; + text-align: center; + width: 100%; +} + +.main-container { + background: #ecf0f1; + border-radius: 4px; + box-shadow: 0px 2px 10px 2px #95a5a6; + display: block; + min-height: 50vh; + margin: 2rem 0 0 25%; + padding: 1rem; + text-align: left; + width: 50%; +} + +.survey-item, .result-item, #results-email-container { + box-sizing: border-box; + display: block; + margin: 1.5rem 0; + padding: 4px; +} + +.survey-item span { + font-size: 1rem; + margin-left: 1rem; +} + +#email-results-button, #goHome { + height: 2rem; + line-height: 2rem; + margin-left: 1rem; + text-align: center; +} + +#mean-girls-gif { + display: block; + margin-left: auto; + margin-right: auto; +} + diff --git a/Labs/Lab_Flask/app/templates/.DS_Store b/Labs/Lab_Flask/app/templates/.DS_Store new file mode 100644 index 0000000..6ef9ee8 Binary files /dev/null and b/Labs/Lab_Flask/app/templates/.DS_Store differ diff --git a/Labs/Lab_Flask/app/templates/base.html b/Labs/Lab_Flask/app/templates/base.html new file mode 100755 index 0000000..eb802bc --- /dev/null +++ b/Labs/Lab_Flask/app/templates/base.html @@ -0,0 +1,33 @@ + + + +
+ +
+
+