mirror of
https://github.com/dpnmw/community-landing.git
synced 2026-03-18 09:27:16 +00:00
Compare commits
7 Commits
13d63d101e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| babfc15c24 | |||
| 70cf5099d4 | |||
| 81971b70fc | |||
| 9b3fdd80c3 | |||
| 9029396fca | |||
| de19c2e2b6 | |||
| 81785aecf9 |
BIN
assets/images/badge-dark.png
Normal file
BIN
assets/images/badge-dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
assets/images/badge-light.png
Normal file
BIN
assets/images/badge-light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
assets/images/badge.png
Normal file
BIN
assets/images/badge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -2319,75 +2319,75 @@ html, .cl-body {
|
|||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--cl-glass);
|
||||||
|
backdrop-filter: var(--cl-blur);
|
||||||
|
-webkit-backdrop-filter: var(--cl-blur);
|
||||||
|
border: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
opacity: 0.4;
|
||||||
transition: transform 0.3s ease, opacity 0.3s ease;
|
transition: transform 0.3s ease, opacity 0.3s ease;
|
||||||
opacity: 0.7;
|
|
||||||
}
|
}
|
||||||
.cl-designer-badge:hover {
|
.cl-designer-badge:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: scale(1.1);
|
|
||||||
}
|
}
|
||||||
.cl-designer-badge__logo {
|
.cl-designer-badge__logo {
|
||||||
width: 36px;
|
width: 26px;
|
||||||
height: 36px;
|
height: 26px;
|
||||||
display: block;
|
|
||||||
filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
|
|
||||||
}
|
|
||||||
.cl-designer-badge__logo--dark {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.cl-designer-badge__logo--light {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
[data-theme="light"] .cl-designer-badge__logo--dark {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
[data-theme="light"] .cl-designer-badge__logo--light {
|
|
||||||
display: block;
|
display: block;
|
||||||
|
border-radius: 50%;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
.cl-designer-badge__tooltip {
|
.cl-designer-badge__tooltip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: calc(100% + 10px);
|
bottom: calc(100% + 10px);
|
||||||
right: 0;
|
right: 0;
|
||||||
background: var(--cl-glass, rgba(12, 12, 25, 0.85));
|
background: var(--cl-glass);
|
||||||
backdrop-filter: blur(12px);
|
border: 1px solid var(--cl-glass-border);
|
||||||
-webkit-backdrop-filter: blur(12px);
|
border-radius: 40px;
|
||||||
border: 1px solid var(--cl-border, rgba(255, 255, 255, 0.08));
|
padding: 0px 12px 4px;
|
||||||
border-radius: var(--cl-radius-sm, 10px);
|
|
||||||
padding: 10px 14px;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(6px);
|
transition: opacity 0.2s ease;
|
||||||
transition: opacity 0.25s ease, transform 0.25s ease;
|
text-align: left;
|
||||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
}
|
||||||
.cl-designer-badge__tooltip.active {
|
.cl-designer-badge__tooltip.active {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(0);
|
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
.cl-designer-badge__tooltip::after {
|
.cl-designer-badge__tooltip::after {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -6px;
|
bottom: -5px;
|
||||||
right: 12px;
|
right: 16px;
|
||||||
width: 12px;
|
width: 8px;
|
||||||
height: 12px;
|
height: 8px;
|
||||||
background: var(--cl-glass, rgba(12, 12, 25, 0.85));
|
background: inherit;
|
||||||
border-right: 1px solid var(--cl-border, rgba(255, 255, 255, 0.08));
|
border-right: 1px solid var(--cl-glass-border);
|
||||||
border-bottom: 1px solid var(--cl-border, rgba(255, 255, 255, 0.08));
|
border-bottom: 1px solid var(--cl-glass-border);
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
.cl-designer-badge__tooltip a {
|
.cl-designer-badge__tooltip a {
|
||||||
color: var(--cl-accent, #d4a24e);
|
color: #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 13px;
|
font-size: 10px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.06em;
|
||||||
transition: color 0.2s ease;
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.cl-designer-badge__tooltip a:hover {
|
.cl-designer-badge__tooltip a:hover {
|
||||||
color: var(--cl-accent-hover, #c4922e);
|
color: #b0b0b0;
|
||||||
text-decoration: underline;
|
}
|
||||||
|
[data-theme="light"] .cl-designer-badge__tooltip a {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
[data-theme="light"] .cl-designer-badge__tooltip a:hover {
|
||||||
|
color: #444;
|
||||||
}
|
}
|
||||||
@@ -863,20 +863,20 @@ module CommunityLanding
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render_designer_badge
|
def render_designer_badge
|
||||||
dark_logo = File.join(CommunityLanding::PLUGIN_DIR, "..", "logo-dark.png")
|
logo_path = File.join(CommunityLanding::PLUGIN_DIR, "assets", "images", "badge.png")
|
||||||
light_logo = File.join(CommunityLanding::PLUGIN_DIR, "..", "logo-light.png")
|
|
||||||
return "" unless File.exist?(dark_logo) && File.exist?(light_logo)
|
|
||||||
|
|
||||||
dark_b64 = Base64.strict_encode64(File.binread(dark_logo))
|
begin
|
||||||
light_b64 = Base64.strict_encode64(File.binread(light_logo))
|
logo_b64 = Base64.strict_encode64(File.binread(logo_path))
|
||||||
|
rescue StandardError
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
html = +""
|
html = +""
|
||||||
html << "<div class=\"cl-designer-badge\" id=\"cl-designer-badge\">\n"
|
html << "<div class=\"cl-designer-badge\" id=\"cl-designer-badge\">\n"
|
||||||
html << " <div class=\"cl-designer-badge__tooltip\" id=\"cl-designer-tooltip\">\n"
|
html << " <div class=\"cl-designer-badge__tooltip\" id=\"cl-designer-tooltip\">\n"
|
||||||
html << " <a href=\"https://www.dpnmw.com\" target=\"_blank\" rel=\"noopener noreferrer\">Interface design by dpnmw.com</a>\n"
|
html << " <a href=\"https://www.dpnmw.com\" target=\"_blank\" rel=\"noopener noreferrer\">Interface By DPN MW <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 -960 960 960\" fill=\"currentColor\" style=\"vertical-align:middle;margin-left:2px\"><path d=\"M186.67-120q-27 0-46.84-19.83Q120-159.67 120-186.67v-586.66q0-27 19.83-46.84Q159.67-840 186.67-840H466v66.67H186.67v586.66h586.66V-466H840v279.33q0 27-19.83 46.84Q800.33-120 773.33-120H186.67ZM384-336.67 337.33-384l389.34-389.33h-194V-840H840v307.33h-66.67V-726L384-336.67Z\"/></svg></a>\n"
|
||||||
html << " </div>\n"
|
html << " </div>\n"
|
||||||
html << " <img class=\"cl-designer-badge__logo cl-designer-badge__logo--dark\" src=\"data:image/png;base64,#{dark_b64}\" alt=\"Designer\">\n"
|
html << " <img class=\"cl-designer-badge__logo\" src=\"data:image/png;base64,#{logo_b64}\" alt=\"Designer\">\n"
|
||||||
html << " <img class=\"cl-designer-badge__logo cl-designer-badge__logo--light\" src=\"data:image/png;base64,#{light_b64}\" alt=\"Designer\">\n"
|
|
||||||
html << "</div>\n"
|
html << "</div>\n"
|
||||||
html
|
html
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ enabled_site_setting :community_landing_enabled
|
|||||||
|
|
||||||
register_asset "stylesheets/community_landing/admin.css", :admin
|
register_asset "stylesheets/community_landing/admin.css", :admin
|
||||||
|
|
||||||
|
require "base64"
|
||||||
|
|
||||||
after_initialize do
|
after_initialize do
|
||||||
module ::CommunityLanding
|
module ::CommunityLanding
|
||||||
PLUGIN_NAME = "community-landing"
|
PLUGIN_NAME = "community-landing"
|
||||||
|
|||||||
Reference in New Issue
Block a user