style(calendar): add styling to the ui
This commit is contained in:
parent
869beeb3d4
commit
ce8c6e66a5
3 changed files with 170 additions and 72 deletions
|
@ -4,44 +4,45 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Calendar Merger</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
#calendars {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
#calendars .calendar {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#calendars .calendar input[type="text"] {
|
||||
width: 50%;
|
||||
margin-right: 10px;
|
||||
}
|
||||
#calendars .calendar input[type="url"] {
|
||||
width: 50%;
|
||||
}
|
||||
#add-calendar {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Calendar Merger</h1>
|
||||
<div class="container">
|
||||
<h1>📅 Calendar Merger</h1>
|
||||
|
||||
<div class="form-card">
|
||||
<form id="merge-form">
|
||||
<input type="text" id="link-group-name" placeholder="Link Group Name">
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
id="link-group-name"
|
||||
placeholder="Enter collection name"
|
||||
class="input-field">
|
||||
</div>
|
||||
|
||||
<div id="calendars">
|
||||
<div class="calendar">
|
||||
<input type="text" id="prefix-0" placeholder="Prefix">
|
||||
<div class="calendar-entry">
|
||||
<input type="text" id="prefix-0" placeholder="Event prefix">
|
||||
<input type="url" id="url-0" placeholder="https://example.com/calendar.ics">
|
||||
<div class="checkbox-group">
|
||||
<input type="checkbox" id="override-0">
|
||||
<label for="override-0">Override</label>
|
||||
<input type="url" id="url-0" placeholder="Calendar URL">
|
||||
</div>
|
||||
</div>
|
||||
<button id="add-calendar" type="button">Add Calendar</button>
|
||||
<button type="submit">Merge Calendars</button>
|
||||
</div>
|
||||
|
||||
<div class="button-group">
|
||||
<button type="button" id="add-calendar" class="button secondary-btn">
|
||||
➕ Add Another Calendar
|
||||
</button>
|
||||
<button type="submit" class="button primary-btn">
|
||||
🔗 Merge Calendars
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="result"></div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -14,12 +14,12 @@ function isValidUrl(url) {
|
|||
|
||||
addCalendarButton.addEventListener('click', () => {
|
||||
const newCalendar = document.createElement('div');
|
||||
newCalendar.className = 'calendar';
|
||||
newCalendar.className = 'calendar-entry';
|
||||
newCalendar.innerHTML = `
|
||||
<input type="text" id="prefix-${calendarIndex}" placeholder="Prefix">
|
||||
<input type="text" id="prefix-${calendarIndex}" placeholder="Event prefix">
|
||||
<input type="url" id="url-${calendarIndex}" placeholder="https://example.com/calendar.ics">
|
||||
<input type="checkbox" id="override-${calendarIndex}">
|
||||
<label for="override-${calendarIndex}">Override</label>
|
||||
<input type="url" id="url-${calendarIndex}" placeholder="Calendar URL">
|
||||
`;
|
||||
calendars.appendChild(newCalendar);
|
||||
calendarIndex++;
|
||||
|
|
|
@ -1,37 +1,134 @@
|
|||
:root {
|
||||
--primary: #2563eb;
|
||||
--primary-hover: #1d4ed8;
|
||||
--background: #f8fafc;
|
||||
--surface: #ffffff;
|
||||
--border: #e2e8f0;
|
||||
--text: #1e293b;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
font-family: 'Segoe UI', system-ui, sans-serif;
|
||||
background: var(--background);
|
||||
color: var(--text);
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
#merge-form {
|
||||
max-width: 400px;
|
||||
margin: 40px auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
/* Form Styling */
|
||||
.form-card {
|
||||
background: var(--surface);
|
||||
border-radius: 12px;
|
||||
padding: 2rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
input[type="url"], input[type="text"] {
|
||||
.input-group {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
/* Calendar Entry Styling */
|
||||
.calendar-entry {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
background: var(--background);
|
||||
border-radius: 8px;
|
||||
transition: all 0.2s ease;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.calendar-entry:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* Input Elements */
|
||||
input[type="text"],
|
||||
input[type="url"] {
|
||||
padding: 0.75rem;
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 6px;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #ccc;
|
||||
transition: border-color 0.2s ease;
|
||||
}
|
||||
|
||||
button[type="submit"] {
|
||||
background-color: #4CAF50;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
input:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
|
||||
}
|
||||
|
||||
/* Checkbox Styling */
|
||||
.checkbox-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
accent-color: var(--primary);
|
||||
}
|
||||
|
||||
/* Button Styling */
|
||||
.button {
|
||||
padding: 0.75rem 1.5rem;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
button[type="submit"]:hover {
|
||||
background-color: #3e8e41;
|
||||
.primary-btn {
|
||||
background: var(--primary);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.primary-btn:hover {
|
||||
background: var(--primary-hover);
|
||||
}
|
||||
|
||||
.secondary-btn {
|
||||
background: var(--background);
|
||||
border: 2px solid var(--border);
|
||||
}
|
||||
|
||||
/* Result Display */
|
||||
#result {
|
||||
padding: 1.5rem;
|
||||
background: var(--surface);
|
||||
border-radius: 8px;
|
||||
margin-top: 1rem;
|
||||
border: 2px dashed var(--border);
|
||||
}
|
||||
|
||||
#result a {
|
||||
color: var(--primary);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 640px) {
|
||||
.calendar-entry {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue