Add more funcionality

This commit is contained in:
Gokalp Sen 2024-12-06 23:24:31 +03:00
parent 1d4ab06af1
commit 1e09e9488a
5 changed files with 815 additions and 69 deletions

View file

@ -14,6 +14,7 @@
margin: 1.5rem 0 1rem;
color: var(--md-header, #2c3e50);
line-height: 1.25;
scroll-margin-top: 1rem;
}
.mdrender h1 { font-size: 2em; }
@ -79,6 +80,7 @@
max-width: 100%;
height: auto;
margin: 1rem 0;
border-radius: 4px;
}
.mdrender hr {
@ -87,10 +89,13 @@
margin: 2rem 0;
}
/* Tables */
.mdrender table {
border-collapse: collapse;
width: 100%;
margin: 1rem 0;
overflow-x: auto;
display: block;
}
.mdrender th,
@ -101,6 +106,74 @@
.mdrender th {
background: var(--md-code-bg, #f8f9fa);
font-weight: 600;
}
.mdrender tr:nth-child(even) {
background: var(--md-code-bg, #f8f9fa);
}
/* Task Lists */
.mdrender .task-list-item {
list-style-type: none;
margin-left: -1.5rem;
}
.mdrender .task-list-item input[type="checkbox"] {
margin-right: 0.5rem;
}
/* Footnotes */
.mdrender .footnotes {
margin-top: 2rem;
font-size: 0.9em;
color: var(--md-blockquote, #666);
}
.mdrender .footnotes hr {
margin: 1rem 0;
}
.mdrender .footnote-ref {
font-size: 0.8em;
vertical-align: super;
line-height: 0;
}
.mdrender .footnote-backref {
font-size: 0.8em;
margin-left: 0.5rem;
}
/* Definition Lists */
.mdrender dl {
margin: 1rem 0;
}
.mdrender dt {
font-weight: bold;
margin-top: 1rem;
}
.mdrender dd {
margin-left: 2rem;
margin-top: 0.5rem;
}
/* Text Formatting */
.mdrender mark {
background-color: #fff1a7;
padding: 0.1em 0.2em;
border-radius: 2px;
}
.mdrender del {
color: var(--md-blockquote, #666);
}
.mdrender sup,
.mdrender sub {
font-size: 0.8em;
}
/* Dark theme support */
@ -112,3 +185,12 @@
--md-link: #60a5fa;
--md-border: #404040;
}
[data-theme="dark"] .mdrender mark {
background-color: #665c1e;
color: #fff;
}
[data-theme="dark"] .mdrender tr:nth-child(even) {
background: rgba(255, 255, 255, 0.05);
}

View file

@ -44,24 +44,36 @@ body {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
min-height: 100vh;
display: flex;
flex-direction: column;
}
header {
text-align: center;
margin-bottom: 2rem;
display: flex;
justify-content: center;
justify-content: space-between;
align-items: center;
gap: 1rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--border-color);
}
.header-content {
text-align: center;
text-align: left;
}
.header-controls {
display: flex;
gap: 1rem;
align-items: center;
}
header h1 {
color: var(--header-color);
margin-bottom: 0.5rem;
font-size: 2.5rem;
}
#theme-toggle {
@ -98,6 +110,24 @@ main {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
flex-grow: 1;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.section-header h2 {
margin: 0;
}
.preview-controls,
.html-controls {
display: flex;
gap: 0.5rem;
}
.editor-section {
@ -146,31 +176,93 @@ button {
border: none;
border-radius: 4px;
cursor: pointer;
margin-bottom: 1rem;
font-size: 0.9rem;
transition: background-color 0.2s ease;
}
button:hover {
background: var(--button-hover);
}
#html-output {
#output-container {
border: 2px solid var(--border-color);
border-radius: 5px;
padding: 1rem;
background: var(--preview-bg);
padding: 2px;
border: 1px solid var(--border-color);
border-radius: 4px;
overflow-x: auto;
max-height: 300px;
overflow-y: auto;
}
#html-output {
font-family: 'Courier New', Courier, monospace;
font-size: 14px;
color: var(--text-color);
white-space: pre-wrap;
word-break: break-all;
}
select {
padding: 0.5rem;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--preview-bg);
color: var(--text-color);
font-size: 0.9rem;
cursor: pointer;
}
select:hover {
border-color: var(--button-bg);
}
footer {
margin-top: 2rem;
text-align: center;
padding-top: 1rem;
border-top: 2px solid var(--border-color);
}
footer a {
color: var(--link-color);
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
header {
flex-direction: column;
text-align: center;
}
.header-content {
text-align: center;
}
main {
grid-template-columns: 1fr;
gap: 1rem;
}
.editor-section,
.preview-section {
grid-column: 1;
}
.section-header {
flex-direction: column;
gap: 0.5rem;
align-items: stretch;
}
.preview-controls,
.html-controls {
flex-direction: column;
}
}