Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- Deobfuscated version of the hacker-in-a-hoodie logo by F-Secure
- Original info/files: https://twitter.com/mikko/status/437970730433511424
- https://twitter.com/ydklijnsma
- -->
- <html>
- <head>
- <title>0xF-Secure</title>
- <style type="text/css">canvas {display: block;}</style>
- </head>
- <body>
- <script>
- title_str = '0xF';
- scroller_str = '\u263a\t\t\t\t0xF-Secure Labs squashing malware since 1988\t\t\t\t\u0ca0_\u0cb0\u0cc3\t\t\t\t\t\t\t\tsuch scan\t\t\t\tso detections\t\t\t\tmuch award\t\t\t\twow';
- /*
- Generates a random a star position & direction
- */
- function randomize_starpos(spos) {
- spos.x = Math.random() - .5;
- spos.y = Math.random() - .5;
- spos.s = Math.random()
- }
- window_height = window.innerHeight;
- windows_width = window.innerWidth;
- document.body.style.margin = 0;
- render_canvas = document.createElement('canvas');
- document.body.appendChild(render_canvas);
- render_canvas.height = window_height;
- render_canvas.width = windows_width;
- c2d_context = render_canvas.getContext('2d');
- c2d_context.shadowColor = '#7A9BD7';
- aspect_relative_minsize = Math.min(window_height, windows_width); // Used in text scaling relative to viewport size & aspect
- scroller_xpos = windows_width; // Set starting position of the scroller (just outside the viewport)
- // Initialize the starfield table
- starfield_table = [];
- for (i = 0; (windows_width + window_height) / 4 > i; ++i) {
- starfield_table[i] = [];
- randomize_starpos(starfield_table[i]);
- starfield_table[i].z = Math.random();
- }
- elapsed_frames = 0; // Used for progress, counts frameticks
- setInterval(function () {
- pulse = Math.abs(Math.sin(elapsed_frames * .01)); // Pulse value for the title glow & scroller color rotation
- /*
- Scroller
- */
- c2d_context.fillStyle = 'rgba(0, 0, 0, .2)';
- c2d_context.fillRect(0, 0, windows_width, window_height); // Clear canvas
- c2d_context.font = Math.round(aspect_relative_minsize / 20) + 'pt Courier'; // Set font-size relative to window size
- scroller_pixelwidth = c2d_context.measureText(scroller_str).width; // Precalc scroller pixel width
- // Reset scroller if it has scrolled by completely
- if(scroller_xpos > -scroller_pixelwidth) {
- scroller_xpos -= .7;
- } else {
- scroller_xpos = windows_width;
- }
- scroller_ypos = (.8 * window_height) + Math.sin(elapsed_frames / 20) * (window_height / 16);
- c2d_context.fillStyle = 'hsl(' + Math.round(pulse * 360) + ', 99%, 70%)'; // Pulsating color change
- c2d_context.fillText(scroller_str, scroller_xpos, scroller_ypos);
- c2d_context.fillStyle = 'white'; // Set fillstyle for stars & 0xF title
- /*
- Starfield
- */
- for (index in starfield_table) {
- star_pos = starfield_table[index];
- Z = 1 / (star_pos.z -= 1e-3);
- X = (star_pos.x += Math.sin(elapsed_frames / 450) / 2e3) * Z + .5;
- Y = (star_pos.y += Math.sin(elapsed_frames / 650) / 2e3) * Z + .5;
- // Reset the star if its outside the viewport
- if(0 > X || 0 > Y || X > 1 || Y > 1) {
- randomize_starpos(star_pos);
- star_pos.z = 1;
- }
- rect_size = (1 - star_pos.z) * star_pos.s * 3;
- c2d_context.fillRect(X * windows_width, Y * window_height, rect_size, rect_size);
- }
- /*
- 0xF title
- */
- c2d_context.shadowBlur = 15 * pulse + 5;
- c2d_context.font = Math.round(aspect_relative_minsize / 3) - 1 + 'pt Courier'; // Set font-size relative to window size
- title_width = c2d_context.measureText(title_str).width;
- c2d_context.fillText(title_str, windows_width / 2 - title_width / 2, window_height / 2); // Render title centered
- c2d_context.shadowBlur = 0;
- elapsed_frames++ // Frame counter
- }, 9); // 111.111 FPS
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment