In this project, you ll learn how to use CSS to create an animated sunrise.

Similar documents
Magazine-style websites often have lots of small items on a page. First you re going to create a heading and background for your magazine.

In this project, you ll learn how to create your own webpage to tell a story, joke or poem. Think about the story you want to tell.

In this project, you ll create a set of linked rooms where each room is a different web page which you can decorate with HTML.

Stickers! Introduction. Step 1: Colourful coding sticker

Let s create a grid of pixels that you can use for creating pixel art. CSS provides table styles for grid and table layouts.

In this project, you ll create a mystery letter that looks like each word has been cut from a different newspaper, magazine, comic or other source.

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

Introduction to WEB PROGRAMMING

In this project, you ll learn how to create a webpage for your favourite recipe.

In this project, you will create a showcase of your HTML projects and learn about links and embedding resources.

ORB Education Quality Teaching Resources

Tutorial: Overview. CHAPTER 2 Tutorial

You will be writing code in the Python programming language, which you may have learnt in the Python module.

CSS (CASCADING STYLE SHEETS) LAYOUT: INTRODUCTION ON PAGE BACKGROUNDS. By Ted Mitchell

Add in a new balloon sprite, and a suitable stage backdrop.

Advanced Special Effects

Positioning in CSS: There are 5 different ways we can set our position:

Links Menu (Blogroll) Contents: Links Widget

REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB!

CSS worksheet. JMC 105 Drake University

MEGA MENU USER GUIDE. Phone: Extension version: 1.0 Magento Compatibility: CE 2.

Create a three column layout using CSS, divs and floating

Designing the Home Page and Creating Additional Pages

Adobe Flash CS5. Creating a web banner. Garvin Ling Juan Santa Cruz Bruno Venegas

ICT IGCSE Practical Revision Presentation Web Authoring

ICT IGCSE Practical Revision Presentation Web Authoring

Week 8 Google Maps. This week you ll learn how to embed a Google Map into a web page and add custom markers with custom labels.

Creative Effects with Illustrator

AGENDA :: MULTIMEDIA TOOLS :: CLASS NOTES

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

How to Add Text to an Animated Image

About Freeway. Freeway s Tools and Palettes

Creative Effects with Illustrator

Using Flash Animation Basics

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Web Designer s Manual

Windows Movie Maker lets you edit videos from video and photo files. It is free from Microsoft.

Exploring Computer Science Web Final - Website

How to lay out a web page with CSS

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

Edge Television Advertisement. -Open the 3 images of TV characters and the network logo in Photoshop. Your images must be high resolution images!

Introduction to Flash - Creating a Motion Tween

Table of contents. Sliding Billboard DMXzone.com

CROSSFADE ANIMATION with AFTEREFFECTS

Styles, Style Sheets, the Box Model and Liquid Layout

Meet the Cast. The Cosmic Defenders: Gobo, Fabu, and Pele The Cosmic Defenders are transdimensional

FolderView DMXzone.com FolderView Manual

Title and Modify Page Properties

Guidelines for Legible and Readable Text, page 2-1 Visual Density Transparent, Translucent, or Opaque?, page 2-3

AO3. 1. Load Flash. 2. Under Create New click on Flash document a blank screen should appear:

DNNGo LayerSlider3D. User Manual

Gdes2000 Graphic Design for Internet & MM. Dreamweaver: Simple page construction with DIVs.

Enlargeit! Version 1.1 Operation Manual

Interactive Tourist Map

Google Earth. Tutorials. Tutorial 2: Annotating Google Earth

= 3 + (5*4) + (1/2)*(4/2)^2.

Adobe Flash CS3 Reference Flash CS3 Application Window

Table of contents. Ajax AutoComplete Manual DMXzone.com

FolderView DMXzone.com Folder View 2 Manual

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee

1 Getting started with Processing

Drupal FAQs for administrators

Recipes4Success. Animate Plant Growth. Share 4 - Animation

[ the academy_of_code] Senior Beginners

Tutorial 4. Activities. Code o Editor: Expression Web o Focus : Base Layout, navigation with folders, external stylesheets, Open up Expression Web

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

Website Development (WEB) Lab Exercises

How to lay out a web page with CSS

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

Flames in Particle Flow

HTML/CSS Lesson Plans

Building a Waterfall Chart in Excel

BUILDING A WATERFALL CHART IN EXCEL

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

Using Dreamweaver CS6

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

Fish Eye Menu DMXzone.com Fish Eye Menu Manual

Create a Web Page with Spry Navigation Bar. March 30, 2010

Welcome to Book Display Widgets

FLASH ANIMATION TUTORIAL

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

COMSC-031 Web Site Development- Part 2

2. Click on the Freeform Pen Tool. It looks like the image to the right. If it s not showing, right click on that square and choose it from the list.

HTML & CSS. Rupayan Neogy

Dice in Google SketchUp

CUPA-HR Chapters: WordPress Reference Guide

Illustrator Tutorial: How to create a stipple texture By Jason McConnell on Dec,

CS7026 CSS3. CSS3 Graphics Effects

Epilog Laser Cutter Instructions (Only the Essentials)

Using Microsoft Word. Tables

PHOTOPLUS HELP GUIDE

FRONTPAGE STEP BY STEP GUIDE

Creating and Publishing Faculty Webpages

Using Dreamweaver. 4 Creating a Template. Logo. Page Heading. Home About Us Gallery Ordering Contact Us Links. Page content in this area

Using Dreamweaver CS6

Chapter 8: Using Toolbars

Dreamweaver Tutorial #2

Dreamweaver CS5 Lab 4: Sprys

Animatron Tutorial. Ronald Bourret

Transcription:

Sunrise Introduction In this project, you ll learn how to use CSS to create an animated sunrise. Step 1: Creating the sun Let s start by adding an image for the sun and positioning it with some CSS. Activity Checklist Open this trinket: jumpto.cc/web-sunrise. The project should look like this: 1

Look inside the body of your index.html file and you ll find the the div elements for the sky and the sea. <div id="sky"> </div> <div id="sea"> </div> An image for the sun is already included in your project. Add the image inside your sun div including an id so you can style it: Whoa, the image is huge. Go to style.css and add the CSS to set the image height: 2

Note that the width is updated automatically to keep the proportions the same. Finally, let s add some code to position the sun: Step 2: Animating the sunrise To animate your sunrise, you need to define how the sun moves and how long it takes to rise. To do this you define a list of key frames. Each key frame defines the CSS properties of an element at a particular point in an animation. Activity Checklist First, you need to use @keyframes to create a new animation called sunrise. Add this CSS code to the end of your style.css file: @keyframes sunrise { 0% {top: 90%; 100% {top: 0; This code tells the sun where to position itself at the start (0% ) and the end ( 100% ) of the animation. Because the sun is inside the sky div, the top and left positions you give are within to the sky, with top: 100% being the bottom of the sky, and not the bottom of the webpage. 3

Now that you have created a sunrise animation, you just need to tell your sun to use it! Add the highlighted code to your sun s CSS: This tells the sun to spend 10 seconds animating a sunrise. To run the animation again in Trinket, just click Autorun. Challenge: Diagonal animation Can you add code to your sunrise animation, to make your sun start at the bottom left of the sky and move diagonally to its position at roughly the top center? You can use the left property to do this, for example: left: 40%; 4

Step 3: Infinite animation Let s make the animation keep repeating forever. Activity Checklist If you want the sun to rise and then set, just add more keyframes to your animation: @keyframes sunrise { 0% {top:90%; left:0; 33% {top:0; left:40%; 66% {top:0; left:40%; 100% {top:90%; left:80%; This means that the animation starts and ends with the sun at the bottom of the sky, and stays at the top from 33% until 66% of the animation. Now you just need to add the word infinite to the #sun animation to make it loop forever: 5

Test out your animation. Does the sun keep rising and setting? Step 4: Animating the sky Animation isn t just for movement. Let s animate the sky to turn dark at night. Activity Checklist Add an animation called sky to your CSS: @keyframes sky { 0% {background: black 100% {background: lightblue Notice that this time you re animating the colour of the sky, and not the position. Add code to your sky, to tell it to use your new animation: animation: sky 10s; 6

Click Autorun to test your animation. Challenge: Improve the sky Can you change the sky animation so that it matches the sun and stays blue during the day and returns to black as the sun sets. Make it loop forever too. Challenge: More animation Can you animate another image? You can animate the position, colour, shape, size, opacity (seethroughness) or anything else you can think of. Also try changing the amount of time your animations run for. For each item you want to animate, you will need to: Include it in your HTML with an id 7

Add a style for the id Create an @keyframes rule Use animation: in the style to use the animation you defined with @keyframes Click on the image icon to see the images that are included in the project: You can also upload your own images if you like. Don t forget you can put items in the sea as well as the sky: 8

In the example the rainbow uses opacity for a fade effect: @keyframes fade { 0% {opacity: 0; 50% {opacity: 100; 66% {opacity: 0; 100% {opacity: 0; The boat uses a negative starting position so that you can t see it for part of the animation: @keyframes left-right { 0% {left:-50%; 100% {left:200%; 9