This commit is contained in:
syuilo 2018-09-22 20:39:12 +09:00
parent d0437ce540
commit 973a051463
17 changed files with 72 additions and 18 deletions

View file

@ -779,6 +779,8 @@ desktop/views/components/settings.vue:
choose-wallpaper: "壁紙を選択" choose-wallpaper: "壁紙を選択"
delete-wallpaper: "壁紙を削除" delete-wallpaper: "壁紙を削除"
dark-mode: "ダークモード" dark-mode: "ダークモード"
use-shadow: "UIに影を使用"
rounded-corners: "UIの角を丸める"
circle-icons: "円形のアイコンを使用" circle-icons: "円形のアイコンを使用"
contrasted-acct: "ユーザー名にコントラストを付ける" contrasted-acct: "ユーザー名にコントラストを付ける"
gradient-window-header: "ウィンドウのタイトルバーにグラデーションを使用" gradient-window-header: "ウィンドウのタイトルバーにグラデーションを使用"

View file

@ -133,7 +133,8 @@ export default Vue.extend({
root(isDark) root(isDark)
color isDark ? #c5ced6 : #777 color isDark ? #c5ced6 : #777
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
overflow hidden overflow hidden
&[data-melt] &[data-melt]

View file

@ -231,7 +231,8 @@ root(isDark)
overflow hidden overflow hidden
text-align left text-align left
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
> .read-more > .read-more
display block display block

View file

@ -60,6 +60,8 @@
<button class="ui" @click="updateWallpaper">%i18n:@choose-wallpaper%</button> <button class="ui" @click="updateWallpaper">%i18n:@choose-wallpaper%</button>
<button class="ui" @click="deleteWallpaper">%i18n:@delete-wallpaper%</button> <button class="ui" @click="deleteWallpaper">%i18n:@delete-wallpaper%</button>
<mk-switch v-model="darkmode" text="%i18n:@dark-mode%"/> <mk-switch v-model="darkmode" text="%i18n:@dark-mode%"/>
<mk-switch v-model="useShadow" text="%i18n:@use-shadow%"/>
<mk-switch v-model="roundedCorners" text="%i18n:@rounded-corners%"/>
<mk-switch v-model="circleIcons" text="%i18n:@circle-icons%"/> <mk-switch v-model="circleIcons" text="%i18n:@circle-icons%"/>
<mk-switch v-model="reduceMotion" text="%i18n:common.reduce-motion%"/> <mk-switch v-model="reduceMotion" text="%i18n:common.reduce-motion%"/>
<mk-switch v-model="contrastedAcct" text="%i18n:@contrasted-acct%"/> <mk-switch v-model="contrastedAcct" text="%i18n:@contrasted-acct%"/>
@ -316,6 +318,16 @@ export default Vue.extend({
set(value) { this.$store.commit('device/set', { key: 'alwaysShowNsfw', value }); } set(value) { this.$store.commit('device/set', { key: 'alwaysShowNsfw', value }); }
}, },
useShadow: {
get() { return this.$store.state.settings.useShadow; },
set(value) { this.$store.dispatch('settings/set', { key: 'useShadow', value }); }
},
roundedCorners: {
get() { return this.$store.state.settings.roundedCorners; },
set(value) { this.$store.dispatch('settings/set', { key: 'roundedCorners', value }); }
},
fetchOnScroll: { fetchOnScroll: {
get() { return this.$store.state.settings.fetchOnScroll; }, get() { return this.$store.state.settings.fetchOnScroll; },
set(value) { this.$store.dispatch('settings/set', { key: 'fetchOnScroll', value }); } set(value) { this.$store.dispatch('settings/set', { key: 'fetchOnScroll', value }); }

View file

@ -179,7 +179,9 @@ export default Vue.extend({
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
overflow hidden
> header > header
padding 0 8px padding 0 8px

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="header"> <div class="header" :style="style">
<p class="warn" v-if="env != 'production'">%i18n:common.do-not-use-in-production%</p> <p class="warn" v-if="env != 'production'">%i18n:common.do-not-use-in-production%</p>
<mk-special-message/> <mk-special-message/>
<div class="main" ref="main"> <div class="main" ref="main">
@ -54,6 +54,14 @@ export default Vue.extend({
}; };
}, },
computed: {
style(): any {
return {
'box-shadow': this.$store.state.settings.useShadow ? '0 0px 8px rgba(0, 0, 0, 0.2)' : 'none'
};
}
},
mounted() { mounted() {
this.$store.commit('setUiHeaderHeight', this.$el.offsetHeight); this.$store.commit('setUiHeaderHeight', this.$el.offsetHeight);
@ -124,7 +132,6 @@ root(isDark)
top 0 top 0
z-index 1000 z-index 1000
width 100% width 100%
box-shadow 0 0px 8px rgba(#000, 0.2)
> .warn > .warn
display block display block

View file

@ -36,7 +36,8 @@ export default Vue.extend({
<style lang="stylus" scoped> <style lang="stylus" scoped>
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
overflow hidden overflow hidden
&.naked &.naked

View file

@ -38,7 +38,8 @@ export default Vue.extend({
<style lang="stylus" scoped> <style lang="stylus" scoped>
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
> .title > .title
z-index 1 z-index 1

View file

@ -42,7 +42,8 @@ export default Vue.extend({
<style lang="stylus" scoped> <style lang="stylus" scoped>
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
overflow hidden overflow hidden
> .title > .title

View file

@ -104,7 +104,8 @@ export default Vue.extend({
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
overflow hidden overflow hidden
&[data-is-dark-background] &[data-is-dark-background]

View file

@ -41,7 +41,8 @@ export default Vue.extend({
<style lang="stylus" scoped> <style lang="stylus" scoped>
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
overflow hidden overflow hidden
> .title > .title

View file

@ -87,7 +87,8 @@ export default Vue.extend({
<style lang="stylus" scoped> <style lang="stylus" scoped>
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
> *:first-child > *:first-child
border-top none !important border-top none !important

View file

@ -116,12 +116,13 @@ export default Vue.extend({
root(isDark) root(isDark)
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
border-radius var(--round)
overflow hidden
> header > header
padding 0 8px padding 0 8px
z-index 10 z-index 10
background isDark ? #313543 : #fff background isDark ? #313543 : #fff
border-radius 6px 6px 0 0
box-shadow 0 1px isDark ? rgba(#000, 0.15) : rgba(#000, 0.08) box-shadow 0 1px isDark ? rgba(#000, 0.15) : rgba(#000, 0.08)
> span > span

View file

@ -88,17 +88,16 @@ root(isDark)
margin-bottom 16px margin-bottom 16px
padding 14px 16px padding 14px 16px
font-size 14px font-size 14px
border-radius 6px box-shadow var(--shadow)
border-radius var(--round)
&.is-suspended &.is-suspended
color isDark ? #ffb4b4 : #570808 color isDark ? #ffb4b4 : #570808
background isDark ? #611d1d : #ffdbdb background isDark ? #611d1d : #ffdbdb
border solid 1px isDark ? #d64a4a : #e09696
&.is-remote &.is-remote
color isDark ? #ffbd3e : #573c08 color isDark ? #ffbd3e : #573c08
background isDark ? #42321c : #fff0db background isDark ? #42321c : #fff0db
border solid 1px isDark ? #90733c : #dcbb7b
> a > a
font-weight bold font-weight bold
@ -118,7 +117,7 @@ root(isDark)
margin-right 16px margin-right 16px
> .timeline > .timeline
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
> .side > .side
width 275px width 275px
@ -137,7 +136,8 @@ root(isDark)
font-size 12px font-size 12px
color #aaa color #aaa
background isDark ? #21242f : #fff background isDark ? #21242f : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
border-radius var(--round)
a a
color #999 color #999

View file

@ -355,7 +355,7 @@ root(isDark)
.block .block
color isDark ? #fff : #444 color isDark ? #fff : #444
background isDark ? #282C37 : #fff background isDark ? #282C37 : #fff
box-shadow 0 3px 8px rgba(0, 0, 0, 0.2) box-shadow var(--shadow)
//border-radius 8px //border-radius 8px
overflow auto overflow auto

View file

@ -125,6 +125,26 @@ export default (callback: (launch: (router: VueRouter, api?: (os: MiOS) => API)
}); });
//#endregion //#endregion
//#region shadow
const shadow = '0 3px 8px rgba(0, 0, 0, 0.2)';
if (os.store.state.settings.useShadow) document.documentElement.style.setProperty('--shadow', shadow);
os.store.watch(s => {
return s.settings.useShadow;
}, v => {
document.documentElement.style.setProperty('--shadow', v ? shadow : 'none');
});
//#endregion
//#region rounded corners
const round = '6px';
if (os.store.state.settings.roundedCorners) document.documentElement.style.setProperty('--round', round);
os.store.watch(s => {
return s.settings.roundedCorners;
}, v => {
document.documentElement.style.setProperty('--round', v ? round : '0');
});
//#endregion
Vue.mixin({ Vue.mixin({
data() { data() {
return { return {

View file

@ -16,6 +16,8 @@ const defaultSettings = {
showPostFormOnTopOfTl: false, showPostFormOnTopOfTl: false,
suggestRecentHashtags: true, suggestRecentHashtags: true,
showClockOnHeader: true, showClockOnHeader: true,
useShadow: true,
roundedCorners: false,
circleIcons: true, circleIcons: true,
contrastedAcct: true, contrastedAcct: true,
showFullAcct: false, showFullAcct: false,