|
|
@@ -34,28 +34,13 @@
|
|
|
<img v-if="state.showLightOpen" :src="lightOpen" alt="灯光打开" class="full-screen-image overlay-image" />
|
|
|
<img v-if="!state.showLightClose" :src="lightClose" alt="灯光关闭" class="full-screen-image overlay-image" />
|
|
|
</div>
|
|
|
- <!-- 使用动态样式设置灯光遮罩 -->
|
|
|
- <div v-if="state.lamp.isLightOn" :style="{ '--lamp-color': state.lamp.color,'--lamp-opacity': state.lamp.brightness / 100 }" class="lamp-light-mask"></div>
|
|
|
|
|
|
<!-- 右下角按钮组 -->
|
|
|
<div class="button-group">
|
|
|
- <el-button class="control-button run-button" @click="toggleLight">运行</el-button>
|
|
|
+ <el-button class="control-button run-button" @click="runButtonClick">运行</el-button>
|
|
|
<el-button class="control-button code-button" @click="handleViewCode">代码</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- 显示当前灯光信息 -->
|
|
|
-<!-- <div v-if="state.lamp.isLightOn" class="lamp-info">
|
|
|
- <p>颜色: {{ state.lamp.colorLog }}色</p>
|
|
|
- <p>亮度: {{ state.lamp.brightness }}%</p>
|
|
|
-
|
|
|
- <!– 音乐播放状态显示和控制按钮 –>
|
|
|
- <div v-if="state.isMusicPlaying" class="music-info">
|
|
|
- <p>正在播放: {{ state.currentMusicName }}</p>
|
|
|
- <button class="stop-music-btn" @click="handleStopMusic">
|
|
|
- 停止播放
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </div>-->
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@@ -102,7 +87,6 @@
|
|
|
<block type="ai_smart_speaker_multi_param"></block>
|
|
|
<block type="ai_smart_speaker_single_param"></block>
|
|
|
</category>
|
|
|
-
|
|
|
<category name="逻辑" colour="%{BKY_LOGIC_HUE}">
|
|
|
<block type="controls_if"></block>
|
|
|
<block type="logic_compare"></block>
|
|
|
@@ -174,12 +158,12 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
- <!-- 工作区-->
|
|
|
+ <!-- 工作区 -->
|
|
|
<div class="workspace-section">
|
|
|
<h2>工作区</h2>
|
|
|
<div id="blocklyDiv"></div>
|
|
|
<div class="controls">
|
|
|
- <button id="runCode" @click="toggleLight">运行代码</button>
|
|
|
+ <button id="runCode" @click="runButtonClick">运行代码</button>
|
|
|
<button @click="clearWorkspace">清空工作区</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -258,7 +242,7 @@ const device = ref({
|
|
|
jsonData: {}
|
|
|
});
|
|
|
|
|
|
-// 台灯预览显示状态
|
|
|
+// 显示状态
|
|
|
const showLampPreview = ref(true);
|
|
|
// 语音识别
|
|
|
const isRecording = ref(false);
|
|
|
@@ -272,9 +256,9 @@ const goLabShow = () => {
|
|
|
const goBack = () => {
|
|
|
window.location.href = "/virtual-laboratory";
|
|
|
};
|
|
|
-// 切换灯光状态
|
|
|
-const toggleLight = () => {
|
|
|
- state.lamp.isLightOn = true;
|
|
|
+
|
|
|
+// 运行
|
|
|
+const runButtonClick = () => {
|
|
|
generateCode('javascript');
|
|
|
// 在运行前设置为正在录音状态
|
|
|
startRecordingStatus();
|
|
|
@@ -374,13 +358,6 @@ const state = reactive({
|
|
|
//【文生视频】文生视频
|
|
|
inProgressVideoMap: {},
|
|
|
|
|
|
- // 台灯状态
|
|
|
- lamp: {
|
|
|
- isLightOn: false,// 台灯是否亮着
|
|
|
- brightness: 50, // 默认亮度50%
|
|
|
- color: "#ffffff", // 默认颜色白色
|
|
|
- colorLog: "白", // 默认颜色白色
|
|
|
- },
|
|
|
|
|
|
// 智能家居图片显示控制
|
|
|
showCurtainLeft: true,
|
|
|
@@ -1841,11 +1818,6 @@ const clearOutput = () => {
|
|
|
const showStatus = (message, type = 'success') => {
|
|
|
statusMessage.value = message;
|
|
|
statusType.value = type;
|
|
|
-
|
|
|
- // 3秒后自动清除状态消息
|
|
|
- // setTimeout(() => {
|
|
|
- // statusMessage.value = '';
|
|
|
- // }, 3000);
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -2230,40 +2202,6 @@ textarea {
|
|
|
-webkit-clip-path: inset(0 0 0 0);
|
|
|
}
|
|
|
|
|
|
-/* 台灯灯光样式 - 使用动态颜色 */
|
|
|
-.lamp-light-mask {
|
|
|
- position: absolute;
|
|
|
- /* 使用更精确的定位,并针对不同屏幕尺寸进行优化 */
|
|
|
- top: 56%; /* 调整这个值以匹配台灯的位置 */
|
|
|
- left: 64%; /* 调整这个值以匹配台灯的位置 */
|
|
|
- width: 18vmin; /* 使用视口单位使灯光大小随屏幕变化 */
|
|
|
- height: 60vmin;
|
|
|
- /* 使用transform进行精确定位 */
|
|
|
- transform: translate(-50%, -50%) rotate(9deg);
|
|
|
- transform-origin: top center;
|
|
|
- background: radial-gradient(circle at center top, var(--lamp-color) 0%, var(--lamp-color) 20%, rgba(255, 255, 255, 0) 70%);
|
|
|
- filter: blur(40px);
|
|
|
- opacity: var(--lamp-opacity, 0.6);
|
|
|
- /* 创建扇形效果 */
|
|
|
- clip-path: polygon(0% 0%, 100% 0%, 200% 100%, -100% 100%);
|
|
|
- z-index: 1; /* 确保在图片上方但在UI控件下方 */
|
|
|
- /* 固定定位确保在全屏时也能正确显示 */
|
|
|
- will-change: transform;
|
|
|
-}
|
|
|
-/* 响应式调整:在不同屏幕尺寸下微调灯光位置 */
|
|
|
-@media (max-aspect-ratio: 4/3) {
|
|
|
- .lamp-light-mask {
|
|
|
- top: 56%;
|
|
|
- left: 64%;
|
|
|
- }
|
|
|
-}
|
|
|
-@media (min-aspect-ratio: 16/9) {
|
|
|
- .lamp-light-mask {
|
|
|
- top: 55%;
|
|
|
- left: 63%;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
/* 灯光信息显示 */
|
|
|
.lamp-info {
|
|
|
position: absolute;
|