Lab Manual ITEC-241
Lab Manual ITEC-241
LAB MANUAL
Javascript
Embed audio file in your web page using javascript
Function.
12 2
Embed video file in your web page using javascript
function.
13 Revision 2
What is HTML?
pages.
• HTML describes the structure of a Web page.
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
• All HTML documents must start with a document type declaration: <!DOCTYPE html>.
• The HTML document itself begins with <html> and ends with </html>.
• The visible part of the HTML document is between <body> and </body>.
HTML Editor
Windows- NOTEPAD
Mac- TextEdit
BASIC TAGS
<b> : Bold
<u>: Underline
<i>: Italics
<p>: Paragraph tag
• Heading Tags
HTML headings are defined with the <h1> to <h6> tags.
e.g <h6> heading tag h6 </h6>
• Font Tag
The font tag is used to change the color, size, and style of a
text. The base font tag is used to set all the text to the same
size, color and face.
Syntax:
<font attribute = "value"> Content </font>
Attributes: Size=”20”
Color=”blue”
Face=”Times New Roman”
Insert an Image
The HTML <img> tag is used to embed/insert an image in a web
page.
Images are not technically inserted into a web page; images are
linked to web pages. The <img> tag creates a holding space for
the referenced image.
The <img> tag is empty; it contains attributes only, and does not
have a closing tag.
The <img> tag has two required attributes:
• src - Specifies the path to the image
The required src attribute specifies the path (URL) to the
image.
• alt - Specifies an alternate text for the image
The required alt attribute provides an alternate text for an
image
• The width and height attributes always define the width and
height of the image in pixels.
<html>
<head>
<title> Insert Image </title>
</head>
<body>
<img src=”flower.jpg” alt=”My Flower” height=”50”
width=”50”/>
</body>
</html>
Hyperlink
HTML links are hyperlinks. You can click on a link and jump to another document.
<a> : Anchor tag
Href: Hyperlink reference
• The <a> tag is used to create a hyperlink on the webpage.
• The most important attribute of the <a> element is the href attribute, which indicates the
link's destination.
Example for creating a link to a website
<html>
<head>
<title> Hyperlink </title>
</head>
<body>
<a href=”program1.html”> Click Here </a>
<br>
<a href=”program1.html > <img src=”logo.jpg” height=”30” width=”30”/> </a>
<br>
</html>
Create Table
• Each table row starts with a <tr> and ends with a </tr> tag.
• Everything between <td> and </td> are the content of the table cell.
• The text in <th> elements are bold and centered.
<html>
<head>
<title> Insert Image </title>
</head>
<body>
<table>
<tr>
<th> Name </th>
<th> ID </th>
</tr>
<tr>
<td> abc </td>
<td> 20201111 </td>
</tr>
<tr>
<td>xyz </td>
<td> 20202222 </td>
</tr>
</table>
</body>
</html>
Creating Frames
• HTML frames are used to divide your browser window into multiple sections where
each section can load a separate HTML document.
• A collection of frames in the browser window is known as a frameset.
• The window is divided into frames in a similar way the tables are organized: into rows and
columns.
• To use frames on a page we use <frameset> tag instead of <body> tag.
• The <frameset> tag defines how to divide the window into frames.
• The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines
vertical frames. Each frame is indicated by <frame> tag
<html>
<head>
<title> frames </title>
</head>
<frameset cols="25%,50%,25%">
<frame src="program1.html"/>
<frame src="image.jpg">
<frame src="program2.html">
</frameset>
</html>
CSS SCRIPT
What is CSS?
Styling background
e.g 1
body { background-image:url('gradient2.png'); background-repeat:repeat-x; }
e.g 2
body { background-image:url('img_tree.png'); background-repeat:no-repeat; background-position:right
top; }
CSS Script
h1 { color:orange; text-align:center; }
p { font-family:"Times New Roman"; font-size:20px; }
Introduction to GIMP
Downloading GIMP Open Source Tools:
https://www.gimp.org/downloads/
GIMP Tutorial: https://www.gimp.org/tutorials/
GIMP Introduction:
GIMP is a multi-platform photo manipulation tool. GIMP is an acronym for GNU Image
Manipulation Program. The GIMP is suitable for a variety of image manipulation tasks,
including photo retouching, image composition, and image construction.
One of The GIMP's strengths is its free availability from many sources for many operating
systems. The GIMP is a Free Software application covered by the General Public License
(GPL). The GPL provides users with the freedom to access and alter the source code that makes
up computer programs.
GIMP Interface:
GIMP Tools:
GIMP provides a comprehensive toolbox in order to quickly perform basic tasks such as making
selections or drawing paths.
Row 1: Row 2:
Rectangle Select Tool Scissors Selection Tool
Eclipse Select Tool Foreground Selection Tool
Free Select Tool
Path Tool
Fuzzy Select Tool
Color Picker Tool
Select By Color Tool Zoom Tool
Row 3: Row 4:
Measure Tool Rotate Tool
Row 5: Row 6:
Flip Tool
Gradient Tool
Cage Transform Tool
Pencil Tool
Wrap Transform Tool
Paintbrush Tool
Text Tool
Eraser Tool
Bucket Fill Tool Airbrush Tool
Row 7: Row 8:
TEXT EFFECTS
or
https://www.youtube.com/watch?v=_Wq_A-jkWQE
(wrap text around circle) https://www.youtube.com/watch?
v=0CMt3Uc0zrg (text along path)
Here are the steps for wrap the text around the Shape:
step 15
Go to “path”à Layers/channel/Path
Make visibility off for ->selection
or or
https://www.youtube.com/watch?v=OfeIBK1k_PY
https://www.youtube.com/watch?v=-gjK00o4EP0
or or
https://www.youtube.com/watch?v=Ab4m63SRj-w
https://www.youtube.com/watch?v=PBohY0adf18
https:/**/www.youtube.com/watch?v=WAX6bK5BjMc
https://www.youtube.com/watch?v=SETdoN_B4lg
or or
https://www.youtube.com/watch?v=4BHMA-llEKA
https://www.youtube.com/watch?v=-qizkopE3uE
https://www.youtube.com/watch?v=UJg_BQVuueA
Here are the steps to create fire flaming text (YouTube) using
GIMP:
1. File->New-> Set height and width for the new image-> click
ok
Make sure Background color is “Black” color.
2. Select “Text” tool-> Type any text of your choice
Adjust the size, and style of your text. Make sure text color is
“white” color
3. Layer Menu-> “Layer to Image size”
4. Select “Smudge” tool->Select the brush (select fuzzy type
brush)
Adjust the brush size of your choice
Rate= 75
Spacing=1
Fade Length=100
5. Using brush, smudge the text, make some flames on top
6. Go to the text layer-> right click on it-> select “Merge Down”
It will merge the text and background layer as one layer.
7. Go to” Colors” menu-> select “Color Balance”
In Color balance box
For shadow:
Cyan-Red=100
Magneta-Green=30
Yellow- Blue= -30
-------
For Midtones:
Cyan-Red=100
Magneta-Green=30
Yellow- Blue= -30
-------
For Highlights:
Cyan-Red=100
Magneta-Green=0
Yellow- Blue= -100
3. Click on “Free Select Tool”. Using this tool select the face
area which you want to swap.
4. Copy the selected area (by pressing Ctrl+C key or Go to
“Edit” Menu -> “Copy”)
5. Paste it (by pressing Ctrl+V key or Go to “Edit” Menu ->
“Paste”)
It will appear in 3 Layer, as Floating Layer
rd
or or
https://www.youtube.com/watch?v=kUt2cditN1g
https://www.youtube.com/watch?v=fsfI6BRO3ps
https://www.youtube.com/watch?v=Ez5uaH_FVA4
or or
https://www.youtube.com/watch?v=FpYwxPE9J54
https://www.youtube.com/watch?v=0Vz8ES48DpQ
https://www.youtube.com/watch?v=uuWJg_ew3No
Here are the steps for displacement effect on face image (as
background) with a flag image:
1. File Menu-> Open->[open the image –face image]
2. Select Path tool-> [using path tool, select the area—face area
—around the face make a selection]
3. Press ctrl+ C (copy the selection) and Press ctrl+ V (paste)
4. Right click on the new Layer-> “As a New Layer” (it will
create a pasted layer)
5. Go to Layer Menu-> Layer to Image size
6. Go to Colors Menu-> Select Saturation (it will make change
image black & white)
Set Saturation as 0 -> click ok
7. Drag the 2 image (flag image) and drop on the face (on
nd
gimp)
8. Select Scale tool-> click on 2 image(or flag)-> adjust the size
nd
image layer)
11. Use Move tool to adjust the 2 image on face nd
SYNFIG STUDIO
Introduction to Synfig Studio
Synfig Studio (also known as Synfig) is a free and open source vector based 2D animation
software. It uses the filename extension .sif (uncompressed), .sifz (compressed) or .sfg (zip container
format).
The center of the window is the Canvas Window. A new Canvas Window appears each time Synfig Studio starts.
Animate Editing Mode Off Changes will be applied throughout the entire timeline of the animation.
Animate Editing Mode On Changes will create a waypoint to remember the value.
https://www.youtube.com/watch?v=JtUxHVIBFhE
https://www.youtube.com/watch?v=2Bi--fpBhsM
Animated Banner/Logo using SYNFIG STUDIO
Animated logos (adding motion to your logo) help you to create
a strong image/logo for your brand/website.
Animated banners are made up of a series of frames. An individual display time is set for each frame,
measured in fractions of a second. A loop is a complete cycle through all of the images in an animated
sequence.
Because of the eye catching movement, animated banners stand out from the static data on websites and
social media platforms.
For animated web banner designs, you can animate texts, shapes, texts inside shape, images.
https://www.youtube.com/watch?v=RL1tZl61H5Q
https://www.youtube.com/watch?v=7x5ET6JTvKY
https://www.youtube.com/watch?v=VxS0qu8ovvA
https://www.youtube.com/watch?v=UL1ZHkouWgM
https://www.youtube.com/watch?v=ZiK-2bB15Bg
https://www.youtube.com/watch?v=Dr8aqNF2jhc
https://www.youtube.com/watch?v=AmNzxxb8BkY
JAVASCRIPT PROGRAMS
Embed multimedia component text and image in your web page and make the image Zoom In -
Zoom out using JavaScript function.
Answer:
<HTML>
<HEAD>
<TITLE>ZOOM-IN AND ZOOM-OUT</TITLE>
</HEAD>
<BODY BGCOLOR="#996666">
<marquee>
<FONT COLOR="#000066" size="30">Zooming In....Zooming Out Image....</FONT>
</marquee>
<img src="nr.jpg" name="slide" height=600 width=675 border=5>
<Script>
var i=600;
var j=50;
var k;
var zoomspeed=500;
function zooming()
{
if(i==600)
{
k=0;
}
if(i==0)
{
k=1;
}
if(k==0)
{
document.images.slide.width=i;
document.images.slide.height=i;
i=i-j;
}
else
{
document.images.slide.width=i;
document.images.slide.height=i;
i=i+j;
}
setTimeout("zooming()", zoomspeed);
}
zooming();
</SCRIPT>
</BODY>
</HTML>
Embed an audio file in your web page using JavaScript function.
<HTML>
<HEAD>
<TITLE>EMBED AUDIO FILE ON WEB PAGE</TITLE>
</HEAD>
<BODY>
****Code to embed Audio file on web page***
<SCRIPT>
function play()
{
var source="horse.mp3";
document.write('<EMBED SRC='+source+' VOLUME
="100" HEIGHT="500" WIDTH="1000">');
}
</SCRIPT>
<input type="button" value="click" onClick="play()">
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>EMBED AUDIO FILE ON WEB PAGE</TITLE>
</HEAD>
<BODY>
****Code to embed Video file on web page***
<SCRIPT>
function play()
{
var source="jarir.mp4";
document.write('<EMBED SRC='+source+' VOLUME
="100" HEIGHT="300" WIDTH="500">');
}
</SCRIPT>
<input type="button" value="click" onClick="play()">
</BODY>
</HTML>