@kvass/widgets 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/.github/workflows/semantic-release.yml +0 -21
- package/.prettierrc +0 -6
- package/.releaserc +0 -3
- package/index.html +0 -38
- package/src/contact/README.md +0 -80
- package/src/contact/api.js +0 -82
- package/src/contact/components/Checkbox.ce.vue +0 -127
- package/src/contact/components/Field.ce.vue +0 -156
- package/src/contact/components/Fieldset.ce.vue +0 -63
- package/src/contact/components/Form.ce.vue +0 -407
- package/src/contact/main.js +0 -9
- package/src/contact/utils.js +0 -14
- package/src/flatfinder/README.md +0 -58
- package/src/flatfinder/components/Flatfinder.ce.vue +0 -34
- package/src/flatfinder/main.js +0 -4
- package/src/font-selector/README.md +0 -60
- package/src/font-selector/components/FontSelector.ce.vue +0 -246
- package/src/font-selector/main.js +0 -4
- package/src/font-selector/providers.js +0 -48
- package/src/font-selector/selector.svg +0 -7
- package/src/img-comparison-slider/README.md +0 -69
- package/src/img-comparison-slider/components/ImgComparisonSlider.ce.vue +0 -139
- package/src/img-comparison-slider/main.js +0 -7
- package/src/map/README.md +0 -59
- package/src/map/components/Map.ce.vue +0 -66
- package/src/map/main.js +0 -4
- package/src/project-portal/App.ce.vue +0 -308
- package/src/project-portal/api.js +0 -48
- package/src/project-portal/assets/logo.png +0 -0
- package/src/project-portal/assets/map-pin-solid.svg +0 -1
- package/src/project-portal/components/Card.ce.vue +0 -110
- package/src/project-portal/components/Category.ce.vue +0 -87
- package/src/project-portal/components/CategorySelector.ce.vue +0 -43
- package/src/project-portal/components/ProjectTypeSelector.ce.vue +0 -70
- package/src/project-portal/main.js +0 -16
- package/src/project-portal/styles/_variables.scss +0 -19
- package/src/project-portal/styles/components/_card.scss +0 -178
- package/src/utils/index.js +0 -40
- package/src/vimeo/README.md +0 -58
- package/src/vimeo/components/Vimeo.ce.vue +0 -311
- package/src/vimeo/main.js +0 -4
- package/src/youtube/README.md +0 -58
- package/src/youtube/components/Youtube.ce.vue +0 -322
- package/src/youtube/main.js +0 -4
- package/vite.config.js +0 -51
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
@import '../_variables';
|
|
2
|
-
|
|
3
|
-
.project-selector-card {
|
|
4
|
-
position: relative;
|
|
5
|
-
font-family: var(--kvass-project-selector-secondary-font, inherit);
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
border-radius: GetVariable('border-radius');
|
|
9
|
-
background-color: white;
|
|
10
|
-
text-decoration: none;
|
|
11
|
-
color: inherit;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
|
|
14
|
-
$space: GetVariable('card-spacing');
|
|
15
|
-
|
|
16
|
-
&__header {
|
|
17
|
-
min-height: var(--kvass-project-selector-header-min-height, 250px);
|
|
18
|
-
background-color: GetVariable('dark');
|
|
19
|
-
|
|
20
|
-
@media (max-width: $kvass-project-selector-resposive) {
|
|
21
|
-
min-height: var(
|
|
22
|
-
--kvass-project-selector-header-min-height-resposive,
|
|
23
|
-
150px
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&-category {
|
|
28
|
-
position: absolute;
|
|
29
|
-
background-color: GetVariable('secondary');
|
|
30
|
-
z-index: 11;
|
|
31
|
-
color: white;
|
|
32
|
-
left: var(--kvass-project-selector-card-status-gap, 0.5rem);
|
|
33
|
-
top: var(--kvass-project-selector-card-status-gap, 0.5rem);
|
|
34
|
-
border-radius: GetVariable('border-radius');
|
|
35
|
-
.category {
|
|
36
|
-
font-size: var(--kvass-project-selector-card-status-font-size, 0.8em);
|
|
37
|
-
padding: var(--kvass-project-selector-card-status-padding-x, 0.5rem)
|
|
38
|
-
var(--kvass-project-selector-card-status-padding-x, 1rem);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&-cover {
|
|
43
|
-
width: 100%;
|
|
44
|
-
background-repeat: no-repeat;
|
|
45
|
-
height: 100%;
|
|
46
|
-
background-size: cover;
|
|
47
|
-
background-position: center;
|
|
48
|
-
transition: transform 0.62s cubic-bezier(0.05, 0.2, 0.1, 1);
|
|
49
|
-
|
|
50
|
-
&:hover {
|
|
51
|
-
transform: scale(1.11);
|
|
52
|
-
-webkit-transform: scale(1.11);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&__title {
|
|
58
|
-
font-weight: bold;
|
|
59
|
-
line-height: 1;
|
|
60
|
-
margin: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&__content {
|
|
64
|
-
background-color: GetVariable('background-color');
|
|
65
|
-
border-top: none;
|
|
66
|
-
text-align: left;
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
gap: 0.5rem;
|
|
70
|
-
padding: calc(#{$space} - 0.5rem);
|
|
71
|
-
|
|
72
|
-
height: 100%;
|
|
73
|
-
|
|
74
|
-
&-name {
|
|
75
|
-
color: GetVariable('dark');
|
|
76
|
-
margin: 0 !important;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&-url {
|
|
80
|
-
color: GetVariable('primary');
|
|
81
|
-
font-size: 1.1em;
|
|
82
|
-
margin-top: auto;
|
|
83
|
-
text-decoration: underline;
|
|
84
|
-
text-decoration-color: GetVariable('primary');
|
|
85
|
-
text-underline-offset: 0.3em;
|
|
86
|
-
text-decoration-thickness: 1px;
|
|
87
|
-
|
|
88
|
-
&:hover {
|
|
89
|
-
color: GetVariable('secondary');
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
&-city {
|
|
94
|
-
font-size: 1.2rem;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&-location {
|
|
98
|
-
display: flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
align-content: center;
|
|
101
|
-
gap: 1rem;
|
|
102
|
-
color: GetVariable('secondary');
|
|
103
|
-
|
|
104
|
-
svg {
|
|
105
|
-
opacity: 0.5;
|
|
106
|
-
height: 0.9rem;
|
|
107
|
-
path {
|
|
108
|
-
color: currentColor;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@media (max-width: $kvass-project-selector-resposive) {
|
|
114
|
-
gap: 0.5rem;
|
|
115
|
-
padding: calc(#{$space} - 0.5rem) calc(#{$space} - 1rem);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// tiles theme
|
|
121
|
-
.project-selector--theme-tiles {
|
|
122
|
-
.project-selector-card {
|
|
123
|
-
border-radius: var(--kvass-project-selector-border-radius, 0px);
|
|
124
|
-
|
|
125
|
-
&:hover {
|
|
126
|
-
.project-selector-card__content {
|
|
127
|
-
background: rgba(0, 0, 0, 0.2) !important;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&__header {
|
|
132
|
-
min-height: var(--kvass-project-selector-header-min-height, 400px);
|
|
133
|
-
|
|
134
|
-
@media (max-width: $kvass-project-selector-resposive) {
|
|
135
|
-
min-height: var(
|
|
136
|
-
--kvass-project-selector-header-min-height-resposive,
|
|
137
|
-
250px
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&__content {
|
|
143
|
-
font-size: 1.5rem;
|
|
144
|
-
height: unset !important;
|
|
145
|
-
position: absolute;
|
|
146
|
-
inset: 0;
|
|
147
|
-
z-index: 10;
|
|
148
|
-
pointer-events: none;
|
|
149
|
-
background: rgba(0, 0, 0, 0.4) !important;
|
|
150
|
-
transition: background 200ms ease;
|
|
151
|
-
|
|
152
|
-
display: grid !important;
|
|
153
|
-
place-content: center;
|
|
154
|
-
|
|
155
|
-
& > * {
|
|
156
|
-
color: white !important;
|
|
157
|
-
text-align: center;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
&-url {
|
|
161
|
-
text-decoration-color: currentColor;
|
|
162
|
-
font-size: 0.8em;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
&-location {
|
|
166
|
-
justify-content: center;
|
|
167
|
-
margin-bottom: 1rem;
|
|
168
|
-
|
|
169
|
-
svg {
|
|
170
|
-
display: none;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
&-intro {
|
|
174
|
-
font-size: 0.8em;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
package/src/utils/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
function ExtractString(str, pattern, options = {}) {
|
|
2
|
-
let { group = 1 } = options
|
|
3
|
-
let match = str.match(pattern)
|
|
4
|
-
if (!match) return
|
|
5
|
-
return match[group]
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function Wait(ms) {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
setTimeout(resolve, ms)
|
|
11
|
-
})
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async function WaitUntil(func, options = {}) {
|
|
15
|
-
let { interval = 200, limit = 50 } = options
|
|
16
|
-
|
|
17
|
-
let count = 0
|
|
18
|
-
let result
|
|
19
|
-
|
|
20
|
-
while (count < limit) {
|
|
21
|
-
count++
|
|
22
|
-
if ((result = func())) break
|
|
23
|
-
await Wait(interval)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (count >= limit) throw new Error('Could not resolve')
|
|
27
|
-
return result
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function LoadScript(src) {
|
|
31
|
-
if (document.querySelector(`script[src="${src}"]`)) return
|
|
32
|
-
|
|
33
|
-
let script = document.createElement('script')
|
|
34
|
-
script.type = 'text/javascript'
|
|
35
|
-
script.src = src
|
|
36
|
-
|
|
37
|
-
document.body.appendChild(script)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { ExtractString, Wait, WaitUntil, LoadScript }
|
package/src/vimeo/README.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# kvass-vimeo
|
|
2
|
-
|
|
3
|
-
A simple, embeddable Web Component to play vimeo videos.
|
|
4
|
-
|
|
5
|
-
## Develop
|
|
6
|
-
|
|
7
|
-
To run in development mode, first install the neccessary packages.
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
npm install
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Then, run in development mode.
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
npm run dev
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Open `localhost:3000` in the browser of your choice, and you will see the form widget.
|
|
20
|
-
|
|
21
|
-
## Build
|
|
22
|
-
|
|
23
|
-
To build the widget for production, run `build` instead of `dev`.
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
npm run build
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
To use the widget, use the `<kvass-vimeo />` element as shown here.
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<kvass-vimeo
|
|
33
|
-
url="https://vimeo.com/833277445"
|
|
34
|
-
autoplay="true"
|
|
35
|
-
loop="true"
|
|
36
|
-
></kvass-vimeo>
|
|
37
|
-
|
|
38
|
-
<script type="module" src="/src/vimeo/main.js"></script>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Props
|
|
42
|
-
|
|
43
|
-
The component has several props for easy configuration.
|
|
44
|
-
|
|
45
|
-
| Name | Type | Description | Enums | Default |
|
|
46
|
-
| :------------------ | :---------------------------------- | :------------------------------------------- | :-------------- | ------------------------------------------------------ |
|
|
47
|
-
| **url** | String | vimeo embed / share url | |
|
|
48
|
-
| loop | String / Boolean | Loop video | `false`, `true` | true |
|
|
49
|
-
| autoplay | String / Boolean | Autoplay video | `false`, `true` | false |
|
|
50
|
-
| controls | String / Boolean | Enable / disable control bar | `false`, `true` | true |
|
|
51
|
-
| mute | String / Boolean | Mute sound | `false`, `true` | false |
|
|
52
|
-
| displayThumbnail | String | specify if the thumbnail should be displayed | `false`, `true` | true |
|
|
53
|
-
| ignoreConsent | Boolean | spesify to ignore consent | `false`, `true` | false |
|
|
54
|
-
| hideConsent | specify to hide the consent warning | | `false`, `true` | false |
|
|
55
|
-
| thumbnailSource | String | specify the soruce of the thumbnail | | if Kvass defined: /api/media/thumbnail?url=${this.url} |
|
|
56
|
-
| consentBlockMessage | String | Block consent message | | The video is blocked due to lack of consent to cookies |
|
|
57
|
-
| consentButtonLabel | String | Label on consent button | | Edit consents |
|
|
58
|
-
| aspect-ratio | String | aspect ratio of the video | | 16/9 |
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { WaitUntil, LoadScript, ExtractString } from '../../utils'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
props: {
|
|
6
|
-
url: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: '',
|
|
9
|
-
},
|
|
10
|
-
videoState: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: 'ready',
|
|
13
|
-
enums: ['ready ', 'play', 'pause'],
|
|
14
|
-
},
|
|
15
|
-
loop: {
|
|
16
|
-
type: [String, Boolean],
|
|
17
|
-
default: true,
|
|
18
|
-
},
|
|
19
|
-
autoplay: {
|
|
20
|
-
type: [String, Boolean],
|
|
21
|
-
default: false,
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
controls: {
|
|
25
|
-
type: [String, Boolean],
|
|
26
|
-
default: true,
|
|
27
|
-
},
|
|
28
|
-
mute: {
|
|
29
|
-
type: [String, Boolean],
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
displayThumbnail: {
|
|
33
|
-
type: [String, Boolean],
|
|
34
|
-
default: true,
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
ignoreConsent: {
|
|
38
|
-
type: [String, Boolean],
|
|
39
|
-
default: false,
|
|
40
|
-
},
|
|
41
|
-
hideConsent: {
|
|
42
|
-
type: [String, Boolean],
|
|
43
|
-
default: false,
|
|
44
|
-
},
|
|
45
|
-
thumbnailSource: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: '',
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
consentBlockMessage: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: 'The video is blocked due to lack of consent to cookies',
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
consentButtonLabel: {
|
|
56
|
-
type: String,
|
|
57
|
-
default: 'Edit consents',
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
aspectRatio: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: '16/9',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
watch: {
|
|
66
|
-
videoState: {
|
|
67
|
-
handler(newValue, oldValue) {
|
|
68
|
-
if (newValue === oldValue) return
|
|
69
|
-
switch (newValue) {
|
|
70
|
-
case 'play':
|
|
71
|
-
return this.play()
|
|
72
|
-
case 'pause':
|
|
73
|
-
return this.pause()
|
|
74
|
-
default:
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
data() {
|
|
81
|
-
return {
|
|
82
|
-
ready: false,
|
|
83
|
-
|
|
84
|
-
thumbnail: null,
|
|
85
|
-
consents: [],
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
computed: {
|
|
90
|
-
kvassDefined() {
|
|
91
|
-
return typeof Kvass !== 'undefined'
|
|
92
|
-
},
|
|
93
|
-
showConsent() {
|
|
94
|
-
if (this.hideConsent || !this.kvassDefined) return false
|
|
95
|
-
return !this.ignoreConsent && !this.consents.includes('statistics')
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
videoId() {
|
|
99
|
-
if (!this.url) return
|
|
100
|
-
|
|
101
|
-
let id = [
|
|
102
|
-
ExtractString(this.url, /https\:\/\/(w{3}\.)?vimeo\.com\/(.+)\/?/, {
|
|
103
|
-
group: 2,
|
|
104
|
-
}),
|
|
105
|
-
ExtractString(
|
|
106
|
-
this.url,
|
|
107
|
-
/https\:\/\/(w{3}\.)?player\.vimeo\.com\/(video\/)?(.+)\/?/,
|
|
108
|
-
{
|
|
109
|
-
group: 3,
|
|
110
|
-
},
|
|
111
|
-
),
|
|
112
|
-
].find((e) => Boolean(e))
|
|
113
|
-
|
|
114
|
-
if (id) return id.split('&')[0]
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
methods: {
|
|
119
|
-
openConsent() {
|
|
120
|
-
if (!this.kvassDefined) return
|
|
121
|
-
Kvass.emit('consent:show')
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
async play() {
|
|
125
|
-
try {
|
|
126
|
-
this.player.setVolume(0)
|
|
127
|
-
await this.player.play()
|
|
128
|
-
} catch (e) {
|
|
129
|
-
console.log(e)
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
pause() {
|
|
133
|
-
this.player.pause()
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
async init() {
|
|
137
|
-
const mergeOptions = {
|
|
138
|
-
url: `https://vimeo.com/${this.videoId}`,
|
|
139
|
-
loop: this.loop,
|
|
140
|
-
autoplay: this.autoplay,
|
|
141
|
-
controls: this.controls,
|
|
142
|
-
muted: this.mute || this.autoplay,
|
|
143
|
-
playsinline: 1,
|
|
144
|
-
dnt: 1,
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function stringToBoolean(value) {
|
|
148
|
-
if (value === 'false') return false
|
|
149
|
-
if (value === 'true') return true
|
|
150
|
-
return value
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
Object.entries(mergeOptions).map(([key, value]) => {
|
|
154
|
-
return (mergeOptions[key] = stringToBoolean(value))
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
LoadScript('https://player.vimeo.com/api/player.js')
|
|
158
|
-
const Vimeo = await WaitUntil(() => window.Vimeo, { limit: 100 })
|
|
159
|
-
|
|
160
|
-
this.player = new Vimeo.Player(this.$refs.vimeoPlayer, mergeOptions)
|
|
161
|
-
|
|
162
|
-
await this.player
|
|
163
|
-
.ready()
|
|
164
|
-
.then(() => {
|
|
165
|
-
this.ready = true
|
|
166
|
-
})
|
|
167
|
-
.catch((error) => {
|
|
168
|
-
console.log(error)
|
|
169
|
-
})
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
async mounted() {
|
|
174
|
-
if (this.displayThumbnail)
|
|
175
|
-
this.thumbnail = `/api/media/thumbnail?url=${this.url}`
|
|
176
|
-
|
|
177
|
-
if (this.ignoreConsent || !this.kvassDefined) return this.init()
|
|
178
|
-
|
|
179
|
-
let onChange = (consents) => {
|
|
180
|
-
this.consents = consents || []
|
|
181
|
-
if (!this.consents || !this.consents.length) return
|
|
182
|
-
|
|
183
|
-
if (this.consents.includes('statistics')) return this.init()
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (this.kvassDefined) {
|
|
187
|
-
Kvass.emit('consent:get', (c) => onChange(c))
|
|
188
|
-
Kvass.on('consent:change', onChange)
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
}
|
|
192
|
-
</script>
|
|
193
|
-
|
|
194
|
-
<template>
|
|
195
|
-
<div
|
|
196
|
-
class="widget-kvass-media-render-vimeo"
|
|
197
|
-
:style="`aspect-ratio: ${aspectRatio};`"
|
|
198
|
-
>
|
|
199
|
-
<div
|
|
200
|
-
v-show="ready"
|
|
201
|
-
:key="videoId"
|
|
202
|
-
ref="vimeoPlayer"
|
|
203
|
-
class="widget-kvass-media-render-vimeo__embed"
|
|
204
|
-
frameborder="0"
|
|
205
|
-
allow="autoplay; fullscreen;"
|
|
206
|
-
webkitallowfullscreen
|
|
207
|
-
mozallowfullscreen
|
|
208
|
-
/>
|
|
209
|
-
|
|
210
|
-
<transition name="fade" mode="in-out">
|
|
211
|
-
<div
|
|
212
|
-
v-show="!ready && thumbnail"
|
|
213
|
-
class="widget-kvass-media-render-vimeo__thumbnail"
|
|
214
|
-
:style="{ backgroundImage: `url(${thumbnail})` }"
|
|
215
|
-
/>
|
|
216
|
-
</transition>
|
|
217
|
-
<div v-if="showConsent" class="widget-kvass-media-render-vimeo__blocked">
|
|
218
|
-
<div class="widget-kvass-media-render-vimeo__blocked-warning">
|
|
219
|
-
{{ consentBlockMessage }}
|
|
220
|
-
<button
|
|
221
|
-
class="widget-kvass-media-render-vimeo__blocked-warning-button"
|
|
222
|
-
@click="openConsent"
|
|
223
|
-
>
|
|
224
|
-
{{ consentButtonLabel }}
|
|
225
|
-
</button>
|
|
226
|
-
</div>
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
</template>
|
|
230
|
-
|
|
231
|
-
<style lang="scss">
|
|
232
|
-
.widget-kvass-media-render-vimeo {
|
|
233
|
-
height: 100%;
|
|
234
|
-
width: 100%;
|
|
235
|
-
position: relative;
|
|
236
|
-
|
|
237
|
-
iframe {
|
|
238
|
-
height: 100%;
|
|
239
|
-
width: 100%;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
& > * {
|
|
243
|
-
position: absolute;
|
|
244
|
-
top: 0;
|
|
245
|
-
left: 0;
|
|
246
|
-
width: 100%;
|
|
247
|
-
height: 100%;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&__thumbnail {
|
|
251
|
-
background-size: cover;
|
|
252
|
-
background-repeat: no-repeat;
|
|
253
|
-
background-position: center;
|
|
254
|
-
filter: blur(10px);
|
|
255
|
-
opacity: 0.7;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
&__blocked {
|
|
259
|
-
display: flex;
|
|
260
|
-
justify-content: center;
|
|
261
|
-
align-items: center;
|
|
262
|
-
left: 50%;
|
|
263
|
-
top: 50%;
|
|
264
|
-
transform: translate(-50%, -50%);
|
|
265
|
-
svg {
|
|
266
|
-
opacity: 0.3;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
@media (max-width: 992px) {
|
|
270
|
-
svg {
|
|
271
|
-
font-size: 2.5em;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
&-warning {
|
|
275
|
-
pointer-events: initial;
|
|
276
|
-
position: absolute;
|
|
277
|
-
bottom: 0;
|
|
278
|
-
text-align: center;
|
|
279
|
-
background-color: #f2f2f2;
|
|
280
|
-
font-size: 0.6em;
|
|
281
|
-
bottom: 3rem;
|
|
282
|
-
left: 3rem;
|
|
283
|
-
max-width: 400px;
|
|
284
|
-
font-size: 0.8em;
|
|
285
|
-
padding: 1.5em 2em;
|
|
286
|
-
|
|
287
|
-
&-button {
|
|
288
|
-
padding: 0.5rem;
|
|
289
|
-
border: 1px solid #818181;
|
|
290
|
-
backdrop-filter: none;
|
|
291
|
-
background-color: transparent;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
@media (max-width: 992px) {
|
|
295
|
-
left: 0.5rem;
|
|
296
|
-
bottom: 0.5rem;
|
|
297
|
-
font-size: 0.6em;
|
|
298
|
-
max-width: 200px;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
.fade-enter-active,
|
|
303
|
-
.fade-leave-active {
|
|
304
|
-
transition: opacity 500ms;
|
|
305
|
-
}
|
|
306
|
-
.fade-enter,
|
|
307
|
-
.fade-leave-to {
|
|
308
|
-
opacity: 0;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
</style>
|
package/src/vimeo/main.js
DELETED
package/src/youtube/README.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# kvass-youtube
|
|
2
|
-
|
|
3
|
-
A simple, embeddable Web Component to play youtube videos.
|
|
4
|
-
|
|
5
|
-
## Develop
|
|
6
|
-
|
|
7
|
-
To run in development mode, first install the neccessary packages.
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
npm install
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Then, run in development mode.
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
npm run dev
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Open `localhost:3000` in the browser of your choice, and you will see the form widget.
|
|
20
|
-
|
|
21
|
-
## Build
|
|
22
|
-
|
|
23
|
-
To build the widget for production, run `build` instead of `dev`.
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
npm run build
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
To use the widget, use the `<kvass-youtube />` element as shown here.
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<kvass-youtube
|
|
33
|
-
url="https://www.youtube.com/watch?v=oPVte6aMprI"
|
|
34
|
-
autoplay="true"
|
|
35
|
-
loop="true"
|
|
36
|
-
></kvass-youtube>
|
|
37
|
-
|
|
38
|
-
<script type="module" src="/src/youtube/main.js"></script>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Props
|
|
42
|
-
|
|
43
|
-
The component has several props for easy configuration.
|
|
44
|
-
|
|
45
|
-
| Name | Type | Description | Enums | Default |
|
|
46
|
-
| :------------------ | :---------------------------------- | :------------------------------------------- | :-------------- | ------------------------------------------------------ |
|
|
47
|
-
| **url** | String | youtube embed / share url | |
|
|
48
|
-
| loop | String / Boolean | Loop video | `false`, `true` | true |
|
|
49
|
-
| autoplay | String / Boolean | Autoplay video | `false`, `true` | false |
|
|
50
|
-
| controls | String / Boolean | Enable / disable control bar | `false`, `true` | true |
|
|
51
|
-
| mute | String / Boolean | Mute sound | `false`, `true` | false |
|
|
52
|
-
| displayThumbnail | String | specify if the thumbnail should be displayed | `false`, `true` | true |
|
|
53
|
-
| ignoreConsent | Boolean | spesify to ignore consent | `false`, `true` | false |
|
|
54
|
-
| hideConsent | specify to hide the consent warning | | `false`, `true` | false |
|
|
55
|
-
| thumbnailSource | String | specify the soruce of the thumbnail | | if Kvass defined: /api/media/thumbnail?url=${this.url} |
|
|
56
|
-
| consentBlockMessage | String | Block consent message | | The video is blocked due to lack of consent to cookies |
|
|
57
|
-
| consentButtonLabel | String | Label on consent button | | Edit consents |
|
|
58
|
-
| aspect-ratio | String | aspect ratio of the video | | 16/9 |
|