Skip to content

Commit 76071e0

Browse files
committed
Fixed mobile version
1 parent 4af3008 commit 76071e0

4 files changed

Lines changed: 199 additions & 3 deletions

File tree

package-lock.json

Lines changed: 134 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
1010
},
1111
"dependencies": {
12+
"@vueuse/core": "^10.1.2",
1213
"vite-plugin-vuetify": "^1.0.2",
1314
"vue": "^3.2.47",
1415
"vuetify": "^3.2.1",

src/App.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,28 @@ function reportIssue() {
3737
padding-top: 50px;
3838
padding-bottom: 50px;
3939
}
40+
41+
/* media query for mobile padding */
42+
@media (max-width: 700px) {
43+
.parent {
44+
padding-left: 20px;
45+
padding-right: 20px;
46+
}
47+
}
48+
49+
/* media query for small screen padding min width 801 */
50+
@media (min-width: 701px) and (max-width: 1200px) {
51+
.parent {
52+
padding-left: 10%;
53+
padding-right: 10%;
54+
}
55+
}
56+
57+
/* media query for small screen padding min width 801 */
58+
@media (min-width: 1201px) and (max-width: 1500px) {
59+
.parent {
60+
padding-left: 20%;
61+
padding-right: 20%;
62+
}
63+
}
4064
</style>

src/components/Card.vue

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,38 @@
33
<v-toolbar
44
style="padding-left: 15px; padding-right: 15px"
55
:color="content.hasWebsite ? 'primary' : ''"
6+
v-if="!isMobile"
67
>
7-
<h2>{{ content.name }}</h2>
8+
<h2 class="title">{{ content.name }}</h2>
89
<v-spacer></v-spacer>
910
<div v-if="content.hasWebsite">
10-
<v-btn @click="openWebsite" text> Open Website </v-btn>
11+
<v-btn @click="openWebsite" variant="text"> Open Website </v-btn>
1112
<v-icon right>mdi-open-in-new</v-icon>
1213
</div>
1314
</v-toolbar>
15+
<div v-else>
16+
<v-sheet
17+
width="100%"
18+
style="
19+
padding-left: 15px;
20+
padding-right: 15px;
21+
flex-direction: row;
22+
display: flex;
23+
align-items: center;
24+
"
25+
:color="content.hasWebsite ? 'primary' : 'rgba(255, 255, 255, 0.1)'"
26+
>
27+
<h2 class="title">{{ content.name }}</h2>
28+
<v-spacer></v-spacer>
29+
<v-icon v-if="content.hasWebsite" right>mdi-open-in-new</v-icon>
30+
</v-sheet>
31+
32+
<v-sheet v-if="content.hasWebsite" width="100%" class="button">
33+
<v-btn @click="openWebsite" variant="text" style="width: 100%">
34+
Open Website
35+
</v-btn>
36+
</v-sheet>
37+
</div>
1438
<v-card-text>
1539
{{ content.description }}
1640
</v-card-text>
@@ -21,7 +45,7 @@
2145
{{ content.status }}
2246
</v-chip>
2347
</div>
24-
<div>
48+
<div style="display: flex; flex-wrap: nowrap">
2549
<v-btn @click="openRepo">Open Repo</v-btn>
2650
<v-icon>mdi-github</v-icon>
2751
</div>
@@ -31,6 +55,7 @@
3155

3256
<script setup>
3357
import { computed } from "vue";
58+
import { useMediaQuery } from "@vueuse/core";
3459
3560
// define prop for content object
3661
const props = defineProps({
@@ -47,6 +72,8 @@ const chipColor = computed(() => {
4772
}[props.content.status];
4873
});
4974
75+
const isMobile = useMediaQuery("(max-width: 700px)");
76+
5077
function openWebsite() {
5178
window.open(props.content.url);
5279
}
@@ -77,4 +104,14 @@ function openRepo() {
77104
display: flex;
78105
color: white;
79106
}
107+
108+
.button {
109+
width: 100%;
110+
/* linear gradient to white */
111+
background: linear-gradient(
112+
90deg,
113+
rgba(255, 255, 255, 0) 0%,
114+
rgba(255, 255, 255, 0.1) 100%
115+
);
116+
}
80117
</style>

0 commit comments

Comments
 (0)