|
1 | 1 | <template> |
2 | | - <div class="selected-license-card"> |
3 | | - <h3 class="vocab"> |
4 | | - {{ headingText }} |
5 | | - </h3> |
6 | | - <h4 class="vocab b-header"> |
7 | | - <a |
8 | | - :href="licenseUrl('web')" |
9 | | - class="license-name" |
10 | | - > |
11 | | - {{ fullName }} ({{ shortName }}) |
12 | | - <LicenseIcons |
13 | | - class="license-icons" |
14 | | - :url="licenseUrl('web')" |
15 | | - :icons-arr="iconsList" |
| 2 | + <div class="recommended-card"> |
| 3 | + <h3> {{ cardHeading }} </h3> |
| 4 | + <div class="license-short-name"> |
| 5 | + <span class="license-icons"> |
| 6 | + <i |
| 7 | + v-for="icon in ['logo', ...iconsList]" |
| 8 | + :key="icon" |
| 9 | + :class="['icon', 'has-background-white', `cc-${icon}`]" |
16 | 10 | /> |
17 | | - </a> |
| 11 | + </span> |
| 12 | + <h4 class="b-header"> |
| 13 | + {{ shortName }} |
| 14 | + </h4> |
| 15 | + </div> |
| 16 | + <h4 class="b-header"> |
| 17 | + {{ fullName }} |
18 | 18 | </h4> |
19 | | - <p class="chooser-selected-description"> |
20 | | - <b>{{ slug.toUpperCase() }}</b> |
| 19 | + <p class="license-full-description body-big"> |
21 | 20 | {{ $t(licenseKey) }} |
22 | 21 | </p> |
23 | | - <section class="license-visual-info"> |
| 22 | + <section class="items-description"> |
24 | 23 | <ul class="license-list"> |
25 | 24 | <transition-group name="highlight"> |
26 | 25 | <li |
|
29 | 28 | :class="['license-list-item', item]" |
30 | 29 | > |
31 | 30 | <span class="readable-string"> |
32 | | - <b v-if="item!=='zero'">{{ item.toUpperCase() }}:</b> |
33 | | - <b v-else>CC0:</b> |
| 31 | + <i :class="['icon', 'has-background-white', `cc-${item}`]" /> |
| 32 | + <b>{{ item === 'zero' ? 'CC0' : item.toUpperCase() }}:</b> |
34 | 33 | {{ $t(`license-details-card.item-description.${item}`) }} |
35 | 34 | </span> |
| 35 | + <span |
| 36 | + v-if="item === 'nc'" |
| 37 | + class="description-caption caption" |
| 38 | + > |
| 39 | + {{ $t(`license-details-card.caption.${item}`) }} |
| 40 | + </span> |
36 | 41 | </li> |
37 | 42 | </transition-group> |
38 | 43 | </ul> |
39 | 44 | </section> |
| 45 | + <a |
| 46 | + class="license-deed-link" |
| 47 | + :href="licenseUrl()" |
| 48 | + target="_blank" |
| 49 | + rel="noopener noreferrer" |
| 50 | + > |
| 51 | + See the License Deed |
| 52 | + <span class="icon external-link"> |
| 53 | + <svg |
| 54 | + xmlns="http://www.w3.org/2000/svg" |
| 55 | + width="15" |
| 56 | + height="15" |
| 57 | + viewBox="0 0 30 30" |
| 58 | + ><path |
| 59 | + d="M25.313 18.75h-1.875a.938.938 0 00-.938.938v6.562H3.75V7.5h8.438a.937.937 0 00.937-.938V4.688a.938.938 0 00-.938-.937H2.813A2.813 2.813 0 000 6.563v20.625A2.812 2.812 0 002.813 30h20.625a2.812 2.812 0 002.812-2.813v-7.5a.938.938 0 00-.938-.937zM28.593 0h-7.5c-1.251 0-1.877 1.518-.995 2.402l2.093 2.094-14.28 14.276a1.406 1.406 0 000 1.992l1.327 1.326a1.405 1.405 0 001.993 0L25.505 7.812l2.093 2.09c.879.88 2.402.264 2.402-.996v-7.5A1.406 1.406 0 0028.594 0z" |
| 60 | + fill="currentColor" |
| 61 | + /></svg> |
| 62 | + </span> |
| 63 | + </a> |
40 | 64 | </div> |
41 | 65 | </template> |
42 | 66 | <script> |
43 | 67 | import { LICENSES, licenseSlug } from '../utils/license-utilities' |
44 | | -import LicenseIcons from './LicenseIcons' |
45 | 68 | import { mapGetters } from 'vuex' |
46 | 69 |
|
47 | 70 | export default { |
48 | 71 | name: 'LicenseDetailsCard', |
49 | | - components: { |
50 | | - LicenseIcons |
51 | | - }, |
52 | 72 | computed: { |
53 | 73 | ...mapGetters(['shortName', 'fullName', 'iconsList', 'licenseUrl']), |
54 | | - licenseDescription() { |
55 | | - const descriptionString = `${this.slug}-description` |
56 | | - return this.$t(descriptionString) |
57 | | - }, |
58 | 74 | licenseKey() { |
59 | 75 | return `license-details-card.full-description.${this.slug}` |
60 | 76 | }, |
61 | 77 | slug() { |
62 | 78 | return licenseSlug(this.shortName) |
63 | 79 | }, |
64 | | - headingText() { |
| 80 | + cardHeading() { |
65 | 81 | return this.shortName === LICENSES.CC0.SHORT |
66 | 82 | ? this.$t('license-details-card.cc0-heading') |
67 | 83 | : this.$t('license-details-card.heading') |
68 | 84 | } |
| 85 | +
|
69 | 86 | } |
70 | 87 | } |
71 | 88 | </script> |
72 | 89 |
|
73 | | -<style lang="scss"> |
74 | | - .select-license-card { |
75 | | - margin-bottom: 32px; |
76 | | - } |
77 | | - .license-name { |
78 | | - vertical-align: middle; |
79 | | - display: inline-block; |
80 | | - margin-top: 8px; |
81 | | - } |
82 | | - .license-icons { |
83 | | - height: 35px; |
84 | | - vertical-align: middle; |
85 | | - } |
86 | | - .license-name .photo-license-icon { |
87 | | - height: 35px; |
88 | | - opacity: 1; |
89 | | - } |
90 | | - .license-visual-info { |
91 | | - margin-top: 16px; |
92 | | - } |
93 | | - .license-list-item { |
94 | | - position: relative; |
95 | | - padding-bottom: 8px; |
96 | | - } |
97 | | - .license-list-item span { |
98 | | - vertical-align: middle; |
99 | | - display:inline-block; |
100 | | - } |
101 | | - .license-list-item span b { |
102 | | - display: inline-block; |
103 | | - width: 36px; |
104 | | - } |
105 | | - .license-list-item::before{ |
106 | | - position: absolute; |
107 | | - left: 0; |
108 | | - top: 0; |
109 | | - display: inline-block; |
110 | | - width: 35px; |
111 | | - height: 35px; |
112 | | - border-radius: 50%; |
113 | | - content: ""; |
114 | | - background-size: 35px 35px; |
115 | | - } |
116 | | - .license-list-item.zero::before { |
117 | | - background-image: url("../assets/license-icons/zero.svg"); |
118 | | - } |
119 | | - .license-list-item.by::before { |
120 | | - background-image: url("../assets/license-icons/by.svg"); |
121 | | - } |
122 | | - .license-list-item.nc::before { |
123 | | - background-image: url("../assets/license-icons/nc.svg"); |
124 | | - } |
125 | | - .license-list-item.nd::before { |
126 | | - background-image: url("../assets/license-icons/nd.svg"); |
| 90 | +<style lang="scss" scoped> |
| 91 | +.recommended-card { |
| 92 | + margin-bottom: 2rem; |
| 93 | +} |
| 94 | +.license-full-description { |
| 95 | + margin: 1.5rem 0; |
| 96 | +} |
| 97 | +.license-short-name { |
| 98 | + margin-bottom: 0.5rem; |
| 99 | + margin-top: 2rem; |
| 100 | + display: flex; |
| 101 | + align-items: center; |
| 102 | + gap: 1rem; |
| 103 | +} |
| 104 | +.license-deed-link { |
| 105 | + margin-top: 1.375rem; |
| 106 | + font-weight: bold; |
| 107 | + display: flex; |
| 108 | + align-items: center; |
| 109 | + .icon { |
| 110 | + margin-right: 0.5rem; |
127 | 111 | } |
128 | | - .license-list-item.sa::before { |
129 | | - background-image: url("../assets/license-icons/sa.svg"); |
| 112 | +} |
| 113 | +.license-list-item { |
| 114 | + display: flex; |
| 115 | + flex-direction: column; |
| 116 | + margin-bottom: 1rem; |
| 117 | +} |
| 118 | +.readable-string { |
| 119 | + display: flex; |
| 120 | + flex-direction: row; |
| 121 | + align-items: center; |
| 122 | + i { |
| 123 | + font-size: 2.1875rem; |
| 124 | + height: 2.1875rem; |
| 125 | + width: 2.1875rem; |
| 126 | + margin-right: 1rem; |
| 127 | + } |
| 128 | + b { |
| 129 | + margin-right: 0.2rem; |
130 | 130 | } |
131 | | - .readable-string { |
132 | | - padding-left:51px; |
133 | | - line-height:35px; |
| 131 | +} |
| 132 | +.license-icons { |
| 133 | + display: flex; |
| 134 | + flex-direction: row; |
| 135 | + gap: 0.5rem; |
| 136 | + font-size: 2.1875rem; |
| 137 | + .icon { |
| 138 | + height: 2.1875rem; |
| 139 | + width: 2.1875rem; |
134 | 140 | } |
| 141 | +} |
| 142 | +.description-caption { |
| 143 | + padding-left: 3.1875rem; |
| 144 | + font-weight: 600; |
| 145 | +} |
135 | 146 | </style> |
0 commit comments