ObinnaOkpolu's picture
Dala Translate Demo Web App
42a776b
Raw
History Blame Contribute Delete
6.83 kB
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
:root {
--bg-color: #000000;
--card-bg: #09090b;
--text-primary: #ededed;
--text-secondary: #71767b;
--border-color: #27272a;
--accent-color: #ffffff;
--accent-hover: #d4d4d8;
--input-bg: #000000;
--focus-ring: rgba(255, 255, 255, 0.15);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Outfit', system-ui, -apple-system, sans-serif;
background-color: var(--bg-color);
color: var(--text-primary);
min-height: 100vh;
display: flex;
flex-direction: column;
-webkit-font-smoothing: antialiased;
letter-spacing: -0.01em;
}
/* Header */
header {
background-color: transparent;
padding: 3rem 2rem 1rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1.25rem;
border-bottom: none;
z-index: 10;
}
.logo {
width: 80px;
height: 80px;
filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.4));
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.logo:hover {
transform: scale(1.05) rotate(-5deg);
filter: drop-shadow(0 0 35px rgba(255, 255, 255, 0.6));
}
header h1 {
font-size: 2.25rem;
font-weight: 700;
color: var(--text-primary);
text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
letter-spacing: -0.05em;
}
.header-text {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.35rem;
text-align: center;
}
.tagline {
font-size: 0.75rem;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.25em;
font-weight: 500;
}
/* Main Container */
.container {
flex: 1;
max-width: 900px;
width: 100%;
margin: 0 auto;
padding: 2.5rem 1.5rem;
display: flex;
flex-direction: column;
gap: 2rem;
}
/* Language Selector */
.language-selector {
display: flex;
align-items: center;
justify-content: space-between;
background-color: var(--bg-color);
padding: 0.5rem;
border-radius: 9999px;
border: 1px solid var(--border-color);
width: fit-content;
margin: 0 auto;
position: relative;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.lang-group {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0 0.5rem;
}
.lang-group label {
display: none;
}
select {
appearance: none;
background-color: transparent;
color: var(--text-primary);
border: none;
padding: 0.5rem 2rem 0.5rem 1rem;
border-radius: 9999px;
font-size: 0.95rem;
font-family: inherit;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 1.25rem;
}
select:focus {
outline: none;
background-color: rgba(255, 255, 255, 0.05);
}
select option {
background-color: var(--card-bg);
color: var(--text-primary);
}
.swap-btn {
background: transparent;
border: 1px solid var(--border-color);
color: var(--text-primary);
width: 36px;
height: 36px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.swap-btn:hover {
background: rgba(255, 255, 255, 0.1);
border-color: var(--text-primary);
transform: rotate(180deg);
}
/* Translation Area */
.translation-area {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1px;
background-color: var(--border-color);
border: 1px solid var(--border-color);
border-radius: 12px;
overflow: hidden;
}
@media (max-width: 768px) {
.translation-area {
grid-template-columns: 1fr;
}
.swap-btn {
transform: rotate(90deg);
}
.swap-btn:hover {
transform: rotate(270deg);
}
}
.text-card {
background-color: var(--input-bg);
display: flex;
flex-direction: column;
min-height: 250px;
transition: background-color 0.2s ease;
}
.text-card:focus-within {
background-color: #050505;
}
.card-header {
padding: 1rem 1.5rem 0.5rem;
}
.card-header h3 {
color: var(--text-secondary);
font-size: 0.75rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.1em;
}
.text-content {
padding: 0 1.5rem 1.5rem;
flex: 1;
display: flex;
flex-direction: column;
}
textarea {
width: 100%;
height: 100%;
min-height: 200px;
background: transparent;
border: none;
color: var(--text-primary);
font-size: 1.25rem;
font-weight: 300;
line-height: 1.6;
resize: none;
font-family: inherit;
}
textarea:focus {
outline: none;
}
textarea::placeholder {
color: #3f3f46;
}
.output-text {
min-height: 200px;
color: var(--text-primary);
font-size: 1.25rem;
font-weight: 300;
line-height: 1.6;
white-space: pre-wrap;
}
.output-text.empty {
color: #3f3f46;
}
/* Controls */
.controls {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
margin-top: 1rem;
}
.translate-btn {
padding: 0.875rem 3rem;
background: var(--text-primary);
color: var(--bg-color);
border: none;
border-radius: 9999px;
font-size: 1rem;
font-family: inherit;
font-weight: 600;
cursor: pointer;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.translate-btn:hover:not(:disabled) {
background: var(--accent-hover);
transform: scale(1.02);
box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
}
.translate-btn:active:not(:disabled) {
transform: scale(0.98);
}
.translate-btn:disabled {
background: var(--border-color);
color: var(--text-secondary);
cursor: not-allowed;
box-shadow: none;
}
.loading {
display: none;
align-items: center;
gap: 0.75rem;
color: var(--text-secondary);
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 0.1em;
}
.loading.visible {
display: flex;
}
.spinner {
width: 16px;
height: 16px;
border: 2px solid var(--border-color);
border-top-color: var(--text-primary);
border-radius: 50%;
animation: spin 0.6s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Footer */
footer {
text-align: center;
padding: 2rem 1rem;
color: #3f3f46;
font-size: 0.75rem;
margin-top: auto;
font-weight: 400;
}