From 28d318a54ba77dc381ba0c92f9adc7b29e0abac3 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 13 Aug 2019 16:00:49 -0400 Subject: Big changes --- models/User.js | 0 public/css/style.css | 11 +++++++++- public/img/carousel/unicity.png | Bin 0 -> 187117 bytes public/js/yt-list-videos.js | 44 ++++++++++++++++++++++++++++++++++++++++ views/404.ejs | 3 ++- views/about.ejs | 6 ++++++ views/blog.ejs | 5 +++-- views/includes/footer.ejs | 12 +---------- views/includes/scripts.ejs | 9 ++++++++ views/index.ejs | 33 +++++++++++++++++------------- views/projects.ejs | 34 +++++++++++++++++++++++++++++-- 11 files changed, 126 insertions(+), 31 deletions(-) delete mode 100644 models/User.js create mode 100644 public/img/carousel/unicity.png create mode 100644 public/js/yt-list-videos.js create mode 100644 views/includes/scripts.ejs diff --git a/models/User.js b/models/User.js deleted file mode 100644 index e69de29..0000000 diff --git a/public/css/style.css b/public/css/style.css index 1067840..386343b 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -2,5 +2,14 @@ body { font-family: Play, sans-serif; background-color: #212121; color: #ffffff; - margin-bottom: 100px; +} + +ul.yt { + margin: 0 auto; + text-align: center; +} + +li.yt-vid-list { + display: inline-block; + vertical-align: top; } \ No newline at end of file diff --git a/public/img/carousel/unicity.png b/public/img/carousel/unicity.png new file mode 100644 index 0000000..de29b53 Binary files /dev/null and b/public/img/carousel/unicity.png differ diff --git a/public/js/yt-list-videos.js b/public/js/yt-list-videos.js new file mode 100644 index 0000000..42deb0c --- /dev/null +++ b/public/js/yt-list-videos.js @@ -0,0 +1,44 @@ + + +let channelID = 'UCNRn4YDPCCWSEl3CT7eWorA'; +let apiKey = ""; // Note to hide this +let vidHeight = 400; +let vidWidth = 500; +let vidMaxResult = 5; // Maximum can be 50 + +$(document).ready(function () { + $.get("https://www.googleapis.com/youtube/v3/channels", { + part: 'contentDetails', + id: channelID, + key: apiKey //Browser API Key + }, + function (data) { + $.each(data.items, function (i, item) { + console.log(item); // See in Browser Console + pid = item.contentDetails.relatedPlaylists.uploads; + getVideos(pid); + }) + } + ); + function getVideos(pid) + { + $.get("https://www.googleapis.com/youtube/v3/playlistItems", { + part: 'snippet', + maxResults: vidMaxResult, + playlistId: pid, + key: apiKey //Browser API Key + }, + function (data) { + let outputVideo; + $.each(data.items, function (i, item) { + console.log(item); // See in Browser Console + vidId = item.snippet.resourceId.videoId; + outputVideo = '
  • '; + + //Append to result list + $('#yt-results').append(outputVideo); + }) + } + ); + } +}); \ No newline at end of file diff --git a/views/404.ejs b/views/404.ejs index 6265009..43c308d 100644 --- a/views/404.ejs +++ b/views/404.ejs @@ -1,4 +1,5 @@ + <% include ./includes/header %> @@ -10,6 +11,6 @@

    Oops, seems like that page isn't found!

    Return to homepage?

    - <% include ./includes/footer %> + <% include ./includes/scripts %> \ No newline at end of file diff --git a/views/about.ejs b/views/about.ejs index f00c69f..2f28498 100644 --- a/views/about.ejs +++ b/views/about.ejs @@ -1,4 +1,5 @@ + @@ -27,6 +28,9 @@
  • A: Reason why I want to create this is because I want to make my own things as a passion also sharing it to the public and to make it as a career.
  • +
    +
  • Q: Why did you call this Alee Productions?
  • +
  • A: As you know my name is Andrew Lee and my name starts with an "A" and combine it with "Lee" you get "Alee". :)
  • Team

    @@ -45,6 +49,8 @@

    + + <% include ./includes/scripts %> <% include ./includes/footer %> diff --git a/views/blog.ejs b/views/blog.ejs index ee21e43..4572c3e 100644 --- a/views/blog.ejs +++ b/views/blog.ejs @@ -1,4 +1,5 @@ + @@ -12,8 +13,8 @@

    Where we post updates on products, this website and etc.

    Notice: We are currently working on this page

    - -<% include ./includes/footer %> + <% include ./includes/scripts %> + <% include ./includes/footer %> \ No newline at end of file diff --git a/views/includes/footer.ejs b/views/includes/footer.ejs index 600ae87..ac519d1 100644 --- a/views/includes/footer.ejs +++ b/views/includes/footer.ejs @@ -1,13 +1,3 @@ - - - - - - - - - -