Hi! Welcome to AirbnAnime! This is a site where you can book anime homes/locations for your Otaku-filled vacations with your friends. You can book trips, create homes, leave reviews, and search based on different criteria. More features incoming!
git clone the repo
bundle install
to install gemfilesnpm install
to install npm packagesbundle exec rails db:setup
to create, seed, and migrate databasenpm run start
to start your webpack
The project should then be available at the address localhost:3000 in your browserJavaScript (React, Redux, AJAX, Jquery, Vanilla DOM), HTML, CSS
Ruby on Rails
PostgreSQL
Feature: Airbnanime implements a mapping feature that does a few things.
registerListeners() {
google.maps.event.addListener(this.map, 'idle', () => {
const { north, south, east, west } = this.map.getBounds().toJSON();
const bounds = {
northEast: { lat: north, lng: east },
southWest: { lat: south, lng: west } };
this.props.updateFilter('bounds', bounds);
});
google.maps.event.addListener(this.map, 'click', (event) => {
const coords = getCoordsObj(event.latLng);
this.handleClick(coords);
});
}
updateMarkers(homes){
const homesObj = {};
homes.forEach(home => homesObj[home.id] = home);
homes
.filter(home => !this.markers[home.id])
.forEach(newHome => this.createMarkerFromHome(newHome)); //, this.handleClick))
Object.keys(this.markers)
.filter(homeId => !homesObj[homeId])
.forEach((homeId) => this.removeMarker(this.markers[homeId]));
}
createMarkerFromHome(home) {
const position = new google.maps.LatLng(home.lat, home.lng);
const marker = new google.maps.Marker({
position,
map: this.map,
homeId: home.id
});
// marker.addListener('click', () => this.handleClick(home));
this.markers[marker.homeId] = marker;
}