-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
156 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<Card :mainStyle="mainStyle" @click="$emit('click')"> | ||
<Progress | ||
:class="{'mobile_progress': mobileDisplay === 'bottom'}" | ||
:progress="moveProgress" | ||
v-if="!closeOnClick" | ||
:color="progressColor" | ||
/> | ||
<div class="mobile"> | ||
<div class="mobile_title" v-if="content.title">{{content.title}}</div> | ||
<div | ||
class="mobile_message" | ||
:style="{'padding-top':content.title ? '10px': 0 }" | ||
v-if="content.message" | ||
> | ||
{{content.message}} | ||
</div> | ||
</div> | ||
</Card> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Card from "./Card.vue" | ||
import { Component, Vue, Prop } from "vue-property-decorator"; | ||
import { CardContent } from "../types/index"; | ||
import Progress from "./Progress.vue"; | ||
@Component({ | ||
components: { | ||
Card, | ||
Progress | ||
} | ||
}) | ||
export default class Mobile extends Vue { | ||
@Prop({ type: Object, required: true }) private content!: CardContent; | ||
@Prop({ type: String, required: false }) private textColor!: string; | ||
@Prop({ type: String, required: false }) private statusColor!: string; | ||
@Prop({ type: Boolean, required: false }) private closeOnClick!: boolean; | ||
@Prop({ type: String, required: false }) private progressColor!: string; | ||
@Prop({ type: Number, required: false }) private moveProgress!: number; | ||
@Prop({ type: String, required: false }) private mobileDisplay!: string; | ||
get mainStyle() { | ||
const style: any = { | ||
color: this.textColor, | ||
"background-color": this.statusColor, | ||
width: "100%", | ||
height: "max-content", | ||
right:0 | ||
}; | ||
this.mobileDisplay === "bottom" ? style.bottom = 0 : style.top = 0; | ||
return style; | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.mobile{ | ||
text-align: left; | ||
padding: 10px; | ||
font-family: sans-serif; | ||
} | ||
.mobile_title { | ||
font-weight: bold; | ||
} | ||
.mobile_message { | ||
} | ||
.mobile_progress{ | ||
position: absolute; | ||
bottom: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const screenWidth = screen.width; | ||
export const isActualMobile = /iPhone|iPad|iPod|Android|BlackBerry|Windows Phone|webOS/i.test( | ||
navigator.userAgent | ||
); | ||
|
||
export const isMobile = () => { | ||
const mq = window.matchMedia("(max-width: 700px)"); | ||
return isActualMobile || mq.matches; | ||
}; |
2 changes: 1 addition & 1 deletion
2
src/components/Whoosh/Util.ts → src/components/Whoosh/helpers/Util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters