Improved carrousel
This commit is contained in:
+619
-217
@@ -1,256 +1,658 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>1973 Jaguar E-Type Roadster</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
|
||||
|
||||
<!-- ================= Schema.org Vehicle Markup ================= -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Vehicle",
|
||||
"name": "1973 Jaguar E-Type Series III Roadster",
|
||||
"brand": {
|
||||
"@type": "Brand",
|
||||
"name": "Jaguar"
|
||||
},
|
||||
"model": "E-Type Series III",
|
||||
"vehicleModelDate": "1973",
|
||||
"vehicleConfiguration": "Roadster",
|
||||
"bodyType": "Convertible",
|
||||
"vehicleEngine": {
|
||||
"@type": "EngineSpecification",
|
||||
"engineType": "V12",
|
||||
"engineDisplacement": {
|
||||
"@type": "QuantitativeValue",
|
||||
"value": 5.3,
|
||||
"unitCode": "LTR"
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>1973 Jaguar E-Type Series 3 V12 Roadster | For Sale</title>
|
||||
<meta name="description" content="Privately owned 1973 Jaguar E-Type Roadster in red, featuring the legendary 5.3L V12 engine. Offered at CHF 65'000.">
|
||||
<style>
|
||||
:root {
|
||||
--bg-dark: #0d0f12;
|
||||
--bg-card: #161b22;
|
||||
--accent-red: #c0262d;
|
||||
--accent-gold: #d4af37;
|
||||
--text-main: #f0f3f6;
|
||||
--text-muted: #8b949e;
|
||||
--border-color: rgba(255, 255, 255, 0.1);
|
||||
--font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
}
|
||||
},
|
||||
"vehicleTransmission": "Automatic",
|
||||
"fuelType": "Petrol",
|
||||
"color": "Red",
|
||||
"itemCondition": "https://schema.org/UsedCondition",
|
||||
"offers": {
|
||||
"@type": "Offer",
|
||||
"price": "65000",
|
||||
"priceCurrency": "CHF",
|
||||
"availability": "https://schema.org/InStock",
|
||||
"seller": {
|
||||
"@type": "Person",
|
||||
"name": "Private Seller"
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
},
|
||||
"additionalProperty": [
|
||||
{ "@type": "PropertyValue", "name": "Condition", "value": "Very Good" },
|
||||
{ "@type": "PropertyValue", "name": "Import History", "value": "US import 1980" },
|
||||
{ "@type": "PropertyValue", "name": "Heritage", "value": "Jaguar Heritage Certificate" },
|
||||
{ "@type": "PropertyValue", "name": "Hardtop", "value": "Removable Hardtop" },
|
||||
{ "@type": "PropertyValue", "name": "Technical Inspection", "value": "Swiss Technical Control" }
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<!-- ============================================================ -->
|
||||
|
||||
<style>
|
||||
body { margin:0; font-family:"Segoe UI",Arial,sans-serif; background:#f5f6f8; color:#333; }
|
||||
header { background:#c62828; color:white; padding:40px 20px; position:relative; text-align:center; }
|
||||
.lang-switch { position:absolute; top:15px; right:20px; display:flex; gap:12px; }
|
||||
.lang-btn { cursor:pointer; opacity:.6; text-align:center; }
|
||||
.lang-btn.active { opacity:1; }
|
||||
.lang-btn img { width:32px; height:22px; }
|
||||
.lang-indicator { height:3px; background:white; margin-top:4px; opacity:0; }
|
||||
.lang-btn.active .lang-indicator { opacity:1; }
|
||||
body {
|
||||
background-color: var(--bg-dark);
|
||||
color: var(--text-main);
|
||||
font-family: var(--font-stack);
|
||||
line-height: 1.6;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
section { max-width:1100px; margin:40px auto; padding:0 20px; }
|
||||
.card { background:white; border-radius:6px; padding:30px; margin-bottom:35px; box-shadow:0 6px 16px rgba(0,0,0,.08); }
|
||||
.price { font-size:34px; color:#c62828; }
|
||||
.badge { background:#e0e0e0; padding:6px 12px; border-radius:20px; font-size:13px; }
|
||||
.wrapper {
|
||||
max-width: 1040px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 1rem 4rem;
|
||||
}
|
||||
|
||||
.specs { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:15px; }
|
||||
.spec { background:#f1f1f1; padding:15px; text-align:center; border-radius:5px; }
|
||||
/* Header */
|
||||
header {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.carousel { position:relative; height:260px; overflow:hidden; }
|
||||
.carousel img { position:absolute; inset:0; margin:auto; max-width:100%; max-height:100%; opacity:0; transition:.8s; cursor:pointer; }
|
||||
.carousel img.active { opacity:1; position:relative; }
|
||||
.badge {
|
||||
display: inline-block;
|
||||
background: rgba(192, 38, 45, 0.15);
|
||||
border: 1px solid var(--accent-red);
|
||||
color: #ff6b6b;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1.5px;
|
||||
padding: 0.35rem 0.8rem;
|
||||
border-radius: 20px;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.dots { display:flex; justify-content:center; gap:8px; margin-top:12px; }
|
||||
.dot { width:10px; height:10px; border-radius:50%; background:#ccc; cursor:pointer; }
|
||||
.dot.active { background:#c62828; }
|
||||
h1 {
|
||||
font-size: 2.4rem;
|
||||
font-weight: 300;
|
||||
letter-spacing: 1px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fullscreen { position:fixed; inset:0; background:rgba(0,0,0,.95); display:flex; align-items:center; justify-content:center; z-index:9999; }
|
||||
.fullscreen img { max-width:95%; max-height:95%; }
|
||||
.close-btn,.arrow { position:absolute; color:white; font-size:2rem; cursor:pointer; }
|
||||
.close-btn { top:20px; right:25px; }
|
||||
.arrow-left { left:20px; }
|
||||
.arrow-right { right:20px; }
|
||||
.tagline {
|
||||
color: var(--text-muted);
|
||||
font-size: 1.05rem;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.links a { display:block; padding:14px; background:#f1f1f1; margin-bottom:8px; text-decoration:none; color:#333; border-radius:5px; }
|
||||
.price-tag {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent-gold);
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.whatsapp-form input,.whatsapp-form textarea { width:100%; padding:12px; margin-bottom:10px; }
|
||||
.whatsapp-form button { background:#25d366; border:none; color:white; padding:14px; font-size:16px; cursor:pointer; width:100%; }
|
||||
/* Fast Swipe Carousel */
|
||||
.gallery-container {
|
||||
position: relative;
|
||||
background: var(--bg-card);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border-color);
|
||||
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
|
||||
min-height: 320px;
|
||||
}
|
||||
|
||||
.call-box { text-align:center; font-size:18px; }
|
||||
.call-box a { display:inline-block; margin-top:10px; font-size:22px; color:#c62828; text-decoration:none; }
|
||||
.carousel-track {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
scroll-snap-type: x mandatory;
|
||||
scroll-behavior: smooth;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
cursor: grab;
|
||||
min-height: 320px;
|
||||
}
|
||||
|
||||
footer { background:#222; color:#aaa; text-align:center; padding:25px; }
|
||||
</style>
|
||||
.carousel-track::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.slide {
|
||||
flex: 0 0 100%;
|
||||
scroll-snap-align: start;
|
||||
position: relative;
|
||||
aspect-ratio: 16 / 9;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.slide img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
|
||||
.slide-overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 1.5rem 1.25rem 1rem;
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.slide-overlay h3 {
|
||||
font-size: 1.15rem;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.slide-counter {
|
||||
color: var(--accent-gold);
|
||||
font-weight: bold;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Loading placeholder */
|
||||
.loading-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 350px;
|
||||
color: var(--text-muted);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Carousel Nav Arrows */
|
||||
.nav-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: rgba(13, 15, 18, 0.75);
|
||||
border: 1px solid var(--border-color);
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
backdrop-filter: blur(4px);
|
||||
transition: all 0.2s;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.nav-btn:hover {
|
||||
background: var(--accent-red);
|
||||
border-color: var(--accent-red);
|
||||
}
|
||||
|
||||
.nav-btn.prev { left: 1rem; }
|
||||
.nav-btn.next { right: 1rem; }
|
||||
|
||||
/* Navigation Dots */
|
||||
.dots-nav {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
padding: 1rem 0 0.5rem;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.dot.active {
|
||||
background: var(--accent-gold);
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
/* Technical Specifications */
|
||||
.specs-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
|
||||
.spec-card {
|
||||
background: var(--bg-card);
|
||||
padding: 1.25rem;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.spec-label {
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.spec-value {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Key Features Box */
|
||||
.highlights-box {
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-color);
|
||||
padding: 1.5rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.highlights-box h2 {
|
||||
font-size: 1.25rem;
|
||||
color: var(--accent-gold);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.highlights-list {
|
||||
list-style: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.highlights-list li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
color: var(--text-main);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.highlights-list li::before {
|
||||
content: "✓";
|
||||
color: var(--accent-gold);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Contact Action Bar */
|
||||
.contact-section {
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, var(--bg-card), rgba(22, 27, 34, 0.5));
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 12px;
|
||||
padding: 2.5rem 1.5rem;
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
|
||||
.contact-section h2 {
|
||||
font-size: 1.5rem;
|
||||
color: #fff;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.85rem 1.75rem;
|
||||
border-radius: 6px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.btn-phone {
|
||||
background-color: var(--accent-gold);
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-phone:hover {
|
||||
background-color: #e5be48;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.btn-whatsapp {
|
||||
background-color: #25D366;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-whatsapp:hover {
|
||||
background-color: #20bd5a;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
/* Related Links */
|
||||
.links-section {
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
|
||||
.links-section h3 {
|
||||
font-size: 1.1rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.links-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.external-link {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--text-main);
|
||||
padding: 0.6rem 1rem;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
font-size: 0.85rem;
|
||||
transition: border-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.external-link:hover {
|
||||
border-color: var(--accent-gold);
|
||||
color: var(--accent-gold);
|
||||
}
|
||||
|
||||
/* Fullscreen Lightbox Modal */
|
||||
.lightbox {
|
||||
display: none;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.92);
|
||||
z-index: 1000;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.lightbox.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.lightbox img {
|
||||
max-width: 90vw;
|
||||
max-height: 90vh;
|
||||
object-fit: contain;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.lightbox-close {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 25px;
|
||||
color: #fff;
|
||||
font-size: 2rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
margin-top: 3rem;
|
||||
color: var(--text-muted);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
h1 { font-size: 1.8rem; }
|
||||
.nav-btn { display: none; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
|
||||
<header>
|
||||
<div class="lang-switch">
|
||||
<div class="lang-btn" :class="{active:lang==='en'}" @click="setLang('en')">
|
||||
<img src="https://flagcdn.com/w40/gb.png"><div class="lang-indicator"></div>
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header>
|
||||
<span class="badge">Private Classic Car Sale</span>
|
||||
<h1>1973 Jaguar E-Type Roadster</h1>
|
||||
<p class="tagline">Iconic British Classic • 5.3L V12 • Roadster</p>
|
||||
<div class="price-tag">CHF 65'000</div>
|
||||
</header>
|
||||
|
||||
<!-- Fast-Loading Swipe Gallery -->
|
||||
<div class="gallery-container">
|
||||
<button class="nav-btn prev" id="prevBtn" aria-label="Previous image">❮</button>
|
||||
<button class="nav-btn next" id="nextBtn" aria-label="Next image">❯</button>
|
||||
|
||||
<div class="carousel-track" id="carouselTrack">
|
||||
<div class="loading-state" id="loadingState">Loading vehicle photos...</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lang-btn" :class="{active:lang==='fr'}" @click="setLang('fr')">
|
||||
<img src="https://flagcdn.com/w40/fr.png"><div class="lang-indicator"></div>
|
||||
|
||||
<!-- Navigation Dots -->
|
||||
<div class="dots-nav" id="dotsNav"></div>
|
||||
|
||||
<!-- Specifications -->
|
||||
<div class="specs-grid">
|
||||
<div class="spec-card">
|
||||
<div class="spec-label">Year</div>
|
||||
<div class="spec-value">1973</div>
|
||||
</div>
|
||||
<div class="spec-card">
|
||||
<div class="spec-label">Engine</div>
|
||||
<div class="spec-value">5.3L V12</div>
|
||||
</div>
|
||||
<div class="spec-card">
|
||||
<div class="spec-label">Transmission</div>
|
||||
<div class="spec-value">Automatic</div>
|
||||
</div>
|
||||
<div class="spec-card">
|
||||
<div class="spec-label">Exterior</div>
|
||||
<div class="spec-value">Red</div>
|
||||
</div>
|
||||
<div class="spec-card">
|
||||
<div class="spec-label">Body Style</div>
|
||||
<div class="spec-value">Roadster</div>
|
||||
</div>
|
||||
<div class="spec-card">
|
||||
<div class="spec-label">Condition</div>
|
||||
<div class="spec-value">Very Good</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>{{ t.title }}</h1>
|
||||
<p>{{ t.subtitle }}</p>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<div class="card">
|
||||
<h2>{{ t.overview }}</h2>
|
||||
<span class="badge">{{ t.privateSeller }}</span>
|
||||
<p>{{ t.description }}</p>
|
||||
<div class="price">CHF 65'000</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>{{ t.specs }}</h2>
|
||||
<div class="specs">
|
||||
<div class="spec" v-for="s in specifications" :key="s">{{ s }}</div>
|
||||
<!-- Highlights -->
|
||||
<div class="highlights-box">
|
||||
<h2>Vehicle Highlights & Details</h2>
|
||||
<ul class="highlights-list">
|
||||
<li>Removable Hardtop</li>
|
||||
<li>Jaguar Heritage Certificate</li>
|
||||
<li>US Import 1980</li>
|
||||
<li>Swiss Technical Control (MFK)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="photos.length">
|
||||
<div class="card">
|
||||
<h2>{{ t.photos }}</h2>
|
||||
<div class="carousel">
|
||||
<img v-for="(img,i) in photos"
|
||||
:key="img"
|
||||
:src="'photos/'+img"
|
||||
:class="{active:i===activeIndex}"
|
||||
loading="lazy"
|
||||
@click="openFullscreen(i)">
|
||||
<!-- Owner Contact -->
|
||||
<div class="contact-section" id="contact">
|
||||
<h2>Call the Owner</h2>
|
||||
<p style="color: var(--text-muted);">For direct inquiries, please call or text the owner:</p>
|
||||
|
||||
<div class="btn-group">
|
||||
<a href="tel:+41793758510" class="btn btn-phone">
|
||||
📞 +41 79 375 8510
|
||||
</a>
|
||||
<a href="https://wa.me/41793758510" target="_blank" rel="noopener" class="btn btn-whatsapp">
|
||||
💬 Contact via WhatsApp
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dots">
|
||||
<div v-for="(img,i) in photos"
|
||||
:key="i"
|
||||
class="dot"
|
||||
:class="{active:i===activeIndex}"
|
||||
@click="activeIndex=i"></div>
|
||||
|
||||
<!-- Related Links & References -->
|
||||
<div class="links-section">
|
||||
<h3>Related Links & References</h3>
|
||||
<div class="links-grid">
|
||||
<a href="https://bringatrailer.com/jaguar/e-type-series-iii/" target="_blank" rel="noopener" class="external-link">
|
||||
Bring a Trailer – Jaguar E-Type Series III
|
||||
</a>
|
||||
<a href="https://www.youtube.com/results?search_query=Jaguar+E-Type+Documentary" target="_blank" rel="noopener" class="external-link">
|
||||
Jaguar E-Type Documentary (YouTube)
|
||||
</a>
|
||||
<a href="https://www.youtube.com/results?search_query=Jaguar+E-Type+Review" target="_blank" rel="noopener" class="external-link">
|
||||
Jaguar E-Type Review (YouTube)
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
© Private Classic Car Sale
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="card">
|
||||
<h2>{{ t.links }}</h2>
|
||||
<div class="links">
|
||||
<a v-for="l in links" :key="l.url" :href="l.url" target="_blank">{{ l.label }}</a>
|
||||
</div>
|
||||
<!-- Lightbox Modal -->
|
||||
<div class="lightbox" id="lightbox">
|
||||
<span class="lightbox-close" id="lightboxClose">×</span>
|
||||
<img id="lightboxImg" src="" alt="Enlarged photo view">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="card call-box">
|
||||
<h2>{{ t.callTitle }}</h2>
|
||||
<p>{{ t.callText }}</p>
|
||||
<a href="tel:+41793758510">📞 +41 79 375 8510</a>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
const track = document.getElementById('carouselTrack');
|
||||
const dotsNav = document.getElementById('dotsNav');
|
||||
const prevBtn = document.getElementById('prevBtn');
|
||||
const nextBtn = document.getElementById('nextBtn');
|
||||
const lightbox = document.getElementById('lightbox');
|
||||
const lightboxImg = document.getElementById('lightboxImg');
|
||||
const lightboxClose = document.getElementById('lightboxClose');
|
||||
|
||||
<section>
|
||||
<div class="card">
|
||||
<h2>{{ t.contactTitle }}</h2>
|
||||
<form class="whatsapp-form" @submit.prevent="openWhatsApp">
|
||||
<input v-model="form.name" :placeholder="t.name" required>
|
||||
<input v-model="form.phone" :placeholder="t.phone" required>
|
||||
<textarea v-model="form.message" rows="4"></textarea>
|
||||
<button type="submit">{{ t.whatsapp }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
let currentIndex = 0;
|
||||
let slides = [];
|
||||
let dots = [];
|
||||
|
||||
<footer>© 2025 Private Classic Car Sale</footer>
|
||||
// Fetch photos.json from the ROOT directory
|
||||
async function initGallery() {
|
||||
try {
|
||||
const response = await fetch('photos.json');
|
||||
if (!response.ok) throw new Error('Failed to load photos.json from root');
|
||||
|
||||
const photoFiles = await response.json();
|
||||
|
||||
if (!Array.isArray(photoFiles) || photoFiles.length === 0) {
|
||||
track.innerHTML = '<div class="loading-state">No photos listed in photos.json</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
<div v-if="fullscreen" class="fullscreen">
|
||||
<span class="close-btn" @click="fullscreen=false">×</span>
|
||||
<span class="arrow arrow-left" @click="prev">‹</span>
|
||||
<img :src="'photos/'+photos[activeIndex]">
|
||||
<span class="arrow arrow-right" @click="next">›</span>
|
||||
</div>
|
||||
// Render Slides & Dots dynamically
|
||||
track.innerHTML = '';
|
||||
dotsNav.innerHTML = '';
|
||||
|
||||
<script>
|
||||
const { createApp } = Vue;
|
||||
photoFiles.forEach((item, idx) => {
|
||||
// Extracts filename whether item is a string or an object with a file property
|
||||
const filename = typeof item === 'string' ? item : (item.file || item.src || item.name);
|
||||
|
||||
// Ensures path points into the photos/ subfolder
|
||||
const photoPath = filename.startsWith('photos/') ? filename : `photos/${filename}`;
|
||||
|
||||
const total = photoFiles.length;
|
||||
const padIdx = String(idx + 1).padStart(2, '0');
|
||||
const padTotal = String(total).padStart(2, '0');
|
||||
|
||||
createApp({
|
||||
data() {
|
||||
return {
|
||||
lang:'en',
|
||||
photos:[],
|
||||
specifications:[],
|
||||
links:[],
|
||||
activeIndex:0,
|
||||
fullscreen:false,
|
||||
form:{name:'',phone:'',message:''},
|
||||
translations:{
|
||||
en:{ title:"1973 Jaguar E-Type Roadster", subtitle:"Iconic British Classic • V12 • Roadster",
|
||||
overview:"Overview", privateSeller:"Private Seller", specs:"Specifications",
|
||||
photos:"Photos", links:"Related Links & References",
|
||||
callTitle:"Call the Owner", callText:"For direct inquiries, please call the owner:",
|
||||
contactTitle:"Contact via WhatsApp", name:"Your name", phone:"Your phone number",
|
||||
whatsapp:"Contact via WhatsApp",
|
||||
description:"Privately owned 1973 Jaguar E-Type Roadster in red, featuring the legendary V12 engine."},
|
||||
fr:{ title:"Jaguar E-Type Roadster 1973", subtitle:"Icône britannique • V12 • Roadster",
|
||||
overview:"Présentation", privateSeller:"Vente privée", specs:"Caractéristiques",
|
||||
photos:"Photos", links:"Liens et références",
|
||||
callTitle:"Appeler le propriétaire", callText:"Pour toute demande directe, veuillez appeler le propriétaire :",
|
||||
contactTitle:"Contact via WhatsApp", name:"Votre nom", phone:"Votre numéro de téléphone",
|
||||
whatsapp:"Contacter via WhatsApp",
|
||||
description:"Jaguar E-Type Roadster de 1973, propriété privée, en rouge, équipée du légendaire moteur V12."}
|
||||
// Slide element
|
||||
const slide = document.createElement('div');
|
||||
slide.className = 'slide';
|
||||
slide.innerHTML = `
|
||||
<img
|
||||
src="${photoPath}"
|
||||
alt="1973 Jaguar E-Type Roadster Photo ${idx + 1}"
|
||||
loading="${idx === 0 ? 'eager' : 'lazy'}"
|
||||
/>
|
||||
<div class="slide-overlay">
|
||||
<h3>Jaguar E-Type V12 Roadster</h3>
|
||||
<span class="slide-counter">${padIdx} / ${padTotal}</span>
|
||||
</div>
|
||||
`;
|
||||
track.appendChild(slide);
|
||||
|
||||
// Dot element
|
||||
const dot = document.createElement('div');
|
||||
dot.className = `dot ${idx === 0 ? 'active' : ''}`;
|
||||
dot.dataset.index = idx;
|
||||
dotsNav.appendChild(dot);
|
||||
});
|
||||
|
||||
slides = Array.from(track.children);
|
||||
dots = Array.from(dotsNav.children);
|
||||
|
||||
attachEventListeners();
|
||||
|
||||
} catch (err) {
|
||||
console.error('Gallery initialization error:', err);
|
||||
track.innerHTML = '<div class="loading-state">Unable to load photos.json from root</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed:{ t(){ return this.translations[this.lang]; }},
|
||||
methods:{
|
||||
loadData(){
|
||||
fetch(`specifications_${this.lang}.json`).then(r=>r.json()).then(j=>this.specifications=j);
|
||||
fetch(`links_${this.lang}.json`).then(r=>r.json()).then(j=>this.links=j);
|
||||
},
|
||||
setLang(l){ this.lang=l; this.loadData(); },
|
||||
openFullscreen(i){ this.activeIndex=i; this.fullscreen=true; },
|
||||
next(){ this.activeIndex=(this.activeIndex+1)%this.photos.length; },
|
||||
prev(){ this.activeIndex=(this.activeIndex-1+this.photos.length)%this.photos.length; },
|
||||
openWhatsApp(){
|
||||
const t=`${this.form.name} (${this.form.phone}): ${this.form.message}`;
|
||||
window.open(`https://wa.me/41793758510?text=${encodeURIComponent(t)}`);
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
fetch("photos.json").then(r=>r.json()).then(j=>this.photos=j);
|
||||
this.loadData();
|
||||
}
|
||||
}).mount("#app");
|
||||
</script>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKE9H4BLN3"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-WKE9H4BLN3');
|
||||
</script>
|
||||
function scrollToSlide(index) {
|
||||
if (!slides.length) return;
|
||||
if (index < 0) index = slides.length - 1;
|
||||
if (index >= slides.length) index = 0;
|
||||
|
||||
const slideWidth = slides[0].getBoundingClientRect().width;
|
||||
track.scrollTo({
|
||||
left: slideWidth * index,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
|
||||
updateActiveState(index);
|
||||
currentIndex = index;
|
||||
}
|
||||
|
||||
function updateActiveState(activeIndex) {
|
||||
dots.forEach((dot, idx) => {
|
||||
dot.classList.toggle('active', idx === activeIndex);
|
||||
});
|
||||
}
|
||||
|
||||
function attachEventListeners() {
|
||||
prevBtn.addEventListener('click', () => scrollToSlide(currentIndex - 1));
|
||||
nextBtn.addEventListener('click', () => scrollToSlide(currentIndex + 1));
|
||||
|
||||
dots.forEach(dot => {
|
||||
dot.addEventListener('click', (e) => {
|
||||
const index = parseInt(e.target.dataset.index);
|
||||
scrollToSlide(index);
|
||||
});
|
||||
});
|
||||
|
||||
let scrollTimeout;
|
||||
track.addEventListener('scroll', () => {
|
||||
clearTimeout(scrollTimeout);
|
||||
scrollTimeout = setTimeout(() => {
|
||||
const slideWidth = slides[0].getBoundingClientRect().width;
|
||||
const newIndex = Math.round(track.scrollLeft / slideWidth);
|
||||
if (newIndex !== currentIndex) {
|
||||
currentIndex = newIndex;
|
||||
updateActiveState(currentIndex);
|
||||
}
|
||||
}, 50);
|
||||
});
|
||||
|
||||
// Lightbox click handler
|
||||
slides.forEach(slide => {
|
||||
const img = slide.querySelector('img');
|
||||
if (img) {
|
||||
img.addEventListener('click', () => {
|
||||
lightboxImg.src = img.src;
|
||||
lightbox.classList.add('active');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
lightboxClose.addEventListener('click', () => lightbox.classList.remove('active'));
|
||||
lightbox.addEventListener('click', (e) => {
|
||||
if (e.target === lightbox) lightbox.classList.remove('active');
|
||||
});
|
||||
|
||||
// Run gallery initialization
|
||||
initGallery();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user