Internet Technologies

Tasks studies - laboratory


Project maintained by dawidolko Hosted on GitHub Pages — Theme by dawidolko

Creating Complex Page Layouts, RWD Introduction

1. CSS Animations

In the past, animations on webpages were done, for example, using Adobe Flash. Later, JavaScript was also used (by writing scripts that dynamically created and removed HTML elements with varying property values).
Nowadays, however, many animations are natively supported by CSS, with JavaScript serving a supplementary role (for example, triggering an animation).

To animate an element, you must assign it an animation-name property. Then, you define an at-rule @keyframes with that name as its identifier. You must set the duration of the animation using the animation-duration property, which defaults to 0 (so the animation will not play). If an animation has only two states, you can use the from and to keywords. Otherwise, you can use percentage values from 0% to 100% (which correspond to from (0%) and to (100%)).

<!DOCTYPE html>
<html>
  <head>
    <style>
      div {
        width: 100px;
        height: 100px;
        background-color: rgb(0, 51, 160); /* base color */
        animation-name: example;
        animation-duration: 15s;
      }
      @keyframes example {
        0% {
          background-color: rgb(128, 0, 0);
        }
        25% {
          background-color: rgb(104, 73, 28);
        }
        50% {
          background-color: rgb(127, 64, 112);
        }
        100% {
          background-color: rgb(0, 102, 51);
        }
      }
    </style>
  </head>
  <body>
    <h1>The colors of the University of Rzeszów Colleges are as follows:</h1>
    <div></div>
    <p>
      <b>Note:</b> When the animation ends, the element will return to its
      default state.
    </p>
  </body>
</html>

Task 1.

Write an animation that animates the logo of the University of Rzeszów from its standard version into a monochromatic version (assets are provided). Use the background-image and background-size properties.


Task 2.

Using CSS, create the following spinner:

Use the animation-timing-function property to ensure the animation runs smoothly.


Task 3.

Review the example that defines a custom (i.e. author-created) checkbox. Then add an animation that, upon activation of the checkbox:

Then add a submit button to the form that is animated as follows:


Task 4.

Have the form from the previous task additionally appear as an animated element – that is, it expands dynamically as it animates.
Use the example here as a reference: link.


Task 5.

Review the example grid_areas.html. In that example, the main container first defines the grid-template-areas property, and then subsequent elements are assigned the corresponding grid-area value.


Task 6.

A popular element on websites is the slider. This is a content layout where a group of elements is shown much like a slideshow (hence the name), i.e. one element is visible at a time, while navigation buttons allow switching to the next element. A similar solution is a carousel, where several elements are visible at once and navigation buttons cycle through the elements, usually in a circular fashion (the last element switches back to the first).

Below is a simple slider:


Task 7.

Open the project created in a design tool (e.g., Figma):

Figma: link.
Based on the tasks completed so far, create a responsive implementation of the following homepage fragment for mobile devices and desktops:


lab7

The font Roboto used on the site can be found at:
link


lab7

To access the full version of the Figma file:


lab7

Click Continue with Google, then use your MS Teams credentials (this is also your Google account).

For example, to determine the exact color scheme, click an element:


lab7

If you are interested in an image, press Ctrl and click on the element:

lab7

A useful shortcut is Ctrl+Shift+E (to export all assets):


lab7

If you use it by clicking on a frame:


lab7