-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevc.html
More file actions
156 lines (135 loc) · 6.38 KB
/
Copy pathevc.html
File metadata and controls
156 lines (135 loc) · 6.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title id="pageTitle">EVC Details | Find My EVC</title>
<meta name="description" id="pageDescription" content="Ecological Vegetation Class information for Victoria">
<link rel="canonical" id="canonicalUrl" href="https://findmyevc.com/evc.html">
<link rel="manifest" href="./manifest.json">
<meta name="theme-color" content="#3d4535">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Abril+Fatface&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./assets/styles.css">
</head>
<body>
<nav class="main-nav">
<div class="nav-container">
<a href="./" class="logo">Find My EVC</a>
<button class="hamburger" id="hamburger" aria-label="Menu">
<span></span>
<span></span>
<span></span>
</button>
</div>
</nav>
<div class="nav-modal" id="navModal">
<div class="nav-modal-content">
<button class="nav-close" id="navClose">×</button>
<ul class="nav-links">
<li><a href="./">Home</a></li>
<li><a href="./about.html">About EVCs</a></li>
<li><a href="./contact.html">Contact</a></li>
<li><a href="https://www.findmyecologicalgarden.com/" target="_blank" rel="noopener">Find My Ecological Garden →</a></li>
</ul>
</div>
</div>
<main class="main-content page-content">
<div id="evcContent">
<div class="loading-spinner"></div>
</div>
</main>
<div class="gardener-badge">
<a href="https://www.gardenerandson.com.au/" target="_blank" rel="noopener">
<div class="badge-text">A Gardener & Son Project</div>
</a>
</div>
<footer class="footer">
<div class="footer-content">
<p class="acknowledgement">We acknowledge the Traditional Custodians of the lands on which we work and pay our respects to Elders past, present, and emerging. This site uses ecological data to support the restoration of indigenous plant communities on Country.</p>
<p class="footer-links">
<a href="./about.html">About</a>
<span>·</span>
<a href="./contact.html">Contact</a>
<span>·</span>
<a href="https://www.gardenerandson.com.au/" target="_blank" rel="noopener">Gardener & Son</a>
</p>
</div>
</footer>
<script src="./assets/app.js"></script>
<script>
async function loadEVCPage() {
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
const slug = urlParams.get('slug');
if (!code && !slug) {
window.location.href = './';
return;
}
try {
const response = await fetch('./data/evc_pages.json');
const data = await response.json();
let evc = null;
if (code) {
evc = data.evcs.find(e => e.code === code);
} else if (slug) {
evc = data.evcs.find(e => e.slug === slug);
}
if (!evc) {
window.location.href = './404.html';
return;
}
const title = `EVC ${evc.code} — ${evc.name} | Find My EVC`;
const description = `${evc.overview.substring(0, 155)}...`;
document.getElementById('pageTitle').textContent = title;
document.getElementById('pageDescription').setAttribute('content', description);
document.getElementById('canonicalUrl').setAttribute('href', `https://findmyevc.com/evc.html?code=${evc.code}`);
const content = `
<article class="content-article">
<div class="evc-header">
<div class="evc-code">EVC ${evc.code}</div>
<h1>${evc.name}</h1>
</div>
<section class="content-section">
<h2>Overview</h2>
<p>${evc.overview}</p>
</section>
<section class="content-section">
<h2>Where it occurs</h2>
<p>${evc.distribution}</p>
</section>
<section class="content-section">
<h2>Typical structure</h2>
<p>${evc.structure}</p>
</section>
<section class="content-section">
<h2>Boundaries and common confusion</h2>
<p>${evc.boundaries}</p>
</section>
<section class="content-section">
<h2>Why this matters for gardens</h2>
<p>${evc.garden_relevance}</p>
</section>
<div class="cta-box">
<h3>Get indigenous plants for this EVC</h3>
<p>Discover plant species naturally occurring in ${evc.name}.</p>
<a href="https://www.findmyecologicalgarden.com/?evc=${evc.code}&name=${encodeURIComponent(evc.name)}" class="btn-primary">View Plant List →</a>
</div>
</article>
`;
document.getElementById('evcContent').innerHTML = content;
} catch (error) {
console.error('Error loading EVC data:', error);
document.getElementById('evcContent').innerHTML = `
<article class="content-article">
<h1>Error loading EVC data</h1>
<p>Please try again or <a href="./">return to the home page</a>.</p>
</article>
`;
}
}
loadEVCPage();
</script>
</body>
</html>