google-gemini ai
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simplified Google Gemini API Guide for JSFiddle</title>
<style>
:root {
--primary-color: #1a73e8;
--secondary-color: #34a853;
--text-primary: #202124;
--text-secondary: #5f6368;
--bg-primary: #ffffff;
--bg-secondary: #f8f9fa;
--border-color: #dadce0;
--shadow: 0 2px 10px rgba(0,0,0,0.1);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
color: var(--text-primary);
background: var(--bg-secondary);
padding: 20px;
min-height: 100vh;
}
.container {
max-width: 800px;
margin: 0 auto;
}
.header {
background: var(--bg-primary);
padding: 30px;
text-align: center;
margin-bottom: 20px;
border-radius: 12px;
box-shadow: var(--shadow);
}
h1 {
font-size: 2.5rem;
color: var(--primary-color);
}
.subtitle {
font-size: 1.1rem;
color: var(--text-secondary);
}
.section {
background: var(--bg-primary);
margin-bottom: 20px;
padding: 20px;
border-radius: 12px;
box-shadow: var(--shadow);
}
h2 {
font-size: 1.6rem;
color: var(--primary-color);
margin-bottom: 10px;
}
p {
margin-bottom: 15px;
}
.alert {
padding: 15px;
...
CSS
css
#scheduleInput {
width: 300px;
height: 100px;
}
#scheduleList {
list-style-type: none;
padding: 0;
}
#scheduleList li {
margin-bottom: 5px;
}
JavaScript
function addScheduleItem() {
const inputText = document.getElementById("scheduleInput").value;
const scheduleList = document.getElementById("scheduleList");
if (inputText.trim() !== "") { //Avoid adding empty items
const listItem = document.createElement("li");
listItem.textContent = inputText;
scheduleList.appendChild(listItem);
document.getElementById("scheduleInput").value = ""; //clear input
}
}