Revamp advertisement section with enhanced styling, dynamic pricing, and urgency messaging
This commit is contained in:
parent
3d5252ad12
commit
38930d7766
@ -8,132 +8,262 @@ $result = $conn->query($query);
|
|||||||
$adProduct = $result->fetch_assoc();
|
$adProduct = $result->fetch_assoc();
|
||||||
|
|
||||||
if ($adProduct):
|
if ($adProduct):
|
||||||
|
$fakeOldPrice = rand(199, 599) . ",00 €";
|
||||||
|
$fakeNewPrice = rand(19, 49) . ",99 €";
|
||||||
|
$fakeStock = rand(2, 5);
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
.ad-recommendation {
|
.ad-recommendation {
|
||||||
background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
|
background: linear-gradient(45deg, #ff0000, #ff8c00, #ff007f);
|
||||||
border-radius: 12px;
|
background-size: 600% 600%;
|
||||||
padding: 20px;
|
animation: gradientShift 5s ease infinite;
|
||||||
margin: 20px auto;
|
padding: 60px 20px;
|
||||||
max-width: 1200px;
|
margin: 40px 0;
|
||||||
|
width: 100vw;
|
||||||
|
position: relative;
|
||||||
|
left: 50%;
|
||||||
|
right: 50%;
|
||||||
|
margin-left: -50vw;
|
||||||
|
margin-right: -50vw;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes gradientShift {
|
||||||
|
0% { background-position: 0% 50%; }
|
||||||
|
50% { background-position: 100% 50%; }
|
||||||
|
100% { background-position: 0% 50%; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-recommendation::before {
|
||||||
|
content: 'ANZEIGE - GESPONSERT';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background: rgba(0,0,0,0.8);
|
||||||
|
color: #ffd700;
|
||||||
|
padding: 4px 20px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 900;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 3px;
|
||||||
|
border-bottom-left-radius: 10px;
|
||||||
|
border-bottom-right-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-container {
|
||||||
|
max-width: 1400px;
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
gap: 50px;
|
||||||
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.ad-recommendation::before {
|
|
||||||
content: 'Anzeige';
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
right: 15px;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
background: rgba(255,255,255,0.7);
|
|
||||||
padding: 2px 8px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ad-image-container {
|
.ad-image-container {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 200px;
|
width: 350px;
|
||||||
height: 200px;
|
height: 350px;
|
||||||
background: #fff;
|
background: radial-gradient(circle, #fff 0%, #ffe6e6 100%);
|
||||||
border-radius: 8px;
|
border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 10px;
|
padding: 20px;
|
||||||
box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
|
box-shadow: 0 0 50px rgba(255, 255, 255, 0.4), inset 0 0 20px rgba(0,0,0,0.1);
|
||||||
|
border: 8px solid #ffd700;
|
||||||
|
transform: rotate(-5deg);
|
||||||
|
animation: floating 3s ease-in-out infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes floating {
|
||||||
|
0% { transform: translateY(0px) rotate(-5deg); }
|
||||||
|
50% { transform: translateY(-15px) rotate(-2deg); }
|
||||||
|
100% { transform: translateY(0px) rotate(-5deg); }
|
||||||
|
}
|
||||||
|
|
||||||
.ad-image-container img {
|
.ad-image-container img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
filter: drop-shadow(0 10px 10px rgba(0,0,0,0.3));
|
||||||
}
|
}
|
||||||
|
|
||||||
.ad-content {
|
.ad-content {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ad-tag {
|
.ad-tag {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: #ff4757;
|
background: #ffd700;
|
||||||
color: white;
|
color: #d10000;
|
||||||
padding: 5px 12px;
|
padding: 8px 20px;
|
||||||
border-radius: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
box-shadow: 0 4px 6px rgba(255, 71, 87, 0.3);
|
|
||||||
}
|
|
||||||
.ad-title {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
font-weight: 800;
|
|
||||||
margin: 0 0 10px 0;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
.ad-description {
|
|
||||||
font-size: 1rem;
|
|
||||||
line-height: 1.5;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
opacity: 0.9;
|
|
||||||
max-width: 600px;
|
|
||||||
}
|
|
||||||
.ad-btn {
|
|
||||||
display: inline-block;
|
|
||||||
background: #2ed573;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 12px 24px;
|
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
font-weight: bold;
|
font-weight: 900;
|
||||||
font-size: 1.1rem;
|
font-size: 1.2rem;
|
||||||
transition: transform 0.2s, box-shadow 0.2s;
|
margin-bottom: 15px;
|
||||||
box-shadow: 0 4px 6px rgba(46, 213, 115, 0.3);
|
text-transform: uppercase;
|
||||||
}
|
animation: pulseTag 1s infinite alternate;
|
||||||
.ad-btn:hover {
|
box-shadow: 0 0 15px #ffd700;
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 6px 12px rgba(46, 213, 115, 0.4);
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@keyframes pulseTag {
|
||||||
.ad-recommendation {
|
0% { transform: scale(1); }
|
||||||
|
100% { transform: scale(1.1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-title {
|
||||||
|
font-size: 3.5rem;
|
||||||
|
font-weight: 900;
|
||||||
|
margin: 0 0 15px 0;
|
||||||
|
line-height: 1.1;
|
||||||
|
text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-stars {
|
||||||
|
color: #ffd700;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-shadow: 1px 1px 2px #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-prices {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-old-price {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
text-decoration: line-through;
|
||||||
|
color: #ffcccc;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-new-price {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #ffd700;
|
||||||
|
text-shadow: 2px 2px 4px #000;
|
||||||
|
animation: flashPrice 2s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes flashPrice {
|
||||||
|
0%, 100% { color: #ffd700; }
|
||||||
|
50% { color: #fff; text-shadow: 0 0 20px #ffd700, 2px 2px 4px #000; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-description {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
|
||||||
|
background: rgba(0,0,0,0.3);
|
||||||
|
padding: 15px;
|
||||||
|
border-left: 5px solid #ffd700;
|
||||||
|
border-radius: 0 10px 10px 0;
|
||||||
|
max-width: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-urgency {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #fff;
|
||||||
|
background: #d10000;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
box-shadow: 0 0 15px rgba(209,0,0,0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-btn {
|
||||||
|
display: inline-block;
|
||||||
|
background: linear-gradient(to bottom, #ffd700, #ff8c00);
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
padding: 20px 50px;
|
||||||
|
border-radius: 50px;
|
||||||
|
font-weight: 900;
|
||||||
|
font-size: 1.8rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
transition: all 0.2s;
|
||||||
|
box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 -4px 0 rgba(0,0,0,0.2);
|
||||||
|
border: 4px solid #fff;
|
||||||
|
animation: heartbeat 1.5s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ad-btn:hover {
|
||||||
|
transform: scale(1.1);
|
||||||
|
box-shadow: 0 15px 30px rgba(0,0,0,0.6), inset 0 -4px 0 rgba(0,0,0,0.2);
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes heartbeat {
|
||||||
|
0% { transform: scale(1); }
|
||||||
|
15% { transform: scale(1.05); }
|
||||||
|
30% { transform: scale(1); }
|
||||||
|
45% { transform: scale(1.05); }
|
||||||
|
60% { transform: scale(1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.ad-container {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 30px 15px;
|
|
||||||
}
|
|
||||||
.ad-image-container {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 250px;
|
|
||||||
}
|
|
||||||
.ad-title {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
}
|
||||||
|
.ad-title { font-size: 2.2rem; }
|
||||||
|
.ad-description { border-left: none; border-top: 5px solid #ffd700; border-radius: 0 0 10px 10px; }
|
||||||
|
.ad-prices { justify-content: center; }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="ad-recommendation">
|
<div class="ad-recommendation">
|
||||||
<div class="ad-image-container">
|
<div class="ad-container">
|
||||||
<img src="<?= htmlspecialchars($adProduct['imagePath']) ?>" alt="<?= htmlspecialchars($adProduct['model']) ?>">
|
<div class="ad-image-container">
|
||||||
</div>
|
<img src="<?= htmlspecialchars($adProduct['imagePath']) ?>" alt="<?= htmlspecialchars($adProduct['model']) ?>">
|
||||||
<div class="ad-content">
|
</div>
|
||||||
<div class="ad-tag">🔥 Empfehlung des Tages</div>
|
<div class="ad-content">
|
||||||
<h2 class="ad-title"><?= htmlspecialchars($adProduct['model']) ?></h2>
|
<div class="ad-tag">🔥 WAHNSINNS-DEAL DES TAGES 🔥</div>
|
||||||
<p class="ad-description">
|
<h2 class="ad-title"><?= htmlspecialchars($adProduct['model']) ?></h2>
|
||||||
<?php
|
|
||||||
$desc = $adProduct['description'];
|
<div class="ad-stars">
|
||||||
if (function_exists('mb_strimwidth')) {
|
★★★★★ <span style="font-size:1rem; color:#fff; font-weight:normal; text-shadow:none;">(4.987 Bewertungen)</span>
|
||||||
$desc = mb_strimwidth($desc, 0, 150, "...");
|
</div>
|
||||||
} else {
|
|
||||||
$desc = strlen($desc) > 150 ? substr($desc, 0, 147) . "..." : $desc;
|
<div class="ad-prices">
|
||||||
}
|
<span class="ad-old-price">Statt <?= $fakeOldPrice ?></span>
|
||||||
echo htmlspecialchars($desc);
|
<span class="ad-new-price">JETZT NUR <?= $fakeNewPrice ?>!</span>
|
||||||
?>
|
</div>
|
||||||
</p>
|
|
||||||
<a href="productpage.php?id=<?= $adProduct['productID'] ?>" class="ad-btn">Jetzt entdecken</a>
|
<p class="ad-description">
|
||||||
|
UNFASSBAR! Dieser unglaubliche Bestseller geht gerade viral und sprengt alle Erwartungen!
|
||||||
|
Greif jetzt zu, bevor es zu spät ist!
|
||||||
|
<?php
|
||||||
|
$desc = $adProduct['description'];
|
||||||
|
if (function_exists('mb_strimwidth')) {
|
||||||
|
$desc = mb_strimwidth($desc, 0, 100, "...");
|
||||||
|
} else {
|
||||||
|
$desc = strlen($desc) > 100 ? substr($desc, 0, 97) . "..." : $desc;
|
||||||
|
}
|
||||||
|
echo htmlspecialchars($desc);
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="ad-urgency">
|
||||||
|
⏳ ACHTUNG: Nur noch <?= $fakeStock ?> Stück auf Lager! Andere Nutzer schauen sich diesen Artikel gerade an!
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a href="productpage.php?id=<?= $adProduct['productID'] ?>" class="ad-btn">👉 SOFORT ZUSCHLAGEN 👈</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user