Skip to content

Commit

Permalink
continue progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Prospector committed Oct 31, 2024
1 parent d6a4b28 commit cd21547
Show file tree
Hide file tree
Showing 15 changed files with 327 additions and 313 deletions.
24 changes: 24 additions & 0 deletions apps/app-frontend/src/assets/modrinth_servers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions apps/app-frontend/src/components/ui/NavButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ withDefaults(defineProps<{
position: absolute;
background-color: var(--_tooltip-bg);
color: var(--_tooltip-color);
//background-color: black;
//color: var(--dark-color-contrast);
text-wrap: nowrap;
padding: 0.5rem 0.5rem;
border-radius: var(--radius-sm);
Expand Down
12 changes: 11 additions & 1 deletion apps/app-frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ Sentry.init({

app.use(router)
app.use(pinia)
app.use(FloatingVue)
app.use(FloatingVue, {
themes: {
'ribbit-popout': {
'$extend': 'dropdown',
placement: 'bottom-end',
instantMove: true,
distance: 8,
triggers: ['click'],
}
}
})
app.use(VIntlPlugin)

app.mount('#app')
5 changes: 4 additions & 1 deletion apps/app-frontend/src/pages/instance/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
:versions="modrinthVersions"
:installed="instance.install_stage !== 'installed'"
></component>
<template #fallback>
<LoadingIndicator />
</template>
</Suspense>
</template>
</RouterView>
Expand Down Expand Up @@ -134,7 +137,7 @@ import {
Avatar,
ContentPageHeader,
ButtonStyled,
OverflowMenu
OverflowMenu, LoadingIndicator
} from '@modrinth/ui'
import {
UserPlusIcon,
Expand Down
24 changes: 18 additions & 6 deletions apps/app-frontend/src/pages/instance/Mods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,38 @@
>
<template #actions="{ item }">
<ButtonStyled v-if="!isPackLocked" type="transparent" circular>
<button @click="removeMod(item)">
<button v-tooltip="item.disabled ? `Enable` : `Disable`" @click="toggleDisableMod(item.data)">
<CheckCircleIcon v-if="item.disabled" />
<SlashIcon v-else />
</button>
</ButtonStyled>
<ButtonStyled v-if="!isPackLocked" type="transparent" circular>
<button v-tooltip="'Delete'" @click="removeMod(item)">
<TrashIcon />
</button>
</ButtonStyled>
<ButtonStyled type="transparent" circular>
<OverflowMenu
:options="[
{
id: 'copy-link',
shown: item.project,
action: () => toggleDisableMod(item.data),
id: 'show-file',
action: () => {},
},
{
id: 'toggle',
shown: !isPackLocked,
divider: true,
},
{
id: 'copy-link',
shown: item.project,
action: () => toggleDisableMod(item.data),
},
]"
direction="left"
>
<MoreVerticalIcon />
<template #show-file>
<ClipboardCopyIcon /> Show file
</template>
<template #copy-link>
<ClipboardCopyIcon /> Copy link
</template>
Expand Down
69 changes: 63 additions & 6 deletions packages/assets/styles/classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -816,17 +816,19 @@ a,

.v-popper--theme-tooltip {
.v-popper__inner {
background: var(--color-tooltip-bg) !important;
color: var(--color-tooltip-text) !important;
padding: 5px 10px 4px !important;
background: var(--color-tooltip-bg);
color: var(--color-tooltip-text);
padding: 0.5rem 0.5rem !important;
border-radius: var(--radius-sm) !important;
box-shadow: var(--shadow-floating) !important;
font-size: 0.9rem !important;
filter: drop-shadow(5px 5px 0.8rem rgba(0, 0, 0, 0.35));
font-size: 0.9rem;
font-weight: bold;
line-height: 1;
}

.v-popper__arrow-outer,
.v-popper__arrow-inner {
border-color: var(--color-tooltip-bg) !important;
border-color: var(--color-tooltip-bg);
}
}

Expand Down Expand Up @@ -1182,3 +1184,58 @@ select {
border-top-left-radius: var(--radius-md) !important;
border-top-right-radius: var(--radius-md) !important;
}

.v-popper--theme-dropdown.v-popper--theme-ribbit-popout {
.v-popper__inner {
border: 1px solid var(--color-button-bg);
padding: var(--gap-sm);
width: fit-content;
border-radius: var(--radius-md);
background-color: var(--color-raised-bg);
box-shadow: var(--shadow-floating);
}

.v-popper__arrow-outer {
border-color: var(--color-button-bg);
}

.v-popper__arrow-inner {
border-color: var(--color-raised-bg);
}
}

.v-popper__popper[data-popper-placement="bottom-end"] .v-popper__wrapper {
transform-origin: top right;
}

.v-popper__popper[data-popper-placement="top-end"] .v-popper__wrapper {
transform-origin: bottom right;
}

.v-popper__popper[data-popper-placement="bottom-start"] .v-popper__wrapper {
transform-origin: top left;
}

.v-popper__popper[data-popper-placement="top-start"] .v-popper__wrapper {
transform-origin: bottom left;
}

.v-popper__popper.v-popper__popper--show-from .v-popper__wrapper {
transform: scale(.9);
opacity: 1;
}

.v-popper__popper.v-popper__popper--show-to .v-popper__wrapper {
transform: none;
transition: transform 0.125s;
}

.v-popper__popper.v-popper__popper--hide-from .v-popper__wrapper {
transform: none;
transition: transform 0.0625s;
}

.v-popper__popper.v-popper__popper--hide-to .v-popper__wrapper {
//transform: scale(.9);
}

4 changes: 2 additions & 2 deletions packages/assets/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ html {
--radius-xl: 1.25rem;
--radius-max: 999999999px;

--color-tooltip-text: var(--color-base);
--color-tooltip-bg: var(--color-button-bg);
--color-tooltip-text: var(--dark-color-contrast);
--color-tooltip-bg: #000;

--color-ad: rgba(125, 75, 162, 0.2);
--color-ad-raised: rgba(190, 140, 243, 0.5);
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"qrcode.vue": "^3.4.1",
"vue-multiselect": "3.0.0",
"vue-select": "4.0.0-beta.6",
"vue-virtual-scroller": "v2.0.0-beta.8",
"vue3-apexcharts": "^1.4.4",
"xss": "^1.0.14"
}
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/src/components/base/ButtonStyled.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const colorVariables = computed(() => {
}
/* Searches up to 4 children deep for valid button */
.btn-wrapper :deep(:is(button, a, .button-like):first-child),
.btn-wrapper :slotted(:is(button, a, .button-like):first-child),
.btn-wrapper :slotted(*) > :is(button, a, .button-like):first-child,
.btn-wrapper :slotted(*) > *:first-child > :is(button, a, .button-like):first-child,
Expand Down Expand Up @@ -194,6 +195,7 @@ const colorVariables = computed(() => {
}
}
.btn-wrapper.outline :deep(:is(button, a, .button-like):first-child),
.btn-wrapper.outline :slotted(:is(button, a, .button-like):first-child),
.btn-wrapper.outline :slotted(*) > :is(button, a, .button-like):first-child,
.btn-wrapper.outline :slotted(*) > *:first-child > :is(button, a, .button-like):first-child,
Expand All @@ -206,6 +208,7 @@ const colorVariables = computed(() => {
}
/*noinspection CssUnresolvedCustomProperty*/
.btn-wrapper :deep(:is(button, a, .button-like):first-child) > svg:first-child,
.btn-wrapper :slotted(:is(button, a, .button-like):first-child) > svg:first-child,
.btn-wrapper :slotted(*) > :is(button, a, .button-like):first-child > svg:first-child,
.btn-wrapper
Expand All @@ -228,6 +231,7 @@ const colorVariables = computed(() => {
gap: 1px;
> .btn-wrapper:not(:first-child) {
:deep(:is(button, a, .button-like):first-child),
:slotted(:is(button, a, .button-like):first-child),
:slotted(*) > :is(button, a, .button-like):first-child,
:slotted(*) > *:first-child > :is(button, a, .button-like):first-child,
Expand All @@ -238,6 +242,7 @@ const colorVariables = computed(() => {
}
> :not(:last-child) {
:deep(:is(button, a, .button-like):first-child),
:slotted(:is(button, a, .button-like):first-child),
:slotted(*) > :is(button, a, .button-like):first-child,
:slotted(*) > *:first-child > :is(button, a, .button-like):first-child,
Expand Down
113 changes: 113 additions & 0 deletions packages/ui/src/components/base/LoadingIndicator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<template>
<div class="w-full flex items-center justify-center flex-col gap-2">
<div class="title">Loading</div>
<div class="placeholder"></div>
<div class="placeholder"></div>
<div class="placeholder"></div>
</div>
</template>

<script setup></script>
<style scoped>
.title {
position: absolute;
z-index: 1;
font-weight: bold;
color: var(--color-contrast);
&::after {
content: '';
animation: dots 2s infinite;
}
}
@keyframes dots {
25% {
content: '';
}
50% {
content: '.';
}
75% {
content: '..';
}
0%,
100% {
content: '...';
}
}
.placeholder {
border-radius: var(--radius-lg);
width: 100%;
height: 4rem;
opacity: 0.25;
position: relative;
overflow: hidden;
background-color: var(--color-raised-bg);
animation: pop 4s ease-in-out infinite;
border: 1px solid transparent;
&::before {
content: '';
position: absolute;
inset: 0;
background-image: linear-gradient(
-45deg,
transparent 30%,
rgba(196, 217, 237, 0.075) 50%,
transparent 70%
);
animation: shimmer 4s ease-in-out infinite;
}
&:nth-child(2)::before {
animation-delay: 0s;
}
&:nth-child(3)::before {
animation-delay: 0.3s;
}
&:nth-child(4)::before {
animation-delay: 0.6s;
}
&:nth-child(2) {
animation-delay: 0s;
}
&:nth-child(3) {
animation-delay: 0.3s;
}
&:nth-child(4) {
animation-delay: 0.6s;
}
}
@keyframes pop {
from {
opacity: 0.25;
border-color: transparent;
}
50% {
opacity: 0.5;
border-color: var(--color-button-bg);
}
to {
opacity: 0.25;
border-color: transparent;
}
}
@keyframes shimmer {
from {
transform: translateX(-80%);
}
50%,
to {
transform: translateX(80%);
}
}
</style>
Loading

0 comments on commit cd21547

Please sign in to comment.