├── .gitignore
├── .eslintrc
├── assets
├── css
│ ├── css
│ │ └── fonts
│ │ │ ├── Lato-Bold.ttf
│ │ │ ├── Lato-Light.ttf
│ │ │ └── Lato-Regular.ttf
│ ├── style.css
│ └── grid.css
└── javascript
│ └── main.js
├── .travis.yml
├── .github
├── CODE_OF_CONDUCT.md
├── ISSUE_TEMPLATE
│ ├── new-study-group.md
│ └── problem-report.md
├── PULL_REQUEST_TEMPLATE.md
└── CONTRIBUTING.md
├── README.md
├── package.json
├── LICENSE
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "json"
4 | ]
5 | }
--------------------------------------------------------------------------------
/assets/css/css/fonts/Lato-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freeCodeCamp/study-group-directory/HEAD/assets/css/css/fonts/Lato-Bold.ttf
--------------------------------------------------------------------------------
/assets/css/css/fonts/Lato-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freeCodeCamp/study-group-directory/HEAD/assets/css/css/fonts/Lato-Light.ttf
--------------------------------------------------------------------------------
/assets/css/css/fonts/Lato-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freeCodeCamp/study-group-directory/HEAD/assets/css/css/fonts/Lato-Regular.ttf
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 |
3 | node_js:
4 | - '8'
5 |
6 | cache:
7 | directories:
8 | - node_modules
9 |
10 | sudo: false
11 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | Please read the freeCodeCamp Code of Conduct, which can be found at [Code of Conduct](https://code-of-conduct.freecodecamp.org/)
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/new-study-group.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: New study group
3 | about: Raise a request to add a new study group
4 |
5 | ---
6 |
7 | Please provide the following information to aid in adding your group to the directory:
8 |
9 | ### Esssential
10 | - [ ] Group URL (Web address)
11 | - [ ] Town or City group is located in
12 | - [ ] State / County / Region
13 | - [ ] Country
14 |
15 | ### Nice to have
16 | - [ ] Co-ordinates
17 |
18 | ### If you have one
19 | - [ ] URL of Group Photo
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # freeCodeCamp Study Group Directory
2 |
3 | This simple website is a catalog of all the freeCodeCamp study groups around the world (that we know about).
4 |
5 | If the user allows location access the groups closest to your browser location are displayed at the top of the page. Alternatively, you can search for groups by place name.
6 |
7 | Find the directory here [freeCodeCamp Study Groups](https://study-group-directory.freecodecamp.org/)
8 |
9 | If you wish to contribute by adding entries, fixing problems or otherwise improving the directory please refer to [CONTRIBUTING.md](https://github.com/freeCodeCamp/study-group-directory/blob/master/.github/CONTRIBUTING.md)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "study-groups-fcc",
3 | "version": "0.0.1",
4 | "description": "freeCodeCamp study group directory static page",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"No tests\"",
8 | "pretest": "npm run lint",
9 | "lint": "eslint . --ext .json"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "git+https://github.com/freeCodeCamp/study-group-directory.git"
14 | },
15 | "author": "",
16 | "license": "BSD-3-Clause",
17 | "bugs": {
18 | "url": "https://github.com/freeCodeCamp/study-group-directory/issues"
19 | },
20 | "homepage": "https://github.com/freeCodeCamp/study-group-directory#readme",
21 | "devDependencies": {
22 | "eslint": "^3.18.0",
23 | "eslint-plugin-json": "^1.2.0"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/problem-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Problem report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | #### Describe your problem and - if possible - how to reproduce it
8 | A clear and concise description of what the problem is.
9 |
10 | #### To Reproduce
11 | Steps to reproduce the behaviour:
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | #### What was the expected behaviour
18 | A clear and concise description of what you expected to happen.
19 |
20 | #### If possible, add a screenshot here
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | #### Tell us about your browser and operating system
24 | **Desktop (please complete the following information):**
25 | - OS: [e.g. iOS]
26 | - Browser [e.g. chrome, safari]
27 | - Version [e.g. 22]
28 |
29 | **Smartphone (please complete the following information):**
30 | - Device: [e.g. iPhone6]
31 | - OS: [e.g. iOS8.1]
32 | - Browser [e.g. stock browser, safari]
33 | - Version [e.g. 22]
34 |
35 | #### Additional Information
36 | Add any other information you think will be helpful for us to fix the problem
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2016, Free Code Camp
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | * Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | #### Pre-Submission Checklist
8 |
9 |
10 |
11 | - [ ] Your pull request targets the `master` branch of freeCodeCamp/study-group-directory.
12 | - [ ] You have only one commit (if not, [squash](http://forum.freecodecamp.org/t/how-to-squash-multiple-commits-into-one-with-git/13231) them into one commit).
13 |
14 | #### Type of Change
15 |
16 | - [ ] Small bug fix (non-breaking change which fixes an issue)
17 | - [ ] New feature (non-breaking change which adds new functionality)
18 | - [ ] Breaking change (fix or feature that would change existing functionality)
19 | - [ ] Update or Correct an existing group entry
20 | - [ ] Add a new group entry
21 |
22 | #### Checklist:
23 |
24 |
25 | - [ ] Tested changes locally.
26 | - [ ] Automated build tests (Travis and Netlify) pass
27 | - [ ] Addressed currently open issue (replace XXXXX with an issue number in next line)
28 |
29 | Closes #XXXXX
30 |
31 | #### Description
32 |
33 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | The Study Guide Directory is an important tool for helping to bring together campers with their local peers.
4 |
5 | ### Add new and missing groups.
6 | We need help to add new groups as they are created and also to add any that are missing. You can create an issue requesting a new group be added by using the [New Study Group template.](https://github.com/freeCodeCamp/study-group-directory/issues/new?template=new-study-group.md) Alternatively you can use the instructions below to create a pull request to add the entry if you are comfortable doing so.
7 |
8 | ### Fix errors in the directory.
9 | There may also be errors or changes required for the information provided for each group. In particular the location data was sourced from a maps service and sometimes the service identified the wrong location. You can raise an [issue](https://github.com/freeCodeCamp/study-group-directory/issues/new?template=problem-report.md) to let us know of any problems, or you can raise a pull request to fix any mistakes.
10 |
11 | We welcome pull requests from freeCodeCamp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute:
12 |
13 | 1. Find an existing issue that needs assistance by searching for the [Help Wanted](https://github.com/freeCodeCamp/study-group-directory/labels/help%20wanted) tag, or [create one](https://github.com/freeCodeCamp/study-group-directory/issues/new?template=problem-report.md) if you've seen an issue not already logged.
14 |
15 | 2. Let us know you are working on it by posting a comment on the issue.
16 |
17 | 3. Create a fork of the repository.
18 |
19 | 4. Create a branch in your fork for your changes.
20 |
21 | 5. When ready submit a pull request to fix, complete the information requested in the template and be sure to include a line in the PR comment that states which issue the PR closes.
22 |
23 | Remember to feel free to ask for help in our [Contributors](https://gitter.im/FreeCodeCamp/Contributors) Gitter room.
24 |
25 | Working on your first Pull Request? You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
26 |
27 | ### The directory data.
28 | The data for the directory is held in the [campsitesfinal.json](https://github.com/freeCodeCamp/study-group-directory/blob/master/assets/json/campsitesfinal.json). The file is large so will be slow to load on GitHub.
29 |
30 | The structure of the file is an array of objects. Each object is an entry in the directory.
31 |
32 | The objects are simply collections of name / value pairs, some are mandatory others optional.
33 |
34 | Sample entry:
35 | ``` javascript
36 | {
37 | "url": "https://www.facebook.com/groups/free.code.camp.to",
38 | "city": "Toronto",
39 | "state": "Ontario",
40 | "country": "Canada",
41 | "coordinates": "43.652921, -79.384901",
42 | "photoUrl": "https://scontent-dft4-2.xx.fbcdn.net/v/t31.0-8/15068500_10210962248150704_3614548903645249833_o.jpg?oh=49670f8c4ac9b83dbbbb1207c3d2b780&oe=599725C0"
43 | }
44 | ```
45 |
46 | The `url`, `country` and `coordinates` fields are mandatory. `city` and `state` fields should be used to provide name and area of the location of the group. Either may be left blank if the entry still makes sense without it. `photoUrl` can be used to provide the groups chosen photo if it has one - presently this is not used but will be in the Events platform.
47 |
--------------------------------------------------------------------------------
/assets/javascript/main.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 |
3 | $('form').on('submit', function(e) { e.preventDefault(); });
4 |
5 | $('.hidden-code').click(function(e) {
6 | e.preventDefault();
7 | $(this).children('.gist').slideToggle();
8 | });
9 |
10 | var originalText;
11 | $('.example-grid').children().hover(
12 | function() {
13 | originalText = $(this).text();
14 | $(this).html($(this).width()+'px');
15 | },
16 | function() {
17 | $(this).html(originalText);
18 | }
19 | );
20 |
21 | $('#select-search-nearby').change(function(e){
22 | e.preventDefault();
23 | $('#closeCamps').children().hide();
24 | $('#closeCamps>div').filter(function(){
25 | return parseInt($('h4>a>div', this)[0].innerText.match(/(\d+.\d\d)\skm/)[1]) < parseInt($('#select-search-nearby').val());
26 | }).show();
27 | });
28 |
29 | searchNearby(100);
30 |
31 | // find close to coordinates
32 | function searchNearby(maxRadius) {
33 | if (navigator.geolocation) {
34 | navigator.geolocation.getCurrentPosition(function(position){
35 | NearestCities(position.coords.latitude, position.coords.longitude, maxRadius);
36 | });
37 | } else {
38 | // loc = "Geolocation is not supported by this browser.";
39 | NearestCities(38.8951, -77.0367, maxRadius);
40 | }
41 | }
42 |
43 | // Convert Degress to Radians
44 | function Deg2Rad(deg) {
45 | return deg * Math.PI / 180;
46 | }
47 |
48 | function PythagorasEquirectangular(lat1, lon1, lat2, lon2) {
49 | lat1 = Deg2Rad(lat1);
50 | lat2 = Deg2Rad(lat2);
51 | lon1 = Deg2Rad(lon1);
52 | lon2 = Deg2Rad(lon2);
53 | var R = 6371; // km
54 | var x = (lon2 - lon1) * Math.cos((lat1 + lat2) / 2);
55 | var y = (lat2 - lat1);
56 | var d = Math.sqrt(x * x + y * y) * R;
57 | return d;
58 | }
59 |
60 | var cities = [];
61 | var cityNames = [];
62 |
63 | $.getJSON('assets/json/campsitesfinal.json').then(function(data) {
64 | data.forEach(function(loc) {
65 | const coordString = loc.coordinates;
66 | let values = coordString.split(",");
67 |
68 | var lat = ConvertDMSToDD(parseFloat(values[0]));
69 | var lng = ConvertDMSToDD(parseFloat(values[1]));
70 | let coords = [loc.city, loc.state, loc.country, lat, lng];
71 |
72 | cities.push(coords);
73 |
74 | cityNames.push(
75 | (loc.city.length > 0 ? loc.city + ", " : "") +
76 | (loc.state.length > 0 ? loc.state + ", " : "") +
77 | loc.country
78 | );
79 |
80 |
81 | });
82 | });
83 |
84 | function ConvertDMSToDD(degrees) {
85 | var dd = degrees;
86 |
87 | // if (direction == "S" || direction == "W") {
88 | // dd = dd * -1;
89 | // } // Don't do anything for N or E
90 | return dd;
91 | }
92 |
93 | function NearestCities(latitude, longitude, maxRadius) {
94 | var closest = [];
95 |
96 | for (index = 0; index < cities.length; ++index) {
97 | var dif = PythagorasEquirectangular(latitude, longitude, cities[index][3], cities[index][4]);
98 | if (dif < maxRadius) {
99 | closest.push({index:index, dist:dif});
100 | }
101 | }
102 |
103 | closest = closest.sort(function(a, b){
104 | return a.dist - b.dist;
105 | });
106 |
107 | $.getJSON('assets/json/campsitesfinal.json').then(function(data) {
108 | $('#search-nearby').show();
109 | for (let i = 0; i < closest.length; i++){
110 | let loc = data[closest[i].index];
111 | let img = loc.photoUrl || "https://s3.amazonaws.com/freecodecamp/bannercropped.png",
112 | city = loc.city,
113 | state = loc.state,
114 | country = loc.country,
115 | url = loc.url,
116 | coords = loc.coordinates;
117 | let location = '';
118 |
119 | location = (city.length > 0 ? city + ", " : "") +
120 | (state.length > 0 ? state + ", " : "") +
121 | country;
122 |
123 | $("#closeCamps").append(
124 | `
125 |
Join the study group closest to you or search for a place name below.
106 |
107 |
Note: Currently most freeCodeCamp Study Groups are using Facebook Groups to organize themselves. We are building our own events platform to use in the future. If you can't find a study group near you, you can create one.
108 |
109 |
110 |
111 |
112 |
113 |
Study groups within
114 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
138 |
139 | If you cannot find the exact place name you are looking for try searching for nearby places, or the the region or even country the place is in.
140 |