Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add optional info icon to top right of cards #149

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ services:
tag: "app"
url: "https://www.reddit.com/r/selfhosted/"
target: "_blank" # optional html tag target attribute
info: "https://github.com/bastienwirtz/homer/tree/main/docs" # optional link to documentation
infotarget: "_blank" # same as target, but for icon link
- name: "Another one"
logo: "assets/tools/sample2.png"
subtitle: "Another application"
Expand Down
25 changes: 23 additions & 2 deletions src/assets/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ body {
&:hover {
background-color: var(--card-background);
}

.linkoverlay {
position:absolute;
left:0;
top:0;
bottom:0;
right:0;
}
.thirty-five {
font-size: 35px;
}
}

.message {
Expand Down Expand Up @@ -196,17 +207,27 @@ body {
}
}
}

.media-left {
pointer-events: none;
z-index: 1;
}
.media-content {
overflow: hidden;
text-overflow: inherit;
}
.infolink {
font-family: "Font Awesome 5 Free";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried without this line? as we use the <i> tag with the css class, I don't think that's needed (other icons works without it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically line 219 or the entire block?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the line 219 yes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any update on this PR?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any update?

position: absolute;
top: 0.5rem;
right: 0.5rem;
padding: 0;
}

.tag {
color: var(--highlight-secondary);
background-color: var(--highlight-secondary);
position: absolute;
top: 1rem;
bottom: 1rem;
right: -0.2rem;
width: 3px;
overflow: hidden;
Expand Down
56 changes: 35 additions & 21 deletions src/components/services/Generic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {};
</script>

<style></style> */
<style></style>

<script>
export default {};
Expand All @@ -13,29 +13,43 @@ export default {};
<template>
<div>
<div class="card" :class="item.class">
<a :href="item.url" :target="item.target" rel="noreferrer">
<div class="card-content">
<div class="media">
<div v-if="item.logo" class="media-left">
<figure class="image is-48x48">
<img :src="item.logo" :alt="`${item.name} logo`" />
</figure>
</div>
<div v-if="item.icon" class="media-left">
<figure class="image is-48x48">
<i style="font-size: 35px;" :class="['fa-fw', item.icon]"></i>
</figure>
</div>
<div class="media-content">
<p class="title is-4">{{ item.name }}</p>
<p class="subtitle is-6">{{ item.subtitle }}</p>
</div>
<a
:href="item.url"
class="linkoverlay"
:target="item.target"
rel="noreferrer"
></a>
<div class="card-content">
<div class="media">
<div v-if="item.logo" class="media-left">
<figure class="image is-48x48">
<img :src="item.logo" :alt="`${item.name} logo`" />
</figure>
</div>
<div v-if="item.icon" class="media-left">
<figure class="image is-48x48">
<i class="thirty-five" :class="['fa-fw', item.icon]"></i>
</figure>
</div>
<div class="tag" :class="item.tagstyle" v-if="item.tag">
<strong class="tag-text">#{{ item.tag }}</strong>
<div class="media-content">
<p class="title is-4">{{ item.name }}</p>
<p class="subtitle is-6">{{ item.subtitle }}</p>
</div>
</div>
<a
v-if="item.info"
:href="item.info"
:target="item.infotarget"
rel="noreferrer"
>
<div class="infolink">
<i class="fas fa-info-circle"></i>
</div>
</a>
<div class="tag" :class="item.tagstyle" v-if="item.tag">
<strong class="tag-text">#{{ item.tag }}</strong>
</div>
</a>
</div>
</div>
</div>
</template>
Expand Down