SlideShare a Scribd company logo
1 of 27
CHRISTMAS TREES
WITH HTML, CSS & JS
NIAMH FOLEY
WHAT WE ARE GOING TO CREATE
HTML5 Tree with decoration

HTML + CSS Tree
HYPER TEXT MARK UP LANGUAGE
Pros

Cons

• Provides a basic structure for data to be
displayed

• HTML is not dynamic – meaning it has no logic
to it

• Very easy to pick up and learn

• No one structure to it

• Mistakes are easily found and fixed
• There are many development environments
CASCADING STYLE SHEETS
Pros
• Easy to learn
• Used by 99.999% of websites
• Tidy's up HTML makes it “Cleaner”
• Provides the skin to HMTL

Cons
• None Its that Good
JAVASCRIPT
Pros
• As close as you can get to coding with out all the
“Messy Stuff” of code
• Safe !! You cannot damage your system as its
self contained

• Extremely powerful tool for creating web apps
• Very easy to pick up and learn

Cons
• Only works in a browser
• No Development environment
• Debugging is a pain
• Each browser reacts to code differently
• Imagination is your only limit with JS
HOUSE KEEPING
1. Create a Directory called “Christmas Tree”
2. Create a subdirectory called “css”
3. Create a file called “styles.css” and save into css
4. Create a file called “index.htm” and save into the root directory (Christmas Tree)
Keyboard Short cuts
Copy : Ctrl + C
Paste : Ctrl + V
Cut :

Ctrl + X
HTML BOILER PLATE
Use this boiler plate code to begin

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML, CSS & JS Christmass Trees</title>
<link rel="stylesheet" href="css/tree.css">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<canvas id="canvas" width="300" height="300" style="border-style:solid;" ></canvas>
</body>
</html>
HTTP://BIT.LY/CHRISTMASTREE
HTTP://BIT.LY/TREECSS
HTTP://BIT.LY/JSTREE
FEAR NOT !!!
HTML5 + JAVASCRIPT TREE
<body onload="draw();">
<script type="text/javascript">

FUNCTIONALITY

// JS goes in here

Setup

</script>
function draw() {
var canvas = document.getElementById('canvas');

FUNCTIONALITY
Step 1 - Beginning Code

if (canvas.getContext){
var ctx = canvas.getContext('2d');
// more code goes here !!

}
}
ctx.beginPath();
ctx.moveTo(150, 10); // starting point

FUNCTIONALITY
Step 2 – The Triangle

ctx.lineTo(x, y);

ctx.lineTo(x, y);
ctx.fillStyle = “USE HEX CODE” ;
ctx.fill();
FUNCTIONALITY
Step 3 – The base

ctx.fillStyle = “USE HEX CODE”;
ctx.fillRect (x,y,w,h); // (x,y,width,height)
ctx.beginPath();
ctx.arc(140, 75, 10, 0, Math.PI*2, true);

FUNCTIONALITY
Step 4 - Decorations

// Uses trig to create circle

ctx.closePath();
ctx.fillStyle = " USE HEX CODE ";
ctx.fill();
TEST IT !!
Fingers Crossed it Worked
HTML + CSS TREE
SETUP

1. Use HTML Boiler Plate
2. Create a styles.css file in the css directory
HTML BOILER PLATE
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML, CSS & JS Christmass Trees</title>
<link rel="stylesheet" href="css/tree.css">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<canvas id="canvas" width="300" height="300" style="border-style:dotted solid;" ></canvas>
</body>
</html>
<div class="logo">
<div id="tree"></div>
<div id="trunk">

FUNCTIONALITY
Adding the HTML scaffolding

<div id="left-branch"></div>
<div id="right-bottom-branch"></div>
<div id="right-top-branch"></div>
</div>
</div>
.logo{

height: 200px; width: 160px;

FUNCTIONALITY

margin: 150px auto;

Logo Class

position: relative;
}
#tree {

border-bottom: 200px solid #//Putt Colour in here;
border-left: 80px solid transparent;

FUNCTIONALITY

border-right: 80px solid transparent;

Tree Identifier

position: absolute; top: 0; left: 0;
height: 0; width: 0;
}
#trunk{

height: 85px; width: 16px;

FUNCTIONALITY

background: #3b543f;

Trunk Identifier

position: absolute; left: 72px; bottom: -20px;
}
#left-branch{
background: #//Put Colour in here;
height: 30px; width: 6px;

position: absolute; left: -10px; top: 15px;

FUNCTIONALITY

transform: rotate(-50deg);

Branch Identifiers

-webkit-transform: rotate(-50deg);

Left

-moz-transform: rotate(-50deg);
-ms-transform: rotate(-50deg);
-o-transform: rotate(-50deg);
}
#right-bottom-branch{
background: #//Put Colour in here;
height: 50px; width: 6px;
position: absolute; top: 15px; left: 23px;

FUNCTIONALITY

transform: rotate(50deg);

Branch Identifier

-webkit-transform: rotate(50deg);

Right bottom

-moz-transform: rotate(50deg);

-ms-transform: rotate(50deg);
-o-transform: rotate(50deg);
}
#right-top-branch{
background: #//Put Colour in here;
height: 27px; width: 6px;
position: absolute; top: 2px; left: 20px;

FUNCTIONALITY

transform: rotate(50deg);

Branch Identifier

-webkit-transform: rotate(50deg);

Right Top

-moz-transform: rotate(50deg);

-ms-transform: rotate(50deg);
-o-transform: rotate(50deg);
}
TEST IT !!
Fingers Crossed it Worked
Christmas Trees Made with HTML CSS and JS

More Related Content

What's hot

RIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdf
RIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdfRIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdf
RIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdf
KyleneAndreaAlim
 
Telephone Influence on Society
Telephone Influence on SocietyTelephone Influence on Society
Telephone Influence on Society
Jess Miedel
 
4.6 graciano lopez jaena
4.6 graciano lopez jaena4.6 graciano lopez jaena
4.6 graciano lopez jaena
Marien Be
 

What's hot (20)

RIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdf
RIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdfRIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdf
RIZALS-HIGHER-EDUCATION-AND-LIFE-ABROAD.pdf
 
Rizal's second sojourn in Paris and the Universal Exposition of 1889
Rizal's second sojourn in Paris and the Universal Exposition of 1889Rizal's second sojourn in Paris and the Universal Exposition of 1889
Rizal's second sojourn in Paris and the Universal Exposition of 1889
 
The period of enlightenment
The period of enlightenmentThe period of enlightenment
The period of enlightenment
 
Telephone Influence on Society
Telephone Influence on SocietyTelephone Influence on Society
Telephone Influence on Society
 
Pre-Spanish 21st group#5 12-microsoft
Pre-Spanish 21st group#5 12-microsoftPre-Spanish 21st group#5 12-microsoft
Pre-Spanish 21st group#5 12-microsoft
 
Alejandro Roces.pptx
Alejandro Roces.pptxAlejandro Roces.pptx
Alejandro Roces.pptx
 
Jose Garcia Villa
Jose Garcia Villa Jose Garcia Villa
Jose Garcia Villa
 
Chapter 7_dp-pertemuan_11
 Chapter 7_dp-pertemuan_11 Chapter 7_dp-pertemuan_11
Chapter 7_dp-pertemuan_11
 
4.6 graciano lopez jaena
4.6 graciano lopez jaena4.6 graciano lopez jaena
4.6 graciano lopez jaena
 
EMPOWERMENT TECHNOLOGIES - LESSON 2
EMPOWERMENT TECHNOLOGIES - LESSON 2EMPOWERMENT TECHNOLOGIES - LESSON 2
EMPOWERMENT TECHNOLOGIES - LESSON 2
 
The literature of national capital region (introduction)
The literature of national capital region (introduction)The literature of national capital region (introduction)
The literature of national capital region (introduction)
 
CEBUANO LITEFATURE ( PHILIPPINE LITERATURE)
CEBUANO LITEFATURE ( PHILIPPINE LITERATURE) CEBUANO LITEFATURE ( PHILIPPINE LITERATURE)
CEBUANO LITEFATURE ( PHILIPPINE LITERATURE)
 
Online safety, Security, Ethics and Etiquette
Online safety, Security, Ethics and EtiquetteOnline safety, Security, Ethics and Etiquette
Online safety, Security, Ethics and Etiquette
 
MODULE 1 LESSON 1.pptx
MODULE 1 LESSON 1.pptxMODULE 1 LESSON 1.pptx
MODULE 1 LESSON 1.pptx
 
History of PH Internet
History of PH InternetHistory of PH Internet
History of PH Internet
 
American-Period ppt.pptx
American-Period ppt.pptxAmerican-Period ppt.pptx
American-Period ppt.pptx
 
National Capital Region Philippines Literature
National Capital Region Philippines LiteratureNational Capital Region Philippines Literature
National Capital Region Philippines Literature
 
Lakbay Rizal sa intramuros: Rizal in Ateneo and UST
Lakbay Rizal sa intramuros: Rizal in Ateneo and USTLakbay Rizal sa intramuros: Rizal in Ateneo and UST
Lakbay Rizal sa intramuros: Rizal in Ateneo and UST
 
E-Tech L9 Collaborative ICT Development.pptx
E-Tech L9 Collaborative ICT Development.pptxE-Tech L9 Collaborative ICT Development.pptx
E-Tech L9 Collaborative ICT Development.pptx
 
Rizal as historian
Rizal as historianRizal as historian
Rizal as historian
 

Viewers also liked

Media as mirror vs. prosthesis
Media as mirror vs. prosthesisMedia as mirror vs. prosthesis
Media as mirror vs. prosthesis
Himanshu Bansal
 
Lifestyle unit 9
Lifestyle unit 9Lifestyle unit 9
Lifestyle unit 9
Les Davy
 
решение основной проблемы Agile (scrum) проектов в контексте ba
решение основной проблемы Agile (scrum) проектов в контексте baрешение основной проблемы Agile (scrum) проектов в контексте ba
решение основной проблемы Agile (scrum) проектов в контексте ba
ISsoft
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
Aarti P
 

Viewers also liked (20)

HTML lets get creative!!
HTML lets get creative!!HTML lets get creative!!
HTML lets get creative!!
 
Media as mirror vs. prosthesis
Media as mirror vs. prosthesisMedia as mirror vs. prosthesis
Media as mirror vs. prosthesis
 
HTML and UML
HTML and  UMLHTML and  UML
HTML and UML
 
HMTL putting it all to gether
HMTL putting it all to getherHMTL putting it all to gether
HMTL putting it all to gether
 
HTML page layout II
HTML page layout IIHTML page layout II
HTML page layout II
 
Lifestyle unit 9
Lifestyle unit 9Lifestyle unit 9
Lifestyle unit 9
 
Php Security
Php SecurityPhp Security
Php Security
 
Введение в веб-проектирование
Введение в веб-проектированиеВведение в веб-проектирование
Введение в веб-проектирование
 
Таблицы Html
Таблицы HtmlТаблицы Html
Таблицы Html
 
решение основной проблемы Agile (scrum) проектов в контексте ba
решение основной проблемы Agile (scrum) проектов в контексте baрешение основной проблемы Agile (scrum) проектов в контексте ba
решение основной проблемы Agile (scrum) проектов в контексте ba
 
WordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping ToolWordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping Tool
 
Пингвины из калининграда
Пингвины из калининградаПингвины из калининграда
Пингвины из калининграда
 
Custom Post Type and Taxonomies in WordPress 3.x
Custom Post Type and Taxonomies in WordPress 3.xCustom Post Type and Taxonomies in WordPress 3.x
Custom Post Type and Taxonomies in WordPress 3.x
 
Show vs. Tell in UX Design (Front in Amsterdam)
Show vs. Tell in UX Design (Front in Amsterdam)Show vs. Tell in UX Design (Front in Amsterdam)
Show vs. Tell in UX Design (Front in Amsterdam)
 
How Joomla Works
How Joomla WorksHow Joomla Works
How Joomla Works
 
17. основы css (cascading style sheets)
17. основы css (cascading style sheets)17. основы css (cascading style sheets)
17. основы css (cascading style sheets)
 
6. таблицы и другие теги html
6. таблицы и другие теги html6. таблицы и другие теги html
6. таблицы и другие теги html
 
Organisation and navigation
Organisation and navigationOrganisation and navigation
Organisation and navigation
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
 
Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5
 

Similar to Christmas Trees Made with HTML CSS and JS

Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
Adam Lu
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 

Similar to Christmas Trees Made with HTML CSS and JS (20)

About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
Introduction to Web Technologies PPT.pptx
Introduction to Web Technologies PPT.pptxIntroduction to Web Technologies PPT.pptx
Introduction to Web Technologies PPT.pptx
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Html5 & less css
Html5 & less cssHtml5 & less css
Html5 & less css
 
Html5
Html5Html5
Html5
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
 
Sanjeev ghai 12
Sanjeev ghai 12Sanjeev ghai 12
Sanjeev ghai 12
 
Claim Academy Intro to Programming
Claim Academy Intro to ProgrammingClaim Academy Intro to Programming
Claim Academy Intro to Programming
 
Html5
Html5Html5
Html5
 
Html5 - Novas Tags na Prática!
Html5 - Novas Tags na Prática!Html5 - Novas Tags na Prática!
Html5 - Novas Tags na Prática!
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web Apps
 
jQuery
jQueryjQuery
jQuery
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Ext JS Introduction
Ext JS IntroductionExt JS Introduction
Ext JS Introduction
 

More from Niamh Foley (7)

HTML Cheat Sheet
HTML Cheat SheetHTML Cheat Sheet
HTML Cheat Sheet
 
HTML coding and syntax
HTML coding and syntaxHTML coding and syntax
HTML coding and syntax
 
HTML an introduction
HTML an introductionHTML an introduction
HTML an introduction
 
HTML an introduction
HTML an introductionHTML an introduction
HTML an introduction
 
File management 101
File management 101File management 101
File management 101
 
Basic tags
Basic tagsBasic tags
Basic tags
 
Niamh foley html module discriptor
Niamh foley html module discriptorNiamh foley html module discriptor
Niamh foley html module discriptor
 

Recently uploaded

Recently uploaded (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

Christmas Trees Made with HTML CSS and JS

  • 1. CHRISTMAS TREES WITH HTML, CSS & JS NIAMH FOLEY
  • 2. WHAT WE ARE GOING TO CREATE HTML5 Tree with decoration HTML + CSS Tree
  • 3. HYPER TEXT MARK UP LANGUAGE Pros Cons • Provides a basic structure for data to be displayed • HTML is not dynamic – meaning it has no logic to it • Very easy to pick up and learn • No one structure to it • Mistakes are easily found and fixed • There are many development environments
  • 4. CASCADING STYLE SHEETS Pros • Easy to learn • Used by 99.999% of websites • Tidy's up HTML makes it “Cleaner” • Provides the skin to HMTL Cons • None Its that Good
  • 5. JAVASCRIPT Pros • As close as you can get to coding with out all the “Messy Stuff” of code • Safe !! You cannot damage your system as its self contained • Extremely powerful tool for creating web apps • Very easy to pick up and learn Cons • Only works in a browser • No Development environment • Debugging is a pain • Each browser reacts to code differently • Imagination is your only limit with JS
  • 6. HOUSE KEEPING 1. Create a Directory called “Christmas Tree” 2. Create a subdirectory called “css” 3. Create a file called “styles.css” and save into css 4. Create a file called “index.htm” and save into the root directory (Christmas Tree) Keyboard Short cuts Copy : Ctrl + C Paste : Ctrl + V Cut : Ctrl + X
  • 7. HTML BOILER PLATE Use this boiler plate code to begin <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>The HTML, CSS & JS Christmass Trees</title> <link rel="stylesheet" href="css/tree.css"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <canvas id="canvas" width="300" height="300" style="border-style:solid;" ></canvas> </body> </html>
  • 11. function draw() { var canvas = document.getElementById('canvas'); FUNCTIONALITY Step 1 - Beginning Code if (canvas.getContext){ var ctx = canvas.getContext('2d'); // more code goes here !! } }
  • 12. ctx.beginPath(); ctx.moveTo(150, 10); // starting point FUNCTIONALITY Step 2 – The Triangle ctx.lineTo(x, y); ctx.lineTo(x, y); ctx.fillStyle = “USE HEX CODE” ; ctx.fill();
  • 13. FUNCTIONALITY Step 3 – The base ctx.fillStyle = “USE HEX CODE”; ctx.fillRect (x,y,w,h); // (x,y,width,height)
  • 14. ctx.beginPath(); ctx.arc(140, 75, 10, 0, Math.PI*2, true); FUNCTIONALITY Step 4 - Decorations // Uses trig to create circle ctx.closePath(); ctx.fillStyle = " USE HEX CODE "; ctx.fill();
  • 15. TEST IT !! Fingers Crossed it Worked
  • 16. HTML + CSS TREE
  • 17. SETUP 1. Use HTML Boiler Plate 2. Create a styles.css file in the css directory
  • 18. HTML BOILER PLATE <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>The HTML, CSS & JS Christmass Trees</title> <link rel="stylesheet" href="css/tree.css"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <canvas id="canvas" width="300" height="300" style="border-style:dotted solid;" ></canvas> </body> </html>
  • 19. <div class="logo"> <div id="tree"></div> <div id="trunk"> FUNCTIONALITY Adding the HTML scaffolding <div id="left-branch"></div> <div id="right-bottom-branch"></div> <div id="right-top-branch"></div> </div> </div>
  • 20. .logo{ height: 200px; width: 160px; FUNCTIONALITY margin: 150px auto; Logo Class position: relative; }
  • 21. #tree { border-bottom: 200px solid #//Putt Colour in here; border-left: 80px solid transparent; FUNCTIONALITY border-right: 80px solid transparent; Tree Identifier position: absolute; top: 0; left: 0; height: 0; width: 0; }
  • 22. #trunk{ height: 85px; width: 16px; FUNCTIONALITY background: #3b543f; Trunk Identifier position: absolute; left: 72px; bottom: -20px; }
  • 23. #left-branch{ background: #//Put Colour in here; height: 30px; width: 6px; position: absolute; left: -10px; top: 15px; FUNCTIONALITY transform: rotate(-50deg); Branch Identifiers -webkit-transform: rotate(-50deg); Left -moz-transform: rotate(-50deg); -ms-transform: rotate(-50deg); -o-transform: rotate(-50deg); }
  • 24. #right-bottom-branch{ background: #//Put Colour in here; height: 50px; width: 6px; position: absolute; top: 15px; left: 23px; FUNCTIONALITY transform: rotate(50deg); Branch Identifier -webkit-transform: rotate(50deg); Right bottom -moz-transform: rotate(50deg); -ms-transform: rotate(50deg); -o-transform: rotate(50deg); }
  • 25. #right-top-branch{ background: #//Put Colour in here; height: 27px; width: 6px; position: absolute; top: 2px; left: 20px; FUNCTIONALITY transform: rotate(50deg); Branch Identifier -webkit-transform: rotate(50deg); Right Top -moz-transform: rotate(50deg); -ms-transform: rotate(50deg); -o-transform: rotate(50deg); }
  • 26. TEST IT !! Fingers Crossed it Worked