用 Claude Sonnet 3.7 的天气测试编码,让谷歌VS Code AI 编程插件 Gemini Code Assist 自动编程。
生成的文件在浏览器中的效果如下:(附源代码)
VS Code AI 编程插件 Gemini Code Assist
Animated Weather Cards
Sun
Rain
Snow
Wind
<script>
function switchWeather(condition) {
const cards = document.querySelectorAll('.weather-card');
cards.forEach(card => {
if(card.classList.contains(condition)) {
card.style.display = 'flex';
}else{
card.style.display = 'none';
}
});
}
function showAll(){
const cards = document.querySelectorAll('.weather-card');
cards.forEach(card => {
card.style.display = 'flex';
});
}
showAll();
</script>