Skip to content

Commit

Permalink
add suggest form, and updated styling for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tijs committed Dec 1, 2024
1 parent e675d66 commit 47d7275
Show file tree
Hide file tree
Showing 7 changed files with 524 additions and 54 deletions.
10 changes: 10 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ title: Open EV Data
description: Open Dataset of Electric Vehicles and their specs
domain: opendata.kilowattcharging.com
url: https://opendata.kilowattcharging.com
baseurl: ""

# GitHub metadata
github:
owner_name: KilowattApp
owner_url: https://github.com/KilowattApp
repository_url: https://github.com/KilowattApp/open-ev-data

# Navigation
navigation:
- title: Home
url: /
- title: Search
url: /search
- title: Suggest Vehicle
url: /suggest


76 changes: 24 additions & 52 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,33 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page.title }} - {{ site.title }}</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
color: #24292e;
}
header {
border-bottom: 1px solid #eaecef;
margin-bottom: 2rem;
}
nav {
margin: 1rem 0;
}
nav a {
margin-right: 1rem;
color: #0366d6;
text-decoration: none;
}
nav a:hover {
text-decoration: underline;
}
img {
max-width: 100%;
height: auto;
}
code {
background-color: #f6f8fa;
padding: 0.2em 0.4em;
border-radius: 3px;
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
pre code {
display: block;
padding: 1rem;
overflow-x: auto;
}
footer {
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid #eaecef;
color: #586069;
font-size: 0.9rem;
}
</style>
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
</head>
<body>
<header>
<h1>{{ site.title }}</h1>
<nav>
<a href="{{ site.baseurl }}/">Home</a>
<a href="{{ site.baseurl }}/search">Search</a>
<a href="{{ site.github.repository_url }}">View on GitHub</a>
<div class="site-header">
<h1 class="site-title">{{ site.title }}</h1>
<p class="site-description">{{ site.description }}</p>
</div>
<nav class="main-nav">
<!-- Debug output to see what's in site.navigation -->
{% if site.navigation %}
<!-- Navigation exists -->
{% for item in site.navigation %}
<a href="{{ item.url | relative_url }}" {% if page.url contains item.url and item.url != "/" or page.url == "/" and item.url == "/" %}class="active"{% endif %}>
{{ item.title }}
</a>
{% endfor %}
{% else %}
<!-- No navigation found -->
<p>Debug: Navigation not found in site configuration</p>
{% endif %}
<a href="{{ site.github.repository_url }}" class="github-link">
<svg height="16" viewBox="0 0 16 16" width="16" class="github-icon">
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>
</svg>
View on GitHub
</a>
</nav>
</header>

Expand Down
149 changes: 149 additions & 0 deletions docs/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
:root {
/* Main colors */
--kw-darker-green: #70CF96;
--kw-dark-blue: #9CDDE3;
--kw-green: #85F5B1;
--kw-main-blue: #2D9CDB;
--kw-light-blue: #A7ECF2;
--kw-eighty-percent: #F2CA4D;

/* Text and background colors */
--text-primary: #24292e;
--text-secondary: #586069;
--bg-primary: #f5fbfc; /* Very light blue-green tint */
--bg-white: #ffffff;
}

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
color: var(--text-primary);
background: var(--bg-primary);
}

.site-header {
text-align: center;
padding: 2rem 1rem 3rem;
margin: -2rem -2rem 0 -2rem;
}

.site-title {
margin: 0;
font-size: 2.5rem;
font-weight: 600;
color: var(--text-primary);
}

.site-description {
margin: 0.5rem 0 0;
color: var(--text-secondary);
font-size: 1.1rem;
}

.main-nav {
padding: 1rem;
margin: -2rem -2rem 2rem -2rem;
text-align: center;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-nav a {
color: var(--text-primary);
text-decoration: none;
padding: 0.5rem 1rem;
margin: 0 0.5rem;
border-radius: 4px;
transition: all 0.2s;
}

.main-nav a:hover {
background: var(--kw-light-blue);
color: var(--text-primary);
}

.main-nav a.active {
background: var(--kw-darker-green);
color: white;
}

.github-link {
background: var(--text-primary) !important;
color: white !important;
}

.github-link:hover {
background: var(--kw-main-blue) !important;
}

/* Form styling */
.form-section {
background: var(--bg-white);
border-left: 4px solid var(--kw-darker-green);
}

.submit-button {
background: var(--kw-main-blue);
}

.submit-button:hover {
background: var(--kw-dark-blue);
}

/* Search styling */
.search-box input {
border-color: var(--kw-darker-green);
}

.search-box input:focus {
box-shadow: 0 0 0 2px var(--kw-light-blue);
}

/* Links */
a {
color: var(--kw-main-blue);
text-decoration: none;
}

a:hover {
color: var(--kw-darker-green);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
color: var(--text-primary);
padding-bottom: 0.3em;
}

/* Code blocks */
code {
background-color: #f6f8fa;
border: 1px solid var(--kw-light-blue);
}

/* Footer */
footer {
margin-top: 2rem;
padding-top: 2rem;
border-top: 3px solid var(--kw-darker-green);
color: var(--text-secondary);
font-size: 0.9rem;
}

.github-icon {
display: inline-block;
vertical-align: text-bottom;
}

img {
max-width: 100%;
height: auto;
}

pre code {
display: block;
padding: 1rem;
overflow-x: auto;
}
138 changes: 138 additions & 0 deletions docs/assets/css/suggest.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.suggestion-container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
box-sizing: border-box;
}

.form-section {
margin-bottom: 30px;
padding: 25px;
background: #f5f5f5;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
box-sizing: border-box;
}

.form-section h3 {
margin-top: 0;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #e0e0e0;
color: #333;
}

.form-group {
margin-bottom: 20px;
display: grid;
grid-template-columns: minmax(150px, 200px) minmax(200px, 1fr);
gap: 15px;
align-items: center;
box-sizing: border-box;
}

label {
font-weight: 600;
color: #444;
}

label[for="sources"] {
align-self: start;
padding-top: 8px;
}

input[type="text"],
input[type="number"],
select,
textarea {
width: 100%;
max-width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
transition: border-color 0.2s, box-shadow 0.2s;
box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
outline: none;
border-color: #4CAF50;
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Add units after input fields */
.form-group.with-unit {
position: relative;
}

.form-group.with-unit input {
padding-right: 45px;
}

.form-group.with-unit::after {
content: attr(data-unit);
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
color: #666;
font-size: 14px;
}

textarea {
height: 100px;
resize: vertical;
font-family: inherit;
}

.submit-button {
background: #4CAF50;
color: white;
padding: 12px 24px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
width: 100%;
max-width: 300px;
margin: 20px auto 0;
display: block;
transition: background-color 0.2s;
}

.submit-button:hover {
background: #45a049;
}

.error {
color: #ff0000;
font-size: 14px;
margin-top: 5px;
grid-column: 2;
}

/* Required field indicator */
label.required::after {
content: " *";
color: #ff0000;
}

/* Responsive design */
@media (max-width: 600px) {
.form-group {
grid-template-columns: 1fr;
gap: 8px;
}

label {
margin-bottom: 5px;
}

.error {
grid-column: 1;
}
}
Loading

0 comments on commit 47d7275

Please sign in to comment.