-
Notifications
You must be signed in to change notification settings - Fork 5
/
App.vue
75 lines (67 loc) · 1.59 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<script setup lang="ts">
import { FakerError } from "@faker-js/faker";
import { faker } from "@faker-js/faker/locale/en";
import { ref } from "vue";
const fullName = ref(`${faker.person.firstName()} ${faker.person.lastName()}`);
const avatarUrl = ref(faker.image.avatar());
const natureImageUrl = ref(
faker.image.urlLoremFlickr({ category: "nature" }) + new FakerError("test")
);
</script>
<template>
<h1>Vite CJS Faker Demo</h1>
<div class="card">
<div class="card__image">
<img :src="natureImageUrl" :alt="'Background image for ' + fullName" />
</div>
<div class="card__profile">
<img :src="avatarUrl" :alt="'Avatar image of ' + fullName" />
</div>
<div class="card__body">
{{ fullName }}
</div>
</div>
</template>
<style>
.card {
border-radius: 4px;
width: 256px;
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2),
0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
overflow: hidden;
}
.card__body {
padding: 64px 8px 16px;
}
.card__image {
padding-bottom: 100%;
position: relative;
border-bottom: 1px solid #888888;
}
.card__image img {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.card__profile {
position: absolute;
width: 128px;
height: 128px;
top: 256px;
left: 64px;
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2),
0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
border-radius: 100%;
border: 1px solid #dddddd;
overflow: hidden;
}
.card__profile img {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
</style>