mirror of
https://github.com/davegallant/rfd-fyi.git
synced 2026-03-04 10:06:35 +00:00
Compare commits
1 Commits
089f8bc719
...
bbec670b85
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbec670b85 |
@@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io/ioutil"
|
||||||
"math/rand/v2"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -82,47 +82,10 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) {
|
|||||||
// @Summary Lists all topics stored in the database
|
// @Summary Lists all topics stored in the database
|
||||||
// @Description All topics will be listed. There is currently no pagination implemented.
|
// @Description All topics will be listed. There is currently no pagination implemented.
|
||||||
// @ID list-topics
|
// @ID list-topics
|
||||||
// @Param filters query string false "JSON array of filter strings"
|
|
||||||
// @Router /topics [get]
|
// @Router /topics [get]
|
||||||
// @Success 200 {array} Topic
|
// @Success 200 {array} Topic
|
||||||
func (a *App) listTopics(w http.ResponseWriter, r *http.Request) {
|
func (a *App) listTopics(w http.ResponseWriter, r *http.Request) {
|
||||||
filtersParam := r.URL.Query().Get("filters")
|
respondWithJSON(w, http.StatusOK, a.CurrentTopics)
|
||||||
|
|
||||||
if filtersParam == "" {
|
|
||||||
respondWithJSON(w, http.StatusOK, a.CurrentTopics)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var filters []string
|
|
||||||
err := json.Unmarshal([]byte(filtersParam), &filters)
|
|
||||||
if err != nil {
|
|
||||||
log.Warn().Msgf("could not parse filters parameter: %s", err)
|
|
||||||
respondWithJSON(w, http.StatusOK, a.CurrentTopics)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(filters) == 0 {
|
|
||||||
respondWithJSON(w, http.StatusOK, a.CurrentTopics)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter topics
|
|
||||||
var filteredTopics []Topic
|
|
||||||
for _, topic := range a.CurrentTopics {
|
|
||||||
searchText := strings.ToLower(topic.Title + " [" + topic.Offer.DealerName + "]")
|
|
||||||
matchesAll := true
|
|
||||||
for _, filter := range filters {
|
|
||||||
if !strings.Contains(searchText, strings.ToLower(filter)) {
|
|
||||||
matchesAll = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if matchesAll {
|
|
||||||
filteredTopics = append(filteredTopics, topic)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
respondWithJSON(w, http.StatusOK, filteredTopics)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getTopicDetails godoc
|
// getTopicDetails godoc
|
||||||
@@ -160,7 +123,7 @@ func (a *App) getTopicDetails(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
body, err := io.ReadAll(res.Body)
|
body, err := ioutil.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Msgf("could not read response body: %s\n", err)
|
log.Warn().Msgf("could not read response body: %s\n", err)
|
||||||
respondWithJSON(w, http.StatusInternalServerError, map[string]string{"error": "Failed to read response"})
|
respondWithJSON(w, http.StatusInternalServerError, map[string]string{"error": "Failed to read response"})
|
||||||
@@ -225,7 +188,8 @@ func (a *App) refreshTopics() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.LastRefresh = time.Now()
|
a.LastRefresh = time.Now()
|
||||||
time.Sleep(time.Duration(rand.IntN(90-60+1)+60) * time.Second)
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
time.Sleep(time.Duration(rand.Intn(90-60+1)+60) * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +262,7 @@ func (a *App) getDeals(id int, firstPage int, lastPage int) []Topic {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Msgf("error fetching deals: %s\n", err)
|
log.Warn().Msgf("error fetching deals: %s\n", err)
|
||||||
}
|
}
|
||||||
body, err := io.ReadAll(res.Body)
|
body, err := ioutil.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Msgf("could not read response body: %s\n", err)
|
log.Warn().Msgf("could not read response body: %s\n", err)
|
||||||
}
|
}
|
||||||
@@ -328,7 +292,7 @@ func (a *App) getRedirects() []Redirect {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Msgf("error fetching redirects: %s\n", err)
|
log.Warn().Msgf("error fetching redirects: %s\n", err)
|
||||||
}
|
}
|
||||||
body, err := io.ReadAll(res.Body)
|
body, err := ioutil.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Msgf("could not read response body: %s\n", err)
|
log.Warn().Msgf("could not read response body: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<title>rfd-fyi</title>
|
<title>rfd-fyi - An alternative frontend for hot deals</title>
|
||||||
|
|
||||||
<!-- Analytics - loaded async/defer so it doesn't block page -->
|
<!-- Analytics - loaded async/defer so it doesn't block page -->
|
||||||
<script
|
<script
|
||||||
|
|||||||
232
src/App.vue
232
src/App.vue
@@ -7,62 +7,16 @@ import "./theme.css";
|
|||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
// Color palette for dealer labels - muted, visually distinct colors
|
|
||||||
const DEALER_COLORS = [
|
|
||||||
{ bg: '#e8eef4', border: '#5a7a9a', text: '#4a6a8a' }, // Muted Blue
|
|
||||||
{ bg: '#ece8f0', border: '#7a6a8a', text: '#6a5a7a' }, // Muted Purple
|
|
||||||
{ bg: '#e8f0e8', border: '#5a7a5a', text: '#4a6a4a' }, // Muted Green
|
|
||||||
{ bg: '#f0ebe5', border: '#9a7a5a', text: '#8a6a4a' }, // Muted Orange
|
|
||||||
{ bg: '#f0e8ec', border: '#8a5a6a', text: '#7a4a5a' }, // Muted Pink
|
|
||||||
{ bg: '#e5efed', border: '#5a7a75', text: '#4a6a65' }, // Muted Teal
|
|
||||||
{ bg: '#f0ede5', border: '#9a8a5a', text: '#8a7a4a' }, // Muted Amber
|
|
||||||
{ bg: '#eaf0e8', border: '#6a8a5a', text: '#5a7a4a' }, // Muted Light Green
|
|
||||||
{ bg: '#e8e9f0', border: '#5a5a8a', text: '#4a4a7a' }, // Muted Indigo
|
|
||||||
{ bg: '#ece9e6', border: '#6a5a50', text: '#5a4a40' }, // Muted Brown
|
|
||||||
{ bg: '#e5f0f0', border: '#5a8a8a', text: '#4a7a7a' }, // Muted Cyan
|
|
||||||
{ bg: '#f0e8e5', border: '#9a6a5a', text: '#8a5a4a' }, // Muted Deep Orange
|
|
||||||
];
|
|
||||||
|
|
||||||
// Dark theme color palette - muted colors
|
|
||||||
const DEALER_COLORS_DARK = [
|
|
||||||
{ bg: '#2a3a4a', border: '#7a9ab0', text: '#9ab0c0' }, // Muted Blue
|
|
||||||
{ bg: '#3a3040', border: '#9a8aaa', text: '#b0a0c0' }, // Muted Purple
|
|
||||||
{ bg: '#2a3a2a', border: '#7a9a7a', text: '#9ab09a' }, // Muted Green
|
|
||||||
{ bg: '#3a3025', border: '#a09070', text: '#b0a080' }, // Muted Orange
|
|
||||||
{ bg: '#3a2a30', border: '#a07a8a', text: '#b09aa0' }, // Muted Pink
|
|
||||||
{ bg: '#253a38', border: '#7a9a95', text: '#9ab0aa' }, // Muted Teal
|
|
||||||
{ bg: '#3a3525', border: '#a09a70', text: '#b0aa80' }, // Muted Amber
|
|
||||||
{ bg: '#2a3a25', border: '#8a9a7a', text: '#a0b090' }, // Muted Light Green
|
|
||||||
{ bg: '#30304a', border: '#8a8aaa', text: '#a0a0c0' }, // Muted Indigo
|
|
||||||
{ bg: '#352d28', border: '#8a7a70', text: '#a09a90' }, // Muted Brown
|
|
||||||
{ bg: '#253a3a', border: '#7a9a9a', text: '#9ab0b0' }, // Muted Cyan
|
|
||||||
{ bg: '#3a2a25', border: '#a08070', text: '#b09a8a' }, // Muted Deep Orange
|
|
||||||
];
|
|
||||||
|
|
||||||
// Simple hash function for consistent color assignment
|
|
||||||
function hashString(str) {
|
|
||||||
let hash = 0;
|
|
||||||
const normalizedStr = str.toLowerCase().trim();
|
|
||||||
for (let i = 0; i < normalizedStr.length; i++) {
|
|
||||||
const char = normalizedStr.charCodeAt(i);
|
|
||||||
hash = ((hash << 5) - hash) + char;
|
|
||||||
hash = hash & hash; // Convert to 32-bit integer
|
|
||||||
}
|
|
||||||
return Math.abs(hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
filterInput: "",
|
filter: decodeURIComponent(window.location.href.split("filter=")[1] || ""),
|
||||||
activeFilters: this.parseFiltersFromUrl(),
|
|
||||||
sortMethod: "score",
|
sortMethod: "score",
|
||||||
topics: [],
|
topics: [],
|
||||||
isMobile: false,
|
isMobile: false,
|
||||||
currentTheme: "auto",
|
currentTheme: "auto",
|
||||||
darkModeQuery: null,
|
darkModeQuery: null,
|
||||||
themeChangeHandler: null,
|
themeChangeHandler: null,
|
||||||
isLoading: false,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -86,12 +40,11 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
filteredTopics() {
|
filteredTopics() {
|
||||||
const filterTerms = this.activeFilters.map(f => f.toLowerCase());
|
const filterTerm = this.filter.toLowerCase();
|
||||||
|
|
||||||
const filtered = this.topics.filter((row) => {
|
const filtered = this.topics.filter((row) => {
|
||||||
if (filterTerms.length === 0) return true;
|
|
||||||
const searchText = `${row.title} [${row.Offer.dealer_name}]`.toLowerCase();
|
const searchText = `${row.title} [${row.Offer.dealer_name}]`.toLowerCase();
|
||||||
return filterTerms.every(term => searchText.includes(term));
|
return searchText.includes(filterTerm);
|
||||||
});
|
});
|
||||||
|
|
||||||
const sortFns = {
|
const sortFns = {
|
||||||
@@ -138,19 +91,15 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
highlightText(text) {
|
highlightText(text) {
|
||||||
if (!this.activeFilters || this.activeFilters.length === 0) return text;
|
if (!this.filter) return text;
|
||||||
|
|
||||||
let result = text;
|
const lowerText = text.toLowerCase();
|
||||||
for (const filter of this.activeFilters) {
|
const lowerFilter = this.filter.toLowerCase();
|
||||||
const lowerText = result.toLowerCase();
|
|
||||||
const lowerFilter = filter.toLowerCase();
|
|
||||||
|
|
||||||
if (lowerText.includes(lowerFilter)) {
|
if (!lowerText.includes(lowerFilter)) return text;
|
||||||
const regex = new RegExp(filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "ig");
|
|
||||||
result = result.replace(regex, (match) => `<mark>${match}</mark>`);
|
const regex = new RegExp(this.filter, "ig");
|
||||||
}
|
return text.replace(regex, (match) => `<mark>${match}</mark>`);
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initializeTheme() {
|
initializeTheme() {
|
||||||
@@ -217,76 +166,23 @@ export default {
|
|||||||
|
|
||||||
if (event.key === "/" && !isInput) {
|
if (event.key === "/" && !isInput) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.$refs.filterInput.focus();
|
this.$refs.filter.focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseFiltersFromUrl() {
|
createFilterRoute(params) {
|
||||||
const hash = window.location.hash || "";
|
this.$refs.filter.blur();
|
||||||
const match = hash.match(/filters=([^&]*)/);
|
history.pushState({}, null, `${window.location.origin}#/filter=${encodeURIComponent(params)}`);
|
||||||
if (match && match[1]) {
|
|
||||||
try {
|
|
||||||
const decoded = decodeURIComponent(match[1]);
|
|
||||||
return JSON.parse(decoded);
|
|
||||||
} catch (e) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Legacy single filter support
|
|
||||||
const legacyMatch = hash.match(/filter=([^&]*)/);
|
|
||||||
if (legacyMatch && legacyMatch[1]) {
|
|
||||||
const decoded = decodeURIComponent(legacyMatch[1]);
|
|
||||||
return decoded ? [decoded] : [];
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
|
|
||||||
updateUrlWithFilters() {
|
|
||||||
if (this.activeFilters.length > 0) {
|
|
||||||
const encoded = encodeURIComponent(JSON.stringify(this.activeFilters));
|
|
||||||
history.pushState({}, null, `${window.location.origin}#/filters=${encoded}`);
|
|
||||||
} else {
|
|
||||||
history.pushState({}, null, window.location.origin);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
applyFilter() {
|
|
||||||
const trimmed = this.filterInput.trim();
|
|
||||||
if (trimmed && !this.activeFilters.includes(trimmed)) {
|
|
||||||
this.activeFilters.push(trimmed);
|
|
||||||
this.filterInput = "";
|
|
||||||
this.$refs.filterInput.blur();
|
|
||||||
this.updateUrlWithFilters();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
clearFilter(index) {
|
|
||||||
this.activeFilters.splice(index, 1);
|
|
||||||
this.updateUrlWithFilters();
|
|
||||||
},
|
|
||||||
|
|
||||||
clearAllFilters() {
|
|
||||||
this.activeFilters = [];
|
|
||||||
this.filterInput = "";
|
|
||||||
this.updateUrlWithFilters();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchDeals() {
|
fetchDeals() {
|
||||||
this.isLoading = true;
|
axios
|
||||||
const minLoadingTime = new Promise(resolve => setTimeout(resolve, 500));
|
.get("api/v1/topics")
|
||||||
|
.then((response) => {
|
||||||
Promise.all([
|
|
||||||
axios.get("api/v1/topics"),
|
|
||||||
minLoadingTime
|
|
||||||
])
|
|
||||||
.then(([response]) => {
|
|
||||||
this.topics = response.data;
|
this.topics = response.data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error("Failed to fetch deals:", err.response || err);
|
console.error("Failed to fetch deals:", err.response || err);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.isLoading = false;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -302,26 +198,6 @@ export default {
|
|||||||
this.sortMethod = cycle[this.sortMethod];
|
this.sortMethod = cycle[this.sortMethod];
|
||||||
localStorage.setItem("sortMethod", this.sortMethod);
|
localStorage.setItem("sortMethod", this.sortMethod);
|
||||||
},
|
},
|
||||||
|
|
||||||
getDealerColor(dealerName) {
|
|
||||||
if (!dealerName) return null;
|
|
||||||
const isDark = document.documentElement.getAttribute('data-bs-theme') === 'dark' ||
|
|
||||||
document.documentElement.classList.contains('dark-theme') ||
|
|
||||||
(this.currentTheme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
||||||
const colors = isDark ? DEALER_COLORS_DARK : DEALER_COLORS;
|
|
||||||
const index = hashString(dealerName) % colors.length;
|
|
||||||
return colors[index];
|
|
||||||
},
|
|
||||||
|
|
||||||
getDealerStyle(dealerName) {
|
|
||||||
const color = this.getDealerColor(dealerName);
|
|
||||||
if (!color) return {};
|
|
||||||
return {
|
|
||||||
backgroundColor: color.bg,
|
|
||||||
borderColor: color.border,
|
|
||||||
color: color.text,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -331,26 +207,15 @@ export default {
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="header-controls">
|
<div class="header-controls">
|
||||||
<div class="filter-container" :class="{ 'has-active-filters': activeFilters.length > 0 }">
|
<input
|
||||||
<span v-for="(filter, index) in activeFilters" :key="index" class="filter-tag">
|
ref="filter"
|
||||||
{{ filter }}
|
v-model="filter"
|
||||||
<button class="filter-tag-clear" @click="clearFilter(index)" title="Clear filter">
|
type="text"
|
||||||
<span class="material-symbols-outlined">close</span>
|
placeholder="Filter deals"
|
||||||
</button>
|
class="search-input"
|
||||||
</span>
|
@keyup.enter="createFilterRoute(filter.toString())"
|
||||||
<input
|
@keyup.esc="$refs.filter.blur()"
|
||||||
ref="filterInput"
|
/>
|
||||||
v-model="filterInput"
|
|
||||||
type="text"
|
|
||||||
placeholder="Filter deals"
|
|
||||||
class="search-input"
|
|
||||||
@keyup.enter="applyFilter"
|
|
||||||
@keyup.esc="$refs.filterInput.blur()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<button class="icon-button" title="Refresh deals" @click="fetchDeals" :disabled="isLoading">
|
|
||||||
<span class="material-symbols-outlined" :class="{ 'spinning': isLoading }">refresh</span>
|
|
||||||
</button>
|
|
||||||
<button class="icon-button" :title="sortTitle" @click="toggleSort">
|
<button class="icon-button" :title="sortTitle" @click="toggleSort">
|
||||||
<span class="material-symbols-outlined">{{ sortIcon }}</span>
|
<span class="material-symbols-outlined">{{ sortIcon }}</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -360,16 +225,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="isLoading && topics.length === 0" class="loading-container">
|
<div class="cards-grid">
|
||||||
<span class="material-symbols-outlined spinning loading-spinner">refresh</span>
|
|
||||||
<p>Loading deals...</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cards-wrapper" v-else>
|
|
||||||
<div v-if="isLoading" class="loading-overlay">
|
|
||||||
<span class="material-symbols-outlined spinning loading-spinner">refresh</span>
|
|
||||||
</div>
|
|
||||||
<div class="cards-grid">
|
|
||||||
<div v-for="topic in filteredTopics" :key="topic.topic_id" class="deal-card">
|
<div v-for="topic in filteredTopics" :key="topic.topic_id" class="deal-card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="title-with-link">
|
<div class="title-with-link">
|
||||||
@@ -402,12 +258,8 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-meta" v-if="topic.Offer.dealer_name">
|
<div class="card-meta">
|
||||||
<span
|
<span class="dealer-name" v-html="highlightText(topic.Offer.dealer_name)"></span>
|
||||||
class="dealer-name dealer-label"
|
|
||||||
:style="getDealerStyle(topic.Offer.dealer_name)"
|
|
||||||
v-html="highlightText(topic.Offer.dealer_name)"
|
|
||||||
></span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-details">
|
<div class="card-details">
|
||||||
@@ -425,33 +277,7 @@ export default {
|
|||||||
<div class="card-timestamp">Last post: {{ formatDate(topic.last_post_time) }}</div>
|
<div class="card-timestamp">Last post: {{ formatDate(topic.last_post_time) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.cards-wrapper {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: rgba(128, 128, 128, 0.3);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 10;
|
|
||||||
border-radius: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-overlay .loading-spinner {
|
|
||||||
font-size: 48px;
|
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
132
src/theme.css
132
src/theme.css
@@ -178,78 +178,6 @@ a:visited {
|
|||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================
|
|
||||||
Filter Container & Tags
|
|
||||||
============================================ */
|
|
||||||
|
|
||||||
.filter-container {
|
|
||||||
flex: 1;
|
|
||||||
max-width: 500px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 6px 10px;
|
|
||||||
border: 1px solid var(--border-color-light);
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: var(--bg-input);
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-container:focus-within {
|
|
||||||
border-color: var(--border-color-hover);
|
|
||||||
background-color: var(--bg-input-focus);
|
|
||||||
box-shadow: 0 0 0 2px var(--shadow-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-container .search-input {
|
|
||||||
flex: 1;
|
|
||||||
border: none;
|
|
||||||
padding: 4px 0;
|
|
||||||
background: transparent;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-container .search-input:focus {
|
|
||||||
outline: none;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-tag {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
padding: 2px 6px 2px 8px;
|
|
||||||
background-color: var(--border-color-light);
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text-primary);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-tag-clear {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
background-color: var(--text-secondary);
|
|
||||||
border-radius: 50%;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
color: var(--bg-input);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-tag-clear:hover {
|
|
||||||
background-color: var(--text-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-tag-clear .material-symbols-outlined {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ============================================
|
/* ============================================
|
||||||
Icon Buttons (Theme & Sort Toggle)
|
Icon Buttons (Theme & Sort Toggle)
|
||||||
============================================ */
|
============================================ */
|
||||||
@@ -437,24 +365,15 @@ a:visited {
|
|||||||
.card-meta {
|
.card-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dealer-name {
|
.dealer-name {
|
||||||
display: inline-block;
|
color: var(--text-secondary);
|
||||||
width: fit-content;
|
font-weight: 500;
|
||||||
max-width: 100%;
|
font-size: 13px;
|
||||||
font-weight: 600;
|
|
||||||
font-size: 9px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 2px solid currentColor;
|
|
||||||
background-color: transparent;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
letter-spacing: 0.3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-details {
|
.card-details {
|
||||||
@@ -519,48 +438,3 @@ mark {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================
|
|
||||||
Loading & Spinner
|
|
||||||
============================================ */
|
|
||||||
|
|
||||||
@keyframes spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinning {
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 60px 20px;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-container p {
|
|
||||||
margin-top: 16px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-spinner {
|
|
||||||
font-size: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-button:disabled {
|
|
||||||
opacity: 0.6;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-button:disabled:hover {
|
|
||||||
background-color: var(--bg-input);
|
|
||||||
border-color: var(--border-color-light);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user