diff --git a/main.py b/main.py index a63ffc9..3610f23 100644 --- a/main.py +++ b/main.py @@ -86,6 +86,11 @@ async def generate_music(request: Request, musicPrompt: str=Form(..., title="mus # Convert the current time to a string timestamp = datetime.now().strftime("%Y%m%d%H%M%S") + # Explanation for Below condition: first splits musicPrompt into a list and stores in shortPrompt. + # If shortPrompt length < 3, then we send full prompt. Else we send first 3 letters followed by 2 dots. + + # download_prompt = " ".join(shortPrompt) if (len(shortPrompt:=musicPrompt.split()) < 3) else ((" ".join(shortPrompt[:3])) + "..") + # print("Download Prompt is", download_prompt) return templates.TemplateResponse( "waveform_play_template.html", context={ @@ -93,7 +98,8 @@ async def generate_music(request: Request, musicPrompt: str=Form(..., title="mus "audio_waveform_img": audio_waveform_img, "audio_filepath": audio_filepath, "musicPrompt": musicPrompt, - "timestamp": timestamp + "timestamp": timestamp, + "audioLength": audioLength }, status_code=200 ) diff --git a/static/cd-image.jpg b/static/cd-image.jpg new file mode 100644 index 0000000..8d8fc52 Binary files /dev/null and b/static/cd-image.jpg differ diff --git a/templates/index.html b/templates/index.html index c345155..a6e92f6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -33,25 +33,7 @@ repeating-conic-gradient(from 270deg at 50% 0%, #802364, #942874, #581845); */ :root { - --blue-l1: #C0CFFA; - --blue-l2: #9DADDF; - --blue-l3: #7D8EC4; - --blue-l4: #6171A9; - --blue-l5: #4857BE; - --blue-l6: #334173; --blue-l7: #212C58; - --blue-linear-gradient: linear-gradient(to right, var(--blue-l1), var(--blue-l4), var(--blue-l7)); - --blueTopBottomConeGradient: repeating-conic-gradient(from 270deg at 50% 0%, var(--blue-l1), var(--blue-l4), var(--blue-l7)); - - --pink-l1: #942874; - --pink-l2: #802364; - --pink-l3: #581845; - --pinkTopBottomConeGradient: repeating-conic-gradient(from 270deg at 50% 0%, var(--pink-l2), var(--pink-l1), var(--pink-l3)); - --pinkBottomTopConeGradient: repeating-conic-gradient(from 90deg at 50% 100%, var(--pink-l2), var(--pink-l1), var(--pink-l3)); - - --nothingLightBG: #E2E2E2; - --nothingLightIconBG : #F1F1F1; - --nothingTextOnLight: #1b1b1b; /* Grape Black, Purple, Slight Dark Violet, Slight Dark Pink, Flesh, Light Cream */ --grapeBlack: #180018; @@ -206,6 +188,10 @@ width: 100%; } } + #cd-loading { + content: url(/static/cd-image.jpg); + image-rendering: optimizeSpeed; + } @@ -270,7 +256,7 @@