1. 列出需求
與Claude 3.7 Sonnet兩次對話
幫我寫一個功能和界面都和Google翻譯類似的單獨HTML文件,API格式如下。
Request:
POST /v1/translateHtml HTTP/1.1
Host: translate-pa.googleapis.com
X-Goog-API-Key: my_api_key
Content-Type: application/json+protobuf
[[["Wie geht es dir?"],"auto","en"],"wt_lib"]
Response:
[["How are you doing?"],["de"]]
完整對話紀錄
(模擬程式)
(近真實程式)
2. 深入理解Google翻譯界面的垂直滾動軸
縮小問題範圍,對CSS實現Google翻譯界面有困惑,描述給Micorsoft Copiot來幫忙解決。
Show me a single HTML that has the interface of Google Translate. What impresses me most is when the input or output text is longer than the screen, it allows the user to move one single (instead of 2) vertical scroll bar to see both the input text and output text. Explain your solution in detail because I have been confused by CSS.
完整對話紀錄
(針對textArea元素的解法)
(簡易展示程式)
3. 讓GPT 4o示範簡單的HTML元素控制
在手動將新獲得的CSS語法整合進初版程式的過程中遇到程式的語法錯誤(從textArea改成div),直接求助於GPT 4o。
完整對話紀錄