bx-865-apps #1
|
@ -1,11 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as d3 from "d3";
|
import { SERVER_URL, IMAGE_URL } from '../../constants'
|
||||||
import { onMounted } from "vue";
|
import * as d3 from "d3"
|
||||||
|
import { onMounted } from "vue"
|
||||||
|
|
||||||
const componentFiles = import.meta.glob('../../assets/promo/bg/bg_*.jpg', { eager: true })
|
const componentFiles = import.meta.glob('../../assets/promo/bg/bg_*.jpg', { eager: true })
|
||||||
const componentFilesEntries = Object.entries(componentFiles);
|
const componentFilesEntries = Object.entries(componentFiles);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
const res = await fetch(`${SERVER_URL}/api/front_img/`)
|
||||||
|
const files = await res.json()
|
||||||
const width = 1920
|
const width = 1920
|
||||||
const height = 1080
|
const height = 1080
|
||||||
const radius = 10
|
const radius = 10
|
||||||
|
@ -16,8 +19,10 @@ onMounted(() => {
|
||||||
|
|
||||||
var defs = svg.append('svg:defs');
|
var defs = svg.append('svg:defs');
|
||||||
|
|
||||||
componentFilesEntries.forEach((element: any, i) => {
|
files.forEach((element: any, i: number) => {
|
||||||
const src = element[1].default
|
// const src = element[1].default
|
||||||
|
const src = `${IMAGE_URL}/${element.file}`
|
||||||
|
console.log(src)
|
||||||
defs.append("svg:pattern")
|
defs.append("svg:pattern")
|
||||||
.attr("id", `img${i}`).attr("width", 1920).attr("height", 1080).attr("patternUnits", "userSpaceOnUse").attr("preserveAspectRatio", "none")
|
.attr("id", `img${i}`).attr("width", 1920).attr("height", 1080).attr("patternUnits", "userSpaceOnUse").attr("preserveAspectRatio", "none")
|
||||||
.append("svg:image").attr("xlink:href", src).attr("width", 1920).attr("height", 1080).attr("x", 0).attr("y", 0);
|
.append("svg:image").attr("xlink:href", src).attr("width", 1920).attr("height", 1080).attr("x", 0).attr("y", 0);
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
export const SERVER_URL = import.meta.env.VITE_SERVER_URL ?? window.location.origin
|
export const SERVER_URL = import.meta.env.VITE_SERVER_URL ?? window.location.origin
|
||||||
|
export const IMAGE_URL = import.meta.env.VITE_IMAGE_URL ?? window.location.origin
|
Loading…
Reference in New Issue