Giter VIP home page Giter VIP logo

star_wars_intro's Introduction

Octocat Storm Trooper

HTML, CSS and JavaScript

Quick look at the project

My take on the Star Wars opening crawler done through css and JavaScript.

  • A Star Wars font face is linked.
  • Mp3 File for audio.
  • CSS file is linked for viewing all animated effects.
  • A generated XML-based image is embedded for the Star Wars Logo
  • Embedded JavaScript code generates the background star pattern along with selecting which episode/title/story intro to display.

element

HTML

  • The total HTML body is written in 12 lines.
    • This only includes the HTML lines in-between the body tags.
    • Does not include anything that could be linked externally or the svg/JavaScript.

JavaScript

  • There are 2 JavaScript functions.
    • The first is a pixel generator that randomly places stars at 3 levels moving at 3 different speeds to give the feeling of floating through space (This is unlike any of the Star Wars crawlers, I did this for an added effect) .

    • The other uses a json-collection containing the first 8 Star Wars opening crawls. A random number is generated and then used to select which episode element to add inside the HTML body each time the page is loaded.

SVG

  • The opening Star Wars logo is rendered by svg (Scalable Vector Graphics) and is not a standard raster image (.png, .img, .bmp, or .gif).
    • Vector images are defined using algorithms. SVG is an XML-based language used for describing the vector image. I created this svg file from a png file with a transparent background using an application called Sketch on my MacBook.
    • The image file contains shape and path definitions that the computer can use to work out what the image should look like when rendered on the screen.
    • Vector image files are usually small, but highly scalable. They do not pixelate at large sizes.
    • The total embedded XML svg line count around 23, but is very misleading due to the lengthy code generated along with word wrap, it appears much larger than a single line of code.
    • You can find out more about Vector Images here.

Audio

If the audio is not playing and you would like to hear it, you may have edit your browsers settings to allow the webpage to autoplay music.

Click here to check out the results on github pages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.