SlideShare una empresa de Scribd logo
1 de 25
Tutorial - 4
• CSS basic tricks:
⚬ Transition
⚬ Transform property
⚬ Basics of Grid
⚬ Rows & Graphs in Grid
⚬ Spanning multiple & Col in
Grid
⚬ Autofix & Min-Max
⚬ Creating layout using grid
⚬ Using Media with CSS Grid
• JavaScript
⚬ Introduction
⚬ Variables & Data types and operators
⚬ Strings in JS
⚬ String Function
⚬ Array 1D & MD
⚬ Array functions
⚬ If-else & Switch
⚬ Object in JS (basic to advance)
⚬ Functions in JS
⚬ this in JS
⚬ Alert, Prompt, Confirm, Consoles
⚬ Loops
■ For, while, do-while
Yesterday's revision
• Visibility and z index
• Flexbox
• em, rem, vh and vw
• media queries
• selectors
• nth child
• before and after pseudo selectors
• box shadow & Text shadow
• variables & custom properties
• creating animation & transition
Transform
• transform helps to add more animations to your
element on DOM
• Some basic properties are:
⚬ transform: rotate(360deg);
■ This rotate the element by 360 deg
⚬ transform: skew(40deg);
■ This will make your elemnt skewed
⚬ transform: scale(2);
■ Zoom in effect is applied by it
Some basic properties of transform (cont...):
• transform: translateX(123px);
⚬ Move element on X-axis
• transform: translateY(123px);
⚬ Move element on Y-axis
• transform: translate(123px, 123px);
⚬ Move element on both the axis
Just to support all above properties with an ease we use
transition property:
• transition: all 0.5s ease-in-out;
Grid system
• It'll help us to create the grid layout & eventually helpful in
development of layouts while developing responsive website
• NOTE: you have to apply now ---- display: grid
• some commonly used grid properties are:
⚬ grid-template-columns: 300px auto 100px;
■ defines the width of columns of grid
⚬ grid-template-columns: 1fr 4fr 1fr;
■ defines col width but in ratios e.g.: 1:4:1
⚬ grid-template-columns: repeat(3, auto);
■ defines the width as "auto" for 3 columns , basically its kind of
looping function
⚬ grid-gap: 2rem;
■ gives margin between all columns
Up-till now we have seen grid properties w.r.t. col now
we'll be looking into grid properties w.r.t. rows
• grid-template-rows: 1fr 1fr 4fr;
⚬ divide row wise in ratios
• grid-auto-rows: 2fr;
⚬ when we have many rows and we just want same
grid row size to all then we use grid-auto-rows
Grid with spanning
• Spanning means you'll be using grid design in a
combined format
• major properties to achieve spanning in grid
are:
⚬ grid-column-start , grid-row-start
■ while combining grids it helps to define
starting point w.r.t col & rows
Grid spanning (cont...)
⚬ grid-column-end, grid-row-end
■ defines the ending of spanning
⚬ grid-column: 1 / span 3;
■ shorthand for col spanning
⚬ grid-row: 1 / span 3;
■ shorthand for row spanning
Grid- minmax property
• property used here is:
⚬ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
• It is use full to build responsive layouts where we specify that
minimum certain width should be provided and maximum certain
width is provided
⚬ It's kind of similar to what we did in media-
query
Grid Template Area
• Why we use it:
⚬ to easily build the layouts area-wise
• Uptill now we have seen grid-template-row &
grid-template-columns now we are looking into
grid-template-area
• e.g:
⚬ grid-template-areas:
⚬ 'navbar navbar navbar navbar'
⚬ 'section section section aside'
⚬ 'footer footer footer footer ';
grid-area-template (cont...)
• grid-area-template must be provided a reference
by property named "grid-area" inside any
applied selector:
⚬ e.g:
■ #navbar {
■ grid-area: navbar;
■ }
■ #section {
■ grid-area: section;
■ }
■ #aside {
■ grid-area: aside;
■ }
■ footer {
■ grid-area: footer;
■ }
Grid with media query
Please lets code instead !!
JavaScrip
t
JavaScript (What, When, How, Why)
• What:
⚬ JavaScript is a scripting or programming
language that allows you to implement
complex features on web pages
• When
⚬ If you want to implement some logic to
your website then you use JS
• "JavaScript" is everywhere
⚬ It means doesn't matter its web
development or mobile development or in
IOT or on server side ,
■ JavaScript can handle everything
⚬ On web it form base for many libraries like
React.js on Front-end and Node.js for
Backend even Node.js is used in IOT also
⚬ React Native is used for mobile
development
• Write javascript in HTML is possible via
<script> tag
• Most developer uses browser's devtool along
with its console for debugging and in general
while doing development
• NOTE: JavaScript is way more advance then
any other equally aged language like Java,
CPP or C
• Best combination in market is of MERN stack
⚬ Mongo-Express-React-Node
Datatypes &
operators
• JS has 7 types of datatypes only :
⚬ Number (x= 90)
⚬ String (x="hello world")
⚬ Boolean (x=true, y=false)
⚬ Object (x={first_name:"Hello"})
⚬ undefined (x=undefined)
⚬ null (x=null)
⚬ array (x=[])
Important links for datatypes in JS are:
• https://www.w3schools.com/js/js_datatypes.asp
• https://www.programiz.com/javascript/data-types
• primitive data types:
⚬ String, Number, Boolean, undefined & null
• reference or special or composite datatyes:
⚬ Array, Object and Functions
Operators in JS
• Following are the types of operators in JS
⚬ Assignment Operators
⚬ Arithmetic Operators
⚬ Comparison Operators
⚬ Logical Operators
⚬ Bitwise Operators
⚬ String Operators
⚬ Some special kind of Operators
• Lets jump to :
⚬ https://www.programiz.com/javascript/operators
Object in JavaScript
• Almost everything in JavaScript is either is object
or Primitives.
• Object form base for, function or class or
Number or Boolean or Date or Math or RegX or
Array , etc..
• e.g:
⚬ let person = {firstName:"John", lastName:"Doe", age:50,
eyeColor:"blue"};
How to create an object in JS:
• Using object literal
⚬ const person = {firstName:"John", lastName:"Doe",
age:50, eyeColor:"blue"};
• Using new keyword
⚬ const person = new Object();
⚬ person.firstName = "John";
⚬ person.lastName = "Doe";
⚬ person.age = 50;
⚬ person.eyeColor = "blue";
• Define an object constructor, and then create
objects of the constructed type.
⚬ function Person(first, last, age, eye) {
⚬ this.firstName = first;
⚬ this.lastName = last;
⚬ this.age = age;
⚬ this.eyeColor = eye;
⚬ }
• https://www.w3schools.com/js/js_object_constructo
rs.asp
• Create an object using Object.create()
⚬ var foo = new Foo();
⚬ var foo = Object.create(Foo.prototype);
Interview Question:
• Difference between new and Object.create
⚬ https://stackoverflow.com/questions/41
66616/understanding-the-difference-
between-object-create-and-new-
somefunction
Arrays in JavaScript
• 1-D arrays
⚬ const x = ['a', 1, false, -22]
• 2-D array:
⚬ const x = [[1,2], [2,3],67]
Question:
• const x = [1,2] + [2,3]
• const y = [[1,2],'90',[34]] + [[2,3],[5,5]]
Strings in JS
• const x = "a"
• const x1 = "aaaaa"
• const y = "a" + 121212
• const q = `aapppp${x}${y}`

Más contenido relacionado

La actualidad más candente

La actualidad más candente (19)

JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
The Skinny on Slim
The Skinny on SlimThe Skinny on Slim
The Skinny on Slim
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Java script ppt
Java script pptJava script ppt
Java script ppt
 
JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
 
Spa with angular
Spa with angularSpa with angular
Spa with angular
 
Web application
Web applicationWeb application
Web application
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
Frozen rails 2012 - Fighting Code Smells
Frozen rails 2012 - Fighting Code SmellsFrozen rails 2012 - Fighting Code Smells
Frozen rails 2012 - Fighting Code Smells
 
Web application
Web applicationWeb application
Web application
 
Introduction to SPA with AngularJS
Introduction to SPA with AngularJSIntroduction to SPA with AngularJS
Introduction to SPA with AngularJS
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
 
Javascript Roadmap - The Basics
Javascript Roadmap - The BasicsJavascript Roadmap - The Basics
Javascript Roadmap - The Basics
 
Being a jsp
Being a jsp     Being a jsp
Being a jsp
 
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
Saigon Ruby Meetup 06/10/2015 - Changeful GemSaigon Ruby Meetup 06/10/2015 - Changeful Gem
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
 

Similar a CSS Grid, JavaScript Fundamentals and More

gdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxgdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxsandeshshahapur
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptMarlon Jamera
 
WT Unit-3 PPT.pptx
WT Unit-3 PPT.pptxWT Unit-3 PPT.pptx
WT Unit-3 PPT.pptxTusharTikia
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
BITM3730Week6.pptx
BITM3730Week6.pptxBITM3730Week6.pptx
BITM3730Week6.pptxMattMarino13
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting languageAbhayDhupar
 
Java Script
Java ScriptJava Script
Java ScriptSarvan15
 
Java Script
Java ScriptJava Script
Java ScriptSarvan15
 
javascriptPresentation.pdf
javascriptPresentation.pdfjavascriptPresentation.pdf
javascriptPresentation.pdfwildcat9335
 
WEB MODULE 3.pdf
WEB MODULE 3.pdfWEB MODULE 3.pdf
WEB MODULE 3.pdfDeepika A B
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesLogeekNightUkraine
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOMSukrit Gupta
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 

Similar a CSS Grid, JavaScript Fundamentals and More (20)

gdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxgdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptx
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Java script
Java scriptJava script
Java script
 
WT Unit-3 PPT.pptx
WT Unit-3 PPT.pptxWT Unit-3 PPT.pptx
WT Unit-3 PPT.pptx
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
BITM3730Week6.pptx
BITM3730Week6.pptxBITM3730Week6.pptx
BITM3730Week6.pptx
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
 
Java Script
Java ScriptJava Script
Java Script
 
Java Script
Java ScriptJava Script
Java Script
 
Type script
Type scriptType script
Type script
 
javascriptPresentation.pdf
javascriptPresentation.pdfjavascriptPresentation.pdf
javascriptPresentation.pdf
 
WEB MODULE 3.pdf
WEB MODULE 3.pdfWEB MODULE 3.pdf
WEB MODULE 3.pdf
 
Java script
Java scriptJava script
Java script
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script Technologies
 
Java script
Java scriptJava script
Java script
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOM
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 

Último

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Último (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 

CSS Grid, JavaScript Fundamentals and More

  • 1. Tutorial - 4 • CSS basic tricks: ⚬ Transition ⚬ Transform property ⚬ Basics of Grid ⚬ Rows & Graphs in Grid ⚬ Spanning multiple & Col in Grid ⚬ Autofix & Min-Max ⚬ Creating layout using grid ⚬ Using Media with CSS Grid • JavaScript ⚬ Introduction ⚬ Variables & Data types and operators ⚬ Strings in JS ⚬ String Function ⚬ Array 1D & MD ⚬ Array functions ⚬ If-else & Switch ⚬ Object in JS (basic to advance) ⚬ Functions in JS ⚬ this in JS ⚬ Alert, Prompt, Confirm, Consoles ⚬ Loops ■ For, while, do-while
  • 2. Yesterday's revision • Visibility and z index • Flexbox • em, rem, vh and vw • media queries • selectors • nth child • before and after pseudo selectors • box shadow & Text shadow • variables & custom properties • creating animation & transition
  • 3. Transform • transform helps to add more animations to your element on DOM • Some basic properties are: ⚬ transform: rotate(360deg); ■ This rotate the element by 360 deg ⚬ transform: skew(40deg); ■ This will make your elemnt skewed ⚬ transform: scale(2); ■ Zoom in effect is applied by it
  • 4. Some basic properties of transform (cont...): • transform: translateX(123px); ⚬ Move element on X-axis • transform: translateY(123px); ⚬ Move element on Y-axis • transform: translate(123px, 123px); ⚬ Move element on both the axis Just to support all above properties with an ease we use transition property: • transition: all 0.5s ease-in-out;
  • 5. Grid system • It'll help us to create the grid layout & eventually helpful in development of layouts while developing responsive website • NOTE: you have to apply now ---- display: grid • some commonly used grid properties are: ⚬ grid-template-columns: 300px auto 100px; ■ defines the width of columns of grid ⚬ grid-template-columns: 1fr 4fr 1fr; ■ defines col width but in ratios e.g.: 1:4:1 ⚬ grid-template-columns: repeat(3, auto); ■ defines the width as "auto" for 3 columns , basically its kind of looping function ⚬ grid-gap: 2rem; ■ gives margin between all columns
  • 6. Up-till now we have seen grid properties w.r.t. col now we'll be looking into grid properties w.r.t. rows • grid-template-rows: 1fr 1fr 4fr; ⚬ divide row wise in ratios • grid-auto-rows: 2fr; ⚬ when we have many rows and we just want same grid row size to all then we use grid-auto-rows
  • 7. Grid with spanning • Spanning means you'll be using grid design in a combined format • major properties to achieve spanning in grid are: ⚬ grid-column-start , grid-row-start ■ while combining grids it helps to define starting point w.r.t col & rows
  • 8. Grid spanning (cont...) ⚬ grid-column-end, grid-row-end ■ defines the ending of spanning ⚬ grid-column: 1 / span 3; ■ shorthand for col spanning ⚬ grid-row: 1 / span 3; ■ shorthand for row spanning
  • 9. Grid- minmax property • property used here is: ⚬ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); • It is use full to build responsive layouts where we specify that minimum certain width should be provided and maximum certain width is provided ⚬ It's kind of similar to what we did in media- query
  • 10. Grid Template Area • Why we use it: ⚬ to easily build the layouts area-wise • Uptill now we have seen grid-template-row & grid-template-columns now we are looking into grid-template-area • e.g: ⚬ grid-template-areas: ⚬ 'navbar navbar navbar navbar' ⚬ 'section section section aside' ⚬ 'footer footer footer footer ';
  • 11. grid-area-template (cont...) • grid-area-template must be provided a reference by property named "grid-area" inside any applied selector: ⚬ e.g: ■ #navbar { ■ grid-area: navbar; ■ } ■ #section { ■ grid-area: section; ■ } ■ #aside { ■ grid-area: aside; ■ } ■ footer { ■ grid-area: footer; ■ }
  • 12. Grid with media query Please lets code instead !!
  • 14. JavaScript (What, When, How, Why) • What: ⚬ JavaScript is a scripting or programming language that allows you to implement complex features on web pages • When ⚬ If you want to implement some logic to your website then you use JS
  • 15. • "JavaScript" is everywhere ⚬ It means doesn't matter its web development or mobile development or in IOT or on server side , ■ JavaScript can handle everything ⚬ On web it form base for many libraries like React.js on Front-end and Node.js for Backend even Node.js is used in IOT also ⚬ React Native is used for mobile development
  • 16. • Write javascript in HTML is possible via <script> tag • Most developer uses browser's devtool along with its console for debugging and in general while doing development • NOTE: JavaScript is way more advance then any other equally aged language like Java, CPP or C • Best combination in market is of MERN stack ⚬ Mongo-Express-React-Node
  • 17. Datatypes & operators • JS has 7 types of datatypes only : ⚬ Number (x= 90) ⚬ String (x="hello world") ⚬ Boolean (x=true, y=false) ⚬ Object (x={first_name:"Hello"}) ⚬ undefined (x=undefined) ⚬ null (x=null) ⚬ array (x=[])
  • 18. Important links for datatypes in JS are: • https://www.w3schools.com/js/js_datatypes.asp • https://www.programiz.com/javascript/data-types • primitive data types: ⚬ String, Number, Boolean, undefined & null • reference or special or composite datatyes: ⚬ Array, Object and Functions
  • 19. Operators in JS • Following are the types of operators in JS ⚬ Assignment Operators ⚬ Arithmetic Operators ⚬ Comparison Operators ⚬ Logical Operators ⚬ Bitwise Operators ⚬ String Operators ⚬ Some special kind of Operators • Lets jump to : ⚬ https://www.programiz.com/javascript/operators
  • 20. Object in JavaScript • Almost everything in JavaScript is either is object or Primitives. • Object form base for, function or class or Number or Boolean or Date or Math or RegX or Array , etc.. • e.g: ⚬ let person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};
  • 21. How to create an object in JS: • Using object literal ⚬ const person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"}; • Using new keyword ⚬ const person = new Object(); ⚬ person.firstName = "John"; ⚬ person.lastName = "Doe"; ⚬ person.age = 50; ⚬ person.eyeColor = "blue";
  • 22. • Define an object constructor, and then create objects of the constructed type. ⚬ function Person(first, last, age, eye) { ⚬ this.firstName = first; ⚬ this.lastName = last; ⚬ this.age = age; ⚬ this.eyeColor = eye; ⚬ } • https://www.w3schools.com/js/js_object_constructo rs.asp
  • 23. • Create an object using Object.create() ⚬ var foo = new Foo(); ⚬ var foo = Object.create(Foo.prototype); Interview Question: • Difference between new and Object.create ⚬ https://stackoverflow.com/questions/41 66616/understanding-the-difference- between-object-create-and-new- somefunction
  • 24. Arrays in JavaScript • 1-D arrays ⚬ const x = ['a', 1, false, -22] • 2-D array: ⚬ const x = [[1,2], [2,3],67] Question: • const x = [1,2] + [2,3] • const y = [[1,2],'90',[34]] + [[2,3],[5,5]]
  • 25. Strings in JS • const x = "a" • const x1 = "aaaaa" • const y = "a" + 121212 • const q = `aapppp${x}${y}`