Преглед на файлове

Merge branch 'master' of http://106.3.96.219:13000/CQ_ADI/airoptweb

tangjunhao преди 3 месеца
родител
ревизия
b4bd42e711

BIN
src/assets/flowimg/surromdao.png


+ 6 - 6
src/components/cloudChart/dialog/ColorCardDialog.vue

@@ -266,19 +266,19 @@ let formLabelWidth2 = ref(100)
 let skvalue = ref({
   check1: '1',
   orientation: '竖直',
-  X: '0.9',       // 位置更靠边
-  Y: '0.1',       // 位置更靠边
-  width: '0.5',   // 宽度增大
-  height: '0.7',  // 高度增大
+  X: '0.85',      // 位置更靠右
+  Y: '0.85',      // 位置更靠下
+  width: '0.18',  // 增大宽度(原0.15)
+  height: '0.35',  // 增大高度(原0.4)
   skipc: '2',
   font: '微软雅黑',
-  fontsize: '15',
+  fontsize: '16',  // 增大字体(原15)
   dataformat: '科学计数法',
   jingdu: '2',
   check2: '1',
   texttitle: '使用变量名',
   titlefont: 'Arial',
-  fontsize2: '20',
+  fontsize2: '20', // 增大标题字体
 })
 
 // 下拉选项数据

+ 70 - 9
src/components/cloudChart/dialog/DomainDialog.vue

@@ -28,7 +28,7 @@
           <el-button @click="hideSelected" style="width: 100%;">隐藏</el-button>
         </el-col>
         <el-col :span="8">
-          <el-button style="width: 100%;">表面绘制</el-button>
+          <el-button @click="surfaceRendering" style="width: 100%;">表面绘制</el-button>
         </el-col>
       </el-row>
     </div>
@@ -48,11 +48,18 @@
       </el-table>
     </div>
   </SubDialog>
+  <!-- 表面绘制弹窗 -->
+  <SurfaceDialog
+    v-model="showSurfaceDialog"
+    :initial-data="surfaceFormData"
+    @surfaceConfirm="handleSurfaceConfirm"
+/>
 </template>
 
 <script setup>
 import { ref, defineProps, defineEmits } from 'vue'
 import SubDialog from './SubDialog.vue'
+import SurfaceDialog from './SurfaceDialog.vue'
 
 const props = defineProps({
   modelValue: Boolean,
@@ -66,6 +73,19 @@ const emit = defineEmits(['update:modelValue', 'confirm', 'cancel'])
 
 const selectedRows = ref([]); // 存储选中的行
 
+// 表面绘制弹窗状态
+const showSurfaceDialog = ref(false)
+const surfaceFormData = ref({
+  slotType: '0',
+  start: '1',
+  end: '1',
+  skip: '1'
+})
+
+const selectedDomains = computed(() => {
+  return selectedRows.value.map(row => row.domain)
+})
+
 // 监听选中行变化
 const handleSelectionChange = (rows) => {
   selectedRows.value = rows;
@@ -112,14 +132,14 @@ let domainbtnbox2 = ref(['显示','隐藏','表面绘制'])
 
 // 表格数据
 let tableData = ref([
-  {domain:"Z1", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z2", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z3", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z4", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z1", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z2", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z3", status:'show', drawType:'2', planeRange:'3'},
-  {domain:"Z4", status:'show', drawType:'2', planeRange:'3'},
+  {domain:"Z1", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z2", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z3", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z4", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z1", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z2", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z3", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
+  {domain:"Z4", status:'show', drawType:'Exposed', planeRange:'(1,1,1)'},
 ])
 
 // 表格列配置
@@ -129,6 +149,13 @@ let tabledomainColumns = ref([
   {label:"平面范围", prop:'area'},
 ])
 
+const slotTypeOptions = ref([
+  { value: "0", label: "Exposed" },
+  { value: "1", label: "I-plans" },
+  { value: "2", label: "J-plans" },
+  { value: "3", label: "K-plans" }
+])
+
 // 表头样式
 const headerCellClassName = ({ column }) => {
   // console.log('列:',column.property)
@@ -143,6 +170,40 @@ const headerCellClassName = ({ column }) => {
   return '';
 };
 
+// 表面绘制按钮点击
+const surfaceRendering = () => {
+  if (selectedRows.value.length === 0) {
+    return
+  } 
+  
+  // 初始化表面绘制表单数据
+  surfaceFormData.value = {
+    slotType: '0',
+    start: '1',
+    end: '1',
+    skip: '1',
+    domains: selectedDomains.value // 传递选中的域
+  }
+  
+  showSurfaceDialog.value = true
+}
+
+// 表面绘制确认
+const handleSurfaceConfirm = (surfaceData) => {
+  console.log('表面绘制数据:', surfaceData)
+  // 找到对应的label
+  const selectedOption = slotTypeOptions.value.find(option => option.value === surfaceData.slotType);
+  const drawTypeLabel = selectedOption ? selectedOption.label : surfaceData.slotType;
+  
+  // 更新选中行的绘制类型和平面范围
+  selectedRows.value.forEach(row => {
+    row.drawType = drawTypeLabel;  // 使用label而不是value
+    row.planeRange = `(${surfaceData.start},${surfaceData.end},${surfaceData.skip})`
+  })
+  
+  showSurfaceDialog.value = false
+}
+
 // 确认操作
 const handleConfirm = () => {
   emit('confirm', tableData.value)

+ 139 - 0
src/components/cloudChart/dialog/SurfaceDialog.vue

@@ -0,0 +1,139 @@
+<template>
+  <SubDialog
+    :modelValue="modelValue"
+    @update:modelValue="$emit('update:modelValue', $event)"
+    title="EnterRange"
+    width="400px"
+    @confirm="handleConfirm"
+    @cancel="handleCancel"
+  >
+    <el-form label-position="left" label-width="100px">
+      <!-- 第一行:SlotType 下拉选项框 -->
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <el-form-item label="SlotType:">
+            <el-select
+              v-model="formData.slotType"
+              placeholder="请选择SlotType"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in slotTypeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <!-- 第二行:三个输入框 -->
+      <el-row :gutter="10">
+        <el-col :span="8">
+          <el-form-item label="Start:" label-width="60px">
+            <el-input v-model="formData.start" placeholder="请输入Start值" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="End:" label-width="60px">
+            <el-input v-model="formData.end" placeholder="请输入End值" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="Skip:" label-width="60px">
+            <el-input v-model="formData.skip" placeholder="请输入Skip值" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </SubDialog>
+</template>
+
+<script setup>
+import { ref, defineProps, defineEmits } from "vue"
+import SubDialog from "./SubDialog.vue" // 引入通用弹窗组件
+
+const props = defineProps({
+  modelValue: {
+    type: Boolean,
+    default: false
+  },
+  title: {
+    type: String,
+    default: "EnterRange"
+  },
+  width: {
+    type: String,
+    default: "650px"
+  },
+  initialData: {
+    type: Object,
+    default: () => ({
+      slotType: "",
+      start: "",
+      end: "",
+      skip: ""
+    })
+  },
+  slotTypes: {
+    type: Array,
+    default: () => [
+      { value: "0", label: "Exposed" },
+      { value: "1", label: "I-plans" },
+      { value: "2", label: "J-plans" },
+      { value: "3", label: "K-plans" }
+    ]
+  }
+})
+
+const emit = defineEmits(["update:modelValue", "success"])
+
+const dialogVisible = ref(props.modelValue)
+const formData = ref({ ...props.initialData })
+const slotTypeOptions = ref(props.slotTypes)
+
+const handleConfirm = () => {
+  if (!formData.value.slotType) {
+    return
+  }
+  
+    emit('surfaceConfirm', { 
+    slotType: formData.value.slotType,
+    start: formData.value.start,
+    end: formData.value.end,
+    skip: formData.value.skip
+  })
+}
+
+const handleCancel = () => {
+  formData.value = { ...props.initialData }
+  emit("cancel")
+}
+
+watch(
+  () => props.modelValue,
+  (val) => {
+    dialogVisible.value = val
+  }
+)
+
+watch(dialogVisible, (val) => {
+  emit("update:modelValue", val)
+  if (!val) {
+    formData.value = { ...props.initialData }
+  }
+})
+
+watch(
+  () => props.initialData,
+  (newVal) => {
+    formData.value = { ...newVal }
+  },
+  { deep: true }
+)
+</script>
+
+<style scoped>
+/* 可以添加自定义样式 */
+</style>

+ 181 - 39
src/views/threejsView/components/ThreeScene.vue

@@ -1,12 +1,5 @@
 <template>
-    <!-- 进度条 -->
-    <!-- <el-progress
-      :percentage="progress"
-      :status="progress === 100 ? 'success' : ''"
-      :stroke-width="10"
-      :text-inside="true"
-      style="width: 100%; margin-bottom: 20px;"
-    /> -->
+
   <div ref="threeContainer" class="three-container" :style="{height: height}">
     <!-- 添加色卡Canvas -->
     <canvas 
@@ -14,6 +7,7 @@
       ref="colorCardCanvas" 
       class="color-card-canvas"
       :style="colorCardStyle"
+      @mousedown="startDrag"
     ></canvas>
   </div>
 </template>
@@ -53,6 +47,10 @@ const threeContainer = ref(null);
 const colorCardCanvas = ref(null)
 const colorCardContext = ref(null)
 const progress = ref(0); // 进度条的值
+// 添加拖拽相关状态
+const isDragging = ref(false)
+const dragStartPos = ref({ x: 0, y: 0 })
+const currentPos = ref({ x: 0.85, y: 0.85 })  // 初始位置
 
 let scene, camera, renderer, controls
 
@@ -156,28 +154,117 @@ const renderVTK = (data) => {
 
 }
 
+// 开始拖拽
+const startDrag = (e) => {
+  if (!colorCardCanvas.value) return
+  
+  const containerRect = threeContainer.value.getBoundingClientRect()
+  const cardRect = colorCardCanvas.value.getBoundingClientRect()
+  
+  // 检查点击是否在色卡上
+  if (
+    e.clientX < cardRect.left ||
+    e.clientX > cardRect.right ||
+    e.clientY < cardRect.top ||
+    e.clientY > cardRect.bottom
+  ) {
+    return
+  }
+  
+  isDragging.value = true
+  dragStartPos.value = {
+    x: e.clientX,
+    y: e.clientY
+  }
+  
+  // 使用passive: false确保能调用preventDefault
+  window.addEventListener('mousemove', handleDrag, { passive: false })
+  window.addEventListener('mouseup', stopDrag, { passive: true })
+  e.preventDefault()
+}
+
+// 添加拖拽边界限制
+const handleDrag = (e) => {
+  if (!isDragging.value || !colorCardCanvas.value) return
+  
+  const containerRect = threeContainer.value.getBoundingClientRect()
+  const cardRect = colorCardCanvas.value.getBoundingClientRect()
+  
+  const dx = e.clientX - dragStartPos.value.x
+  const dy = e.clientY - dragStartPos.value.y
+  
+  // 计算新位置(像素值)
+  let newX = (currentPos.value.x * containerRect.width) + dx
+  let newY = (currentPos.value.y * containerRect.height) + dy
+  
+  // 边界检查(确保色卡完全留在容器内)
+  newX = Math.max(cardRect.width/2, Math.min(containerRect.width - cardRect.width/2, newX))
+  newY = Math.max(cardRect.height/2, Math.min(containerRect.height - cardRect.height/2, newY))
+  
+  // 转换为相对位置 (0-1)
+  currentPos.value.x = newX / containerRect.width
+  currentPos.value.y = newY / containerRect.height
+  
+  dragStartPos.value = { x: e.clientX, y: e.clientY }
+  e.preventDefault() // 防止默认行为
+  
+  // 强制更新样式
+  colorCardCanvas.value.style.left = `${newX}px`
+  colorCardCanvas.value.style.top = `${newY}px`
+}
+
+// 停止拖拽
+const stopDrag = () => {
+  isDragging.value = false
+  window.removeEventListener('mousemove', handleDrag)
+  window.removeEventListener('mouseup', stopDrag)
+}
+
+// 更新色卡位置
+const updateColorCardPosition = () => {
+  // 更新skvalue中的位置值
+  skvalue.value.X = currentPos.value.x.toFixed(2)
+  skvalue.value.Y = currentPos.value.y.toFixed(2)
+  
+  // 触发色卡重新渲染
+  if (pltData.value?.config?.colorCard) {
+    pltData.value.config.colorCard.X = currentPos.value.x
+    pltData.value.config.colorCard.Y = currentPos.value.y
+    pltData.value = {...pltData.value}
+  }
+}
+
 // 计算色卡显示状态和样式
 const showColorCard = computed(() => {
   return props.data?.config?.colorCard?.visible
 })
 
 const colorCardStyle = computed(() => {
-  if (!showColorCard.value) return {}
+  if (!showColorCard.value || !threeContainer.value) return {}
   const config = props.data.config.colorCard
+  
+  // 确保最小尺寸
+  const minWidth = 70 // 最小宽度(px)
+  const minHeight = 25 // 最小高度(px)
+  
+  // 计算实际尺寸(取配置值和最小值的较大者)
+  const width = config.orientation === 'vertical' 
+    ? `${Math.max(minWidth, config.width * 100)}px`
+    : `${Math.max(minWidth, config.width * 100)}%`
+    
+  const height = config.orientation === 'vertical' 
+    ? `${Math.max(minHeight, config.height * 100)}%`
+    : `${Math.max(minHeight, config.height * 100)}px`
+  
   return {
     position: 'absolute',
-    [config.orientation === 'vertical' ? 'right' : 'bottom']: '10px',
-    [config.orientation === 'vertical' ? 'top' : 'left']: '50%',
-    transform: config.orientation === 'vertical' 
-      ? 'translateY(-50%)' 
-      : 'translateX(-50%)',
-    width: config.orientation === 'vertical' 
-      ? `${config.width * 100}px` 
-      : `${config.width * 100}%`,
-    height: config.orientation === 'vertical' 
-      ? `${config.height * 100}%` 
-      : `${config.height * 100}px`,
-    zIndex: 1000
+    left: `${currentPos.value.x * 100}%`,
+    top: `${currentPos.value.y * 100}%`,
+    transform: 'translate(-50%, -50%)',
+    width,
+    height,
+    zIndex: 1000,
+    cursor: 'move'
   }
 })
 // 初始化色卡
@@ -193,18 +280,37 @@ const renderColorCard = () => {
   
   const config = props.data.config.colorCard
   const ctx = colorCardContext.value
-  const width = colorCardCanvas.value.width
-  const height = colorCardCanvas.value.height
+  
+  // 根据设备像素比调整canvas分辨率
+  const dpr = window.devicePixelRatio || 1
+  const width = colorCardCanvas.value.clientWidth * dpr
+  const height = colorCardCanvas.value.clientHeight * dpr
+  
+  // 设置canvas实际尺寸
+  colorCardCanvas.value.width = width
+  colorCardCanvas.value.height = height
+  
+  // 缩放绘图上下文
+  ctx.scale(dpr, dpr)
+
+  if (config.orientation === 'vertical') {
+  canvas.width = 60 * (window.devicePixelRatio || 1)
+  canvas.height = threeContainer.value.clientHeight * 0.35 * (window.devicePixelRatio || 1)
+  } else {
+    canvas.width = threeContainer.value.clientWidth * 0.35 * (window.devicePixelRatio || 1)
+    canvas.height = 60 * (window.devicePixelRatio || 1)
+  }
   
   // 清除画布
   ctx.clearRect(0, 0, width, height)
   
-  // 创建渐变
+  // 创建渐变(根据朝向)
+  // 根据方向创建渐变
   let gradient
   if (config.orientation === 'vertical') {
-    gradient = ctx.createLinearGradient(0, height, 0, 0)
+    gradient = ctx.createLinearGradient(0, canvas.height, 0, 0)
   } else {
-    gradient = ctx.createLinearGradient(0, 0, width, 0)
+    gradient = ctx.createLinearGradient(0, 0, canvas.width, 0)
   }
   
   // 添加色卡颜色
@@ -216,11 +322,12 @@ const renderColorCard = () => {
   ctx.fillStyle = gradient
   ctx.fillRect(0, 0, width, height)
   
-  // 添加刻度
+  // 设置更清晰的文字样式
   ctx.strokeStyle = '#000'
-  ctx.lineWidth = 1
-  ctx.font = `${config.fontSize}px ${config.font}`
-  ctx.fillStyle = '#000'
+  ctx.lineWidth = 2  // 加粗刻度线
+  ctx.font = `bold ${config.fontSize}px ${config.font}`  // 加粗字体
+  ctx.fillStyle = '#FFF'  // 改为白色文字更清晰
+  ctx.textBaseline = 'middle'
   
   // 根据朝向绘制刻度
   if (config.orientation === 'vertical') {
@@ -233,10 +340,13 @@ const renderColorCard = () => {
       ctx.lineTo(width, y)
       ctx.stroke()
       
-      // 跳过指定层级的标签
       if (i % (config.skipLevels + 1) === 0) {
         const value = (1 - i / height * 1).toFixed(config.precision)
-        ctx.fillText(value, 5, y + 5)
+        // 添加文字背景增强可读性
+        ctx.fillStyle = 'rgba(0,0,0,0.5)'
+        ctx.fillRect(5, y - 10, 50, 20)
+        ctx.fillStyle = '#FFF'
+        ctx.fillText(value, 10, y)
       }
     }
   } else {
@@ -249,29 +359,43 @@ const renderColorCard = () => {
       ctx.lineTo(x, height * 0.3)
       ctx.stroke()
       
-      // 跳过指定层级的标签
       if (i % (config.skipLevels + 1) === 0) {
         const value = (i / width * 1).toFixed(config.precision)
-        ctx.fillText(value, x - 10, height - 5)
+        // 添加文字背景
+        ctx.fillStyle = 'rgba(0,0,0,0.5)'
+        ctx.fillRect(x - 15, height - 25, 30, 20)
+        ctx.fillStyle = '#FFF'
+        ctx.fillText(value, x - 10, height - 15)
       }
     }
   }
   
-  // 添加标题
+  // 添加标题(增强样式)
   if (config.showTitle) {
     ctx.font = `bold ${config.titleFontSize}px ${config.titleFont}`
     ctx.textAlign = 'center'
+    ctx.fillStyle = '#FFF'
+    
     const title = config.titleSource === 'custom' 
       ? config.customTitle 
       : 'Color Scale'
     
     if (config.orientation === 'vertical') {
+      // 添加标题背景
+      ctx.fillStyle = 'rgba(0,0,0,0.7)'
+      ctx.fillRect(15, height/2 - 15, 30, 30)
+      ctx.fillStyle = '#FFF'
+      
       ctx.save()
-      ctx.translate(20, height / 2)
+      ctx.translate(30, height / 2)
       ctx.rotate(-Math.PI / 2)
       ctx.fillText(title, 0, 0)
       ctx.restore()
     } else {
+      // 添加标题背景
+      ctx.fillStyle = 'rgba(0,0,0,0.7)'
+      ctx.fillRect(width/2 - 50, height - 30, 100, 25)
+      ctx.fillStyle = '#FFF'
       ctx.fillText(title, width / 2, height - 15)
     }
   }
@@ -567,6 +691,8 @@ const adjustCameraForPlt = (scene, camera, params = {}) => {
 <style scoped>
 .three-container {
   width: 100%;
+  position: relative;
+  overflow: hidden;
   /* height: calc(60vh - 6px);  */
   border: 1px solid #ccc; /* 可选:添加边框以便查看容器范围 */
 }
@@ -574,8 +700,24 @@ const adjustCameraForPlt = (scene, camera, params = {}) => {
   font-size: 12px;
 }
 .color-card-canvas {
-  pointer-events: none; /* 允许点击穿透 */
-  border: 1px solid #ccc;
-  background: white;
+  min-width: 70px;
+  min-height: 25px;
+  position: absolute;
+  will-change: transform;
+  user-select: none;
+  touch-action: none;
+  cursor: move;
+  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
+  transition: transform 0.1s ease-out;
+}
+
+.color-card-canvas:hover {
+  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
+}
+
+.color-card-canvas:active {
+  cursor: grabbing;
+  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
+  transition: none;
 }
 </style>

+ 1 - 0
src/views/threejsView/utils/parsers/PltDataParser.js

@@ -1,6 +1,7 @@
 export class PltDataParser {
     parse(jsonData) {
         console.log("Parsing PLT data...", jsonData);
+        //
         return jsonData;
     }
 }

BIN
static/Build/Build.data


Файловите разлики са ограничени, защото са твърде много
+ 0 - 9
static/Build/Build.framework.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
static/Build/Build.loader.js


BIN
static/Build/Build.wasm


+ 0 - 33
static/ServiceWorker.js

@@ -1,33 +0,0 @@
-const cacheName = "DefaultCompany-CollierySafety-0.1.0";
-const contentToCache = [
-    "Build/Build.loader.js",
-    "Build/Build.framework.js",
-    "Build/Build.data",
-    "Build/Build.wasm",
-    "TemplateData/style.css"
-
-];
-
-self.addEventListener('install', function (e) {
-    console.log('[Service Worker] Install');
-    
-    e.waitUntil((async function () {
-      const cache = await caches.open(cacheName);
-      console.log('[Service Worker] Caching all: app shell and content');
-      await cache.addAll(contentToCache);
-    })());
-});
-
-self.addEventListener('fetch', function (e) {
-    e.respondWith((async function () {
-      let response = await caches.match(e.request);
-      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
-      if (response) { return response; }
-
-      response = await fetch(e.request);
-      const cache = await caches.open(cacheName);
-      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
-      cache.put(e.request, response.clone());
-      return response;
-    })());
-});

BIN
static/TemplateData/favicon.ico


BIN
static/TemplateData/icons/unity-logo-dark.png


BIN
static/TemplateData/icons/unity-logo-light.png


BIN
static/TemplateData/progress-bar-empty-dark.png


BIN
static/TemplateData/progress-bar-empty-light.png


BIN
static/TemplateData/progress-bar-full-dark.png


BIN
static/TemplateData/progress-bar-full-light.png


+ 0 - 8
static/TemplateData/style.css

@@ -1,8 +0,0 @@
-body { padding: 0; margin: 0 }
-#unity-container { position: fixed; width: 100%; height: 100%; }
-#unity-canvas { width: 100%; height: 100%; background: #231F20 }
-#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
-#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
-#unity-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
-#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
-#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

BIN
static/TemplateData/unity-logo-dark.png


BIN
static/TemplateData/unity-logo-light.png


+ 0 - 103
static/index.html

@@ -1,103 +0,0 @@
-<!DOCTYPE html>
-<html lang="en-us">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>Unity WebGL Player | CollierySafety</title>
-    <link rel="shortcut icon" href="TemplateData/favicon.ico">
-    <link rel="stylesheet" href="TemplateData/style.css">
-    <link rel="manifest" href="manifest.webmanifest">
-  </head>
-  <body>
-    <div id="unity-container">
-      <canvas id="unity-canvas" width=960 height=600 tabindex="-1"></canvas>
-      <div id="unity-loading-bar">
-        <div id="unity-logo"></div>
-        <div id="unity-progress-bar-empty">
-          <div id="unity-progress-bar-full"></div>
-        </div>
-      </div>
-      <div id="unity-warning"> </div>
-    </div>
-    <script>
-      window.addEventListener("load", function () {
-        if ("serviceWorker" in navigator) {
-          navigator.serviceWorker.register("ServiceWorker.js");
-        }
-      });
-
-      var container = document.querySelector("#unity-container");
-      var canvas = document.querySelector("#unity-canvas");
-      var loadingBar = document.querySelector("#unity-loading-bar");
-      var progressBarFull = document.querySelector("#unity-progress-bar-full");
-      var warningBanner = document.querySelector("#unity-warning");
-
-      // Shows a temporary message banner/ribbon for a few seconds, or
-      // a permanent error message on top of the canvas if type=='error'.
-      // If type=='warning', a yellow highlight color is used.
-      // Modify or remove this function to customize the visually presented
-      // way that non-critical warnings and error messages are presented to the
-      // user.
-      function unityShowBanner(msg, type) {
-        function updateBannerVisibility() {
-          warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
-        }
-        var div = document.createElement('div');
-        div.innerHTML = msg;
-        warningBanner.appendChild(div);
-        if (type == 'error') div.style = 'background: red; padding: 10px;';
-        else {
-          if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
-          setTimeout(function() {
-            warningBanner.removeChild(div);
-            updateBannerVisibility();
-          }, 5000);
-        }
-        updateBannerVisibility();
-      }
-
-      var buildUrl = "Build";
-      var loaderUrl = buildUrl + "/Build.loader.js";
-      var config = {
-        dataUrl: buildUrl + "/Build.data",
-        frameworkUrl: buildUrl + "/Build.framework.js",
-        codeUrl: buildUrl + "/Build.wasm",
-        streamingAssetsUrl: "StreamingAssets",
-        companyName: "DefaultCompany",
-        productName: "CollierySafety",
-        productVersion: "0.1.0",
-        showBanner: unityShowBanner,
-      };
-
-      // By default Unity keeps WebGL canvas render target size matched with
-      // the DOM size of the canvas element (scaled by window.devicePixelRatio)
-      // Set this to false if you want to decouple this synchronization from
-      // happening inside the engine, and you would instead like to size up
-      // the canvas DOM size and WebGL render target sizes yourself.
-      // config.matchWebGLToCanvasSize = false;
-
-      if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
-        // Mobile device style: fill the whole browser client area with the game canvas:
-        var meta = document.createElement('meta');
-        meta.name = 'viewport';
-        meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
-        document.getElementsByTagName('head')[0].appendChild(meta);
-      }
-
-      loadingBar.style.display = "block";
-
-      var script = document.createElement("script");
-      script.src = loaderUrl;
-      script.onload = () => {
-        createUnityInstance(canvas, config, (progress) => {
-          progressBarFull.style.width = 100 * progress + "%";
-        }).then((unityInstance) => {
-          loadingBar.style.display = "none";
-        }).catch((message) => {
-          alert(message);
-        });
-      };
-      document.body.appendChild(script);
-    </script>
-  </body>
-</html>

+ 0 - 15
static/manifest.webmanifest

@@ -1,15 +0,0 @@
-{
-    "name": "CollierySafety",
-    "short_name": "CollierySafety",
-    "start_url": "index.html",
-    "display": "fullscreen",
-    "background_color": "#231F20",
-    "theme_color": "#000",
-    "description": "",
-    "icons": [{
-      "src": "TemplateData/icons/unity-logo-dark.png",
-      "sizes": "144x144",
-      "type": "image/png",
-      "purpose": "any maskable"
-    }]
-  }

Някои файлове не бяха показани, защото твърде много файлове са промени