Skip to content

Commit 4875f8c

Browse files
committed
style: cleaner looks and sharp gradient for now
1 parent 0e67775 commit 4875f8c

3 files changed

Lines changed: 27 additions & 22 deletions

File tree

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565

6666
<div class="container container-md h-[calc(100svh-3rem)] px-1 py-2 text-center">
6767
<textarea dir="auto"
68-
class="w-full h-[calc(100%-13rem)] p-2 outline-none bg-zinc-950 rounded-md focus:shadow-orange-400 focus:shadow-[0_0_2px_0_#fff] border-zinc-700 transition-all ease-in-out duration-300 focus:border-orange-400 border-2 resize-none"
68+
class="w-full max-w-3xl h-[calc(100%-13rem)] p-2 outline-none bg-zinc-950 rounded-md focus:shadow-orange-400 focus:shadow-[0_0_2px_0_#fff] border-zinc-700 transition-all ease-in-out duration-300 focus:border-orange-400 border-2 resize-none"
6969
id="lyricInput" rows="20" placeholder="Enter your lyric text here" required></textarea>
7070

71-
<div class="w-2/3 my-2 mx-auto rounded-2xl overflow-clip">
71+
<div class="max-w-lg my-2 mx-auto rounded-2xl overflow-clip">
7272
<label class="flex p-2 my-0.5 bg-zinc-800 rounded cursor-pointer items-center justify-between"
7373
for="isWordByWord">
7474
<p class="ps-2 text-lg text-start">Sync word-by-word</p>
@@ -103,8 +103,8 @@
103103
</div>
104104

105105
<!-- Lyrics container -->
106-
<div class="container container-md px-1 py-2 my-28 text-center hidden" id="syncer">
107-
<ul class="w-full text-start rounded-2xl overflow-clip" id="lyricList"></ul>
106+
<div class="container container-md max-w-3xl px-1 py-2 my-28 text-center hidden" id="syncer">
107+
<ul class="w-full text-start font-bold overflow-clip" id="lyricList"></ul>
108108

109109
<button class="h-8 bg-orange-400 text-black font-medium rounded-full px-5 my-2" id="dlFile">
110110
Save

src/main.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ function updateSelection(item, mode) {
133133
'cursor-pointer',
134134
'border-zinc-900',
135135
'bg-zinc-800',
136+
'border-b-2',
136137
]
137-
const selectedStyle = ['border-zinc-900', 'bg-orange-900', 'rounded-b-2xl']
138-
const normalStyle = ['border-zinc-700', 'text-zinc-400']
138+
const selectedStyle = ['border-orange-400', 'border-1', 'rounded-b-2xl']
139+
const normalStyle = ['border-zinc-800', 'border-b-2', 'text-zinc-400']
139140
item.classList.remove(...activeStyle, ...selectedStyle, ...normalStyle)
140141
if (mode == 'active') item.classList.add(...activeStyle)
141142
else if (mode == 'selected') item.classList.add(...selectedStyle)
@@ -252,15 +253,17 @@ function createItemElement(line, isBg = false) {
252253
item.dataset.type = isBg ? 'bg' : 'normal'
253254
item.classList.add(
254255
'flex',
255-
'p-3',
256-
'pl-4',
256+
isBg ? 'py-2' : 'py-4',
257+
'px-5',
257258
'gap-2',
258259
'text-zinc-400',
259260
'items-center',
260261
'rounded',
262+
'first:rounded-t-2xl',
263+
'last:rounded-b-2xl',
261264
'border-b-2',
262265
'border-zinc-800',
263-
'duration-500',
266+
'duration-300',
264267
'ease-out',
265268
'transition-all',
266269
'scroll-mt-[20svh]',
@@ -274,9 +277,7 @@ function createItemElement(line, isBg = false) {
274277
if (isDuet) item.dataset.vocalist = 1
275278
lineEl.classList.add(
276279
'grow',
277-
isBg ? 'text-sm' : 'text-xl',
278-
'text-start',
279-
'font-semibold',
280+
isBg ? null : 'text-2xl',
280281
'transition-all',
281282
'duration-300',
282283
)
@@ -598,12 +599,14 @@ editItemDone.addEventListener('click', () => {
598599
}
599600
if (markAsBg.checked) {
600601
itemsList[index].dataset.type = 'bg'
601-
itemsList[index].children[0].classList.remove('text-xl')
602-
itemsList[index].children[0].classList.add('text-sm')
602+
itemsList[index].children[0].classList.remove('text-2xl', 'p-4')
603+
itemsList[index].classList.remove('py-4')
604+
itemsList[index].classList.add('py-2')
603605
} else {
604606
itemsList[index].dataset.type = 'normal'
605-
itemsList[index].children[0].classList.remove('text-sm')
606-
itemsList[index].children[0].classList.add('text-xl')
607+
itemsList[index].classList.remove('py-2')
608+
itemsList[index].classList.add('py-4')
609+
itemsList[index].children[0].classList.add('text-2xl')
607610
}
608611
})
609612

src/style.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717

1818
--font-vazir: Outfit, Vazirmatn, sans-serif;
1919

20-
--gradient-shade: 8px;
20+
--gradient-start-color: var(--color-zinc-500);
21+
--gradient-end-color: var(--color-zinc-100);
22+
--gradient-hardness: 0px;
2123
}
2224

2325
.word {
2426
background-image: linear-gradient(270deg,
25-
var(--color-zinc-400) calc(50% - var(--gradient-shade) / 2),
26-
var(--color-zinc-100) calc(50% + var(--gradient-shade) / 2));
27-
background-size: calc(200% + var(--gradient-shade)) 100%;
27+
var(--gradient-start-color) calc(50% - var(--gradient-hardness) / 2),
28+
var(--gradient-end-color) calc(50% + var(--gradient-hardness) / 2));
29+
background-size: calc(200% + var(--gradient-hardness)) 100%;
2830
background-position: right;
2931
background-clip: text;
3032
color: transparent;
@@ -41,8 +43,8 @@
4143
.word.rtl {
4244
direction: rtl;
4345
background-image: linear-gradient(90deg,
44-
var(--color-zinc-400) calc(50% - var(--gradient-shade) / 2),
45-
var(--color-zinc-100) calc(50% + var(--gradient-shade) / 2));
46+
var(--gradient-start-color) calc(50% - var(--gradient-hardness) / 2),
47+
var(--gradient-end-color) calc(50% + var(--gradient-hardness) / 2));
4648
background-position: left;
4749
animation-direction: reverse;
4850
}

0 commit comments

Comments
 (0)