SlideShare a Scribd company logo
1 of 36
Download to read offline
Build Your Own Instagram-like Filters
with JavaScript
Visit this link to Download Sublime, Firefox & Starter Code
bit.ly/instagram-dc
WIFI: In3Guest
November 2017
Note
Sublime Text is the text editor we'll be using. We'll
be opening our HTML files in Firefox. Please make
sure you have both downloaded and installed.
bit.ly/instagram-dc
Instructor
TJ Stalcup
Lead Mentor @Thinkful
API Evangelist @WealthEngine
Pokemon Master
Assistant Instructors
bit.ly/instagram-dc
About you
Your name
What brought you to the workshop tonight?
What is your programming experience?
bit.ly/instagram-dc
About us
Thinkful prepares students for web development and
data science jobs with 1-on-1 mentorship programs
bit.ly/instagram-dc
Goals
Set up static website using JavaScript
HTML + JavaScript basics
Access third-party library in JavaScript
Build v1 of Instagram app
Advanced challenges
bit.ly/instagram-dc
The starter code
Download and unzip the starter files into a folder
on your Desktop (four files total). Open index.html
and index.js in Sublime Text.
http://bit.ly/tf-instagram-starter
bit.ly/instagram-dc
Demo
Open index.html in Firefox
bit.ly/instagram-dc
Demo
Click "Apply Filter" to see the image change
bit.ly/instagram-dc
Demo
Click "Revert Filter" to see the image change back
bit.ly/instagram-dc
HTML Overview
HTML is the content and structure of a webpage
It's the skeleton of your website.
bit.ly/instagram-dc
HTML tags
Every tag starts with a "less than" sign and ends
with a "greater than" sign
<html> #an HTML opening tag
<body> #a body opening tag
<h1>Hello, World!</h1>
#a set of h1 tags with content
</body> #a body closing tag
</html> #an HTML closing tag
bit.ly/instagram-dc
More about HTML tags
There are opening tags and closing tags - closing
tags have a backslash before the tag name
(</html>)
Tags instruct a browser about the structure of
our website
There are hundreds of built-in tags but you'll
use the same few a lot
bit.ly/instagram-dc
HTML attributes
HTML attributes set properties on an element -
they are set in the opening tag
href is an attribute that sets the destination of a link
<a href="https://somewhere.com">This is
a link</a>
id is another attribute that identifies elements
(for CSS & JavaScript)
<h1 id="headline">This is a headline</h1>
bit.ly/instagram-dc
Basic functions
A function lets you separate your code into bite-
sized pieces which you can use over and over again.
When you write a function to use later, you are
"declaring" it. When you use (or run) that function
you are "calling" it.
bit.ly/instagram-dc
Example
Declaring a function
Calling a function
function doSomething(){
alert("Done!");
}
doSomething();
bit.ly/instagram-dc
More about basic functions
Functions can save us time because we use them
over and over in code. They are building blocks.
Make your code more organized and easier to read
JavaScript has many built-in functions
You'll write many, many functions in your
programs
bit.ly/instagram-dc
Let's work through the rest of the HTML
<body>
<img id="my-image" src="test-image.png">
<br>
<button onClick="revertFilter()">Revert Filter</button>
<button onClick="applyFilter()">Apply Filter</button>
</body>
bit.ly/instagram-dc
JavaScript overview
<script type="text/javascript" src="index.js"></script>
If HTML is the skeleton of a website, JavaScript is the
brains. JavaScript controls the behavior of our app.
We'll write our JavaScript in the index.js file.
We'll then import the file using similar syntax.
bit.ly/instagram-dc
Adding our functions to index.js
function revertFilter(){
//add code here
}
function applyFilter(){
//add code here
}
bit.ly/instagram-dc
What is a third-party library?
In Javascript, we use third-party libraries to do cool
things. A third-party library is a JavaScript file that
contains a bunch of functions that someone else wrote
for us. There are a ton of these in every language.
bit.ly/instagram-dc
The CamanJS library
We'll be using the CamanJS library. ( )camanjs.com
bit.ly/instagram-dc
Importing the CamanJS library
The CamanJS library is included in your starter code.
Import it at the top of your index.html file using the
syntax above.
<script type="text/javascript" src="caman.full.min.js"></script>
bit.ly/instagram-dc
Documentation
How do we know what functions we can use? We could
look at the library source file, if it's short, or better, we
could look at the documentation.
All common libraries will have documentation with a list
of available functions and/or real-world examples.
bit.ly/instagram-dc
Note
A core part of being a developer is constantly learning
new languages, tools, libraries, and frameworks. They
will all be documented and you should get used to
finding answers through these resources.
bit.ly/instagram-dc
Here's an example
http://camanjs.com/guides/#BasicUsage
bit.ly/instagram-dc
Our functions
The correct function is "called" when a button is clicked
function revertFilter(){
Caman('#my-image', function() {
this.revert();
});
}
function applyFilter(){
Caman('#my-image', function() {
this.brightness(10);
this.contrast(30);
this.sepia(60);
this.saturation(-30);
this.render();
});
}
bit.ly/instagram-dc
Challenge #1
Change out the example image with your own
image
Adjust the filter values in the example code to
update the filter
Make your own filter with at least one new
property (hint: look at built-in functionality)
bit.ly/instagram-dc
Challenge #2
Instead of making your own, use a built-in filter.
Here's a full list:
vintage, lomo, clarity, sinCity, sunrise,
crossProcess, orangePeel, love, grungy,
barques, pinhole, oldBoot, glowingSun,
hazyDays, herMajest, nostalgia,
hemingway, concentrate
function applyFilter() {
Caman('#my-image', function() {
this['vintage']();
this.render();
});
}
bit.ly/instagram-dc
Challenge #3 (Advanced)
Add more buttons, each one should add only one filter
Try cropping your pictures to different sized frames
bit.ly/instagram-dc
Ways to keep learning
For aspiring developers, bootcamps fill the gap
Source: Bureau of Labor Statistics
92%job-placement rate + job guarantee
Link for the third party audit jobs report:
https://www.thinkful.com/bootcamp-jobs-stats
Thinkful's track record of getting students jobs
Our students receive unprecedented support
1-on-1 Learning Mentor
1-on-1 Career MentorProgram Manager
Local Community
You
1-on-1 mentorship enables flexible learning
Learn anywhere,
anytime, and at your
own schedule
You don't have to quit
your job to start career
transition
Thinkful Two-Week Trial
Talk to one of us and email benjy@thinkful.com to learn more
Two-week Free Course Trial
Start with HTML, CSS and JavaScript
Unlimited QAs sessions
Option to continue with full bootcamp
Financing & scholarships available
Offer valid tonight only
Benjy Schechner
Education Advisor

More Related Content

What's hot

10 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.110 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.1Tricode (part of Dept)
 
How to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginHow to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginAndolasoft Inc
 
Extra aem development tools by Justin Edelson
Extra aem development tools by Justin EdelsonExtra aem development tools by Justin Edelson
Extra aem development tools by Justin EdelsonAEM HUB
 
Part 4 Introduction to Gui with tkinter
Part 4 Introduction to Gui with tkinterPart 4 Introduction to Gui with tkinter
Part 4 Introduction to Gui with tkinterMohamed Essam
 
Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)
Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)
Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)Nathan Yergler
 
Lightning page optimization &amp; best practices
Lightning page optimization &amp; best practicesLightning page optimization &amp; best practices
Lightning page optimization &amp; best practicesGaurav Jain
 
Udi Google Dev Day
Udi Google Dev DayUdi Google Dev Day
Udi Google Dev DayUdi Bauman
 
Creating A Vba Function Library For Use In QTP/VBSCRIPT
Creating A Vba Function Library For Use In QTP/VBSCRIPTCreating A Vba Function Library For Use In QTP/VBSCRIPT
Creating A Vba Function Library For Use In QTP/VBSCRIPThsupadrasta
 
AEM and Sling
AEM and SlingAEM and Sling
AEM and SlingLo Ki
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop APIChris Jean
 
Build 2017 - B8085 - The road to commercialization for your Windows IoT solution
Build 2017 - B8085 - The road to commercialization for your Windows IoT solutionBuild 2017 - B8085 - The road to commercialization for your Windows IoT solution
Build 2017 - B8085 - The road to commercialization for your Windows IoT solutionWindows Developer
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)Pamela Fox
 
Week 12 - Search Engine Optimization
Week 12 -  Search Engine OptimizationWeek 12 -  Search Engine Optimization
Week 12 - Search Engine Optimizationhenri_makembe
 
Developing a Google Wave Extension
Developing a Google Wave ExtensionDeveloping a Google Wave Extension
Developing a Google Wave ExtensionBrian Kennish
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkToby Beresford
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMAdobeMarketingCloud
 
Email authentication using firebase auth + flutter
Email authentication using firebase auth + flutterEmail authentication using firebase auth + flutter
Email authentication using firebase auth + flutterKaty Slemon
 

What's hot (20)

10 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.110 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.1
 
How to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginHow to Create a Custom WordPress Plugin
How to Create a Custom WordPress Plugin
 
Extra aem development tools by Justin Edelson
Extra aem development tools by Justin EdelsonExtra aem development tools by Justin Edelson
Extra aem development tools by Justin Edelson
 
Part 4 Introduction to Gui with tkinter
Part 4 Introduction to Gui with tkinterPart 4 Introduction to Gui with tkinter
Part 4 Introduction to Gui with tkinter
 
Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)
Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)
Technology / Open Source @ Creative Commons (CC Salon SF, August 2009)
 
Lightning page optimization &amp; best practices
Lightning page optimization &amp; best practicesLightning page optimization &amp; best practices
Lightning page optimization &amp; best practices
 
Udi Google Dev Day
Udi Google Dev DayUdi Google Dev Day
Udi Google Dev Day
 
Creating A Vba Function Library For Use In QTP/VBSCRIPT
Creating A Vba Function Library For Use In QTP/VBSCRIPTCreating A Vba Function Library For Use In QTP/VBSCRIPT
Creating A Vba Function Library For Use In QTP/VBSCRIPT
 
AEM and Sling
AEM and SlingAEM and Sling
AEM and Sling
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop API
 
Lecture 3 Javascript1
Lecture 3  Javascript1Lecture 3  Javascript1
Lecture 3 Javascript1
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
 
Build 2017 - B8085 - The road to commercialization for your Windows IoT solution
Build 2017 - B8085 - The road to commercialization for your Windows IoT solutionBuild 2017 - B8085 - The road to commercialization for your Windows IoT solution
Build 2017 - B8085 - The road to commercialization for your Windows IoT solution
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)
 
Week 12 - Search Engine Optimization
Week 12 -  Search Engine OptimizationWeek 12 -  Search Engine Optimization
Week 12 - Search Engine Optimization
 
Developing a Google Wave Extension
Developing a Google Wave ExtensionDeveloping a Google Wave Extension
Developing a Google Wave Extension
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter Framework
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
Email authentication using firebase auth + flutter
Email authentication using firebase auth + flutterEmail authentication using firebase auth + flutter
Email authentication using firebase auth + flutter
 

Similar to Build Your Own Instagram Filters

Instagram filters
Instagram filters Instagram filters
Instagram filters Thinkful
 
Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)Thinkful
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
Rails Plugins - Linux For You, March 2011 Issue
Rails Plugins - Linux For You, March 2011 IssueRails Plugins - Linux For You, March 2011 Issue
Rails Plugins - Linux For You, March 2011 IssueSagar Arlekar
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Clarence Ngoh
 
App engine devfest_mexico_10
App engine devfest_mexico_10App engine devfest_mexico_10
App engine devfest_mexico_10Chris Schalk
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
Django 1.10.3 Getting started
Django 1.10.3 Getting startedDjango 1.10.3 Getting started
Django 1.10.3 Getting startedMoniaJ
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonCodeOps Technologies LLP
 
Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 

Similar to Build Your Own Instagram Filters (20)

Instagram filters
Instagram filters Instagram filters
Instagram filters
 
Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
Rails Plugins - Linux For You, March 2011 Issue
Rails Plugins - Linux For You, March 2011 IssueRails Plugins - Linux For You, March 2011 Issue
Rails Plugins - Linux For You, March 2011 Issue
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)
 
App engine devfest_mexico_10
App engine devfest_mexico_10App engine devfest_mexico_10
App engine devfest_mexico_10
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Django - basics
Django - basicsDjango - basics
Django - basics
 
Django 1.10.3 Getting started
Django 1.10.3 Getting startedDjango 1.10.3 Getting started
Django 1.10.3 Getting started
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 

More from TJ Stalcup

Intro to JavaScript - Thinkful DC
Intro to JavaScript - Thinkful DCIntro to JavaScript - Thinkful DC
Intro to JavaScript - Thinkful DCTJ Stalcup
 
Frontend Crash Course
Frontend Crash CourseFrontend Crash Course
Frontend Crash CourseTJ Stalcup
 
Intro to Python for Data Science
Intro to Python for Data ScienceIntro to Python for Data Science
Intro to Python for Data ScienceTJ Stalcup
 
Intro to Python for Data Science
Intro to Python for Data ScienceIntro to Python for Data Science
Intro to Python for Data ScienceTJ Stalcup
 
Build Your Own Website - Intro to HTML & CSS
Build Your Own Website - Intro to HTML & CSSBuild Your Own Website - Intro to HTML & CSS
Build Your Own Website - Intro to HTML & CSSTJ Stalcup
 
Intro to Python
Intro to PythonIntro to Python
Intro to PythonTJ Stalcup
 
Intro to Python
Intro to PythonIntro to Python
Intro to PythonTJ Stalcup
 
Predict the Oscars using Data Science
Predict the Oscars using Data SciencePredict the Oscars using Data Science
Predict the Oscars using Data ScienceTJ Stalcup
 
Thinkful DC - Intro to JavaScript
Thinkful DC - Intro to JavaScriptThinkful DC - Intro to JavaScript
Thinkful DC - Intro to JavaScriptTJ Stalcup
 
Data Science Your Vacation
Data Science Your VacationData Science Your Vacation
Data Science Your VacationTJ Stalcup
 
Data Science Your Vacation
Data Science Your VacationData Science Your Vacation
Data Science Your VacationTJ Stalcup
 
Build a Game with Javascript
Build a Game with JavascriptBuild a Game with Javascript
Build a Game with JavascriptTJ Stalcup
 
Thinkful DC FrontEnd Crash Course - HTML & CSS
Thinkful DC FrontEnd Crash Course - HTML & CSSThinkful DC FrontEnd Crash Course - HTML & CSS
Thinkful DC FrontEnd Crash Course - HTML & CSSTJ Stalcup
 
Choosing a Programming Language
Choosing a Programming LanguageChoosing a Programming Language
Choosing a Programming LanguageTJ Stalcup
 
Frontend Crash Course
Frontend Crash CourseFrontend Crash Course
Frontend Crash CourseTJ Stalcup
 
Thinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSSThinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSSTJ Stalcup
 
Thinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSSThinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSSTJ Stalcup
 
Build a Virtual Pet with JavaScript
Build a Virtual Pet with JavaScriptBuild a Virtual Pet with JavaScript
Build a Virtual Pet with JavaScriptTJ Stalcup
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to JavascriptTJ Stalcup
 

More from TJ Stalcup (20)

Intro to JavaScript - Thinkful DC
Intro to JavaScript - Thinkful DCIntro to JavaScript - Thinkful DC
Intro to JavaScript - Thinkful DC
 
Frontend Crash Course
Frontend Crash CourseFrontend Crash Course
Frontend Crash Course
 
Intro to Python for Data Science
Intro to Python for Data ScienceIntro to Python for Data Science
Intro to Python for Data Science
 
Intro to Python for Data Science
Intro to Python for Data ScienceIntro to Python for Data Science
Intro to Python for Data Science
 
Build Your Own Website - Intro to HTML & CSS
Build Your Own Website - Intro to HTML & CSSBuild Your Own Website - Intro to HTML & CSS
Build Your Own Website - Intro to HTML & CSS
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Predict the Oscars using Data Science
Predict the Oscars using Data SciencePredict the Oscars using Data Science
Predict the Oscars using Data Science
 
Thinkful DC - Intro to JavaScript
Thinkful DC - Intro to JavaScriptThinkful DC - Intro to JavaScript
Thinkful DC - Intro to JavaScript
 
Data Science Your Vacation
Data Science Your VacationData Science Your Vacation
Data Science Your Vacation
 
Data Science Your Vacation
Data Science Your VacationData Science Your Vacation
Data Science Your Vacation
 
Build a Game with Javascript
Build a Game with JavascriptBuild a Game with Javascript
Build a Game with Javascript
 
Thinkful DC FrontEnd Crash Course - HTML & CSS
Thinkful DC FrontEnd Crash Course - HTML & CSSThinkful DC FrontEnd Crash Course - HTML & CSS
Thinkful DC FrontEnd Crash Course - HTML & CSS
 
Choosing a Programming Language
Choosing a Programming LanguageChoosing a Programming Language
Choosing a Programming Language
 
Frontend Crash Course
Frontend Crash CourseFrontend Crash Course
Frontend Crash Course
 
Thinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSSThinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSS
 
Thinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSSThinkful FrontEnd Crash Course - HTML & CSS
Thinkful FrontEnd Crash Course - HTML & CSS
 
Build a Virtual Pet with JavaScript
Build a Virtual Pet with JavaScriptBuild a Virtual Pet with JavaScript
Build a Virtual Pet with JavaScript
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 
DC jQuery App
DC jQuery AppDC jQuery App
DC jQuery App
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Build Your Own Instagram Filters

  • 1. Build Your Own Instagram-like Filters with JavaScript Visit this link to Download Sublime, Firefox & Starter Code bit.ly/instagram-dc WIFI: In3Guest November 2017
  • 2. Note Sublime Text is the text editor we'll be using. We'll be opening our HTML files in Firefox. Please make sure you have both downloaded and installed. bit.ly/instagram-dc
  • 3. Instructor TJ Stalcup Lead Mentor @Thinkful API Evangelist @WealthEngine Pokemon Master Assistant Instructors bit.ly/instagram-dc
  • 4. About you Your name What brought you to the workshop tonight? What is your programming experience? bit.ly/instagram-dc
  • 5. About us Thinkful prepares students for web development and data science jobs with 1-on-1 mentorship programs bit.ly/instagram-dc
  • 6. Goals Set up static website using JavaScript HTML + JavaScript basics Access third-party library in JavaScript Build v1 of Instagram app Advanced challenges bit.ly/instagram-dc
  • 7. The starter code Download and unzip the starter files into a folder on your Desktop (four files total). Open index.html and index.js in Sublime Text. http://bit.ly/tf-instagram-starter bit.ly/instagram-dc
  • 8. Demo Open index.html in Firefox bit.ly/instagram-dc
  • 9. Demo Click "Apply Filter" to see the image change bit.ly/instagram-dc
  • 10. Demo Click "Revert Filter" to see the image change back bit.ly/instagram-dc
  • 11. HTML Overview HTML is the content and structure of a webpage It's the skeleton of your website. bit.ly/instagram-dc
  • 12. HTML tags Every tag starts with a "less than" sign and ends with a "greater than" sign <html> #an HTML opening tag <body> #a body opening tag <h1>Hello, World!</h1> #a set of h1 tags with content </body> #a body closing tag </html> #an HTML closing tag bit.ly/instagram-dc
  • 13. More about HTML tags There are opening tags and closing tags - closing tags have a backslash before the tag name (</html>) Tags instruct a browser about the structure of our website There are hundreds of built-in tags but you'll use the same few a lot bit.ly/instagram-dc
  • 14. HTML attributes HTML attributes set properties on an element - they are set in the opening tag href is an attribute that sets the destination of a link <a href="https://somewhere.com">This is a link</a> id is another attribute that identifies elements (for CSS & JavaScript) <h1 id="headline">This is a headline</h1> bit.ly/instagram-dc
  • 15. Basic functions A function lets you separate your code into bite- sized pieces which you can use over and over again. When you write a function to use later, you are "declaring" it. When you use (or run) that function you are "calling" it. bit.ly/instagram-dc
  • 16. Example Declaring a function Calling a function function doSomething(){ alert("Done!"); } doSomething(); bit.ly/instagram-dc
  • 17. More about basic functions Functions can save us time because we use them over and over in code. They are building blocks. Make your code more organized and easier to read JavaScript has many built-in functions You'll write many, many functions in your programs bit.ly/instagram-dc
  • 18. Let's work through the rest of the HTML <body> <img id="my-image" src="test-image.png"> <br> <button onClick="revertFilter()">Revert Filter</button> <button onClick="applyFilter()">Apply Filter</button> </body> bit.ly/instagram-dc
  • 19. JavaScript overview <script type="text/javascript" src="index.js"></script> If HTML is the skeleton of a website, JavaScript is the brains. JavaScript controls the behavior of our app. We'll write our JavaScript in the index.js file. We'll then import the file using similar syntax. bit.ly/instagram-dc
  • 20. Adding our functions to index.js function revertFilter(){ //add code here } function applyFilter(){ //add code here } bit.ly/instagram-dc
  • 21. What is a third-party library? In Javascript, we use third-party libraries to do cool things. A third-party library is a JavaScript file that contains a bunch of functions that someone else wrote for us. There are a ton of these in every language. bit.ly/instagram-dc
  • 22. The CamanJS library We'll be using the CamanJS library. ( )camanjs.com bit.ly/instagram-dc
  • 23. Importing the CamanJS library The CamanJS library is included in your starter code. Import it at the top of your index.html file using the syntax above. <script type="text/javascript" src="caman.full.min.js"></script> bit.ly/instagram-dc
  • 24. Documentation How do we know what functions we can use? We could look at the library source file, if it's short, or better, we could look at the documentation. All common libraries will have documentation with a list of available functions and/or real-world examples. bit.ly/instagram-dc
  • 25. Note A core part of being a developer is constantly learning new languages, tools, libraries, and frameworks. They will all be documented and you should get used to finding answers through these resources. bit.ly/instagram-dc
  • 27. Our functions The correct function is "called" when a button is clicked function revertFilter(){ Caman('#my-image', function() { this.revert(); }); } function applyFilter(){ Caman('#my-image', function() { this.brightness(10); this.contrast(30); this.sepia(60); this.saturation(-30); this.render(); }); } bit.ly/instagram-dc
  • 28. Challenge #1 Change out the example image with your own image Adjust the filter values in the example code to update the filter Make your own filter with at least one new property (hint: look at built-in functionality) bit.ly/instagram-dc
  • 29. Challenge #2 Instead of making your own, use a built-in filter. Here's a full list: vintage, lomo, clarity, sinCity, sunrise, crossProcess, orangePeel, love, grungy, barques, pinhole, oldBoot, glowingSun, hazyDays, herMajest, nostalgia, hemingway, concentrate function applyFilter() { Caman('#my-image', function() { this['vintage'](); this.render(); }); } bit.ly/instagram-dc
  • 30. Challenge #3 (Advanced) Add more buttons, each one should add only one filter Try cropping your pictures to different sized frames bit.ly/instagram-dc
  • 31. Ways to keep learning
  • 32. For aspiring developers, bootcamps fill the gap Source: Bureau of Labor Statistics
  • 33. 92%job-placement rate + job guarantee Link for the third party audit jobs report: https://www.thinkful.com/bootcamp-jobs-stats Thinkful's track record of getting students jobs
  • 34. Our students receive unprecedented support 1-on-1 Learning Mentor 1-on-1 Career MentorProgram Manager Local Community You
  • 35. 1-on-1 mentorship enables flexible learning Learn anywhere, anytime, and at your own schedule You don't have to quit your job to start career transition
  • 36. Thinkful Two-Week Trial Talk to one of us and email benjy@thinkful.com to learn more Two-week Free Course Trial Start with HTML, CSS and JavaScript Unlimited QAs sessions Option to continue with full bootcamp Financing & scholarships available Offer valid tonight only Benjy Schechner Education Advisor