Skip to content

Commit d8afcaf

Browse files
author
jef
committed
add feedback redirect
1 parent 7e64d73 commit d8afcaf

5 files changed

Lines changed: 125 additions & 0 deletions

File tree

neo-bpsys-wpf.3DViewerIDV.dll

1 KB
Binary file not shown.

wwwroot/js/i18n.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ const translations = {
118118
'common.position': 'Position',
119119
'common.rotation': 'Rotation',
120120
'common.scale': 'Scale',
121+
122+
// === feedback tab (dev only) ===
123+
'feedback.summary': 'Problem or suggestion?',
124+
'feedback.discord': 'Discord:',
125+
'feedback.copyTitle': 'Click to copy',
126+
'feedback.copied': 'copied',
127+
'feedback.github': 'GitHub issues →',
121128
},
122129

123130
zh: {
@@ -234,6 +241,13 @@ const translations = {
234241
'common.position': '位置',
235242
'common.rotation': '旋转',
236243
'common.scale': '缩放',
244+
245+
// === feedback tab (dev only) ===
246+
'feedback.summary': '有问题或建议?',
247+
'feedback.discord': 'Discord:',
248+
'feedback.copyTitle': '点击复制',
249+
'feedback.copied': '已复制',
250+
'feedback.github': 'GitHub 问题 →',
237251
}
238252
};
239253

wwwroot/js/main.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { loadSettings } from './storage/settingsStorage.js';
2222
import { registry } from './editor/registry.js';
2323
import { sequencer } from './animation/sequencer.js';
2424
import { initPerfMonitor, updatePerfMonitor } from './perf/statsMonitor.js';
25+
import { t } from './i18n.js';
2526

2627
const canvas = document.getElementById('renderCanvas');
2728
const clock = new THREE.Clock();
@@ -140,6 +141,7 @@ function animate(currentTime) {
140141
});
141142
window.__editor = editorMod;
142143
document.getElementById('topActions').style.display = 'flex';
144+
setupFeedbackTab();
143145
}
144146

145147
preloadAllModels().catch(err => {
@@ -162,3 +164,32 @@ function animate(currentTime) {
162164
document.getElementById('errorMessage').textContent = `Fatal error: ${error.message}`;
163165
}
164166
})();
167+
168+
function setupFeedbackTab() {
169+
const tab = document.getElementById('feedbackTab');
170+
if (!tab) return;
171+
172+
document.getElementById('feedbackSummary').textContent = t('feedback.summary');
173+
document.getElementById('feedbackDiscordLabel').textContent = t('feedback.discord');
174+
document.getElementById('feedbackGithubLink').textContent = t('feedback.github');
175+
176+
const userCode = document.getElementById('feedbackDiscordUser');
177+
userCode.title = t('feedback.copyTitle');
178+
179+
const copied = document.getElementById('feedbackCopied');
180+
copied.textContent = t('feedback.copied');
181+
182+
let copiedTimeout = null;
183+
userCode.addEventListener('click', async () => {
184+
try {
185+
await navigator.clipboard.writeText(userCode.textContent);
186+
copied.classList.add('show');
187+
clearTimeout(copiedTimeout);
188+
copiedTimeout = setTimeout(() => copied.classList.remove('show'), 1500);
189+
} catch (err) {
190+
console.warn('Clipboard write failed:', err);
191+
}
192+
});
193+
194+
tab.style.display = 'block';
195+
}

wwwroot/scene.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ <h2>Model not found</h2>
3434
</div>
3535
<div id="editorPanel" style="display:none;"></div>
3636

37+
<div id="feedbackTab" style="display:none;">
38+
<div class="feedback-summary" id="feedbackSummary">Problem or suggestion?</div>
39+
<div class="feedback-details">
40+
<div class="feedback-row">
41+
<span class="feedback-label" id="feedbackDiscordLabel">Discord:</span>
42+
<code id="feedbackDiscordUser" title="Click to copy">dostojefsky</code>
43+
<span class="feedback-copied" id="feedbackCopied">copied</span>
44+
</div>
45+
<a class="feedback-github" id="feedbackGithubLink"
46+
href="https://github.com/jefcrb/3DViewerIDV/issues"
47+
target="_blank" rel="noopener noreferrer">GitHub issues &rarr;</a>
48+
</div>
49+
</div>
50+
3751
<script type="module" src="js/main.js"></script>
3852
</body>
3953
</html>

wwwroot/styles/main.css

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,3 +971,69 @@ html, body {
971971
.kf-row.just-recorded > .kf-head {
972972
animation: kfPulse 0.9s ease-out;
973973
}
974+
975+
/* Dev-only feedback tab (bottom-left). */
976+
#feedbackTab {
977+
position: fixed;
978+
left: 12px;
979+
bottom: 12px;
980+
background: #2c2c2c;
981+
border: 1px solid #1e1e1e;
982+
border-radius: 8px;
983+
color: #e5e5e5;
984+
font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
985+
font-size: 11px;
986+
padding: 6px 10px;
987+
box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
988+
z-index: 50;
989+
max-width: 240px;
990+
user-select: none;
991+
}
992+
#feedbackTab .feedback-summary {
993+
font-weight: 500;
994+
color: #cfcfcf;
995+
}
996+
#feedbackTab .feedback-details {
997+
display: flex;
998+
flex-direction: column;
999+
gap: 4px;
1000+
margin-top: 6px;
1001+
padding-top: 6px;
1002+
border-top: 1px solid #1e1e1e;
1003+
}
1004+
#feedbackTab .feedback-row {
1005+
display: flex;
1006+
align-items: center;
1007+
gap: 6px;
1008+
}
1009+
#feedbackTab .feedback-label {
1010+
color: #9a9a9a;
1011+
}
1012+
#feedbackTab code {
1013+
font-family: 'SF Mono', Menlo, Consolas, monospace;
1014+
background: #1e1e1e;
1015+
padding: 1px 5px;
1016+
border-radius: 3px;
1017+
color: #e5e5e5;
1018+
cursor: pointer;
1019+
user-select: text;
1020+
}
1021+
#feedbackTab code:hover {
1022+
background: #262626;
1023+
}
1024+
#feedbackTab .feedback-copied {
1025+
color: #7dd87d;
1026+
font-size: 10px;
1027+
opacity: 0;
1028+
transition: opacity 0.15s ease;
1029+
}
1030+
#feedbackTab .feedback-copied.show {
1031+
opacity: 1;
1032+
}
1033+
#feedbackTab .feedback-github {
1034+
color: #7cc4ff;
1035+
text-decoration: none;
1036+
}
1037+
#feedbackTab .feedback-github:hover {
1038+
text-decoration: underline;
1039+
}

0 commit comments

Comments
 (0)