diff --git a/__pycache__/models.cpython-39.pyc b/__pycache__/models.cpython-39.pyc new file mode 100644 index 0000000..984425c Binary files /dev/null and b/__pycache__/models.cpython-39.pyc differ diff --git a/app.py b/app.py index c5da7f2..472b97b 100644 --- a/app.py +++ b/app.py @@ -44,6 +44,10 @@ def add_item(): return redirect(url_for('home')) return render_template('add_item.html') +@app.route('/motion') +def motion(): + return render_template('motion.html') + @app.route('/about') def about(): return render_template('about.html', now=dt.now()) diff --git a/static/css/motion.css b/static/css/motion.css new file mode 100644 index 0000000..fabff2b --- /dev/null +++ b/static/css/motion.css @@ -0,0 +1,103 @@ +.motion-test-1 { + width: 100px; + height: 100px; + background-color: red; + position: relative; + animation-name: color-move; + animation-duration: 4s; + animation-iteration-count: infinite; /* can be left off to run once, specify a number as desired or inifinite */ + animation-direction: alternate; /* can be left off for forward, reverse, alternate (forward then reverse), alternate-reverse (reverse then forward) */ +} + +.motion-test-2 { + width: 100px; + height: 50px; + background-color: red; + position: relative; + animation: from-to 5s; /* combines multiple animation options together for shorthand (name, duration, timing, delay, interations, direction)*/ + animation-iteration-count: infinite; /* can be left off to run once, specify a number as desired or inifinite */ + animation-direction: alternate; /* can be left off for forward, reverse, alternate (forward then reverse), alternate-reverse (reverse then forward) */ +} + +#linear { + animation-timing-function: linear; +} + +#ease { + animation-timing-function: ease; +} + +#ease-in { + animation-timing-function: ease-in; +} + +#ease-out { + animation-timing-function: ease-out; +} + +#ease-in-out { + animation-timing-function: ease-in-out; +} + +/* from-to pattern where from is 0% and to is 100% can only have these two options */ +@keyframes from-to { + from { + left: 0px; + } + + to { + left: 300px; + } +} + +/* % pattern where each line denotes the starting percent of the style */ +@keyframes percent { + 0% { + background-color: red; + } + + 50% { + background-color: yellow; + } + + 100% { + background-color: red; + } +} +/* uses pixel postions from 0,0 being top-left corner to move the element around +NEEDS: "position: relative;" on element to work +*/ +@keyframes color-move { + 0% { + background-color: red; + left: 0px; + top: 0px; + } + + 25% { + background-color: yellow; + left: 200px; + top: 0px; + transform: scale(1.5); + } + + 50% { + background-color: blue; + left: 200px; + top: 200px; + transform: scale(2); + } + + 75% { + background-color: green; + left: 0px; + top: 200px; + transform: scale(1.5); + } + + 100% { + background-color: red; + left: 0px; + top: 0px; + } +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index e41ed9f..b71e813 100644 --- a/templates/base.html +++ b/templates/base.html @@ -16,6 +16,7 @@ Add Item Weather Relative Rank + Motion Graphics About diff --git a/templates/motion.html b/templates/motion.html new file mode 100644 index 0000000..820449f --- /dev/null +++ b/templates/motion.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% block content %} + +
+
+
linear
+
ease
+
ease-in
+
ease-out
+
ease-in-out
+{% endblock %} \ No newline at end of file