Merge origin/main + bump version to 1.6.0
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 3.4 KiB |
+187
-182
@@ -3,13 +3,13 @@
|
||||
Post and feed styling to match Twitter/X perfectly
|
||||
============================================================ */
|
||||
|
||||
.beep-feed,
|
||||
.beep-feed * {
|
||||
.beep-embed .beep-feed,
|
||||
.beep-embed .beep-feed * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.beep-feed {
|
||||
/* Twitter Dark Mode Palette */
|
||||
:root {
|
||||
/* Default Twitter Dark Mode Palette */
|
||||
--beep-bg: #15202B;
|
||||
--beep-card-bg: #192734;
|
||||
--beep-card-hover: #1C2732;
|
||||
@@ -20,6 +20,11 @@
|
||||
--beep-accent-hover: #1A8CD8;
|
||||
--beep-like: #F91880;
|
||||
--beep-repost: #00BA7C;
|
||||
}
|
||||
|
||||
|
||||
.beep-embed .beep-feed {
|
||||
/* Twitter Dark Mode Palette */
|
||||
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
max-width: 600px;
|
||||
@@ -32,11 +37,11 @@
|
||||
line-height: 1.4;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
min-height: 100vh;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.beep-feed-header {
|
||||
.beep-embed .beep-feed-header {
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid var(--beep-border);
|
||||
display: flex;
|
||||
@@ -49,7 +54,7 @@
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.beep-feed-header-title {
|
||||
.beep-embed .beep-feed-header-title {
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
color: var(--beep-text);
|
||||
@@ -57,12 +62,12 @@
|
||||
}
|
||||
|
||||
/* Nav tabs */
|
||||
.beep-top-nav {
|
||||
.beep-embed .beep-top-nav {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-nav-tab {
|
||||
.beep-embed .beep-nav-tab {
|
||||
flex: 1;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
@@ -77,16 +82,16 @@
|
||||
transition: background-color 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-nav-tab:hover {
|
||||
.beep-embed .beep-nav-tab:hover {
|
||||
background: var(--beep-card-hover);
|
||||
color: var(--beep-text);
|
||||
}
|
||||
|
||||
.beep-nav-tab.is-active {
|
||||
.beep-embed .beep-nav-tab.is-active {
|
||||
color: var(--beep-text);
|
||||
}
|
||||
|
||||
.beep-nav-tab.is-active::after {
|
||||
.beep-embed .beep-nav-tab.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -98,19 +103,19 @@
|
||||
}
|
||||
|
||||
/* Compose area */
|
||||
.beep-compose {
|
||||
.beep-embed .beep-compose {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-compose-body {
|
||||
.beep-embed .beep-compose-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.beep-feed .beep-input {
|
||||
.beep-embed .beep-feed .beep-input {
|
||||
width: 100% !important;
|
||||
border: 0 !important;
|
||||
outline: 0 !important;
|
||||
@@ -127,11 +132,11 @@
|
||||
caret-color: var(--beep-accent);
|
||||
}
|
||||
|
||||
.beep-feed .beep-input::placeholder {
|
||||
.beep-embed .beep-feed .beep-input::placeholder {
|
||||
color: var(--beep-muted) !important;
|
||||
}
|
||||
|
||||
.beep-compose-footer {
|
||||
.beep-embed .beep-compose-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -140,12 +145,12 @@
|
||||
border-top: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-compose-tools {
|
||||
.beep-embed .beep-compose-tools {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.beep-compose-tool {
|
||||
.beep-embed .beep-compose-tool {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: var(--beep-accent);
|
||||
@@ -159,12 +164,12 @@
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-compose-tool:hover {
|
||||
.beep-embed .beep-compose-tool:hover {
|
||||
background: rgba(29, 155, 240, 0.15);
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.beep-button {
|
||||
.beep-embed .beep-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -180,12 +185,12 @@
|
||||
transition: background-color 0.15s ease, transform 0.1s ease;
|
||||
}
|
||||
|
||||
.beep-button:hover { background: var(--beep-accent-hover); color: #fff; }
|
||||
.beep-button:active { transform: scale(0.96); }
|
||||
.beep-button:disabled { opacity: 0.5; cursor: default; }
|
||||
.beep-embed .beep-button:hover { background: var(--beep-accent-hover); color: #fff; }
|
||||
.beep-embed .beep-button:active { transform: scale(0.96); }
|
||||
.beep-embed .beep-button:disabled { opacity: 0.5; cursor: default; }
|
||||
|
||||
/* Follow button */
|
||||
.beep-follow-btn {
|
||||
.beep-embed .beep-follow-btn {
|
||||
background: var(--beep-text);
|
||||
color: var(--beep-bg);
|
||||
border: 0;
|
||||
@@ -199,9 +204,9 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.beep-follow-btn:hover { opacity: 0.85; }
|
||||
.beep-embed .beep-follow-btn:hover { opacity: 0.85; }
|
||||
|
||||
.beep-following-btn {
|
||||
.beep-embed .beep-following-btn {
|
||||
background: transparent;
|
||||
color: var(--beep-text);
|
||||
border: 1px solid var(--beep-border);
|
||||
@@ -214,19 +219,19 @@
|
||||
transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-following-btn:hover {
|
||||
.beep-embed .beep-following-btn:hover {
|
||||
border-color: #F4212E;
|
||||
color: #F4212E;
|
||||
background: rgba(244, 33, 46, 0.1);
|
||||
}
|
||||
|
||||
/* Char counter */
|
||||
.beep-char-counter { font-size: 13px; color: var(--beep-muted); font-variant-numeric: tabular-nums; }
|
||||
.beep-counter-warn { color: #FFD400; }
|
||||
.beep-counter-bad { color: #F4212E; font-weight: 700; }
|
||||
.beep-embed .beep-char-counter { font-size: 13px; color: var(--beep-muted); font-variant-numeric: tabular-nums; }
|
||||
.beep-embed .beep-counter-warn { color: #FFD400; }
|
||||
.beep-embed .beep-counter-bad { color: #F4212E; font-weight: 700; }
|
||||
|
||||
/* Avatars */
|
||||
.beep-feed .beep-avatar {
|
||||
.beep-embed .beep-feed .beep-avatar {
|
||||
width: 48px !important;
|
||||
height: 48px !important;
|
||||
min-width: 48px !important;
|
||||
@@ -241,9 +246,9 @@
|
||||
transition: filter 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-feed .beep-avatar:hover { filter: brightness(0.9); }
|
||||
.beep-embed .beep-feed .beep-avatar:hover { filter: brightness(0.9); }
|
||||
|
||||
.beep-feed .beep-avatar-sm {
|
||||
.beep-embed .beep-feed .beep-avatar-sm {
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
min-width: 40px !important;
|
||||
@@ -251,16 +256,16 @@
|
||||
}
|
||||
|
||||
/* Post list */
|
||||
.beep-list { background: var(--beep-bg); }
|
||||
.beep-embed .beep-list { background: var(--beep-bg); }
|
||||
|
||||
.beep-empty {
|
||||
.beep-embed .beep-empty {
|
||||
padding: 60px 20px;
|
||||
text-align: center;
|
||||
color: var(--beep-muted);
|
||||
}
|
||||
|
||||
/* Individual post */
|
||||
.beep-post {
|
||||
.beep-embed .beep-post {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
padding: 14px 20px;
|
||||
@@ -270,13 +275,13 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.beep-post:hover { background: var(--beep-card-hover); }
|
||||
.beep-post:last-child { border-bottom: 0; }
|
||||
.beep-embed .beep-post:hover { background: var(--beep-card-hover); }
|
||||
.beep-embed .beep-post:last-child { border-bottom: 0; }
|
||||
|
||||
.beep-post-body { flex: 1; min-width: 0; }
|
||||
.beep-embed .beep-post-body { flex: 1; min-width: 0; }
|
||||
|
||||
/* Meta line */
|
||||
.beep-meta {
|
||||
.beep-embed .beep-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
@@ -286,7 +291,7 @@
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.beep-name {
|
||||
.beep-embed .beep-name {
|
||||
font-weight: 700;
|
||||
color: var(--beep-text);
|
||||
white-space: nowrap;
|
||||
@@ -294,19 +299,19 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.beep-name:hover { text-decoration: underline; cursor: pointer; }
|
||||
.beep-embed .beep-name:hover { text-decoration: underline; cursor: pointer; }
|
||||
|
||||
.beep-handle,
|
||||
.beep-dot,
|
||||
.beep-time { color: var(--beep-muted); font-weight: 400; white-space: nowrap; }
|
||||
.beep-embed .beep-handle,
|
||||
.beep-embed .beep-dot,
|
||||
.beep-embed .beep-time { color: var(--beep-muted); font-weight: 400; white-space: nowrap; }
|
||||
|
||||
.beep-time { text-decoration: none; }
|
||||
.beep-time:hover { text-decoration: underline; cursor: pointer; }
|
||||
.beep-embed .beep-time { text-decoration: none; }
|
||||
.beep-embed .beep-time:hover { text-decoration: underline; cursor: pointer; }
|
||||
|
||||
.beep-spacer { flex: 1; }
|
||||
.beep-embed .beep-spacer { flex: 1; }
|
||||
|
||||
/* Verified badge */
|
||||
.beep-verified {
|
||||
.beep-embed .beep-verified {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: var(--beep-accent);
|
||||
@@ -316,7 +321,7 @@
|
||||
}
|
||||
|
||||
/* Post text */
|
||||
.beep-text {
|
||||
.beep-embed .beep-text {
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
color: var(--beep-text);
|
||||
@@ -326,21 +331,21 @@
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.beep-tag, .beep-mention { color: var(--beep-text); text-decoration: none; cursor: pointer; }
|
||||
.beep-tag:hover, .beep-mention:hover { text-decoration: underline; }
|
||||
.beep-embed .beep-tag, .beep-embed .beep-mention { color: var(--beep-text); text-decoration: none; cursor: pointer; }
|
||||
.beep-embed .beep-tag:hover, .beep-embed .beep-mention:hover { text-decoration: underline; }
|
||||
|
||||
.beep-link { color: var(--beep-accent); text-decoration: none; }
|
||||
.beep-link:hover { text-decoration: underline; }
|
||||
.beep-embed .beep-link { color: var(--beep-accent); text-decoration: none; }
|
||||
.beep-embed .beep-link:hover { text-decoration: underline; }
|
||||
|
||||
/* Action bar */
|
||||
.beep-actions {
|
||||
.beep-embed .beep-actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
max-width: 425px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.beep-action {
|
||||
.beep-embed .beep-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
@@ -356,8 +361,8 @@
|
||||
transition: color 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-action svg,
|
||||
.beep-action .beep-icon-svg {
|
||||
.beep-embed .beep-action svg,
|
||||
.beep-embed .beep-action .beep-icon-svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: currentColor;
|
||||
@@ -365,49 +370,49 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.beep-count {
|
||||
.beep-embed .beep-count {
|
||||
font-variant-numeric: tabular-nums;
|
||||
min-width: 20px;
|
||||
}
|
||||
|
||||
/* Reply - blue */
|
||||
.beep-action-reply:hover {
|
||||
.beep-embed .beep-action-reply:hover {
|
||||
color: var(--beep-accent);
|
||||
background: rgba(29, 155, 240, 0.1);
|
||||
}
|
||||
|
||||
/* Retweet - green */
|
||||
.beep-action-retweet:hover {
|
||||
.beep-embed .beep-action-retweet:hover {
|
||||
color: var(--beep-repost);
|
||||
background: rgba(0, 186, 124, 0.1);
|
||||
}
|
||||
|
||||
.beep-action.is-reposted { color: var(--beep-repost); }
|
||||
.beep-embed .beep-action.is-reposted { color: var(--beep-repost); }
|
||||
|
||||
/* Like - pink */
|
||||
.beep-action-like:hover {
|
||||
.beep-embed .beep-action-like:hover {
|
||||
color: var(--beep-like);
|
||||
background: rgba(249, 24, 128, 0.1);
|
||||
}
|
||||
|
||||
.beep-action.is-liked { color: var(--beep-like); }
|
||||
.beep-embed .beep-action.is-liked { color: var(--beep-like); }
|
||||
|
||||
/* Bookmark - blue */
|
||||
.beep-action-bookmark:hover {
|
||||
.beep-embed .beep-action-bookmark:hover {
|
||||
color: var(--beep-accent);
|
||||
background: rgba(29, 155, 240, 0.1);
|
||||
}
|
||||
|
||||
.beep-action.is-bookmarked { color: var(--beep-accent); }
|
||||
.beep-embed .beep-action.is-bookmarked { color: var(--beep-accent); }
|
||||
|
||||
/* Share - blue */
|
||||
.beep-action-share:hover {
|
||||
.beep-embed .beep-action-share:hover {
|
||||
color: var(--beep-accent);
|
||||
background: rgba(29, 155, 240, 0.1);
|
||||
}
|
||||
|
||||
/* Heart pop animation */
|
||||
.beep-action-like.beep-just-liked .beep-icon-filled {
|
||||
.beep-embed .beep-action-like.beep-just-liked .beep-icon-filled {
|
||||
animation: beep-heart-pop 0.55s ease;
|
||||
}
|
||||
|
||||
@@ -419,7 +424,7 @@
|
||||
}
|
||||
|
||||
/* Retweet spin animation */
|
||||
.beep-action-retweet.beep-just-retweeted svg {
|
||||
.beep-embed .beep-action-retweet.beep-just-retweeted svg {
|
||||
animation: beep-retweet-spin 0.4s ease;
|
||||
}
|
||||
|
||||
@@ -430,14 +435,14 @@
|
||||
}
|
||||
|
||||
/* Media */
|
||||
.beep-media-attachments {
|
||||
.beep-embed .beep-media-attachments {
|
||||
margin-top: 12px;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-media-attachments img {
|
||||
.beep-embed .beep-media-attachments img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
@@ -446,7 +451,7 @@
|
||||
}
|
||||
|
||||
/* Image grid */
|
||||
.beep-media-grid {
|
||||
.beep-embed .beep-media-grid {
|
||||
display: grid;
|
||||
gap: 2px;
|
||||
border-radius: 16px;
|
||||
@@ -454,16 +459,16 @@
|
||||
border: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-media-grid-2 { grid-template-columns: 1fr 1fr; }
|
||||
.beep-media-grid-3 .beep-media-grid-item:first-child { grid-column: span 2; }
|
||||
.beep-media-grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
|
||||
.beep-embed .beep-media-grid-2 { grid-template-columns: 1fr 1fr; }
|
||||
.beep-embed .beep-media-grid-3 .beep-media-grid-item:first-child { grid-column: span 2; }
|
||||
.beep-embed .beep-media-grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
|
||||
|
||||
.beep-media-grid-item {
|
||||
.beep-embed .beep-media-grid-item {
|
||||
overflow: hidden;
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
.beep-media-grid-item img {
|
||||
.beep-embed .beep-media-grid-item img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
@@ -471,7 +476,7 @@
|
||||
}
|
||||
|
||||
/* Polls */
|
||||
.beep-poll-container {
|
||||
.beep-embed .beep-poll-container {
|
||||
margin-top: 12px;
|
||||
border: 1px solid var(--beep-border);
|
||||
border-radius: 16px;
|
||||
@@ -479,20 +484,20 @@
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.beep-poll-question {
|
||||
.beep-embed .beep-poll-question {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: var(--beep-text);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.beep-poll-options {
|
||||
.beep-embed .beep-poll-options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.beep-poll-option {
|
||||
.beep-embed .beep-poll-option {
|
||||
border: 1px solid var(--beep-border);
|
||||
border-radius: 9999px;
|
||||
padding: 10px 16px;
|
||||
@@ -506,14 +511,14 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.beep-poll-option:hover {
|
||||
.beep-embed .beep-poll-option:hover {
|
||||
background: var(--beep-card-hover);
|
||||
border-color: var(--beep-muted);
|
||||
}
|
||||
|
||||
.beep-poll-option.is-voted { border-color: var(--beep-accent); }
|
||||
.beep-embed .beep-poll-option.is-voted { border-color: var(--beep-accent); }
|
||||
|
||||
.beep-poll-result {
|
||||
.beep-embed .beep-poll-result {
|
||||
border: 1px solid var(--beep-border);
|
||||
border-radius: 9999px;
|
||||
padding: 10px 16px;
|
||||
@@ -524,7 +529,7 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.beep-poll-result-bar {
|
||||
.beep-embed .beep-poll-result-bar {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
@@ -534,12 +539,12 @@
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.beep-poll-result.is-voted { border-color: var(--beep-accent); }
|
||||
.beep-poll-result-text { position: relative; z-index: 1; }
|
||||
.beep-poll-end { font-size: 13px; color: var(--beep-muted); margin-top: 8px; font-weight: 400; }
|
||||
.beep-embed .beep-poll-result.is-voted { border-color: var(--beep-accent); }
|
||||
.beep-embed .beep-poll-result-text { position: relative; z-index: 1; }
|
||||
.beep-embed .beep-poll-end { font-size: 13px; color: var(--beep-muted); margin-top: 8px; font-weight: 400; }
|
||||
|
||||
/* Quotes */
|
||||
.beep-quoted-container {
|
||||
.beep-embed .beep-quoted-container {
|
||||
margin-top: 12px;
|
||||
border: 1px solid var(--beep-border);
|
||||
border-radius: 16px;
|
||||
@@ -547,13 +552,13 @@
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.beep-quoted-post { text-decoration: none; color: inherit; }
|
||||
.beep-quoted-post:hover { text-decoration: none; }
|
||||
.beep-embed .beep-quoted-post { text-decoration: none; color: inherit; }
|
||||
.beep-embed .beep-quoted-post:hover { text-decoration: none; }
|
||||
|
||||
.beep-quoted-meta { font-size: 13px; color: var(--beep-muted); margin-bottom: 4px; }
|
||||
.beep-quoted-meta .beep-name { font-weight: 700; }
|
||||
.beep-embed .beep-quoted-meta { font-size: 13px; color: var(--beep-muted); margin-bottom: 4px; }
|
||||
.beep-embed .beep-quoted-meta .beep-name { font-weight: 700; }
|
||||
|
||||
.beep-quoted-text {
|
||||
.beep-embed .beep-quoted-text {
|
||||
font-size: 14px;
|
||||
color: var(--beep-text);
|
||||
line-height: 1.4;
|
||||
@@ -565,7 +570,7 @@
|
||||
}
|
||||
|
||||
/* Voice note */
|
||||
.beep-voice-note {
|
||||
.beep-embed .beep-voice-note {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -576,7 +581,7 @@
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.beep-voice-play {
|
||||
.beep-embed .beep-voice-play {
|
||||
background: var(--beep-accent);
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
@@ -590,9 +595,9 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.beep-voice-play svg { width: 14px; height: 14px; fill: #fff; }
|
||||
.beep-embed .beep-voice-play svg { width: 14px; height: 14px; fill: #fff; }
|
||||
|
||||
.beep-voice-waveform {
|
||||
.beep-embed .beep-voice-waveform {
|
||||
flex: 1;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
@@ -600,7 +605,7 @@
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.beep-voice-bar {
|
||||
.beep-embed .beep-voice-bar {
|
||||
width: 3px;
|
||||
height: 100%;
|
||||
background: var(--beep-accent);
|
||||
@@ -608,17 +613,17 @@
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.beep-voice-duration { font-size: 13px; color: var(--beep-muted); font-variant-numeric: tabular-nums; }
|
||||
.beep-embed .beep-voice-duration { font-size: 13px; color: var(--beep-muted); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* Replies */
|
||||
.beep-replies {
|
||||
.beep-embed .beep-replies {
|
||||
margin-top: 8px;
|
||||
padding-left: 0;
|
||||
border-left: 2px solid var(--beep-border);
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
.beep-reply {
|
||||
.beep-embed .beep-reply {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding: 10px 16px;
|
||||
@@ -627,14 +632,14 @@
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-reply:last-child { border-bottom: 0; }
|
||||
.beep-reply-body { flex: 1; min-width: 0; }
|
||||
.beep-reply .beep-text { font-size: 14px; margin-bottom: 0; }
|
||||
.beep-reply .beep-meta { font-size: 13px; margin-bottom: 0; }
|
||||
.beep-reply .beep-avatar { width: 36px !important; height: 36px !important; min-width: 36px !important; max-width: 36px !important; }
|
||||
.beep-embed .beep-reply:last-child { border-bottom: 0; }
|
||||
.beep-embed .beep-reply-body { flex: 1; min-width: 0; }
|
||||
.beep-embed .beep-reply .beep-text { font-size: 14px; margin-bottom: 0; }
|
||||
.beep-embed .beep-reply .beep-meta { font-size: 13px; margin-bottom: 0; }
|
||||
.beep-embed .beep-reply .beep-avatar { width: 36px !important; height: 36px !important; min-width: 36px !important; max-width: 36px !important; }
|
||||
|
||||
/* Reply form */
|
||||
.beep-reply-form {
|
||||
.beep-embed .beep-reply-form {
|
||||
margin-top: 8px;
|
||||
padding: 12px 16px;
|
||||
border-top: 1px solid var(--beep-border);
|
||||
@@ -645,10 +650,10 @@
|
||||
background: var(--beep-bg);
|
||||
}
|
||||
|
||||
.beep-reply-form[hidden] { display: none; }
|
||||
.beep-reply-form-body { flex: 1; min-width: 0; }
|
||||
.beep-embed .beep-reply-form[hidden] { display: none; }
|
||||
.beep-embed .beep-reply-form-body { flex: 1; min-width: 0; }
|
||||
|
||||
.beep-feed .beep-reply-input {
|
||||
.beep-embed .beep-feed .beep-reply-input {
|
||||
width: 100% !important;
|
||||
border: 0 !important;
|
||||
outline: 0 !important;
|
||||
@@ -663,9 +668,9 @@
|
||||
caret-color: var(--beep-accent);
|
||||
}
|
||||
|
||||
.beep-feed .beep-reply-input::placeholder { color: var(--beep-muted) !important; }
|
||||
.beep-embed .beep-feed .beep-reply-input::placeholder { color: var(--beep-muted) !important; }
|
||||
|
||||
.beep-reply-footer {
|
||||
.beep-embed .beep-reply-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
@@ -673,7 +678,7 @@
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
.beep-new { animation: beep-slide-in 0.3s ease; }
|
||||
.beep-embed .beep-new { animation: beep-slide-in 0.3s ease; }
|
||||
|
||||
@keyframes beep-slide-in {
|
||||
from { opacity: 0; transform: translateY(-8px); }
|
||||
@@ -681,7 +686,7 @@
|
||||
}
|
||||
|
||||
/* Post badge */
|
||||
.beep-post-badge {
|
||||
.beep-embed .beep-post-badge {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
flex-shrink: 0;
|
||||
@@ -689,24 +694,24 @@
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.beep-post-badge:hover { opacity: 0.8; cursor: pointer; }
|
||||
.beep-embed .beep-post-badge:hover { opacity: 0.8; cursor: pointer; }
|
||||
|
||||
/* Loading */
|
||||
.beep-loading { opacity: 0.5; pointer-events: none; }
|
||||
.beep-embed .beep-loading { opacity: 0.5; pointer-events: none; }
|
||||
|
||||
/* Mobile */
|
||||
@media (max-width: 640px) {
|
||||
.beep-feed { margin: 0; border-left: 0; border-right: 0; }
|
||||
.beep-post { padding: 12px 16px; }
|
||||
.beep-actions { max-width: none; }
|
||||
.beep-compose { padding: 12px 16px; }
|
||||
.beep-feed-header { padding: 12px 16px; }
|
||||
.beep-embed .beep-feed { margin: 0; border-left: 0; border-right: 0; }
|
||||
.beep-embed .beep-post { padding: 12px 16px; }
|
||||
.beep-embed .beep-actions { max-width: none; }
|
||||
.beep-embed .beep-compose { padding: 12px 16px; }
|
||||
.beep-embed .beep-feed-header { padding: 12px 16px; }
|
||||
}
|
||||
|
||||
/* Delete */
|
||||
.beep-delete-row { display: flex; justify-content: flex-end; margin-top: 6px; }
|
||||
.beep-embed .beep-delete-row { display: flex; justify-content: flex-end; margin-top: 6px; }
|
||||
|
||||
.beep-delete-link {
|
||||
.beep-embed .beep-delete-link {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: var(--beep-muted);
|
||||
@@ -718,15 +723,15 @@
|
||||
transition: color 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-delete-link:hover { color: #F4212E; background: rgba(244, 33, 46, 0.1); }
|
||||
.beep-embed .beep-delete-link:hover { color: #F4212E; background: rgba(244, 33, 46, 0.1); }
|
||||
|
||||
/* Notice */
|
||||
.beep-notice { padding: 14px 20px; border-bottom: 1px solid var(--beep-border); font-size: 14px; }
|
||||
.beep-notice p { margin: 0; color: var(--beep-muted); }
|
||||
.beep-notice-banned { color: #F4212E; font-style: italic; }
|
||||
.beep-embed .beep-notice { padding: 14px 20px; border-bottom: 1px solid var(--beep-border); font-size: 14px; }
|
||||
.beep-embed .beep-notice p { margin: 0; color: var(--beep-muted); }
|
||||
.beep-embed .beep-notice-banned { color: #F4212E; font-style: italic; }
|
||||
|
||||
/* Header post button */
|
||||
.beep-post-btn-header {
|
||||
.beep-embed .beep-post-btn-header {
|
||||
background: var(--beep-accent);
|
||||
color: #fff;
|
||||
border: 0;
|
||||
@@ -739,11 +744,11 @@
|
||||
transition: background-color 0.15s ease, transform 0.1s ease;
|
||||
}
|
||||
|
||||
.beep-post-btn-header:hover { background: var(--beep-accent-hover); }
|
||||
.beep-post-btn-header:active { transform: scale(0.96); }
|
||||
.beep-embed .beep-post-btn-header:hover { background: var(--beep-accent-hover); }
|
||||
.beep-embed .beep-post-btn-header:active { transform: scale(0.96); }
|
||||
|
||||
/* Back link */
|
||||
.beep-back-link {
|
||||
.beep-embed .beep-back-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
@@ -757,11 +762,11 @@
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-back-link:hover { background: var(--beep-card-hover); color: var(--beep-text); text-decoration: none; }
|
||||
.beep-back-link svg { width: 20px; height: 20px; fill: currentColor; }
|
||||
.beep-embed .beep-back-link:hover { background: var(--beep-card-hover); color: var(--beep-text); text-decoration: none; }
|
||||
.beep-embed .beep-back-link svg { width: 20px; height: 20px; fill: currentColor; }
|
||||
|
||||
/* Thread modal */
|
||||
.beep-thread-modal {
|
||||
.beep-embed .beep-thread-modal {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
@@ -772,9 +777,9 @@
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.beep-thread-modal[hidden] { display: none; }
|
||||
.beep-embed .beep-thread-modal[hidden] { display: none; }
|
||||
|
||||
.beep-thread-content {
|
||||
.beep-embed .beep-thread-content {
|
||||
background: var(--beep-card-bg);
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
@@ -784,7 +789,7 @@
|
||||
border-right: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-thread-header {
|
||||
.beep-embed .beep-thread-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
@@ -796,7 +801,7 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.beep-thread-close {
|
||||
.beep-embed .beep-thread-close {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: var(--beep-text);
|
||||
@@ -811,12 +816,12 @@
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-thread-close:hover { background: var(--beep-card-hover); }
|
||||
.beep-thread-close svg { width: 20px; height: 20px; fill: currentColor; }
|
||||
.beep-thread-title { font-size: 18px; font-weight: 700; color: var(--beep-text); }
|
||||
.beep-embed .beep-thread-close:hover { background: var(--beep-card-hover); }
|
||||
.beep-embed .beep-thread-close svg { width: 20px; height: 20px; fill: currentColor; }
|
||||
.beep-embed .beep-thread-title { font-size: 18px; font-weight: 700; color: var(--beep-text); }
|
||||
|
||||
/* Tooltip */
|
||||
.beep-tip {
|
||||
.beep-embed .beep-tip {
|
||||
position: absolute;
|
||||
margin-left: 8px;
|
||||
padding: 4px 10px;
|
||||
@@ -838,14 +843,14 @@
|
||||
}
|
||||
|
||||
/* GIF */
|
||||
.beep-gif-embed {
|
||||
.beep-embed .beep-gif-embed {
|
||||
margin-top: 12px;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--beep-border);
|
||||
}
|
||||
|
||||
.beep-gif-embed img {
|
||||
.beep-embed .beep-gif-embed img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 400px;
|
||||
@@ -856,22 +861,22 @@
|
||||
}
|
||||
|
||||
/* Profile header */
|
||||
.beep-profile-header { padding: 16px 20px; border-bottom: 1px solid var(--beep-border); }
|
||||
.beep-profile-name { font-size: 20px; font-weight: 800; color: var(--beep-text); margin-bottom: 2px; }
|
||||
.beep-profile-meta { font-size: 14px; color: var(--beep-muted); }
|
||||
.beep-profile-stats { display: flex; gap: 20px; margin-top: 12px; }
|
||||
.beep-profile-stat { color: var(--beep-muted); font-size: 14px; cursor: pointer; }
|
||||
.beep-profile-stat:hover { text-decoration: underline; }
|
||||
.beep-profile-stat strong { color: var(--beep-text); font-weight: 700; }
|
||||
.beep-embed .beep-profile-header { padding: 16px 20px; border-bottom: 1px solid var(--beep-border); }
|
||||
.beep-embed .beep-profile-name { font-size: 20px; font-weight: 800; color: var(--beep-text); margin-bottom: 2px; }
|
||||
.beep-embed .beep-profile-meta { font-size: 14px; color: var(--beep-muted); }
|
||||
.beep-embed .beep-profile-stats { display: flex; gap: 20px; margin-top: 12px; }
|
||||
.beep-embed .beep-profile-stat { color: var(--beep-muted); font-size: 14px; cursor: pointer; }
|
||||
.beep-embed .beep-profile-stat:hover { text-decoration: underline; }
|
||||
.beep-embed .beep-profile-stat strong { color: var(--beep-text); font-weight: 700; }
|
||||
|
||||
/* Tabs */
|
||||
.beep-tabs {
|
||||
.beep-embed .beep-tabs {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--beep-border);
|
||||
background: var(--beep-card-bg);
|
||||
}
|
||||
|
||||
.beep-tab {
|
||||
.beep-embed .beep-tab {
|
||||
flex: 1;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
@@ -885,9 +890,9 @@
|
||||
transition: background-color 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
|
||||
.beep-tab:hover { background: var(--beep-card-hover); color: var(--beep-text); }
|
||||
.beep-tab.is-active { color: var(--beep-text); }
|
||||
.beep-tab.is-active::after {
|
||||
.beep-embed .beep-tab:hover { background: var(--beep-card-hover); color: var(--beep-text); }
|
||||
.beep-embed .beep-tab.is-active { color: var(--beep-text); }
|
||||
.beep-embed .beep-tab.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
@@ -900,28 +905,28 @@
|
||||
}
|
||||
|
||||
/* Focus */
|
||||
.beep-feed .beep-input:focus,
|
||||
.beep-feed .beep-input:focus-visible,
|
||||
.beep-feed .beep-reply-input:focus,
|
||||
.beep-feed .beep-reply-input:focus-visible {
|
||||
.beep-embed .beep-feed .beep-input:focus,
|
||||
.beep-embed .beep-feed .beep-input:focus-visible,
|
||||
.beep-embed .beep-feed .beep-reply-input:focus,
|
||||
.beep-embed .beep-feed .beep-reply-input:focus-visible {
|
||||
outline: 0 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.beep-feed .beep-compose:focus-within { background: rgba(29, 155, 240, 0.03); }
|
||||
.beep-embed .beep-feed .beep-compose:focus-within { background: rgba(29, 155, 240, 0.03); }
|
||||
|
||||
/* Hidden */
|
||||
[hidden] { display: none !important; }
|
||||
.beep-embed [hidden] { display: none !important; }
|
||||
|
||||
|
||||
/* Magic Login Form */
|
||||
.beep-magic-login {
|
||||
.beep-embed .beep-magic-login {
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.beep-magic-login-card {
|
||||
.beep-embed .beep-magic-login-card {
|
||||
background: #192734;
|
||||
border-radius: 16px;
|
||||
padding: 32px;
|
||||
@@ -930,34 +935,34 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.beep-magic-login-header {
|
||||
.beep-embed .beep-magic-login-header {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.beep-magic-login-header svg {
|
||||
.beep-embed .beep-magic-login-header svg {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.beep-magic-login-header h3 {
|
||||
.beep-embed .beep-magic-login-header h3 {
|
||||
color: #E7E9EA;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
.beep-magic-login-header p {
|
||||
.beep-embed .beep-magic-login-header p {
|
||||
color: #71767B;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.beep-magic-login-form {
|
||||
.beep-embed .beep-magic-login-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.beep-magic-email {
|
||||
.beep-embed .beep-magic-email {
|
||||
width: 100%;
|
||||
padding: 12px 16px;
|
||||
background: #22303C;
|
||||
@@ -968,16 +973,16 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.beep-magic-email:focus {
|
||||
.beep-embed .beep-magic-email:focus {
|
||||
outline: none;
|
||||
border-color: #1D9BF0;
|
||||
}
|
||||
|
||||
.beep-magic-email::placeholder {
|
||||
.beep-embed .beep-magic-email::placeholder {
|
||||
color: #71767B;
|
||||
}
|
||||
|
||||
.beep-button.beep-magic-submit {
|
||||
.beep-embed .beep-button.beep-magic-submit {
|
||||
width: 100%;
|
||||
padding: 12px 24px;
|
||||
background: #1D9BF0;
|
||||
@@ -990,16 +995,16 @@
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.beep-button.beep-magic-submit:hover {
|
||||
.beep-embed .beep-button.beep-magic-submit:hover {
|
||||
background: #1A8CD8;
|
||||
}
|
||||
|
||||
.beep-button.beep-magic-submit:disabled {
|
||||
.beep-embed .beep-button.beep-magic-submit:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.beep-magic-success {
|
||||
.beep-embed .beep-magic-success {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -1011,7 +1016,7 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.beep-magic-error {
|
||||
.beep-embed .beep-magic-error {
|
||||
padding: 12px;
|
||||
background: rgba(224, 36, 94, 0.1);
|
||||
border-radius: 8px;
|
||||
@@ -1021,7 +1026,7 @@
|
||||
}
|
||||
|
||||
/* Public feed notice */
|
||||
.beep-public-notice {
|
||||
.beep-embed .beep-public-notice {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -1033,11 +1038,11 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.beep-public-notice a {
|
||||
.beep-embed .beep-public-notice a {
|
||||
color: #1D9BF0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.beep-public-notice a:hover {
|
||||
.beep-embed .beep-public-notice a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
/* Beep — Twitter-style microblog frontend */
|
||||
var url = `https://api.giphy.com/v1/gifs/search?api_key=${apiKey}&q=${encodeURIComponent(query)}&limit=30&rating=g`;/* Beep — Twitter-style microblog frontend */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
@@ -44,16 +44,16 @@
|
||||
var content = input.value.trim();
|
||||
if (!content) return;
|
||||
button.disabled = true;
|
||||
fetch(config.restUrl + 'post', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', 'X-WP-Nonce': config.nonce },
|
||||
credentials: 'same-origin',
|
||||
var quotedPost = compose._beepQuotedPost;
|
||||
var gifUrl = compose._beepGifUrl;
|
||||
var payload = { content: content };
|
||||
if (quotedPost && quotedPost.id) payload.quote_id = quotedPost.id;
|
||||
if (gifUrl) payload.gif_url = gifUrl;
|
||||
|
||||
fetch(config.restUrl + 'post', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', 'X-WP-Nonce': config.nonce },
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify(payload)
|
||||
})
|
||||
.then(handleResponse)
|
||||
@@ -799,7 +799,7 @@
|
||||
grid.innerHTML = '<p style="padding:20px;text-align:center;color:var(--beep-text-secondary);">Searching...</p>';
|
||||
|
||||
var apiKey = (window.BeepConfig && window.BeepConfig.giphyKey) || GIPHY_API_KEY;
|
||||
var url = 'https://api.giphy.com/v1/gifs/search?api_key=' + apiKey + '&q=' + encodeURIComponent(query) + '&limit=30&rating=g';
|
||||
var url = `https://api.giphy.com/v1/gifs/search?api_key=${apiKey}&q=${encodeURIComponent(query)}&limit=30&rating=g`;
|
||||
|
||||
fetch(url)
|
||||
.then(function(res) { return res.json(); })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Beep
|
||||
* Description: A Twitter-style microblog for WordPress, with likes, replies, polls, and Gravatars. Use the [beep_feed] shortcode on any page.
|
||||
* Description: A Twitter-style microblog for WordPress, with likes, replies, and Gravatars. Use the [beep_feed] shortcode on any page.
|
||||
* Version: 1.6.0
|
||||
* Requires at least: 6.0
|
||||
* Requires PHP: 7.4
|
||||
@@ -10,32 +10,30 @@
|
||||
* Text Domain: beep
|
||||
*/
|
||||
|
||||
if (!defined("ABSPATH")) {
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define("BEEP_VERSION", "1.6.0");
|
||||
define("BEEP_FILE", __FILE__);
|
||||
define("BEEP_DIR", plugin_dir_path(__FILE__));
|
||||
define("BEEP_URL", plugin_dir_url(__FILE__));
|
||||
define("BEEP_LIKES_TABLE", "beep_likes");
|
||||
define("BEEP_CHAR_LIMIT", 280);
|
||||
define('BEEP_VERSION', '1.6.0');
|
||||
define('BEEP_FILE', __FILE__);
|
||||
define('BEEP_DIR', plugin_dir_path(__FILE__));
|
||||
define('BEEP_URL', plugin_dir_url(__FILE__));
|
||||
define('BEEP_LIKES_TABLE', 'beep_likes');
|
||||
define('BEEP_CHAR_LIMIT', 280);
|
||||
|
||||
require_once BEEP_DIR . "includes/helpers.php";
|
||||
require_once BEEP_DIR . "includes/class-cpt.php";
|
||||
require_once BEEP_DIR . "includes/class-likes.php";
|
||||
require_once BEEP_DIR . "includes/class-replies.php";
|
||||
require_once BEEP_DIR . "includes/class-moderation.php";
|
||||
require_once BEEP_DIR . "includes/class-media.php";
|
||||
require_once BEEP_DIR . "includes/class-quotes.php";
|
||||
require_once BEEP_DIR . "includes/class-polls.php";
|
||||
require_once BEEP_DIR . "includes/class-follows.php";
|
||||
require_once BEEP_DIR . "includes/class-shortcode.php";
|
||||
require_once BEEP_DIR . "includes/class-magic-links.php";
|
||||
require_once BEEP_DIR . "includes/class-beep.php";
|
||||
require_once BEEP_DIR . 'includes/helpers.php';
|
||||
require_once BEEP_DIR . 'includes/class-cpt.php';
|
||||
require_once BEEP_DIR . 'includes/class-likes.php';
|
||||
require_once BEEP_DIR . 'includes/class-replies.php';
|
||||
require_once BEEP_DIR . 'includes/class-moderation.php';
|
||||
require_once BEEP_DIR . 'includes/class-media.php';
|
||||
require_once BEEP_DIR . 'includes/class-quotes.php';
|
||||
require_once BEEP_DIR . 'includes/class-polls.php';
|
||||
require_once BEEP_DIR . 'includes/class-shortcode.php';
|
||||
require_once BEEP_DIR . 'includes/class-settings.php';
|
||||
require_once BEEP_DIR . 'includes/class-beep.php';
|
||||
|
||||
register_activation_hook(__FILE__, ["Beep_Plugin", "activate"]);
|
||||
register_deactivation_hook(__FILE__, ["Beep_Plugin", "deactivate"]);
|
||||
register_activation_hook(__FILE__, ['Beep_Plugin', 'activate']);
|
||||
register_deactivation_hook(__FILE__, ['Beep_Plugin', 'deactivate']);
|
||||
|
||||
add_action("plugins_loaded", ["Beep_Plugin", "init"]);
|
||||
Beep_Magic_Links::init();
|
||||
add_action('plugins_loaded', ['Beep_Plugin', 'init']);
|
||||
|
||||
+59
-1
@@ -14,13 +14,68 @@ class Beep_Plugin {
|
||||
Beep_Shortcode::init();
|
||||
|
||||
add_action('wp_enqueue_scripts', [__CLASS__, 'enqueue_assets']);
|
||||
|
||||
// Set default Giphy API key if not already set
|
||||
if (!get_option('beep_giphy_key')) {
|
||||
update_option('beep_giphy_key', 'xuxYxuIvzPqw5tPB4laa7sQO8dFtSlNS');
|
||||
}
|
||||
|
||||
// Elementor widget
|
||||
add_action('elementor/widgets/register', function ($widgets_manager) {
|
||||
require_once BEEP_DIR . 'includes/class-elementor-widget.php';
|
||||
$widgets_manager->register(new \Elementor\Beep_Elementor_Widget());
|
||||
});
|
||||
|
||||
// Admin settings (Giphy API key only — full settings via Beep_Settings)
|
||||
add_action('admin_menu', [__CLASS__, 'add_admin_menu']);
|
||||
add_action('admin_init', [__CLASS__, 'register_settings']);
|
||||
}
|
||||
|
||||
public static function add_admin_menu() {
|
||||
add_options_page(
|
||||
'Beep Settings',
|
||||
'Beep',
|
||||
'manage_options',
|
||||
'beep-settings',
|
||||
[__CLASS__, 'render_settings_page']
|
||||
);
|
||||
}
|
||||
|
||||
public static function register_settings() {
|
||||
register_setting('beep_settings_group', 'beep_giphy_key', [
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
]);
|
||||
add_settings_section('beep_main_section', 'API Configuration', null, 'beep-settings');
|
||||
add_settings_field(
|
||||
'beep_giphy_key',
|
||||
'Giphy API Key',
|
||||
[__CLASS__, 'giphy_key_field'],
|
||||
'beep-settings',
|
||||
'beep_main_section',
|
||||
['label_for' => 'beep_giphy_key']
|
||||
);
|
||||
}
|
||||
|
||||
public static function giphy_key_field() {
|
||||
$key = get_option('beep_giphy_key', '');
|
||||
echo '<input type="text" id="beep_giphy_key" name="beep_giphy_key" value="' . esc_attr($key) . '" class="regular-text" placeholder="Enter your Giphy API key">';
|
||||
echo '<p class="description">Get a free API key at <a href="https://developers.giphy.com/" target="_blank">developers.giphy.com</a></p>';
|
||||
}
|
||||
|
||||
public static function render_settings_page() {
|
||||
if (!current_user_can('manage_options')) return;
|
||||
echo '<div class="wrap"><h1>Beep Settings</h1>';
|
||||
echo '<form method="post" action="options.php">';
|
||||
settings_fields('beep_settings_group');
|
||||
do_settings_sections('beep-settings');
|
||||
submit_button();
|
||||
echo '</form></div>';
|
||||
}
|
||||
|
||||
public static function activate() {
|
||||
Beep_CPT::register();
|
||||
Beep_Likes::create_table();
|
||||
Beep_Polls::create_tables();
|
||||
Beep_Magic_Links::create_table();
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
|
||||
@@ -42,12 +97,15 @@ class Beep_Plugin {
|
||||
BEEP_VERSION,
|
||||
true
|
||||
);
|
||||
$giphy_key = get_option('beep_giphy_key', '');
|
||||
|
||||
wp_localize_script('beep', 'BeepConfig', [
|
||||
'restUrl' => esc_url_raw(rest_url('beep/v1/')),
|
||||
'nonce' => wp_create_nonce('wp_rest'),
|
||||
'charLimit' => BEEP_CHAR_LIMIT,
|
||||
'loginUrl' => esc_url_raw(wp_login_url(is_singular() ? get_permalink() : home_url('/'))),
|
||||
'isLoggedIn' => is_user_logged_in(),
|
||||
'giphyKey' => $giphy_key,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* Beep Elementor Widget
|
||||
* Drag-and-drop Elementor widget for the Beep feed.
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (did_action('elementor/core')) {
|
||||
return;
|
||||
}
|
||||
|
||||
class Beep_Elementor_Widget extends \Elementor\Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'beep-feed';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return 'Beep Feed';
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eicon-social-icons';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return ['general'];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'section_feed',
|
||||
['label' => 'Feed Settings']
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'header',
|
||||
[
|
||||
'label' => 'Header Title',
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => 'Beep',
|
||||
'description' => 'Text shown in the feed header. Leave empty to show the wordmark logo.',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'show_wordmark',
|
||||
[
|
||||
'label' => 'Show Wordmark Logo',
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'sort',
|
||||
[
|
||||
'label' => 'Default Sort',
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => [
|
||||
'latest' => 'Latest First',
|
||||
'top' => 'Top / Most Liked',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'limit',
|
||||
[
|
||||
'label' => 'Posts Per Page',
|
||||
'type' => \Elementor\Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
'default' => 20,
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_style',
|
||||
['label' => 'Appearance']
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'feed_typography',
|
||||
'label' => 'Feed Typography',
|
||||
'selector' => '{{WRAPPER}} .beep-feed',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'card_radius',
|
||||
[
|
||||
'label' => 'Card Border Radius',
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => ['px' => ['min' => 0, 'max' => 32]],
|
||||
'default' => ['unit' => 'px', 'size' => 0],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .beep-post' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
$atts = [
|
||||
'header' => $settings['header'] ?: 'Beep',
|
||||
'show_wordmark' => $settings['show_wordmark'] ? '1' : '0',
|
||||
'sort' => $settings['sort'],
|
||||
'limit' => (int) $settings['limit'],
|
||||
];
|
||||
|
||||
echo Beep_Shortcode::render_beep_feed($atts);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,7 @@ class Beep_Shortcode {
|
||||
ob_start();
|
||||
?>
|
||||
<div class="beep-feed" data-beep-feed>
|
||||
<div class="beep-embed">
|
||||
<div class="beep-feed-header">
|
||||
<?php if (!empty($atts['show_wordmark'])): ?>
|
||||
<?php echo beep_logo_svg(); ?>
|
||||
@@ -137,8 +138,9 @@ class Beep_Shortcode {
|
||||
echo '<div class="beep-empty">No beeps yet.</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .beep-list -->
|
||||
</div><!-- .beep-embed -->
|
||||
</div><!-- .beep-feed -->
|
||||
<?php
|
||||
// Output BeepConfig and beep.js inline since wp_enqueue_scripts isn't working
|
||||
$beep_config = sprintf(
|
||||
|
||||
+16
-51
@@ -7,8 +7,9 @@ if (!defined('ABSPATH')) {
|
||||
* Wordmark (bird + "Beep!") shown at the top of the feed.
|
||||
*/
|
||||
function beep_logo_svg() {
|
||||
$src = esc_url(BEEP_URL . 'assets/beep-wordmark.jpg');
|
||||
return '<span class="beep-logo-wrap"><span class="beep-logo-text">Messages from</span><img class="beep-logo" src="' . $src . '" alt="Beep"></span>';
|
||||
$logo_url = Beep_Settings::get('logo_url');
|
||||
$src = esc_url($logo_url ?: BEEP_URL . 'assets/beep-wordmark.png');
|
||||
return '<img class="beep-logo" src="' . $src . '" alt="Beep">';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +153,7 @@ function beep_render_post($post) {
|
||||
datetime="<?php echo esc_attr($time_iso); ?>"
|
||||
title="<?php echo esc_attr($time_full); ?>"><?php echo esc_html($time); ?></time>
|
||||
<span class="beep-spacer"></span>
|
||||
<img class="beep-post-badge" src="<?php echo esc_url(BEEP_URL . 'assets/beep-icon.png'); ?>" alt="" width="32" height="32">
|
||||
<img class="beep-post-badge" src="<?php echo esc_url(Beep_Settings::get('icon_url') ?: BEEP_URL . 'assets/beep-icon.png'); ?>" alt="" style="--beep-badge-size:32px;width:var(--beep-badge-size);height:var(--beep-badge-size);">
|
||||
</div>
|
||||
<div class="beep-text"><?php echo $content; ?></div>
|
||||
<?php if (!empty($beep_images)) : ?>
|
||||
@@ -241,12 +242,6 @@ function beep_render_post($post) {
|
||||
<?php echo beep_icon('reply'); ?>
|
||||
<span class="beep-count" data-beep-reply-count><?php echo $reply_count > 0 ? esc_html($reply_count) : ''; ?></span>
|
||||
</button>
|
||||
<button class="beep-action beep-action-retweet"
|
||||
data-beep-retweet-post="<?php echo (int) $post->ID; ?>"
|
||||
type="button"
|
||||
title="Repost">
|
||||
<?php echo beep_icon('retweet'); ?>
|
||||
</button>
|
||||
<button class="beep-action beep-action-like<?php echo $user_liked ? ' is-liked' : ''; ?>"
|
||||
data-beep-like-post="<?php echo (int) $post->ID; ?>"
|
||||
type="button"
|
||||
@@ -255,19 +250,23 @@ function beep_render_post($post) {
|
||||
<span class="beep-icon-filled"><?php echo beep_icon('heart_filled'); ?></span>
|
||||
<span class="beep-count" data-beep-like-count><?php echo $like_count > 0 ? esc_html($like_count) : ''; ?></span>
|
||||
</button>
|
||||
<button class="beep-action beep-action-bookmark"
|
||||
data-beep-bookmark-post="<?php echo (int) $post->ID; ?>"
|
||||
type="button"
|
||||
title="Bookmark">
|
||||
<?php echo beep_icon('bookmark'); ?>
|
||||
</button>
|
||||
<a href="#" class="beep-action beep-action-conversation"
|
||||
data-beep-thread="<?php echo (int) $post->ID; ?>"
|
||||
title="View conversation">
|
||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"/></svg>
|
||||
</a>
|
||||
<button class="beep-action beep-action-share"
|
||||
data-beep-share="<?php echo esc_url(get_permalink($post->ID)); ?>"
|
||||
type="button"
|
||||
title="Share">
|
||||
title="Copy link">
|
||||
<?php echo beep_icon('share'); ?>
|
||||
</button>
|
||||
</div>
|
||||
<a href="#" class="beep-action beep-action-quote"
|
||||
data-beep-quote="<?php echo (int) $post->ID; ?>"
|
||||
title="Quote">
|
||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M8 5H6v2H4v12h2v-2h2v2h8V9h-2V7h-2v2H8V5zm10 0v2h2v12h-2v-2h-2v2H8V9h2v2h2V7h2V5h2z"/></svg>
|
||||
</a>
|
||||
<?php if ($can_delete) : ?>
|
||||
<div class="beep-delete-row">
|
||||
<button class="beep-delete-link"
|
||||
@@ -376,7 +375,7 @@ function beep_render_reply($comment, $all_comments = [], $depth = 0, $post_id =
|
||||
<span class="beep-dot">·</span>
|
||||
<time class="beep-time" datetime="<?php echo esc_attr($time_iso); ?>"><?php echo esc_html($time); ?></time>
|
||||
<span class="beep-spacer"></span>
|
||||
<img class="beep-post-badge beep-post-badge-sm" src="<?php echo esc_url(BEEP_URL . 'assets/beep-icon.png'); ?>" alt="" width="24" height="24">
|
||||
<img class="beep-post-badge beep-post-badge-sm" src="<?php echo esc_url(Beep_Settings::get('icon_url') ?: BEEP_URL . 'assets/beep-icon.png'); ?>" alt="" style="--beep-badge-size:24px;width:var(--beep-badge-size);height:var(--beep-badge-size);">
|
||||
</div>
|
||||
<div class="beep-text"><?php echo $content; ?></div>
|
||||
|
||||
@@ -520,37 +519,3 @@ function beep_render_gif_modal() {
|
||||
'<div class="beep-gif-grid" data-beep-gif-grid></div>' .
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
function beep_render_public_feed($posts, $atts) {
|
||||
ob_start();
|
||||
?>
|
||||
<div class="beep-feed" data-beep-feed>
|
||||
<div class="beep-feed-header">
|
||||
<?php if (!empty($atts['show_wordmark'])): ?>
|
||||
<?php echo beep_logo_svg(); ?>
|
||||
<?php else: ?>
|
||||
<span class="beep-feed-header-text"><?php echo esc_html($atts['header']); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="beep-public-notice">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
|
||||
<path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
|
||||
</svg>
|
||||
<span><a href="<?php echo wp_login_url(); ?>">Sign in</a> to post</span>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($posts)): ?>
|
||||
<div class="beep-posts">
|
||||
<?php foreach ($posts as $post): ?>
|
||||
<?php echo beep_render_post($post); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="beep-empty">No beeps yet.</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user