make me a notepad fanciesttu can
- User
make me a notepad fanciesttu can
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
make me a notepad fanciesttu can
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fancy Notepad</title>
<style>
body {
font-family: 'Georgia', serif;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
height: 100vh;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
}
.notepad {
width: 80%;
max-width: 800px;
background: white;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0,0,0,0.15);
overflow: hidden;
display: flex;
flex-direction: column;
height: 80vh;
}
.toolbar {
background: #4a6fa5;
color: white;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
.title {
font-size: 1.5rem;
margin: 0;
}
.controls button {
background: rgba(255,255,255,0.2);
border: none;
color: white;
padding: 8px 12px;
margin-left: 5px;
border-radius: 4px;
cursor: pointer;
transition: background 0.3s;
}
.controls button:hover {
background: rgba(255,255,255,0.3);
}
.editor {
flex-grow: 1;
padding: 20px;
overflow: auto;
}
#noteContent {
width: 100%;
height: 100%;
border: none;
resize: none;
font-size: 16px;
line-height: 1.6;
padding: 10px;
box-sizing: border-box;
background: rgba(255,255,255,0.8);
border-radius: 5px;
}
#noteContent:focus {
outline: none;
box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.3);
}
.status-bar {
background: #f1f1f1;
padding: 10px 15px;
font-size: 0.8rem;
color: #666;
display: flex;
justify-content: space-between;
}
</style>
</head>
<body>
<div class="notepad">
<div class="toolbar">
<h1 class="title">Fancy Notepad</h1>
<div class="controls">
<button id="saveBtn">Save</button>
<button id="clearBtn">Clear</button>
<button id="fontBtn">Font</button>
</div>
</div>
<div class="editor">
<textarea id="noteContent" placeholder="Start typing your notes here..."></textarea>
</div>
<div class="status-bar">
<div id="wordCount">Words: 0</div>
<div id="charCount">Characters: 0</div>
<div id="timeStamp">Last saved: Never</div>
</div>
</div>
<script>
const noteContent = document.getElementById('noteContent');
const saveBtn = document.getElementById('saveBtn');
const clearBtn = document.getElementById('clearBtn');
const fontBtn = document.getElementById('fontBtn');
const wordCount = document.getElementById('wordCount');
const charCount = document.getElementById('charCount');
const timeStamp = document.getElementById('timeStamp');
// Load saved content if available
if (localStorage.getItem('notepadContent')) {
noteContent.value = localStorage.getItem('notepadContent');
updateCounts();
}
// Update word and character counts
function updateCounts() {
const text = noteContent.value;
const words = text.trim() === '' ? 0 : text.trim().split(/\s+/).length;
const chars = text.length;
wordCount.textContent = `Words: ${words}`;
charCount.textContent = `Characters: ${chars}`;
}
// Save content to localStorage
saveBtn.addEventListener('click', () => {
localStorage.setItem('notepadContent', noteContent.value);
const now = new Date();
timeStamp.textContent = `Last saved: ${now.toLocaleTimeString()}`;
});
// Clear content
clearBtn.addEventListener('click', () => {
if (confirm('Are you sure you want to clear all content?')) {
noteContent.value = '';
updateCounts();
}
});
// Toggle between fonts
const fonts = ['Georgia', 'Arial', 'Courier New', 'Verdana', 'Times New Roman'];
let currentFont = 0;
fontBtn.addEventListener('click', () => {
currentFont = (currentFont + 1) % fonts.length;
noteContent.style.fontFamily = fonts[currentFont];
});
// Update counts on input
noteContent.addEventListener('input', updateCounts);
// Initial count update
updateCounts();
</script>
</body>
</html>
Would you like me to explain how this code works?