Files
CSCI-1200/animations/maps/style.css
2025-04-29 14:42:52 -04:00

365 lines
6.5 KiB
CSS

html, body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
font-size: 16px;
overflow-x: hidden;
}
h1 {
text-align: center;
margin-top: 12px;
margin-bottom: 8px;
font-size: 26px;
}
p {
text-align: center;
margin: 8px 0 12px;
font-size: 15px;
}
.visualization-container {
display: flex;
justify-content: space-between;
max-width: 1800px;
margin: 0 auto;
height: 80vh;
gap: 20px;
padding: 0 15px;
}
.left-panel {
display: flex;
flex-direction: column;
width: 48%;
}
.code-container {
background-color: #f0f0f0;
border-radius: 10px;
padding: 15px;
flex-grow: 1;
overflow-y: auto;
max-height: 52vh;
font-size: 16px;
margin-bottom: 15px;
}
.explanation-result-container {
background-color: #f0f0f0;
border-radius: 10px;
padding: 15px;
display: flex;
flex-direction: column;
}
.color-key {
background-color: #f9f9f9;
border-radius: 5px;
padding: 10px;
margin-top: 10px;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
}
.key-item {
display: flex;
align-items: center;
margin: 4px 12px;
}
.key-color {
width: 18px;
height: 18px;
border-radius: 3px;
margin-right: 8px;
}
.key-current {
background-color: #fffde7;
border: 2px solid #ffeb3b;
}
.key-found {
background-color: #e8f5e9;
border: 2px solid #4caf50;
}
.key-duplicate {
background-color: #ffebee;
border: 2px solid #f44336;
}
.key-description {
font-size: 14px;
}
pre {
margin: 0;
background-color: #f0f0f0;
width: 100%;
}
code {
font-family: Consolas, "Courier New", monospace;
white-space: pre;
display: inline-block;
min-width: 700px;
}
#codeDisplay {
width: 100%;
}
.line-number {
color: #666;
display: inline-block;
min-width: 35px;
font-size: 16px;
}
.code-line {
display: block;
width: 100%;
position: relative;
box-sizing: border-box;
padding: 2px 0;
font-size: 16px;
line-height: 1.5;
}
.code-line.highlighted {
background-color: #ffeb3b;
width: 100%;
display: block;
}
.visualization-panel {
background-color: #f0f0f0;
border-radius: 10px;
padding: 15px;
width: 48%;
height: 75vh;
position: relative;
display: flex;
flex-direction: column;
}
.top-controls {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
}
.test-case-btns {
display: flex;
justify-content: center;
gap: 6px;
flex-wrap: wrap;
flex: 1;
}
.test-btn {
padding: 6px 8px;
font-size: 14px;
border: none;
border-radius: 4px;
background-color: #e0e0e0;
cursor: pointer;
}
.test-btn:hover {
background-color: #d0d0d0;
}
.test-btn.active {
background-color: #2196f3;
color: white;
}
.case-description {
background-color: #e8e8e8;
padding: 10px;
border-radius: 5px;
margin-bottom: 12px;
font-size: 15px;
text-align: center;
line-height: 1.4;
}
.controls {
display: flex;
justify-content: center;
gap: 15px;
margin-bottom: 12px;
}
#nextStep, #resetBtn {
padding: 8px 15px;
font-size: 16px;
cursor: pointer;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
}
#resetBtn {
background-color: #f44336;
}
#nextStep:hover {
background-color: #45a049;
}
#resetBtn:hover {
background-color: #d32f2f;
}
#nextStep:disabled, #resetBtn:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
.visualization-area {
display: flex;
flex-direction: column;
gap: 15px;
overflow: hidden;
padding: 15px;
background-color: white;
border-radius: 5px;
margin-bottom: 12px;
max-height: 55vh;
flex-grow: 1;
padding-bottom: 30px;
}
.array-container, .map-container {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 15px 10px 28px 10px;
background-color: #f9f9f9;
border-radius: 5px;
min-height: 80px;
position: relative;
margin-top: 22px;
}
.array-container::before, .map-container::before {
content: "Array";
position: absolute;
top: -20px;
left: 10px;
font-weight: bold;
font-size: 15px;
}
.map-container::before {
content: "Map";
}
.array-item, .map-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 55px;
height: 55px;
background-color: white;
border: 2px solid #ddd;
border-radius: 5px;
font-weight: bold;
font-size: 16px;
transition: all 0.3s ease;
}
.array-item {
position: relative;
}
.array-item::after {
content: attr(data-index);
position: absolute;
bottom: -20px;
font-size: 13px;
color: #666;
}
.map-item {
width: 90px;
height: 70px;
margin: 4px;
}
.map-key {
font-size: 15px;
margin-bottom: 5px;
}
.map-value {
font-size: 13px;
color: #666;
}
.current {
border-color: #ffeb3b;
background-color: #fffde7;
box-shadow: 0 0 5px #ffeb3b;
}
.found {
border-color: #4caf50;
background-color: #e8f5e9;
box-shadow: 0 0 5px #4caf50;
}
.duplicate {
border-color: #f44336;
background-color: #ffebee;
box-shadow: 0 0 5px #f44336;
}
.explanation {
font-size: 15px;
padding: 12px;
background-color: #e8e8e8;
border-radius: 5px;
min-height: 60px;
line-height: 1.4;
margin-bottom: 12px;
overflow-y: auto;
max-height: 100px;
}
.result-container {
padding: 12px;
background-color: #e8e8e8;
border-radius: 5px;
text-align: center;
font-weight: bold;
font-size: 16px;
}
#result {
color: #2196f3;
font-size: 18px;
}
.success {
color: #4caf50 !important;
}
.failure {
color: #f44336 !important;
}
.color-key-label {
font-weight: bold;
margin-bottom: 5px;
font-size: 15px;
}