Web design and its software. Creating and decorating a web page (Macromedia Flash)
Several tools work together to create and decorate a web page: a text or code editor where the code is written (Notepad, VS Code and others), the browser and its developer tools, a graphics editor for pictures (PhotoShop, GIMP), animation tools and content management systems. JavaScript is a programming language that runs in the browser; it makes an HTML page respond to the user's actions (a button click, typed text). Its arithmetic resembles Pascal's, but with differences: / is always real division (7/2 = 3.5), % gives the remainder, and ** or Math.pow gives a power; the maths functions are Math.abs(a) – absolute value, Math.pow(a, b) – a to the power b, Math.sqrt(a) – square root, Math.sin(a), Math.cos(a), Math.tan(a) (the angle in radians), Math.log(a) – natural logarithm, and Math.round(a) – rounding. A form is made in HTML with input fields and a button, and a function does the calculation. Macromedia Flash was popular for vector animation and interfaces (SWF files) and Dreamweaver was a page editor; but Flash lost its place because of security weaknesses, not working on phones, and HTML5, CSS and JavaScript providing enough features: Adobe ended support on 31 December 2020 and browsers removed it. One of its successors is Adobe Animate, which can output animation for HTML5. Do not download unlicensed (“cracked”) programs: they often contain malware; paid programs have free alternatives or trial versions.
A tile layer divides the area of a room by the area of one tile to find how many tiles are needed and rounds the result up, because you cannot buy part of a tile. The same calculation can be done by a rule written once instead of by hand every time. A calculation form on a web page does exactly this.
Builders, tailors and warehouse accountants do repeated calculations with a ready rule or table.
Measure the length of one of your steps and write the rule “number of steps → metres” on paper, then test it with two values.
1<!DOCTYPE html> 2<html lang="uz"> 3<head> 4 <meta charset="utf-8"> 5 <title>QQS hisobi</title> 6</head> 7<body> 8 <h1>QQS hisoblagich</h1> 9 <p>Narx (so‘m): <input type="number" id="narx" value="250000"></p> 10 <button onclick="hisobla()">Hisobla</button> 11 <p>QQS bilan: <span id="natija"></span> so‘m</p> 12 <script> 13 function hisobla() { 14 var narx = Number(document.getElementById("narx").value); 15 var qqs = narx * 12 / 100; 16 document.getElementById("natija").textContent = narx + qqs; 17 } 18 </script> 19</body> 20</html>
| Expression | Result |
|---|---|
| Math.sqrt(144) | 12 |
| Math.pow(2, 10) | 1024 |
| Math.abs(-7.5) | 7.5 |
| Math.round(2.6) | 3 |
| 17 % 5 | 2 |
| 7 / 2 | 3.5 |
| Math.sqrt(Math.pow(3, 4)) | 9 |
“Form workshop”: pairs write the VAT form, then change it to another calculation (a discount or the average of two numbers); a neighbouring pair checks it with 3 test values.