豆包MarsCode | 一款智能编程助手开发工具
豆包MarsCode 是基于豆包大模型的智能开发工具,提供 Cloud IDE 和 AI 编程助手,支持代码补全、智能问答、代码解释与修复,兼容主流编程工具与 100+ 种编程语言,助力编程更智能便捷
代码补全:在编码过程中提供单行或多行的代码推荐,并支持通过注释生成代码片段,提升代码编写速度
单测生成:为选中函数生成单测,提升单测覆盖率,提升代码质量
代码解释:理解项目仓库,帮助用户准确解释代码从而快速上手开发
码补全 Pro:在修改或重构代码时,支持基于编辑行为预测下一个改动点,并给出推荐,协助完整的编码过程
生成注释:为整个函数或每行代码生成注释,提升代码可读性,方便协同开发
错误修复:快速发现代码中的问题并给出智能优化建议,提升代码质量
AI 问答:针对性地优化研发领域知识问答的质量,提供更准确的问答结果
安装使用教程
1、豆包支持多种使用方式
VS Code插件
-JetBrains IDEs 插件
-MarsCode网页版
2、安装成功授权登录即可
使用体验
1、让豆包MarsCode写一段简单的hello world程序
故意删除代码让豆包排错(ctrl+shift+enter),按tab会自动补全代码
2、让豆包生成二叉树代码并自动注释
点击注释代码豆包MarsCode就会自动生成注释
3、豆包官网还提供了代码联系在线版编程网页,可以在线编程代码学习,并且豆包MarsCode还能够提供注释、排错、以及提供思路等功能
4、豆包MarsCode在大型前后端项目也可以当做一个免费的gpt来使用为项目的搭建做出非常多的便利
豆包MarsCode搭建前端登录页面
使用豆包MarsCodes搭建前端登录页面,并且不断优化实现前端登录页面较为完备的功能
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #6a11cb, #2575fc, #43e97b);
background-size: 400% 400%;
animation: gradientBG 15s ease infinite;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
padding: 20px;
}
@keyframes gradientBG {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.login-container {
background-color: #ffffff;
padding: 40px;
border-radius: 20px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
}
h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.input-container {
position: relative;
width: 100%;
}
.input-icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: #999;
font-size: 18px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 12px 12px 12px 45px;
margin: 12px 0;
border: 1px solid #d1d9e0;
border-radius: 20px;
box-sizing: border-box;
font-size: 16px;
background-color: #f9fafb;
transition: border-color 0.3s ease, background-color 0.3s ease;
}
input:focus {
outline: none;
border-color: #4a90e2;
background-color: #ffffff;
box-shadow: 0 0 8px rgba(74, 144, 226, 0.3);
}
.error-message {
color: #e74c3c;
font-size: 14px;
margin-top: 5px;
}
button {
width: 100%;
padding: 14px;
background-color: #4a90e2;
color: white;
border: none;
border-radius: 20px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #357abd;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.loading-spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #4a90e2;
border-radius: 50%;
width: 20px;
height: 20px;
animation: spin 1s linear infinite;
display: none;
margin-left: 10px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.form-group {
margin-bottom: 20px;
}
.forgot-password {
text-align: right;
margin-top: 10px;
}
.forgot-password a {
color: #4a90e2;
text-decoration: none;
font-size: 14px;
}
.forgot-password a:hover {
text-decoration: underline;
}
.social-login {
display: flex;
justify-content: space-between;
margin: 20px 0;
}
.social-login a {
width: 48%;
padding: 12px;
text-align: center;
border-radius: 20px;
text-decoration: none;
color: white;
font-size: 16px;
transition: background-color 0.3s ease;
}
.google {
background-color: #db4437;
}
.google:hover {
background-color: #c33d2f;
}
.facebook {
background-color: #3b5998;
}
.facebook:hover {
background-color: #2e467d;
}
/* Media query for small screens */
@media (max-width: 480px) {
.login-container {
padding: 30px;
}
}
</style>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form id="login-form">
<div class="input-container">
<i class="input-icon">👤</i> <!-- 用户图标 -->
<input type="text" id="username" name="username" placeholder="用户名" required>
</div>
<div class="input-container">
<i class="input-icon">🔒</i> <!-- 锁图标 -->
<input type="password" id="password" name="password" placeholder="密码" required>
</div>
<div class="form-group">
<input type="checkbox" id="remember" name="remember">
<label for="remember">Remember Me</label>
</div>
<button type="submit" id="login-btn" onclick="showLoading()">登录</button>
<div class="loading-spinner" id="spinner"></div>
<div class="error-message" id="error-message" style="display: none;">
Invalid username or password. Please try again.
</div>
<div class="forgot-password">
<a href="#">Forgot Password?</a>
</div>
</form>
<div class="social-login">
<a href="#" class="google">稀土掘金登录</a>
<a href="#" class="facebook">CSDN登录</a>
</div>
</div>
<script>
function showLoading() {
var button = document.getElementById('login-btn');
var spinner = document.getElementById('spinner');
button.disabled = true;
spinner.style.display = 'inline-block';
}
document.getElementById('login-form').addEventListener('submit', function(event) {
event.preventDefault(); // 停止表单默认提交
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var errorMessage = document.getElementById('error-message');
// 模拟简单验证
if (username !== "admin" || password !== "1234") {
errorMessage.style.display = 'block';
var button = document.getElementById('login-btn');
var spinner = document.getElementById('spinner');
button.disabled = false;
spinner.style.display = 'none';
}
});
</script>
</body>
</html>
这段代码实现了一个现代化的登录页面,具有渐变背景、圆角输入框和按钮;用户可以通过输入用户名和密码进行登录,还可以选择"记住我"选项;页面提供了 稀土掘金和 CSDN登录按钮,并包含错误提示信息和加载状态动画,提升用户体验
体验感受
豆包MarsCode提供了非常多的功能代码编程联系、项目搭建学习、代码知识查询等都能够很好的满足要求,相当于是24小时代码顾问,不仅仅是关于代码方面的知识,除此之外的问题豆包也能很好的回应,感兴趣的小伙伴可以去官网体验!
本文正在参加豆包MarsCode测评官征文活动