Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
feat(dropdown): show SVG icons
Browse files Browse the repository at this point in the history
  • Loading branch information
LukyVj authored and vvo committed Mar 29, 2016
1 parent 5cf298d commit ecf954b
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 80 deletions.
2 changes: 1 addition & 1 deletion docs/source/index.html.haml
@@ -1,5 +1,5 @@
---
title: Welcome to Middleman
title: Algolia - Places
---
%div.navigation
%div.fl-left
Expand Down
23 changes: 22 additions & 1 deletion docs/source/javascripts/all.js
@@ -1,3 +1,24 @@
/* global places */

places({container: document.querySelector('#landing-demo')});
places({
container: document.querySelector('#landing-demo')
});

// automatically add necessary css classes for responsive layour
document.addEventListener('scroll', scrollEvent => {
const hero = document.querySelector('.hero-section');
const navigation = document.querySelector('.navigation');

const value = scrollEvent.target.scrollingElement.scrollTop;
const height = hero.offsetHeight;
const navHeight = navigation.offsetHeight;

if (value > height) {
navigation.classList.add('darken');
} else if (value > (height - navHeight)) {
navigation.classList.add('init');
navigation.classList.remove('darken');
} else {
navigation.classList.remove('darken', 'init');
}
});
7 changes: 0 additions & 7 deletions docs/source/stylesheets/_csspeed.scss

This file was deleted.

21 changes: 21 additions & 0 deletions docs/source/stylesheets/components/_containers.scss
@@ -1,6 +1,27 @@
/* Grid system
// .bloc-1 = 10%
// .bloc-2 = 20%
// and so on..
================*/
$sizes: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;

[class*="bloc-"] {
float: left;
}
@each $size in $sizes {
.bloc-#{$size} {
$size: $size*10%;
width: $size;
}
}


/* Containers
================*/
.container {
float: none;
margin: auto;
width: 100%;
max-width: $max-width;
}

Expand Down
11 changes: 10 additions & 1 deletion docs/source/stylesheets/components/_navigation.scss
Expand Up @@ -3,13 +3,22 @@
width: 100%;
max-height: $navigation-height;
line-height: $navigation-height;
background: darken($denim-blue, 5%);
background: transparent;
overflow: hidden;
z-index: 101;
color: #fff;
padding: 0 16px;
margin: 0;

&.init {
background: #2F468C;
}

&.darken {
background: #0C1621;
}


.brand {
float: left;
}
Expand Down
13 changes: 0 additions & 13 deletions docs/source/stylesheets/csspeed/_base.scss

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/stylesheets/csspeed/_containers.scss

This file was deleted.

11 changes: 0 additions & 11 deletions docs/source/stylesheets/csspeed/_grid.scss

This file was deleted.

21 changes: 0 additions & 21 deletions docs/source/stylesheets/csspeed/_mixins.scss

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/stylesheets/csspeed/_variables.scss

This file was deleted.

11 changes: 2 additions & 9 deletions docs/source/stylesheets/site.css.scss
@@ -1,14 +1,7 @@
@import 'normalize';

// Import CSSPeed boilerplate CSS
// Since I plan to create a css
// boilerplate for algolia's landing pages
// it may change in the future
// Still thinking about it
@import 'csspeed';

@import 'vendors/variables',
'vendors/normalize',
'vendors/mixins',
'vendors/helpers',
'vendors/base',
'vendors/svg-animations';

Expand Down
18 changes: 18 additions & 0 deletions docs/source/stylesheets/vendors/_base.scss
Expand Up @@ -3,6 +3,21 @@
:root {
font-size: 16px;
}

* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
}

html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
float: left;
}

body {
font-family: "Raleway", Helvetica Neue, helvetica;
}
Expand All @@ -12,3 +27,6 @@ a {

}




2 changes: 1 addition & 1 deletion docs/source/stylesheets/vendors/_variables.scss
Expand Up @@ -11,7 +11,7 @@ $bp-small: 768px;
/* Dimensions
=====================*/
$max-width: 940px;
$navigation-height: 70px;
$navigation-height: 60px;


/* Colors
Expand Down
7 changes: 4 additions & 3 deletions src/formatAutocompleteSuggestion.js
Expand Up @@ -10,8 +10,9 @@ export default function formatAutocompleteSuggestion({
name
}) {
return (
`${name}
${isCity === false ? ` ${city},` : ''}
`<span class="pl-icon">${icons[isCity === false ? 'address' : 'city']}</span>
<span class="pl-name">${name}</span> <span class="pl-address">
${isCity === false ? `${city},` : ``}
${administrative},
${country}`);
${country}</span>`);
}
2 changes: 1 addition & 1 deletion src/icons/address.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/icons/city.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ecf954b

Please sign in to comment.