mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-02 17:18:58 +00:00
121 lines
3.1 KiB
HTML
121 lines
3.1 KiB
HTML
---
|
|
layout: page
|
|
title: "Components"
|
|
description: "List of the built-in components of Home Assistant."
|
|
date: 2014-12-21 13:35
|
|
sidebar: false
|
|
comments: false
|
|
sharing: true
|
|
footer: true
|
|
is_homepage: true
|
|
body_id: components-page
|
|
---
|
|
|
|
<p class='note'>
|
|
Support for these components is provided by the Home Assistant community.
|
|
</p>
|
|
|
|
{% assign components = site.components | sort: 'title' %}
|
|
{% assign categories = components | sort: 'ha_category' | map: 'ha_category' %}
|
|
|
|
<div class="filter-button-group">
|
|
<a href='#all' class="btn">All</a>
|
|
<a href='#featured' class="btn">Featured</a>
|
|
|
|
{% comment %} Jekyll 2.5.2 does not support the uniq filter :/ {% endcomment %}
|
|
{% assign category_printed = '' %}
|
|
|
|
{% for category in categories %}
|
|
{% if category and category != 'Other' %}
|
|
{% unless category_printed contains category %}
|
|
<a href='#{{ category | slugify }}' class="btn">{{ category }}</a>
|
|
{% assign category_printed = category_printed | append: ',' | append: category %}
|
|
{% endunless %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<a href='#other' class="btn">Other</a>
|
|
</div>
|
|
|
|
<div id="componentContainer">
|
|
{% for component in components %}
|
|
{% if component.ha_category %}
|
|
<a href='{{ component.url }}' class='{{ component.ha_category | slugify }}{% if component.featured %} featured{% endif %}'>
|
|
<div class='img-container'>
|
|
{% if component.logo %}
|
|
<img src='/images/supported_brands/{{ component.logo }}'>
|
|
{% endif %}
|
|
</div>
|
|
<div class='title'>{{ component.title }}</div>
|
|
<div class='category'>{{ component.ha_category }}</div>
|
|
</a>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% comment %}
|
|
## Pages without categories
|
|
|
|
{% for component in components %}
|
|
{% unless component.ha_category %}
|
|
<p>{{ component.title }}</p>
|
|
{% endunless %}
|
|
{% endfor %}
|
|
{% endcomment %}
|
|
|
|
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.2.2/isotope.pkgd.js"></script>
|
|
<script type="text/javascript">
|
|
$(window).load(function(){
|
|
var $container = $('#componentContainer');
|
|
|
|
function updateHash(newHash) {
|
|
if ('replaceState' in history) {
|
|
history.replaceState('', '', newHash);
|
|
} else {
|
|
location.hash = newHash;
|
|
}
|
|
}
|
|
|
|
function applyFilter() {
|
|
var hash = location.hash;
|
|
|
|
var filter;
|
|
if (hash == '') {
|
|
filter = '.featured'
|
|
hash = '#featured'
|
|
} else if (hash == '#all') {
|
|
filter = '*';
|
|
} else {
|
|
filter = '.' + hash.substr(1);
|
|
}
|
|
|
|
$('.filter-button-group a.current').removeClass('current');
|
|
$('.filter-button-group a[href='+hash+']').addClass('current');
|
|
|
|
$container.isotope({
|
|
filter: filter,
|
|
animationOptions: {
|
|
duration: 750,
|
|
easing: 'linear',
|
|
queue: false
|
|
},
|
|
masonry: {
|
|
columnWidth: 210
|
|
}
|
|
});
|
|
}
|
|
|
|
jQuery('.filter-button-group a').click(function() {
|
|
updateHash(this.getAttribute('href'));
|
|
applyFilter();
|
|
|
|
return false;
|
|
});
|
|
|
|
window.addEventListener('hashchange', applyFilter);
|
|
|
|
applyFilter();
|
|
});
|
|
</script>
|