diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7e18621..f146966 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,9 +4,11 @@ - + + + @@ -47,7 +49,7 @@ - + 1597348071361 @@ -287,7 +289,14 @@ 1597607090595 - + + 1597607586663 + + + + 1597607586663 + + @@ -314,17 +323,19 @@ - + + + - + - + diff --git a/app.css b/app.css index ad9d379..1d82a77 100644 --- a/app.css +++ b/app.css @@ -7,7 +7,6 @@ body { margin: 0; padding: 0; width: auto; - color: white; } .message { @@ -19,12 +18,12 @@ body { } .bot-message { - border-radius: 0px 15px 15px 15px; + border-radius: 0 15px 15px 15px; background-color: lightgreen; } .user-message { - border-radius: 15px 0px 15px 15px; + border-radius: 15px 0 15px 15px; background-color: lightblue; } @@ -41,7 +40,6 @@ body { bottom: 0; left: 0; right: 0; - background-color: #515960; } #kara-banner { @@ -52,7 +50,6 @@ body { right: 0; text-align: center; padding: 0.7em; - background-color: #515960; } #kara-banner .btn, .add-response-input-button { diff --git a/app.js b/app.js index 316b099..28ab701 100644 --- a/app.js +++ b/app.js @@ -7,6 +7,8 @@ let kara = new Vue({ isTyping: false, askedForName: false, username: '', + themes: null, + activeTheme: 'slate', addModal: { includeAll: false, keywords: '', @@ -45,6 +47,7 @@ let kara = new Vue({ }, mounted() { this.getSavedData(); + this.getBootswatchThemes(); this.settingsModal = { name: this.name, @@ -281,6 +284,7 @@ let kara = new Vue({ updateStorage() { localStorage.setItem('name', this.name); localStorage.setItem('username', this.username); + localStorage.setItem('activeTheme', this.activeTheme); localStorage.setItem('messages', JSON.stringify(this.messages)); localStorage.setItem('answers', JSON.stringify(this.answers)); }, @@ -292,6 +296,9 @@ let kara = new Vue({ let savedUsername = localStorage.getItem('username'); this.username = savedUsername ? savedUsername : null; + let savedActiveTheme = localStorage.getItem('activeTheme'); + this.activeTheme = savedActiveTheme ? savedActiveTheme : 'slate'; + let savedMessages = JSON.parse(localStorage.getItem('messages')); this.messages = savedMessages ? savedMessages : []; @@ -337,6 +344,18 @@ let kara = new Vue({ clearChat() { this.messages = []; this.botMessage('Chat cleared.'); + }, + getBootswatchThemes() { + let vue = this; + + axios.get('https://bootswatch.com/api/4.json') + .then(function (response) { + console.log(response.data.themes); + vue.themes = response.data.themes; + }) + .catch(function (error) { + console.log(error); + }) } } }) \ No newline at end of file diff --git a/index.html b/index.html index 2732d67..673e4f9 100644 --- a/index.html +++ b/index.html @@ -1,17 +1,15 @@ - + Kara - - + - + @@ -24,7 +22,7 @@ {{ this.name }} - + @@ -56,9 +54,8 @@ - + - Responses + Responses (Wildcards: $username$, $botname$) - - + + + @@ -116,6 +113,12 @@ What's your name? + + Pick a theme + + + + Data @@ -139,6 +142,8 @@ + + @@ -148,10 +153,8 @@ - - + +