Figma To Real Website | Responsive Homepage | HTML, CSS & JavaScript | Part 2

GTCoding
11 Dec 202109:01

Summary

TLDRThis tutorial series guides viewers through transforming a sigma design into a functional website using HTML, CSS, and JavaScript. The video begins by instructing how to set up the project by downloading a Figma file and creating necessary files in a development environment. It then details linking CSS and JavaScript to the HTML file, obtaining font links from Google Fonts, and setting up color variables in CSS. The final steps involve exporting images and icons from Figma for the website, with a focus on maintaining quality through SVG format for icons. The video promises to delve into coding in subsequent episodes.

Takeaways

  • 😀 The tutorial series aims to convert a Figma design into a functional website using HTML, CSS, and JavaScript.
  • 🔗 A Figma file link is provided in the description for downloading, and viewers are instructed to open it in the Figma application.
  • 💻 For those without Figma, the script suggests downloading it from Google and creating a free account to get started.
  • 📁 The script outlines the creation of necessary files: an HTML file (index.html), a CSS file (style.css), and a JavaScript file (main.js).
  • 🔗 The tutorial explains how to link the CSS and JavaScript files to the HTML file using the appropriate HTML tags.
  • 🖌️ The script details the process of obtaining font links from Google Fonts for the 'Railway' and 'Poppins' fonts in various styles.
  • 🎨 The video demonstrates creating CSS variables for colors in the 'style.css' file, pulling color codes from the Figma design.
  • 📎 CSS variables offer the advantage of easy color updates across the website, as they can be changed in one place.
  • 🖼️ The process of exporting images and icons from the Figma file is described, including the use of PNG for images and SVG for icons to maintain quality.
  • 📁 Images and icons are to be saved in an 'images' folder within the project directory for easy access and organization.
  • 🔍 The script emphasizes the importance of exporting all necessary images and icons from Figma to prepare for coding the website.
  • 👍 The video concludes with an invitation for viewers to ask questions, like the video, and subscribe for updates.

Q & A

  • What is the main purpose of the tutorial series mentioned in the script?

    -The main purpose of the tutorial series is to convert a sigma design into a real website using HTML, CSS, and JavaScript.

  • What is the first step suggested in the script to begin the project setup?

    -The first step is to download and open the provided Figma file in the Figma application.

  • How can someone who does not have Figma installed access it?

    -They can search for 'Figma' on Google, download it from there, and create a free account to get started.

  • What are the three main files that need to be created for the project according to the script?

    -The three main files to be created are an HTML file named 'index.html', a CSS file named 'style.css', and a JavaScript file named 'main.js'.

  • How are the CSS and JavaScript files linked to the HTML file in the script?

    -The CSS file is linked within the 'head' section of the HTML using a 'link' element, and the JavaScript file is linked just before the closing 'body' tag using a 'script' element with the 'src' attribute.

  • What are the two fonts mentioned in the script that need to be used in the project?

    -The two fonts mentioned are 'Railway' and 'Poppins'.

  • How can one obtain the necessary font files from Google Fonts?

    -One can visit fonts.google.com, search for the required fonts, select the specific font weights needed, and use the provided link to include them in the HTML file.

  • What is the advantage of using CSS variables for colors as mentioned in the script?

    -The advantage of using CSS variables for colors is that if you need to change a color later, you can do so in just one place, and the change will be reflected everywhere the variable is used.

  • How does the script suggest exporting images and icons from the Figma file?

    -The script suggests selecting the image or icon in Figma, using the 'Export' option in the 'Design' tab, choosing the desired format (PNG for images, SVG for icons), and saving them to the project's images folder.

  • What should be done with the exported images and icons after they are saved in the images folder?

    -After exporting, the images and icons should be used in the project as needed, ensuring that the website design matches the Figma design.

  • What is the final step mentioned in the script before starting to write the actual code?

    -The final step mentioned is to export all the necessary images and icons from the Figma file to prepare for the coding process.

Outlines

00:00

📝 Project Setup and File Creation

The video begins with an introduction to a tutorial series focused on converting a design into a functional website using HTML, CSS, and JavaScript. The first step outlined is to download and open a provided Figma file using the Sigma application, with a link to the file provided in the video description. Viewers are instructed to install Figma if they haven't already and to create a free account. Subsequently, the tutorial covers the creation of the essential files for the project: an HTML file named 'index.html', a CSS file named 'style.css', and a JavaScript file named 'main.js'. These files are to be created within a folder called 'responsive home page' using VS Code. The video also demonstrates how to link the CSS and JavaScript files to the HTML file within the basic HTML5 structure.

05:03

🎨 Font and Color Setup for the Website

This paragraph delves into the specifics of setting up fonts and colors for the website. The tutorial refers to the Figma file to identify the required fonts: 'Railway' in black and thin versions, and 'Poppins' in regular and bold versions. It guides the viewers to acquire these fonts from fonts.google.com, demonstrating how to select and link the necessary font styles directly into the HTML file. Following the fonts, the video moves on to the creation of CSS variables for the website's colors, extracted from the Figma design. The process includes copying the hex codes for various colors and defining them as CSS variables within the root selector in the 'style.css' file. This approach allows for easy color changes across the entire website by simply updating the variable's value. The paragraph concludes with the task of exporting all necessary images and icons from the Figma file to the project's 'images' folder, with a demonstration of how to export an image and an icon in different formats, emphasizing the use of SVG for icons to maintain quality at different sizes.

Mindmap

Keywords

💡Figma

Figma is a cloud-based design tool primarily used for user interface and user experience (UI/UX) design. It allows multiple users to collaborate in real-time, which is crucial for team projects. In the video, Figma is used to create the design of the website, and the audience is instructed to download and open a specific Figma file to view the design they will be converting into a website.

💡HTML

HTML, or HyperText Markup Language, is the standard markup language for creating web pages and web applications. It is composed of a series of elements, which are the building blocks of all web pages. In the video, HTML is one of the core technologies used to create the structure of the website, with an 'index.html' file being created as the entry point of the website.

💡CSS

CSS, or Cascading Style Sheets, is a stylesheet language used for describing the presentation of a document written in HTML or XML. It provides a way to control the look and feel of web content, including layout, colors, and fonts. In the video, a 'style.css' file is created to apply styles to the HTML elements, making the website visually appealing.

💡JavaScript

JavaScript is a high-level, interpreted programming language that is commonly used to enhance web pages with interactive elements. It can manipulate the Document Object Model (DOM) to dynamically change content and control multimedia, among other features. In the script, a 'main.js' file is created to add interactivity to the website.

💡Responsive Design

Responsive design is an approach to web design that makes web pages render well on different devices and screen sizes, from desktop computer monitors to mobile phones. The video's project folder is named 'responsive home page,' indicating that the website being created will adapt to various screen sizes.

💡VS Code

VS Code, or Visual Studio Code, is a popular source-code editor made by Microsoft for Windows, Linux, and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, and more. In the video, VS Code is used as the integrated development environment (IDE) for writing the code for the website.

💡Font Linking

Font linking is the process of including external fonts in a web design, allowing for a consistent typography across the site. In the script, the fonts 'Railway' and 'Poppins' are linked from Google Fonts, which provides a variety of free-to-use fonts for web projects.

💡CSS Variables

CSS Variables, also known as custom properties, are a way to store values that can be reused throughout a stylesheet. They make it easier to manage and update the design of a website. In the video, CSS variables are created for colors, allowing for easy color theme changes across the site.

💡Google Fonts

Google Fonts is a library of free licensed font families, an interactive way for designers and developers to experiment with typography. In the video, Google Fonts is used to select and link the 'Poppins' and 'Railway' fonts to the project, enhancing the typography of the website.

💡Exporting Images

Exporting images from a design tool like Figma involves saving them in a specific format to be used in web development. The video instructs viewers to export images and icons from Figma in formats like PNG and SVG for use in the website's 'images' folder.

💡SVG

SVG, or Scalable Vector Graphics, is an XML-based vector image format for two-dimensional graphics with support for interactivity and animation. SVGs do not lose any quality if they are zoomed or resized. In the video, icons are exported in SVG format to maintain quality at different sizes.

Highlights

Introduction to the tutorial series on converting a Figma design into a responsive website using HTML, CSS, and JavaScript.

Instructions on downloading and opening the Figma file for the project.

How to create a free Figma account and set up the project workspace.

Creating the necessary HTML, CSS, and JavaScript files for the project.

Using VS Code to organize project files and folders.

Linking the CSS and JavaScript files to the HTML file.

Importing and linking Google Fonts 'Poppins' and 'Railway' to the project.

Explanation of selecting font weights and styles from Google Fonts.

Adding CSS variables for colors in the project for easy management.

Importing color codes from the Figma design into CSS variables.

Advantages of using CSS variables for easy color management.

Exporting images and icons from Figma to the project's image folder.

Technique for exporting images in PNG format and icons in SVG for quality retention.

Guidance on exporting various icons and images required for the website.

Finalizing the setup by exporting all necessary images and icons from Figma.

Invitation for viewers to ask questions in the comments section for doubts.

Encouragement to like and subscribe for the latest video updates.

Closing remarks and sign-off with a thank you note to the viewers.

Transcripts

play00:00

hi everybody welcome to gt coding in

play00:01

this tutorial series we are converting

play00:03

this sigma design into a real website

play00:05

using html css and javascript now in

play00:08

this video we will set everything up for

play00:09

our project and from the next video we

play00:11

will start writing the code so let's get

play00:13

started

play00:14

[Music]

play00:20

now the first thing you have to do is

play00:21

download and open this figma file in

play00:23

your sigma application

play00:25

so i will leave the link of this sigma

play00:26

file in the description so you can go

play00:28

ahead and download from there and then

play00:30

just open it in your figma application

play00:31

now if you don't have figma already

play00:32

installed you can just google for figma

play00:34

and just download it from there and then

play00:37

you can just create a free account and

play00:38

get started all right now the next thing

play00:40

we will do is we will create the html

play00:43

css and javascript files so here i've

play00:46

created this folder called responsive

play00:48

home page and i just opened it with vs

play00:50

code and i also have a folder called

play00:52

images over here to store all the images

play00:54

right now let's go ahead and create the

play00:56

files so let's click on new file

play00:59

and let's create an html file i'll just

play01:01

name it index.html

play01:04

now let's create a css file so let's

play01:06

click on new file

play01:08

and let's name it style.css

play01:11

and we also need to have a javascript

play01:12

file so let's click on new file

play01:14

and let's name it main.js

play01:17

all right now the next thing we will do

play01:18

is we will link the css and the

play01:20

javascript files into our html file

play01:23

so let's go over here to index.html and

play01:25

in vs code you can just press

play01:26

exclamation and press tab and you will

play01:28

have this basic html5 code right now

play01:31

here let's link our css file so here

play01:33

i'll just type link and press tab

play01:35

and here in the hr values tab style.css

play01:39

and now let's link our javascript file

play01:40

over here inside the body

play01:42

so here i'll just type script colon src

play01:45

and press tab

play01:46

and here i'll just type main.js

play01:49

all right now the next thing we will do

play01:50

is we will get the link of the fonts so

play01:52

if we go back to our figma file we can

play01:54

see that we are using two fonts over

play01:56

here one is this font called

play01:58

railway

play01:59

so here we can see for railway we need

play02:01

to have the black version and then we

play02:03

have the next font over here called

play02:04

poppins so we need to have the regular

play02:06

version and you also need to have a bold

play02:09

version

play02:10

i think this is also poppins so here we

play02:12

can see for pop-ins we also have a bold

play02:14

version and let's scroll down and let's

play02:16

see whether we have any more phones

play02:18

so i think this is

play02:20

a railway font so let's double click

play02:22

over here

play02:23

and here we can see we have a railway

play02:25

font for the thin version as well so we

play02:28

need to get these four styles of phones

play02:30

we need to get the railway thin and the

play02:32

railway black

play02:34

and we also need to get the poppins

play02:37

regular and the bold versions so for

play02:39

that let's go to phones.google.com

play02:41

all right so here i'm in

play02:42

phones.google.com and uh here we can see

play02:44

we have the poppins font so let's click

play02:46

on this

play02:48

and we need to get the regular and the

play02:49

bold versions so i'll just select this

play02:52

one right here regular 400

play02:56

and let's scroll down and let's also

play02:58

select

play03:00

ball 700

play03:02

right now let's search for the next font

play03:04

which is railway so let's go back

play03:07

and let's search for railway

play03:11

and let's click on this font

play03:13

and here also we need to select two

play03:14

styles so we'll select this light 300

play03:17

version

play03:18

and let's scroll down and let's also

play03:20

select

play03:21

the bold 900 so let's select this

play03:24

all right now let's click on this icon

play03:26

called viewer selected families and here

play03:28

we can see the link that we can add in

play03:30

our html so i'll just copy this from

play03:32

here

play03:33

and let's go to our html so

play03:35

here in the html i just pasted the link

play03:38

in the head section

play03:41

all right that's it with the phones now

play03:42

let's go ahead and add the colors to our

play03:45

website so we'll create some css

play03:47

variables for that so let's go to our

play03:49

style.css file and here we'll just

play03:51

create a root selector so i'll just type

play03:54

colon root

play03:57

and in here we will add all the css

play03:58

variables for the colors now when we add

play04:00

the css variables inside the root it

play04:02

will be accessible everywhere so let's

play04:04

go back to our figma file and let's get

play04:07

the code of our colors so let's scroll

play04:09

up and here we can see we have the

play04:11

colors so let's click on this color and

play04:13

here we can see the hex code for the

play04:15

color so i'll just copy this

play04:17

and let's go back to our css and here

play04:19

we'll just create a variable so i'll

play04:20

just name it orange color

play04:25

and here i'll just add the hex code so

play04:28

just type hash and paste the code over

play04:31

here

play04:32

so this is our first variable now the

play04:34

advantage of using a css variable is

play04:36

that if you want to change the color

play04:38

later you can go ahead and change it in

play04:40

just one place

play04:41

and it will be changed in all the other

play04:43

places because we're going to use this

play04:44

css variable name as the color all right

play04:47

now let's go ahead and get the second

play04:49

color so let's go back to figma file

play04:51

and let's select

play04:53

this color right here and let's copy

play04:55

this hex code

play04:57

now let's go back

play04:59

and we'll just name it dark blue color

play05:03

and here let's type hash and paste the

play05:05

hex code

play05:07

right now let's go back to figma file

play05:09

and let's select the next color so i'll

play05:11

just select this color right here and

play05:13

i'll just copy this code

play05:15

and let's

play05:17

create a color called dark color

play05:20

and i'll just paste it over here

play05:24

and i don't think we have this color in

play05:25

our website so let's scroll down

play05:29

and i don't think we have that color in

play05:31

our website so i'll just keep this color

play05:32

right here

play05:34

let's select the next color and let's

play05:35

copy this hex code and let's go back and

play05:39

here i'll just name it

play05:40

light color

play05:43

and i'll just paste the code over here

play05:47

right now let's go back and let's select

play05:49

this color right here and i'll just copy

play05:51

this code

play05:52

let's go back

play05:54

and we'll just name it light blue color

play05:59

right that's it with all the colors in

play06:00

our website now the last thing we will

play06:02

do is we will export all the images from

play06:04

the figma file into this images folder

play06:07

over here so i'll just show you how to

play06:08

export a couple of images and then you

play06:10

can go ahead and export all the other

play06:12

images now to export an image you can

play06:14

just select the image so i'll just

play06:16

double click over here to select this

play06:17

image

play06:18

and then you can go over here to this

play06:20

design tab and just scroll down and you

play06:23

can find this option called export and

play06:24

you have to click on this plus icon over

play06:26

here

play06:27

and then here you can click on preview

play06:29

to see how the image looks and then you

play06:31

can go ahead and select the image format

play06:33

so i'll just select png and then you can

play06:36

click on export

play06:38

and you can browse to your project

play06:39

folder and i'll just select this images

play06:41

folder

play06:42

and i'll just name it hero image dot png

play06:47

and let's click on save

play06:49

and now if you go to this images folder

play06:50

we can see that we have this hero image

play06:53

now in the same way you can go ahead and

play06:55

export all the other images and you need

play06:58

to export these icons as well so if we

play07:00

double click over here

play07:02

we can see this is an image so if we

play07:04

scroll down

play07:06

here we can see we have the preview of

play07:08

the image now when you're exporting

play07:09

icons you can just select the image

play07:12

format as svg instead of png because svg

play07:15

will maintain the quality of the image

play07:18

even if we increase the size of the

play07:19

image so whenever you have an icon or

play07:21

shapes like this you can just export it

play07:23

as svg so i'll just click on export and

play07:27

i just name this

play07:29

enroll icon

play07:31

dot svg and let's save it

play07:34

now in this way you can go ahead and

play07:35

export all these images so you can

play07:37

export the star icon

play07:39

you can export these two images

play07:42

and you also need to export these

play07:44

thumbnail images

play07:46

and also these icons for app store and

play07:49

google play store and also these two

play07:51

icons over here you can export these as

play07:55

svgs

play07:57

right now let's go to the ipad version

play08:00

and

play08:01

we don't have any new icons over here

play08:03

so let's go to the mobile version and

play08:05

here we can see we have this icon for

play08:07

the menus

play08:08

so you can just double click over here

play08:10

and export this icon as an svg

play08:14

and you also need to export this close

play08:16

icon

play08:17

and let's see whether we have any icons

play08:19

remaining

play08:20

and we also need to export this icon

play08:22

over here for the clock

play08:25

so these are all the images and icons

play08:27

you need to export from figma and once

play08:29

you export all these images you'll be

play08:31

ready to get started with the code so

play08:32

that's it for this video if you have any

play08:34

doubts you can ask in the comments below

play08:36

and if you like this video please click

play08:37

on the like button and subscribe to this

play08:39

channel to get the latest video updates

play08:41

thanks a lot for watching have a nice

play08:42

day

play08:45

[Music]

play09:00

you

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
Web DevelopmentFigma DesignHTML5CSS3JavaScriptResponsive WebCoding TutorialWeb LayoutFrontendUI DesignSVG Icons
Benötigen Sie eine Zusammenfassung auf Englisch?