Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,150 --> 00:00:04,450
In this lecture, we're going to load the images and fonts from our template.
2
00:00:04,470 --> 00:00:07,120
Let's open the template directory for a moment.
3
00:00:07,140 --> 00:00:09,850
We have a directory called Assets.
4
00:00:09,870 --> 00:00:15,610
This directory contains the custom CSS and images I've created for this course.
5
00:00:15,630 --> 00:00:18,400
We're going to load these assets in our project.
6
00:00:18,420 --> 00:00:23,000
We'll start with the CSS inside the CSS folder.
7
00:00:23,010 --> 00:00:25,560
Copy the main CSS file.
8
00:00:27,700 --> 00:00:31,070
Inside the source slash assets directory.
9
00:00:31,090 --> 00:00:32,560
Paste in this file.
10
00:00:34,700 --> 00:00:40,820
Next, we'll switch over to the main file to import the CSS file from the custom theme.
11
00:00:43,140 --> 00:00:44,910
After importing tailwinds.
12
00:00:44,910 --> 00:00:50,640
The path to the file is dot slash assets slash mean CSS.
13
00:00:52,870 --> 00:00:57,490
We're importing the CSIS file so that it gets processed by vite.
14
00:00:57,520 --> 00:01:03,070
I created some styles that weren't covered by Tailwind, which is why we're including this file.
15
00:01:03,100 --> 00:01:07,000
Most of the styles have to do with the audio player on the page.
16
00:01:07,030 --> 00:01:09,070
Let's move on to the images.
17
00:01:09,100 --> 00:01:12,250
The images can be found under the image directory.
18
00:01:14,570 --> 00:01:18,930
Unlike our CSIS files, we don't want them to be processed by vite.
19
00:01:18,950 --> 00:01:23,270
Instead, they should be copied over to the bundle generated by vite.
20
00:01:23,300 --> 00:01:24,680
Here's what we'll do.
21
00:01:24,710 --> 00:01:28,120
We'll copy the images over to the public directory.
22
00:01:28,130 --> 00:01:31,630
Files placed in the public directory are copied over.
23
00:01:31,640 --> 00:01:34,310
They are not completely processed by vite.
24
00:01:34,310 --> 00:01:39,800
When we ship the app to production, we're going to make a copy of the assets directory.
25
00:01:41,890 --> 00:01:47,320
Next, open the public directory and paste the directory we copied earlier.
26
00:01:49,470 --> 00:01:50,580
Once copied.
27
00:01:50,580 --> 00:01:54,300
Delete the case directory in the public directory.
28
00:01:56,500 --> 00:02:02,170
It doesn't make sense to continue storing the CSIS files in the public directory since they're being
29
00:02:02,170 --> 00:02:04,340
stored in these source directory.
30
00:02:04,360 --> 00:02:06,820
There are two ways to store files.
31
00:02:06,820 --> 00:02:10,060
The source directory can store asset files.
32
00:02:10,150 --> 00:02:16,840
If you store asset files in this directory, it will process them if you want your files to be copied
33
00:02:16,840 --> 00:02:23,590
over without going through other third party libraries like post CSIS and SAS, you should place them
34
00:02:23,590 --> 00:02:25,690
inside the public directory.
35
00:02:25,720 --> 00:02:28,570
All right, let's give the application a test.
36
00:02:28,600 --> 00:02:30,070
Refresh the page.
37
00:02:32,200 --> 00:02:35,830
The application is starting to look like the static template.
38
00:02:35,860 --> 00:02:37,900
This is exactly what we wanted.
39
00:02:37,930 --> 00:02:41,770
If you don't have what I have, then try restarting the server.
40
00:02:41,920 --> 00:02:45,730
The last files will need to load are the fonts and icons.
41
00:02:45,760 --> 00:02:47,590
Let's go back to the editor.
42
00:02:47,620 --> 00:02:52,240
Open the index html file inside the template directory.
43
00:02:54,550 --> 00:02:57,580
Go up to the head section of the document.
44
00:02:59,710 --> 00:03:04,330
We'll find links to the Roboto fonts and font awesome icon set.
45
00:03:04,360 --> 00:03:07,390
We're going to copy these over to the index file.
46
00:03:13,460 --> 00:03:15,880
The fonts come from an external source.
47
00:03:15,890 --> 00:03:19,280
We don't need to install a module or copy files.
48
00:03:19,280 --> 00:03:21,530
We can use a CD and to link them.
49
00:03:21,530 --> 00:03:24,020
Let's check out the page one more time.
50
00:03:26,080 --> 00:03:31,330
We'll see the icons displaying correctly and the font should have slightly changed.
51
00:03:31,360 --> 00:03:33,530
Let's recap what we've learned.
52
00:03:33,550 --> 00:03:39,430
You can load assets by either importing them directly or linking them in the public directory.
53
00:03:39,460 --> 00:03:41,260
Either solution is valid.
54
00:03:41,260 --> 00:03:46,450
Any files placed in the public directory are copied over in the final bundle.
55
00:03:46,720 --> 00:03:53,320
If you place files inside the source directory, they'll be processed by invite before they're shipped
56
00:03:53,320 --> 00:03:54,460
with the bundle.
57
00:03:54,670 --> 00:03:59,410
In the next lecture, we'll begin adding state management to the application.
5231
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.