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 (20)

Web Page Designing
Web Page DesigningWeb Page Designing
Web Page Designing
 
A history of html
A history of htmlA history of html
A history of html
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
Advanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content deliveryAdvanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content delivery
 
Html training slide
Html training slideHtml training slide
Html training slide
 
Computer misuse
Computer misuse Computer misuse
Computer misuse
 
Php forms
Php formsPhp forms
Php forms
 
Lenguajes de marcas
Lenguajes de marcasLenguajes de marcas
Lenguajes de marcas
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 
Html forms
Html formsHtml forms
Html forms
 
Online shopping project synopsis
Online shopping project synopsisOnline shopping project synopsis
Online shopping project synopsis
 
Html forms
Html formsHtml forms
Html forms
 
Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3
 
CSS
CSSCSS
CSS
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
 
Lecture 5: Client Side Programming 1
Lecture 5: Client Side Programming 1Lecture 5: Client Side Programming 1
Lecture 5: Client Side Programming 1
 
State Management in ASP.NET
State Management in ASP.NETState Management in ASP.NET
State Management in ASP.NET
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
Lesson 1: Introduction to HTML
Lesson 1: Introduction to HTMLLesson 1: Introduction to HTML
Lesson 1: Introduction to HTML
 

Viewers also liked

HTML lets get creative!!
HTML lets get creative!!HTML lets get creative!!
HTML lets get creative!!Niamh Foley
 
Media as mirror vs. prosthesis
Media as mirror vs. prosthesisMedia as mirror vs. prosthesis
Media as mirror vs. prosthesisHimanshu Bansal
 
HMTL putting it all to gether
HMTL putting it all to getherHMTL putting it all to gether
HMTL putting it all to getherNiamh Foley
 
HTML page layout II
HTML page layout IIHTML page layout II
HTML page layout IINiamh Foley
 
Lifestyle unit 9
Lifestyle unit 9Lifestyle unit 9
Lifestyle unit 9Les Davy
 
Введение в веб-проектирование
Введение в веб-проектированиеВведение в веб-проектирование
Введение в веб-проектированиеMaryia Davidouskaia
 
Таблицы Html
Таблицы HtmlТаблицы Html
Таблицы HtmlVasya Petrov
 
решение основной проблемы Agile (scrum) проектов в контексте ba
решение основной проблемы Agile (scrum) проектов в контексте baрешение основной проблемы Agile (scrum) проектов в контексте ba
решение основной проблемы Agile (scrum) проектов в контексте baISsoft
 
WordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping ToolWordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping ToolAmit Kumar Singh
 
Пингвины из калининграда
Пингвины из калининградаПингвины из калининграда
Пингвины из калининградаAndrew Yashenko
 
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.xAmit Kumar Singh
 
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)Zoe Gillenwater
 
17. основы css (cascading style sheets)
17. основы css (cascading style sheets)17. основы css (cascading style sheets)
17. основы css (cascading style sheets)Sergei Dubrov
 
6. таблицы и другие теги html
6. таблицы и другие теги html6. таблицы и другие теги html
6. таблицы и другие теги htmlSergei Dubrov
 
Organisation and navigation
Organisation and navigationOrganisation and navigation
Organisation and navigationLon Barfield
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTMLAarti P
 
Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5Amit Kumar Singh
 

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

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 JSNaga Harish M
 
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 2011Timothy Fisher
 
Introduction to Web Technologies PPT.pptx
Introduction to Web Technologies PPT.pptxIntroduction to Web Technologies PPT.pptx
Introduction to Web Technologies PPT.pptxKunal Kalamkar
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web PerformanceAdam Lu
 
Claim Academy Intro to Programming
Claim Academy Intro to ProgrammingClaim Academy Intro to Programming
Claim Academy Intro to ProgrammingAlex Pearson
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web AppsTimothy Fisher
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5Jamshid Hashimi
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesBrad Hill
 

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

HTML Cheat Sheet
HTML Cheat SheetHTML Cheat Sheet
HTML Cheat SheetNiamh Foley
 
HTML coding and syntax
HTML coding and syntaxHTML coding and syntax
HTML coding and syntaxNiamh Foley
 
HTML an introduction
HTML an introductionHTML an introduction
HTML an introductionNiamh Foley
 
HTML an introduction
HTML an introductionHTML an introduction
HTML an introductionNiamh Foley
 
File management 101
File management 101File management 101
File management 101Niamh Foley
 
Niamh foley html module discriptor
Niamh foley html module discriptorNiamh foley html module discriptor
Niamh foley html module discriptorNiamh Foley
 

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

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...liera silvan
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Recently uploaded (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

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