From b10787d23ca645932e89383ebb39402d1eb84700 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 29 Jan 2018 10:47:26 +0300 Subject: first ver --- src/components/attachment/attachment.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/attachment/attachment.vue') diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index d6a51ffd..2810e205 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -8,7 +8,7 @@ - + -- cgit v1.2.3-70-g09d2 From 3257991f4196cb6c2c77b3f81ec9f1850e243211 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 3 Feb 2018 19:55:45 +0300 Subject: unfinished fetch() version that doesn't work --- src/components/attachment/attachment.vue | 1 - src/components/status/status.js | 4 +++- src/components/status/status.vue | 26 +++++++++++++++++++++++--- src/components/still-image/still-image.js | 21 ++++++++++++++++----- src/components/still-image/still-image.vue | 5 +++-- 5 files changed, 45 insertions(+), 12 deletions(-) (limited to 'src/components/attachment/attachment.vue') diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 2810e205..4ee5153b 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -127,7 +127,6 @@ flex: 1; img { - object-fit: contain; width: 100%; height: 100%; /* If this isn't here, chrome will stretch the images */ max-height: 500px; diff --git a/src/components/status/status.js b/src/components/status/status.js index 12f3bb25..7397e80c 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -4,6 +4,7 @@ import RetweetButton from '../retweet_button/retweet_button.vue' import DeleteButton from '../delete_button/delete_button.vue' import PostStatusForm from '../post_status_form/post_status_form.vue' import UserCardContent from '../user_card_content/user_card_content.vue' +import StillImage from '../still-image/still-image.vue' import { filter, find } from 'lodash' const Status = { @@ -76,7 +77,8 @@ const Status = { RetweetButton, DeleteButton, PostStatusForm, - UserCardContent + UserCardContent, + StillImage }, methods: { linkClicked ({target}) { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 28272b0b..999adb21 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -34,7 +34,7 @@
@@ -84,7 +84,7 @@
- +

{{ preview.user.name }} @@ -146,6 +146,7 @@ box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5); margin-top: 0.5em; margin-left: 1em; + z-index: 50; .avatar { flex-shrink: 0; @@ -266,7 +267,6 @@ margin: 0.2em 0.3em 0 0; img { float: right; - border-radius: 5px; } } @@ -330,6 +330,17 @@ .status .avatar { width: 48px; height: 48px; + border-radius: 5px; + overflow: hidden; + + img { + width: 100%; + height: 100%; + } + + &.animated::before { + display: none; + } &.retweeted { width: 40px; @@ -339,6 +350,15 @@ } } + .status:hover .animated.avatar { + canvas { + display: none; + } + img { + visibility: visible; + } + } + .status img.avatar-retweeter { width: 24px; height: 24px; diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index fa027bc4..e674b932 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -12,16 +12,27 @@ const StillImage = { } }, computed: { - animated () { - return this.mimetype === 'image/gif' + animated: { + get () { + // If mimetype is gif then it is certainly animated, if it's undefined - we don't know YET + return this.mimetype === 'image/gif' ? true : this.mimetype == null ? 'maybe' : false + }, + set (val) { + this.mimetype = val + } } }, methods: { - drawCanvas() { + onLoad () { const canvas = this.$refs.canvas if (!canvas) return - const ctx = canvas.getContext('2d') - ctx.drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height) + canvas.getContext('2d').drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height) + if (this.animated === 'maybe') { + fetch(this.src).then((data) => { + console.log(data) + this.animated = data.type + }) + } } } } diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index fa086e51..cc426fff 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -1,7 +1,7 @@ @@ -31,9 +31,10 @@ position: absolute; top: 5px; left: 5px; - background: rgba(255,255,255,.5); + background: rgba(127,127,127,.7); display: block; padding: 2px; + border-radius: 3px; z-index: 2; } } -- cgit v1.2.3-70-g09d2 From 55bc1a3414ac15b08554a43c00f7f631ca1d304a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 3 Feb 2018 20:32:13 +0300 Subject: fixed stretched spurdo in notifications, misc fixes, detect gif by extension for now --- src/components/attachment/attachment.vue | 6 ++++++ src/components/notifications/notifications.scss | 4 ++++ src/components/still-image/still-image.js | 16 ++-------------- src/components/still-image/still-image.vue | 1 + 4 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src/components/attachment/attachment.vue') diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 4ee5153b..a1b35d91 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -126,7 +126,13 @@ display: flex; flex: 1; + .still-image { + width: 100%; + height: 100%; + } + img { + object-fit: contain; width: 100%; height: 100%; /* If this isn't here, chrome will stretch the images */ max-height: 500px; diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 241f10b4..4fda255b 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -104,6 +104,10 @@ max-height: 12em; overflow-y: hidden; //text-overflow: ellipsis; + + img { + object-fit: contain; + } } .notification-gradient { diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index e674b932..595652f2 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -12,14 +12,8 @@ const StillImage = { } }, computed: { - animated: { - get () { - // If mimetype is gif then it is certainly animated, if it's undefined - we don't know YET - return this.mimetype === 'image/gif' ? true : this.mimetype == null ? 'maybe' : false - }, - set (val) { - this.mimetype = val - } + animated () { + return this.mimetype === 'image/gif' || this.src.endsWith('.gif') } }, methods: { @@ -27,12 +21,6 @@ const StillImage = { const canvas = this.$refs.canvas if (!canvas) return canvas.getContext('2d').drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height) - if (this.animated === 'maybe') { - fetch(this.src).then((data) => { - console.log(data) - this.animated = data.type - }) - } } } } diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index cc426fff..b141cdaf 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -11,6 +11,7 @@ @import '../../_variables.scss'; .still-image { position: relative; + line-height: 0; &:hover canvas { display: none; -- cgit v1.2.3-70-g09d2 From aa0564406a95824cc45c815571292716b65806a1 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 31 Mar 2018 21:14:36 +0300 Subject: getting rid of baseXX, some small fixes. Seems to be usable. --- src/App.scss | 79 ++++- src/App.vue | 8 +- src/_variables.scss | 7 +- src/components/attachment/attachment.vue | 200 +++++++------ src/components/chat_panel/chat_panel.vue | 4 +- src/components/conversation/conversation.vue | 2 +- src/components/delete_button/delete_button.vue | 5 +- src/components/favorite_button/favorite_button.vue | 6 +- .../instance_specific_panel.vue | 2 +- src/components/login_form/login_form.vue | 62 ++-- src/components/media_upload/media_upload.vue | 4 +- src/components/nav_panel/nav_panel.vue | 81 +++--- src/components/notifications/notifications.js | 2 +- src/components/notifications/notifications.scss | 27 +- src/components/notifications/notifications.vue | 8 +- .../post_status_form/post_status_form.vue | 295 +++++++++---------- src/components/registration/registration.vue | 104 ++++--- src/components/retweet_button/retweet_button.vue | 10 +- src/components/settings/settings.vue | 4 +- src/components/status/status.js | 5 - src/components/status/status.vue | 319 +++++++++++---------- src/components/style_switcher/style_switcher.js | 8 +- src/components/style_switcher/style_switcher.vue | 14 +- src/components/timeline/timeline.vue | 28 +- src/components/user_card/user_card.vue | 34 +-- .../user_card_content/user_card_content.js | 4 +- .../user_card_content/user_card_content.vue | 28 +- src/components/user_finder/user_finder.vue | 8 +- src/components/user_panel/user_panel.vue | 10 +- src/components/user_profile/user_profile.vue | 5 +- src/components/user_settings/user_settings.vue | 36 +-- src/services/style_setter/style_setter.js | 48 ++-- 32 files changed, 791 insertions(+), 666 deletions(-) (limited to 'src/components/attachment/attachment.vue') diff --git a/src/App.scss b/src/App.scss index 95a653ce..6e0378db 100644 --- a/src/App.scss +++ b/src/App.scss @@ -33,14 +33,18 @@ body { font-family: sans-serif; font-size: 14px; margin: 0; + color: var(--fg); } a { text-decoration: none; + color: var(--link); } button{ user-select: none; + color: var(--faint); + background-color: var(--btn); border: none; border-radius: 5px; cursor: pointer; @@ -50,6 +54,8 @@ button{ font-size: 14px; font-family: sans-serif; + + &:hover { box-shadow: 0px 0px 4px rgba(255, 255, 255, 0.3); } @@ -58,8 +64,72 @@ button{ cursor: not-allowed; opacity: 0.5; } + + &.pressed { + color: var(--faint); + background-color: var(--bg) + } +} + + +input, textarea, select { + border: none; + border-radius: 5px; + border-bottom: 1px solid rgba(255, 255, 255, 0.2); + border-top: 1px solid rgba(0, 0, 0, 0.2); + box-shadow: 0px 0px 2px black inset; + background-color: var(--lightBg); + color: var(--lightFg); + font-family: sans-serif; + font-size: 14px; + padding: 5px; + + // TODO: Restyle