Skip to content

Commit

Permalink
redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
Anemosx committed Jun 26, 2024
1 parent 4a1cd3f commit e07ba26
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 26 deletions.
16 changes: 9 additions & 7 deletions static/mnist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div class="container">
<h1>Draw Digit and Predict</h1>
<canvas id="drawCanvas"></canvas>
<button id="clearButton">Clear</button>
<button id="predictButton">Predict</button>
<predict>Prediction: <span id="predictionOutput">None</span></predict>
<canvas id="distributionChart"></canvas>
<div class="containerMNIST">
<h1 class="headingMNIST">Draw Digit and Predict</h1>
<canvas id="drawCanvas" class="canvasMNIST"></canvas>
<div class="predictMNIST">Prediction: <span id="predictionOutput" class="spanMNIST">None</span></div>
<div class="buttonContainerMNIST">
<button id="clearButton" class="buttonMNIST">Clear</button>
<button id="predictButton" class="buttonMNIST">Predict</button>
</div>
<canvas id="distributionChart" class="canvasMNIST"></canvas>
</div>
<script src="/static/mnist/script.js"></script>
</body>
Expand Down
60 changes: 41 additions & 19 deletions static/mnist/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,39 @@ body {
overflow-x: hidden;
}

.container {
.containerMNIST {
font-family: 'montserratsemibold', sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
margin: 0 auto;
width: 90%;
padding: 1rem;
min-width: fit-content;
max-width: 70rem;
background: rgba(100, 100, 100, 0.5);
backdrop-filter: blur(0.3125rem);
border-radius: 1.25rem;
overflow: hidden;
opacity: 1;
box-shadow: 0.625rem 1.25rem 1.125rem -0.5rem rgba(0, 0, 0, 0.5);
transition: opacity 0.3s, transform 0.3s, background-color 1s;
}

h1 {
.headingMNIST {
font-family: 'montserratsemibold', sans-serif;
display: flex;
font-size: clamp(1rem, 2.5rem, 3rem);
color: white;
letter-spacing: 0.1875rem;
font-weight: 1000;
line-height: 1.2;
letter-spacing: 0.1875rem;
background: radial-gradient(circle, rgba(255, 255, 255, 1.0), rgba(200, 200, 200, 1.0), rgba(255, 255, 255, 1.0)), rgba(200, 200, 200, 1.0);
background-size: 600% 200%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: gradientAnimation 30s infinite;
}

canvas {
.canvasMNIST {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
backdrop-filter: blur(0.3125rem);
Expand All @@ -45,11 +58,17 @@ canvas {
box-shadow: 0.625rem 1.25rem 1.125rem -0.5rem rgba(0, 0, 0, 0.5);
}

canvas:hover {
.canvasMNIST:hover {
transform: scale(1.2);
}

button {
.buttonContainerMNIST {
display: flex;
gap: 1rem;
margin-top: 1rem;
}

.buttonMNIST {
font-family: 'montserratsemibold', sans-serif;
margin-top: 1rem;
width: 10rem;
Expand All @@ -67,31 +86,30 @@ button {
box-shadow: 0.3125rem 0.3125rem 0.3125rem -0.125rem rgba(0, 0, 0, 0.5);
}

button:hover {
.buttonMNIST:hover {
background: rgba(255, 255, 255, 0.8);
color: rgba(0, 0, 0, 1.0);
transform: scale(1.05);
}

predict {
.predictMNIST {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
font-size: clamp(1rem, 1.3rem, 1.5rem);
font-size: clamp(1.2rem, 1.5rem, 1.8rem);
font-weight: 600;
color: #cccccc;
letter-spacing: 0.125rem;
line-height: 1.6;
max-width: 600px;
}

span#predictionOutput {
.spanMNIST#predictionOutput {
font-family: 'montserratsemibold', sans-serif;
font-size: clamp(1rem, 1.3rem, 1.5rem);
font-size: clamp(1.5rem, 1.8rem, 2rem);
font-weight: 600;
color: white;
}

canvas#drawCanvas {
.canvasMNIST#drawCanvas {
background-color: #ffffff;
width: 20rem;
height: auto;
Expand All @@ -101,12 +119,16 @@ canvas#drawCanvas {
aspect-ratio: 1;
}

canvas#distributionChart {
background: rgba(100, 100, 100, 0.5);
.canvasMNIST#distributionChart {
background: rgba(50, 50, 50, 0.5);
width: 50rem;
max-width: 90vw;
max-height: 45vw;
aspect-ratio: 2;
border-radius: 0.625rem;
transform: scale(1);
}

.canvasMNIST#distributionChart:hover {
background: rgba(100, 100, 100, 0.5);
}

0 comments on commit e07ba26

Please sign in to comment.