-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs-#239: add info about raw transformation
- Loading branch information
Showing
2 changed files
with
46 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,55 +2,53 @@ | |
import type { | ||
CloudinaryUploadWidgetError, | ||
CloudinaryUploadWidgetResults, | ||
} from '@cloudinary-util/types' | ||
import type { MediaType } from '../src/runtime/components/CldProductGallery.vue' | ||
} from "@cloudinary-util/types"; | ||
Check failure on line 5 in playground/app.vue GitHub Actions / ci (ubuntu-latest, 18)
|
||
import type { MediaType } from "../src/runtime/components/CldProductGallery.vue"; | ||
Check failure on line 6 in playground/app.vue GitHub Actions / ci (ubuntu-latest, 18)
|
||
const { url } = useCldImageUrl({ options: { src: '/cld-sample-5.jpg' } }) | ||
console.log(url) | ||
const { url } = useCldImageUrl({ options: { src: "/cld-sample-5.jpg" } }); | ||
Check failure on line 8 in playground/app.vue GitHub Actions / ci (ubuntu-latest, 18)
|
||
console.log(url); | ||
const { url: videoUrl } = useCldVideoUrl({ | ||
options: { src: 'videos/mountain-stars' }, | ||
}) | ||
console.log(videoUrl) | ||
options: { src: "videos/mountain-stars" }, | ||
}); | ||
console.log(videoUrl); | ||
const mediaAssets: { tag: string, mediaType?: MediaType }[] = [ | ||
{ tag: 'electric_car_product_gallery_demo' }, // by default mediaType: "image" | ||
{ tag: 'electric_car_product_gallery_demo', mediaType: 'video' }, | ||
{ tag: 'electric_car_360_product_gallery_demo', mediaType: 'spin' }, | ||
] | ||
const mediaAssets: { tag: string; mediaType?: MediaType }[] = [ | ||
{ tag: "electric_car_product_gallery_demo" }, // by default mediaType: "image" | ||
{ tag: "electric_car_product_gallery_demo", mediaType: "video" }, | ||
{ tag: "electric_car_360_product_gallery_demo", mediaType: "spin" }, | ||
]; | ||
const buttonId = 'open-btn' | ||
const buttonId = "open-btn"; | ||
const cldVideoRef = ref() | ||
const cldVideoRef = ref(); | ||
const chapters = { | ||
0: 'Chapter 1', | ||
6: 'Chapter 2', | ||
9: 'Chapter 3', | ||
} | ||
0: "Chapter 1", | ||
6: "Chapter 2", | ||
9: "Chapter 3", | ||
}; | ||
const colors = { | ||
accent: '#ff0000', | ||
base: '#00ff00', | ||
text: '#0000ff', | ||
} | ||
accent: "#ff0000", | ||
base: "#00ff00", | ||
text: "#0000ff", | ||
}; | ||
const onResult = (results: CloudinaryUploadWidgetResults) => { | ||
console.log('results', results) | ||
} | ||
console.log("results", results); | ||
}; | ||
const onError = ( | ||
error: CloudinaryUploadWidgetError, | ||
results: CloudinaryUploadWidgetResults, | ||
results: CloudinaryUploadWidgetResults | ||
) => { | ||
console.log('error', error) | ||
console.log('results', results) | ||
} | ||
console.log("error", error); | ||
console.log("results", results); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<button :id="buttonId"> | ||
Select Image or Video | ||
</button> | ||
<button :id="buttonId">Select Image or Video</button> | ||
Check warning on line 51 in playground/app.vue GitHub Actions / ci (ubuntu-latest, 18)
|
||
<CldMediaLibrary | ||
api-key="12345" | ||
:button-id="buttonId" | ||
|
@@ -83,6 +81,7 @@ const onError = ( | |
chapters-button | ||
:chapters="chapters" | ||
:colors="colors" | ||
:transformation="{ raw_transformation: 'e_fade:2000,e_fade:-2000' }" | ||
/> | ||
<CldUploadWidget | ||
v-slot="{ open }" | ||
|
@@ -91,12 +90,7 @@ const onError = ( | |
:on-error="onError" | ||
:on-result="onResult" | ||
> | ||
<button | ||
type="button" | ||
@click="open" | ||
> | ||
Upload an Image | ||
</button> | ||
<button type="button" @click="open">Upload an Image</button> | ||
Check warning on line 93 in playground/app.vue GitHub Actions / ci (ubuntu-latest, 18)
Check warning on line 93 in playground/app.vue GitHub Actions / ci (ubuntu-latest, 18)
|
||
</CldUploadWidget> | ||
<CldUploadButton | ||
upload-preset="nuxt-cloudinary-unsigned" | ||
|