From 4a73615767ddcd9059f540758278a4be5b5a42f5 Mon Sep 17 00:00:00 2001 From: Kanchan253 Date: Sun, 28 May 2023 10:50:34 +0530 Subject: [PATCH] beautified the UI --- lib/Code.gs | 23 +-- lib/index.html | 404 +++++++++++++++++++++++++++--------------------- lib/index1.html | 199 ++++++++++++++++++++++++ 3 files changed, 429 insertions(+), 197 deletions(-) create mode 100644 lib/index1.html diff --git a/lib/Code.gs b/lib/Code.gs index 15d7249..a5aad98 100644 --- a/lib/Code.gs +++ b/lib/Code.gs @@ -1,5 +1,5 @@ function doGet() { - return HtmlService.createHtmlOutputFromFile("index"); + return HtmlService.createHtmlOutputFromFile("index1"); } var generatedUrls = []; @@ -10,8 +10,6 @@ PRESENTATION_ID = "ENTER_YOUR_PRESENTATION_ID"; OPENAI_KEY = "Bearer ENTER_YOUR_OPENAI_KEY"; BING_API_KEY = "ENTER_YOUR_BING_SEARCH_API_KEY"; - - //Creating a new presentation function createPresentation() { try { @@ -51,7 +49,6 @@ function runn( institute_logo, occasion ) { - //deleteAllSlides(PRESENTATION_ID); // const PRESENTATION_ID = createPresentation(); // console.log(generateSlidesLink(PRESENTATION_ID)); @@ -537,8 +534,7 @@ function getInfo(prompt) { method: "post", headers: { "Content-Type": "application/json", - Authorization: - OPENAI_KEY, + Authorization: OPENAI_KEY, }, payload: JSON.stringify({ prompt: prompt, @@ -687,10 +683,7 @@ function fetchImageUrl(image_text) { // keywords = getInfoHigh(prompt); // generatedUrls.push(keywords); // } - image_url = getImageUrlByKeywords( - image_text, - BING_API_KEY - ); + image_url = getImageUrlByKeywords(image_text, BING_API_KEY); console.log(image_url); return image_url; } @@ -703,8 +696,7 @@ function getInfoHigh(prompt) { method: "post", headers: { "Content-Type": "application/json", - Authorization: - OPENAI_KEY, + Authorization: OPENAI_KEY, }, payload: JSON.stringify({ prompt: prompt, @@ -777,10 +769,7 @@ function createSlide(presentationId, num) { } //Fetching image url from Bing API -function getImageUrlByKeywords( - keywords, - apiKey = BING_API_KEY -) { +function getImageUrlByKeywords(keywords, apiKey = BING_API_KEY) { var query = encodeURIComponent(keywords); var url = "https://api.bing.microsoft.com/v7.0/images/search?q=" + @@ -808,7 +797,7 @@ function getImageUrlByKeywords( function generateKeyWords(content) { jsonn = getInfo( "Understand and Generate 10 tools and computer technologies separated by comma related to the below project - " + - content + content ); console.log(jsonn); list = csvToList(jsonn); diff --git a/lib/index.html b/lib/index.html index a132f76..27cfb8a 100644 --- a/lib/index.html +++ b/lib/index.html @@ -1,202 +1,244 @@ + + + + SlidesAI + + + - - SlidesAI - - - - - - + rgb(43, 131, 148) 100% + ); + } + + - -
-

- SlideAI: Automatic PPT Generator -

- +
+

+ SlideAI: Automatic PPT Generator +

+ - + - + - + - + - + + " + /> - - -
- - - + function scheduleDownload() { + setTimeout(downloadSlides, 45000); + } - \ No newline at end of file + function downloadSlides() { + const downloadLink = + "https://docs.google.com/presentation/d/1ROXSzo28oiI8c6SSvsa1GXGruDkps9KpqlnoMqPLcQo/export/pptx"; + window.location.href = downloadLink; + } + + + diff --git a/lib/index1.html b/lib/index1.html new file mode 100644 index 0000000..9d51882 --- /dev/null +++ b/lib/index1.html @@ -0,0 +1,199 @@ + + + + + + SlidesAI + + + + + + +
+
+

SlideAI: Automatic PPT Generator

+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + + +