0% found this document useful (0 votes)
3 views16 pages

Unit 1 Multimedia Animation

HTML, introduced in 1991 by Tim Berners-Lee, is a markup language for creating web pages, evolving through various versions to support multimedia and responsive design. HTML5, released in 2014, includes new semantic elements, built-in multimedia support, and improved performance features. CSS, or Cascading Style Sheets, is used for styling HTML documents, allowing for greater flexibility in presentation through various properties and selectors.

Uploaded by

hemyk1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
3 views16 pages

Unit 1 Multimedia Animation

HTML, introduced in 1991 by Tim Berners-Lee, is a markup language for creating web pages, evolving through various versions to support multimedia and responsive design. HTML5, released in 2014, includes new semantic elements, built-in multimedia support, and improved performance features. CSS, or Cascading Style Sheets, is used for styling HTML documents, allowing for greater flexibility in presentation through various properties and selectors.

Uploaded by

hemyk1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 16
Multimedia Animation Origins and evolution of htm! HTML (Hypertext Markup Language) is a markup language used to create web pages. It was first introduced in 1991 by Tim Berners-Lee, a British computer scientist who is credited with inventing the World Wide Web. The initial version of HTML, called HTML 1.0, was a simple markup language with only a few tags for formatting text and adding links. Over time, new versions of HTML were developed, adding new features and improving the language's capabilities. HTML 2.0 was released in 1995 and included support for tables and image maps. HTML 3.2 was released in 1997 and included support for frames, which allowed for more complex page layouts. HTML 4.0 was released in 1997 and included support for cascading style sheets (CSS) and scripting languages like JavaScript. In the early 2000s, XHTML (Extensible Hypertext Markup Language) was developed as a ‘successor to HTML. XHTML was designed to be a more modular and strict version of HTML, with stricter rules for syntax and formatting. However, XHTML never gained widespread adoption, and in 2014, the HTMLS specification was released as the latest version of HTML. HTMLS includes many new features and improvements, such as support for multimedia elements like audio and video, native support for responsive design, and improved support for accessibility. It also includes a number of APIs (Application Programming Interfaces) that allow web developers to create more interactive and dynamic web applications. Today, HTML remains an essential tool for web development, used by millions of developers around the world to create everything from simple web pages to complex web applications. Basic syntax of HTML HTML (Hypertext Markup Language) is the standard language used for creating web pages. Here is a basic example of HTML syntax: Page Titlesittle> </head> <body> <h1>Heading 1</h1> <p> This is a paragraph.</p> </body> </html> Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru This example includes the following HTML elements: -'<IDOCTYPE htmi>"’: Defines the document type and version of HTML being used. ~ *<html>": Defines the beginning and end of an HTML document. ‘<head>’: Contains information about the document, such as the title. - ‘stitle>"; Defines the title of the page, which appears in the browser's title bar. <body>’: Contains the visible content of the page. <h1>°: Defines a heading, with *<h2>* to “<h6>" used for subheadings. <p>": Defines a paragraph of text HTML elements are usually defined with a start tag, some content, and an end tag. Some elements, such as ‘<img>" and “<br>", are self-closing and do not require an end tag. Attributes can be added to elements to provide additional information, such as the ‘src attribute for the “<img>" element. Basic text markup, Images, Lists, Tables, Forms, Frames Here's an overview of some basic text markup, images, lists, tables, forms, and frames: 1. Text Markup: Text markup is a way of adding formatting and structure to text. Here are some common examples: ~ Bold text: Wrap the text in <b> and </b> tags. - Italic text: Wrap the text in <i> and </i> tags. - Underlined text: Wrap the text in <u> and </u> tags. - Headings: Use <h1> through <h6> tags to create headings of different sizes. - Links: Use <a href="url">link text</a> to create hyperlinks - Paragraphs: Use <p> and </p> tags to create paragraphs. 2. Images: To add an image to a web page, use the <img> tag with the “src” attribute set to the URL of the image file, For example: <img src="image jpg" alt="Description of the image"> The “alt” attribute provides a text description of the image for users who can't see it 3. Lists: There are two types of lists you can create in HTML: - Ordered lists: Use the <ol> and </ol> tags to create a numbered list, and <li> and </li> tags for each item in the list. For example: <ol> <lipttem </li> <lirttem 2<fli> <lipitem 3<ili> </ol> - Unordered lists: Use the <ul> and </ul> tags to create a bulleted list. For example: Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru <ul> <liettem 4</li> <lirttem 2<ili> <liettem 3</li> </ul> 4. Tables: Use the <table> tag to create a table, and <tr> and </tr> tags for each row, and <td> and </td> tags for each cell. For example: stable> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> std>Cell 4</td> </> </table> 5. Forms: Forms allow users to enter information on a web page. Use the <form> tag to create a form, and various form elements such as <input>, <select>, and <textarea> to create fields for user input. For example: <form> <input type="text" id="name" name="name"><br> <label for="email">Email:</label> ‘email" id="email” name="email’><br> <label for="message">Message'</label> <textarea id="message" name="message"></textarea><br> <input type="submit" value="Submit'> <Mform> 6. Frames: Frames allow you to display multiple web pages within a single browser window. Use the <frameset> tag to create a frame, and the <frame> tag to specify the content of each frame, For example: <frameset cols="25%, 75%"> <frame src="menu.htmI"> <frame sro="content.html"> </frameset> Overview and features of HTML5S Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru HTMLS (Hypertext Markup Language version 5) is the latest version of the markup language sed for creating web pages and applications. It was first introduced in 2014 by the World Wide Web Consortium (W3C), the organization responsible for developing and standardizing web technologies. Here are some of the key features and improvements introduced by HTMLS: 1. Semantics: HTMLS includes new semantic elements that provide a better way to describe the structure of a web page, making it easier for search engines and assistive technologies to understand the content. Some of these new elements, include <header>, <footer>, <section>, <article>, and <nav>. 2. Multimedia support: HTMLS includes built-in support for audio and video playback, eliminating the need for plugins like Adobe Flash. The <audio> and <video> tags allow developers to embed media directly into their web pages. 3. Canvas: HTMLS introduces the <canvas> element, which allows developers to create and manipulate graphics on the fly using JavaScript. This makes it easier to create dynamic and interactive web applications. 4, Forms: HTMLS introduces new input types, such as <email>, <url>, and <date>, which make it easier to create user-friendly forms. The new required and pattern attributes also provide better form validation and input control 5. Offline support: HTMLS introduces the Application Cache API, which allows web applications to work offline, even when the user is not connected to the internet 6. Improved performance: HTMLS includes several features that improve the performance of web pages, such as lazy loading of images and scripts, which allows pages to load faster. Overall, HTMLS is a significant improvement over previous versions of HTML, providing developers with new and powerful tools to create modem web applications. CSS introduction CSS, or Cascading Style Sheets, is a language used for styling and formatting web pages. It is used to define the presentation of HTML documents, including the layout, colors, fonts, and other visual aspects. CSS is a separate language from HTML, which is used to define the structure and content of a web page. By separating content from presentation, CSS allows for greater flexibility and control over the appearance of a web page. CSS works by defining styles and applying them to HTML elements on a web page. Styles can be defined in an external style sheet file, or within the HTML document itself using the <style> tag. There are several ways to select elements in CSS, including by tag name, class name, ID, and more. CSS also includes a wide range of properties that can be used to style elements, such as color, font-size, padding, margin, and more. Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru Overall, CSS is an essential part of modem web development, and is used extensively in building websites, web applications, and other online content. Levels of Style Sheets in CSS or Style Specification formats in CSS In CSS, there are three levels of style sheets: 1. Inline styles: Inline styles are styles that are applied directly to HTML elements using the "style" attribute. For example <p style="color: red;">This text is red</p> Inline styles have the highest specificity, which means that they override styles defined in external and internal style sheets. 2. Internal styles: Internal styles are styles that are defined within the <head> section of an HTML document using the <style> element. For example: <head> <style> pt color: red; } <style> <head> <body> Y <p>This text is red</p> </body> Internal styles have a higher specificity than external styles, but a lower specificity than inline styles. 3. External styles: External styles are styles that are defined in a separate CSS file and linked to an HTML document using the <link> element. For example: <head> <link rel= <head> <body> <p> This text is styled using an external style sheet</p> </body> ‘stylesheet” href="styles.css"> External styles have the lowest specificity, which means that they can be overridden by both internal and inline styles. However, they are typically the easiest to maintain and reuse across multiple pages. Selector Forms in CSS Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru Selector forms in CSS are a way to target elements based on their relationship to other elements in the HTML document. They allow you to select elements based on their position in the document tree, their attributes, or their content. Here are some common selector forms in CSS: 1, Element Selector: This selects all elements of a particular type. For example, to select all paragraphs in the document, use the selector p. 2. Class Selector: This selects all elements that have a particular class attribute. For example, to select all elements with the class "button’, use the selector .button. 3. ID Selector: This selects a single element with a specific ID attribute. For example, to select the element with the ID "header", use the selector #header. 4. Attribute Selector: This selects elements that have a specific attribute value. For example, to select all elements with the attribute "href" set to “httpsi/iwww.example.com", use the selector [href="https://www.example. com") 5. Descendant Selector: This selects elements that are descendants of another element. For example, to select all span elements that are descendants of a div element, use the selector div span. 6. Child Selector: This selects elements that are direct children of another element. For example, to select all Ii elements that are direct children of a ul element, use the selector ul > li. 7. Adjacent Sibling Selector: This selects an element that is immediately adjacent to another element. For example, to select a p element that immediately follows a div element, use the selector div + p. 8. General Sibling Selector: This selects all elements that are siblings of another element. For example, to select all p elements that follow a div element, use the selector div ~ p. Property Value Forms In CSS, there are several property value forms that can be used to style HTML elements. ‘Some common ones include: 1. Keyword values: These are pre-defined values that represent a specific property setting. For example, the ‘display’ property can have keyword values like block’, ‘inline’, ‘none’, etc. 2. Length values: These specify a length measurement, such as pixels (px), ems (em), or percentages (%). For example, ‘width: 100px' sets the width of an element to 100 pixels. 3. Color values: These specify a color using various formats, such as hexadecimal (#RRGGBB), RGB, or HSL. For example, 'background-color: #FF0000' sets the background color of an element to red. 4, URL values: These specify a URL for images or other resources. For example, "background-image: url("image.jpg") sets the background image of an element to image ipg 5. Function values: These are special values that use a function to caloulate a value. For example, ‘transform: rotate(45deg)' rotates an element by 45 degrees using the ‘rotate’ function. Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru 6. Multiple values: Some properties allow for multiple values to be specified, separated by commas. For example, ‘padding: 10px 20px 30px 40px’ sets the padding of an element to 10 pixels on top, 20 pixels on the right, 30 pixels on the bottom, and 40 pixels on the left. These are just a few examples of the many property value forms available in CSS. By using different combinations of these forms, you can create a wide variety of styles for your web pages, Font properties in CSS In CSS (Cascading Style Sheets), there are several font properties that can be used to specify the appearance of text. Here are some of the most commonly used font properties: 1. font-family: This property sets the font face that will be used for the text. It can be set toa specific font name, such as "Arial" or "Times New Roman," or to a generic font family, such as "sans-serif" or "serif." which will use the default sans-serif or serif font on the user's system, 2. font-size: This property sets the size of the font. It can be set to a specific size in pixels, points, ems, or other units, or it can be set using relative values such as "larger" or "smaller." 3. font-weight: This property sets the boldness of the font. It can be set to values such as "normal," "bold," or a numeric value such as 400 or 700. 4. font-style: This property sets the style of the font. It can be set to values such as “normal,” “italic,” or "oblique." 5. font-variant: This property sets the variant of the font. It can be set to values such as “normal” or "small-caps." 6. line-height: This property sets the height of each line of text. It can be set to a specific size or a relative value such as "normal." 7. text-decoration: This property sets the decoration of the text. It can be set to values such as “none,” "underline," or “line-through." These font properties can be used in combination to create a wide variety of text styles and appearances. Few other Properties in css(Properties List in CSS) CSS (Cascading Style Sheets) is a language used for describing the presentation of web pages. Here are some commonly used CSS properties: 1. color: Sets the color of text. 2. background-color: Sets the background color of an element. 3. font-size: Sets the size of the font. 4. font-family: Sets the font family to be used. 5. font-weight: Sets the weight (boldness) of the font. 6. text-align: Sets the horizontal alignment of text. 7. line-height: Sets the height of a line of text. 8. padding: Sets the padding (spacing) within an element. 9. margin: Sets the margin (spacing) around an element. 10. border: Sets the border of an element. Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru 11. width: Sets the width of an element. 12. height: Sets the height of an element. 18. display: Sets how an element is displayed (block, inline, etc.). 14. float: Sets an element to float to the left or right of its container. 16. position: Sets the position of an element (relative, absolute, etc.). 16. z-index: Sets the stacking order of overlapping elements. 17. opacity: Sets the opacity (transparency) of an element. 18. transition: Sets the transition effect when an element changes state (e.g. on hover), 19. text-decoration: Sets the decoration of text (underline, overiine, etc.) 20. box-shadow: Sets the shadow of an element. ‘The <span> and <div> tags Both the <span> and <div> tags are HTML tags used for styling and format webpage. g content on a The <span> tag is an inline element used to apply styles to specific parts of text within a larger block of content. It does not create a new line or add any spacing before or after the element. The <span> tag is commonly used to apply styles such as font size, font color, or text decoration to a small portion of text within a larger paragraph. For example, <p>Here is some <span style="color:red;">red text</span> in a paragraph. </p> will display "red text" in the color red the paragraph ‘The <div> tag, on the other hand, is a block-level element used to create sections of content on a webpage. It can contain other block-level and inline elements and is commonly used to group related content together, such as a navigation menu, a header, or a footer. The <div> tag can also be used to apply styles to an entire section of content. For example, <div style="background-color:blue; color.white;">This is a section of content.</div> will display a blue box with white text. In summary, the <span> tag is used for small sections of content within a larger block, while the <div> tag is used for creating larger sections of content on a webpage. Overview and features of CSS3 CSS3 (Cascading Style Sheets Level 3) is the latest version of the CSS standard used for web page layout and presentation. It was first introduced in 1999, and the latest version was released in 2018. CSS3 includes a range of new features and improvements over previous versions, including: 1. Selectors: CSS3 includes many new selectors, such as attribute selectors, structural pseudo-classes, and negation pseudo-classes. These selectors allow for more precise targeting of HTML elements. 2. Box Model: CSS3 introduces the box-sizing property, which allows for greater control over how the width and height of an element are calculated. It also includes the border-radius property, which enables the creation of rounded comers on boxes. Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru 3. Colors and Gradients: CSS3 introduces a range of new color and gradient properties, including HSL, HSLA, RGBA, and multiple background images. These properties give designers more flexibility and control over color schemes and backgrounds. 4. Typography: CSSS includes new properties for controlling fonts, such as font-face, which allows for the use of custom fonts, and font-size-adjust, which ensures consistent font sizes across different devices. 5. Transitions and Animations: CSS3 provides new properties for creating transitions and animations, such as transition-property, transition-duration, and animation-name. ‘These properties enable designers to create more engaging and interactive web pages, 6. Media Queries: CSS3 includes media queries, which allow for the creation of responsive web pages that adjust their layout based on the device they are viewed on. Overall, CSS3 provides web designers with many new features and tools for creating beautiful, responsive, and engaging web pages. Box model in CSS The box model is a fundamental concept in CSS (Cascading Style Sheets) that defines how elements are displayed and sized on a webpage. It describes the layout of an HTML element by breaking it down into several components or layers, starting from the innermost content and moving outward to the borders. ‘The box model consists of four parts: 1. Content: This is the actual content of the element, such as text or images. 2. Padding: This is the space between the content and the border of the element. It can. be set using the padding property in CSS. 3. Border: This is the line that surrounds the content and padding. It can be set using the border property in CSS. ‘Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru 4, Margin: This is the space outside the border of the element. It can be set using the margin property in CSS. Each of these parts affects the size and layout of the element. The width and height of an element are calculated by adding the content width and height to the padding, border, and margin. The box model is important for creating layouts and styling web pages with CSS. Understanding how it works can help you create better designs and more efficient code. Object orientation and JavaScript JavaScript can be used in conjunction with HTML to create interactive and dynamic web applications. When using JavaScript with HTML, objects can be created and manipulated to provide a rich user experience. Here's an example of how object-oriented programming can be used in HTML and JavaScript: “html <IDOCTYPE htmi> <html> <head> ‘<title>Object-Oriented Programming in JavaScript
1 define a Person object constructor function function Person(name, age) { this.name = name; this.age = age; } 1 define a method for the Person object Person.prototype.sayHello = function() { document getElementByld("output").innerHTML = "Hello, my name is * + this.name: ik // create a new instance of the Person object let person = new Person(*John", 30); 1! call the sayHello method person.sayHello(); Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru In the above example, a ‘Person’ object constructor function is defined, which takes in a “name’ and ‘age’ parameter. A method “sayHello()’ is also defined for the ‘Person’ object using the prototype property. In the HTML, a ‘div’ element is defined with an ‘id’ of ‘output’. The JavaScript code creates a new instance of the ‘Person’ object with the name "John" and age 30, and then calls the *sayHello()’ method. The output of the method is displayed in the ‘div’ element using the ‘innerHTML’ property. This is just a simple example, but it illustrates how object-oriented programming can be used in conjunction with HTML and JavaScript to create dynamic and interactive web applications. General syntactic characteristics: - JavaScript code is usually written in script tags within an HTML document or in a separate Js file. - Statements in JavaScript are terminated with a semicolon (;), although it is not strictly necessary. - JavaScript is a case-sensitive language, so variables and function names must be written in the correct capitalization. Primitives, operations, and expressions: - JavaScript has six primitive data types: string, number, boolean, null, undefined, and symbol. - Operations in JavaScript include arithmetic (+, -, *,/, %), comparison (==, logical (&8, ||, !), and bitwise (& |, *, ~, <<, >>, >>>). - Expressions are combinations of variables, values, and operators that evaluate to a value. For example, 2 + 2 is an expression that evaluates to 4. Screen output and keyboard input: - JavaScript can output text to the screen using the console.log() function or by manipulating the HTML content of a web page. - Keyboard input can be obtained using the prompt() function, which displays a dialog box asking for user input, or by handling events such as key presses using event listeners. Introduction to Animation Definition : Animation refers to the process of creating the illusion of motion and change by displaying a sequence of static images that minimally differ from each other. These images, known as frames, are played in rapid succession, creating the perception of motion. Animation can be used in a variety of contexts, from entertainment to education and advertising Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru The Start and End States, Interpolation In animation, the start state is the initial pose or image, while the end state is the final pose or image. The transition between these two states is achieved through a series of intermediate frames that are created using a process called interpolation. Interpolation involves creating new frames that blend the characteristics of the start and end states, creating a smooth transition between the two. ‘The start and end states In CSS animation, the start and end states refer to the initial and final styles of an element that are being animated, To create an animation in CSS, you need to define the start state and the end state of the element. The start state is the initial style of the element before the animation begins, while the end state is the final style of the element after the animation completes. The start state and end state can be defined using CSS properties, and they can be the same or different depending on the desired effect. For example, if you want to animate the background color of a button from red to blue, the start state would be the button with a red background color, and the end state would be the button with a blue background color. Here's an example of how to define the start and end states of an animation in CSS: ess button { background-color: red; /* Start state */ transition: background-color 1s ease; /* Property to animate and duration */ } button:hover { background-color: blue; /* End state */ + In this example, the start state of the button is a red background color, and the end state is a blue background color when the user hovers over the button. The ‘transition’ property specifies the "background-color’ property to animate and the duration of the animation, which is 1 second in this case. When the user hovers over the button, the background color smoothly transitions from the start state (red) to the end state (blue) over the duration of 1 second with an ease timing function. Note that there are other ways to define animations in CSS, such as using ‘@keyframes’ rules and the ‘animation’ property. The approach you choose depends on the specific animation effect you want to achieve. Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru Interpolation Interpolation in CSS refers to the process of smoothly transitioning between two or more CSS property values over a specified duration using keyframes and animation properties. To create an animation with interpolation in CSS, you need to define the start and end states of an element using CSS properties. Then, you use keyframes to define intermediate states of the animation, specifying the CSS properties for each state. Finally, you use the animation’ property to apply the animation to the element, specifying the duration, timing function, delay, and other properties. For example, let's say you want to create an animation that smoothly changes the color of a button from red to blue. You can define the start state with the button having a red background color using the "background-color" property: css button { background-color: red; Then, you can define the end state with the button having a blue background color: oss button { background-color: blue: } To animate the button between these two states, you can use keyframes to define the intermediate states of the animation. In this case, we'll use two keyframes, one at the start of the animation (0%) and one at the end of the animation (100%): ira @keyframes colorChange { 0%{ background-color: red; } 100% { background-color: blue; + } Finally, you can apply the animation to the button using the ‘animation’ property, specifying the duration, timing function, delay, and other properties: “css Tejaswi S, Asst. Prof. Dept. of Computer Science, Seshadripuram Degree College, Mysuru button { animation-name: colorChange; animation-duration: 2s; animation-timing-function: ease-in-out; animation-delay: 18; iteration-count: infinite: This will create an animation that smoothly changes the color of the button from red to blue over a duration of 2 seconds, with an ease-in-out timing function, a 1 second delay before starting the animation, and infinite iteration count. Animations in HTML ‘Animations can be created using various tools, from traditional hand-drawn animation to digital software like Adobe Animate, Toon Boom, and Blender. With the advent of HTML5, web developers can also create animations using web technologies like CSS, SVG, and JavaScript. HTML provides several ways to create animations, including CSS transitions and animations, SVG animations, and JavaScript-based animations. CSS transitions and animations allow you to specify the properties that should change over time, and the duration and timing of the animation. SVG animations enable you to animate SVG elements and attributes, while JavaScript-based animations offer greater control over the animation process and can be used to create complex animations and interactions. To create animations in HTML, you can use CSS or JavaScript. Here are some ways to create animations using both methods: 1. CSS Animations: CSS animations allow you to create animations using only CSS code. You can define the animation properties such as duration, timing function, and keyframes. Here is an example of a CSS animation: “html