<html> <head> <title>Inwepo Fireworks</title> <style>* { margin: 0; padding: 0; } body { background-color: black; } h1 { margin-top: 5%; font-family: 'Segoe UI'; font-size: 60px; text-align: center; color: white; } </style> </head> <body> <h1>Happy Birthday Chelleee</h2> <script>var rnd = Math.random, flr = Math.floor; let canvas = document.createElement('canvas'); document.getElementsByTagName('body')[0].appendChild(canvas); canvas.style.position = 'absolute'; canvas.style.width = '100%'; canvas.style.height = '100%'; canvas.width = canvas.clientWidth; canvas.height = canvas.clientHeight; let ctx = canvas.getContext('2d'); function rndNum(num) { return rnd() * num + 1; } function vector(x, y) { this.x = x; this.y = y; this.add = function(vec2) { this.x = this.x + vec2.x; this.y = this.y + vec2.y; } } function particle(pos, vel) { this.pos = new vector(pos.x, pos.y); this.vel = vel; this.finish = false; this.start = 0; this.update = function(time) { let timeSpan = time - this.start; if (timeSpan > 500) { this.finish = true; } if (!this.finish) { this.pos.add(this.vel); this.vel.y = this.vel.y + gravity; } }; this.draw = function() { if (!this.finish) { drawDot(this.pos.x, this.pos.y, 1); } } } function firework(x, y) { this.pos = new vector(x, y); this.vel = new vector(0, -rndNum(10) - 3); this.color = 'hsl(' + rndNum(360) + ', 100%, 50%)' this.size = 4; this.finish = false; this.start = 0; let exParticles = [], exPLen = 100; let rootShow = true; this.update = function(time) { if (this.finish) { return; } rootShow = this.vel.y < 0; if (rootShow) { this.pos.add(this.vel); this.vel.y = this.vel.y + gravity; } else { if (exParticles.length === 0) { flash = true; for (let i = 0; i < exPLen; i++) { exParticles.push(new particle(this.pos, new vector(-rndNum(10) + 5, -rndNum(10) + 5))); exParticles[exParticles.length - 1].start = time; } } let countFinish = 0; for (let i = 0; i < exPLen; i++) { let p = exParticles[i]; p.update(time); if (p.finish) { countFinish++; } } if (countFinish === exPLen) { this.finish = true; } } } this.draw = function() { if (this.finish) { return; } ctx.fillStyle = this.color; if (rootShow) { drawDot(this.pos.x, this.pos.y, this.size); } else { for (let i = 0; i < exPLen; i++) { let p = exParticles[i]; p.draw(); } } } } function drawDot(x, y, size) { ctx.beginPath(); ctx.arc(x, y, size, 0, Math.PI * 2); ctx.fill(); ctx.closePath(); } var fireworks = [], gravity = 0.2, snapTime = 0, flash = false; function init() { let numOfFireworks = 20; for (let i = 0; i < numOfFireworks; i++) { fireworks.push(new firework(rndNum(canvas.width), canvas.height)); } } function update(time) { for (let i = 0, len = fireworks.length; i < len; i++) { let p = fireworks[i]; p.update(time); } } function draw(time) { update(time); ctx.fillStyle = 'rgba(0,0,0,0.3)'; if (flash) { flash = false; } ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = 'white'; ctx.font = "30px Segoe UI"; let newTime = time - snapTime; snapTime = time; ctx.fillStyle = 'blue'; for (let i = 0, len = fireworks.length; i < len; i++) { let p = fireworks[i]; if (p.finish) { fireworks[i] = new firework(rndNum(canvas.width), canvas.height); p = fireworks[i]; p.start = time; } p.draw(); } window.requestAnimationFrame(draw); } window.addEventListener('resize', function() { canvas.width = canvas.clientWidth; canvas.height = canvas.clientHeight; }); init(); draw(); </script> </body> </html> <html> <head> <body> <body bgcolor="black"><center><br> <font face="Abel" size="5px" color="white"><b></b> <br><font size="4px"> <font color="white">[ </font><marquee scrollamount="5" width="630" height="20" behavior="alternate">Happy Birthday Michelle. Nothing makes me happier than seeing my best friend happy. Happy birthday, CELEEEEEEE! WISH YOU ALL THE BEST!!!!!!!</marquee><font color="white"> ]</font> <br><br><font size="3px" face="Ubuntu Condensed"> </body> </font>
Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML
. You can also specify the stylesheet information in styles.css
tab and scripts information in scripts.js
tab and start coding.
HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.
<!DOCTYPE html>
<html>
and ends with </html>
<h1>
to <h6>
where <h1>
is the highest important heading and <h6>
is the least important sub-heading.<p>..</p>
tag.<a>
tag.
<a href="https://onecompiler.com/html">HTML online compiler</a>
<img>
tag, where src
attribute consists of image name.<button>..</button>
tag<ul>
for unordered/bullet list and <ol>
for ordered/number list, and the list items are defined in <li>
.<a href="https://onecompiler.com/html">HTML online compiler</a>
CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.
Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.
body{
padding: 25px;
}
.title {
color: #228B22;
font-family: Candara;
}
<table>
tag.<tr>
tag<th>
tag<td>
tag<caption>
tag<script>
is the tag used to write scripts in HTML<script src="script.js"></script>