mirror of
https://github.com/anthropics/claude-code.git
synced 2026-02-19 04:27:33 -08:00
Compare commits
1 Commits
v2.1.11
...
claude/cre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
107272c9fa |
64
index.html
Normal file
64
index.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sample Web Page</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
.button {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
margin: 10px 5px;
|
||||
}
|
||||
.button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
#output {
|
||||
margin-top: 20px;
|
||||
padding: 15px;
|
||||
background-color: #f8f9fa;
|
||||
border-left: 4px solid #007bff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Welcome to My Web Page</h1>
|
||||
<p>This is a sample web page with JavaScript functionality.</p>
|
||||
|
||||
<button class="button" onclick="showMessage()">Show Message</button>
|
||||
<button class="button" onclick="changeColor()">Change Color</button>
|
||||
<button class="button" onclick="showDateTime()">Show Date/Time</button>
|
||||
|
||||
<div id="output">
|
||||
<p>Click a button to see JavaScript in action!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
38
script.js
Normal file
38
script.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// Sample JavaScript functions for the web page
|
||||
|
||||
function showMessage() {
|
||||
const output = document.getElementById('output');
|
||||
output.innerHTML = '<p><strong>Hello from JavaScript!</strong> This message was generated by the external script file.</p>';
|
||||
}
|
||||
|
||||
function changeColor() {
|
||||
const output = document.getElementById('output');
|
||||
const colors = ['#e3f2fd', '#f3e5f5', '#e8f5e8', '#fff3e0', '#fce4ec'];
|
||||
const randomColor = colors[Math.floor(Math.random() * colors.length)];
|
||||
|
||||
output.style.backgroundColor = randomColor;
|
||||
output.innerHTML = '<p>Background color changed! The new color is: <strong>' + randomColor + '</strong></p>';
|
||||
}
|
||||
|
||||
function showDateTime() {
|
||||
const output = document.getElementById('output');
|
||||
const now = new Date();
|
||||
const dateTimeString = now.toLocaleString();
|
||||
|
||||
output.innerHTML = '<p>Current date and time: <strong>' + dateTimeString + '</strong></p>';
|
||||
}
|
||||
|
||||
// Add event listener for when the page loads
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('JavaScript file loaded successfully!');
|
||||
|
||||
// You can add any initialization code here
|
||||
const container = document.querySelector('.container');
|
||||
if (container) {
|
||||
container.addEventListener('click', function(event) {
|
||||
if (event.target.classList.contains('button')) {
|
||||
console.log('Button clicked:', event.target.textContent);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user