Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home page, about page and build your own Data Commons page, and footer #4599

Merged
merged 107 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
baa3794
Feature/home page react (#1)
nick-next Sep 3, 2024
1738d8c
This push addresses a number of comments in the PR:
nick-next Sep 5, 2024
4393072
File, path and import renaming.
nick-next Sep 5, 2024
8b3ac39
File formatting, tagged the homepage metadata data container as "meta…
nick-next Sep 5, 2024
547bf5e
To keep full backwards compatibility with templates using the old hom…
nick-next Sep 5, 2024
8758913
Following up from the previous commit, the .ts file for v2 (the new v…
nick-next Sep 5, 2024
3b788c1
Factored out the calls to `document.getElementById` so that it is onl…
nick-next Sep 5, 2024
d468964
Commenting of interfaces, interface properties and files.
nick-next Sep 5, 2024
ea913a3
This push brings back the application container for the original home…
nick-next Sep 5, 2024
db7146f
Used macros to help render the label and route data containers.
nick-next Sep 5, 2024
4bf9b18
Updating the label and route proxy objects to take the type as a gene…
nick-next Sep 5, 2024
8ff02ae
The label proxy object now emits a log when the requested label does …
nick-next Sep 5, 2024
9d35401
Template routes must now be wrapped in `{}` in order to be resolved, …
nick-next Sep 5, 2024
6ea848f
WIP: A functional implementation of the rich menu. A note that this h…
nick-next Sep 6, 2024
12abba5
WIP We now have the ability to put direct links in the header menu (s…
nick-next Sep 6, 2024
c6b98d5
Menu Styles WIP
pablonoel Sep 6, 2024
859a19f
better search bar
pablonoel Sep 6, 2024
baeeb68
Added in {} tags to remaining routes, and removed an extra logo from …
nick-next Sep 6, 2024
1edc0e6
Menu WIP shadow + arrows
pablonoel Sep 6, 2024
585cc29
Menu item link coloring update.
nick-next Sep 6, 2024
8991754
Improvement over menu item behaviour
pablonoel Sep 6, 2024
166e32e
Animated icon when page is open.
nick-next Sep 6, 2024
dfe6c21
WIP improvements for the menu
pablonoel Sep 6, 2024
17a6c45
Added in TODOs to be resolved before the final PR.
nick-next Sep 6, 2024
37ef92a
Improvements on menu structure and sizes
pablonoel Sep 6, 2024
8c97b7b
Cleaned up the menu sliding action so that it has the appearance of a…
nick-next Sep 6, 2024
6e6c296
Update header content to include missing links.
nick-next Sep 6, 2024
bdbd474
Minor tweaks to the header styles.
nick-next Sep 6, 2024
149f0fe
Temporarily removed the stand-in for the mobile menu toggle button.
nick-next Sep 6, 2024
6eae1b4
Breakpoints and responsive spacing
pablonoel Sep 6, 2024
676d0c8
Merge branch 'feature/header' of https://github.com/Half-Integer/data…
pablonoel Sep 6, 2024
b449369
Removal of stray console log and some formatting.
nick-next Sep 6, 2024
1162697
Merge branch 'feature/homepage-revamp' into feature/header
nick-next Sep 6, 2024
a425a31
Refactor search bar component to fix Firefox Issue
pablonoel Sep 6, 2024
bc80cda
Merge branch 'feature/header' of https://github.com/Half-Integer/data…
pablonoel Sep 6, 2024
1466751
new desktop header
jenibelle08 Sep 6, 2024
49aed83
WIP: implementation of the mobile menu version of the rich menu. A no…
nick-next Sep 7, 2024
63423d2
Some refactoring of how the header CSS is applied, so that it is avai…
nick-next Sep 7, 2024
50d4966
Added in a missing route resolver.
nick-next Sep 7, 2024
52e4993
If the user scrolls and the desktop rich menu is open, it now closes …
nick-next Sep 7, 2024
c30cf86
better styles for mobile menu
pablonoel Sep 7, 2024
34e917f
Some component renaming
nick-next Sep 7, 2024
16c4fde
Mobile Menu Design Details
pablonoel Sep 7, 2024
41fe22e
Merge branch 'feature/header-mobile' of https://github.com/Half-Integ…
pablonoel Sep 7, 2024
f914dd1
Small fix on hamburger menu icon font size
pablonoel Sep 7, 2024
34b79ea
Removal of unused prop.
nick-next Sep 7, 2024
e77f40d
Visual fixes
pablonoel Sep 7, 2024
012278b
Merge branch 'new-homepage' into feature/header-mobile
nick-next Sep 7, 2024
027772c
Removal of unneeded files and imports, as well as an unneeded prop.
nick-next Sep 7, 2024
cff3114
New homepage initial commit
pablonoel Sep 7, 2024
c9b6dae
Scaffolding for the two new pages to be built: a revamp of the about …
nick-next Sep 7, 2024
f8bf97e
New Images
pablonoel Sep 8, 2024
629a8b8
Refactor reusable variables
pablonoel Sep 8, 2024
458bc23
The sample questions are now coming through to the React app via the …
nick-next Sep 8, 2024
bd04751
Formatting follow-up to previous push.
nick-next Sep 8, 2024
d42bb0a
Addition of missing keys and minor formatting updates.
nick-next Sep 8, 2024
8433e96
Hero refactor + video
pablonoel Sep 8, 2024
9ba7690
Merge branch 'feature/new-pages' of https://github.com/Half-Integer/d…
pablonoel Sep 8, 2024
1fb4380
remove margin from main container
pablonoel Sep 8, 2024
ab7b553
testing component specific scss files
pablonoel Sep 8, 2024
46ccdb3
refactor component styles
pablonoel Sep 8, 2024
2da79a2
The partners are now being passed through to the about page.
nick-next Sep 8, 2024
33d3d70
New location for files, new basic content components
pablonoel Sep 8, 2024
4eec52b
Cleanup, Refactor images location, WIP component styles
pablonoel Sep 8, 2024
861310c
Font sizes refactor
pablonoel Sep 8, 2024
f3db4df
WIP: Implementation of a slide carousel for the home page and the abo…
nick-next Sep 8, 2024
2c363da
Merge remote-tracking branch 'origin/feature/new-pages' into feature/…
nick-next Sep 8, 2024
112c9c9
SCSS cleanup (formatting fixes) as well as a fix to the height of the…
nick-next Sep 8, 2024
4dc09e0
Fixes carousel shadow visual bug
pablonoel Sep 8, 2024
a786739
Added in a timer (with a TODO to review the length of it) to delay th…
nick-next Sep 8, 2024
35c1aac
Reactify media_text component
pablonoel Sep 8, 2024
476a2e9
Added in a TODO on the server side for moving to version two of the h…
nick-next Sep 8, 2024
3ac04d6
Directory refactor (placing the header-related components in their ow…
nick-next Sep 8, 2024
0e28fcc
Added in a TODO for the potential to fold the rich desktop and rich m…
nick-next Sep 8, 2024
5796151
Directory reorganization, formatting and small fixes.
nick-next Sep 8, 2024
bce27dc
WIP component styles
pablonoel Sep 8, 2024
a7530d9
Merge branch 'new-homepage' into feature/new-pages
nick-next Sep 8, 2024
5c21f14
An interim improvement for the content flash when loading older pages…
nick-next Sep 9, 2024
45ac859
Trimming down the footer in preparation for styling of the new footer.
nick-next Sep 9, 2024
9204678
Clean up and refactor of font sizes and spacing
pablonoel Sep 9, 2024
5be10ce
Merge branch 'feature/new-pages' of https://github.com/Half-Integer/d…
pablonoel Sep 9, 2024
5dbc6ec
Removing the old homepage and converting the v2 fork to the primary h…
nick-next Sep 9, 2024
eaa84cb
Build page WIP
pablonoel Sep 9, 2024
fa1f5ff
Merge branch 'feature/new-pages' of https://github.com/Half-Integer/d…
pablonoel Sep 9, 2024
afb3b52
Fix some spacing
pablonoel Sep 9, 2024
0957590
better styles for text-columns component
pablonoel Sep 9, 2024
b11feb8
Refactoring, making some components generic, and formatting/commenting.
nick-next Sep 9, 2024
3c2d565
Merge remote-tracking branch 'origin/feature/new-pages' into feature/…
nick-next Sep 9, 2024
46ec299
Footer Styles
pablonoel Sep 9, 2024
8b75252
Merge branch 'feature/new-pages' of https://github.com/Half-Integer/d…
pablonoel Sep 9, 2024
52e74eb
The about page slider component (with some stand-in content for the s…
nick-next Sep 9, 2024
90edca0
Responsive behaviour
pablonoel Sep 9, 2024
96274fa
Nicer slider in about
pablonoel Sep 9, 2024
a8d9f68
Update slide_carousel.scss
pablonoel Sep 9, 2024
b015b8a
Initial push of the quote hero on the build page.
nick-next Sep 9, 2024
4a9c58e
Fix the breakpoints for pages
pablonoel Sep 9, 2024
594006d
Merge branch 'feature/new-pages' of https://github.com/Half-Integer/d…
pablonoel Sep 9, 2024
b368f27
fix some shadow biting
pablonoel Sep 9, 2024
aebdbdb
Fix menu position
pablonoel Sep 9, 2024
6bbbb36
Visual improvements on Build page components
pablonoel Sep 9, 2024
7690674
Update to header loader offsets.
nick-next Sep 9, 2024
8932490
Added in template boolean for the ability to selectively show and hid…
nick-next Sep 9, 2024
a8ab0e7
Add extra padding to mobile menu to avoid cropping content
pablonoel Sep 9, 2024
dd6ba42
Merge branch 'feature/new-pages' of https://github.com/Half-Integer/d…
pablonoel Sep 9, 2024
5dfa86c
Update Menu size
pablonoel Sep 9, 2024
e2f07f7
Flipping of about and build pages.
nick-next Sep 9, 2024
c65b305
Merge remote-tracking branch 'dc/new-homepage' into new-homepage
nick-next Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Scaffolding for the two new pages to be built: a revamp of the about …
…page, and the "Build your own Data Commmons" page.
nick-next committed Sep 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c9b6dae0324225131930873b2a50a4c929a7468a
5 changes: 5 additions & 0 deletions server/routes/static.py
Original file line number Diff line number Diff line change
@@ -49,6 +49,11 @@ def about():
return lib_render.render_page("static/about.html", "about.html")


@bp.route('/build')
def build():
return lib_render.render_page("static/build.html", "build.html")


@bp.route('/faq')
def faq():
current_date = date.today().strftime('%-d %b %Y')
102 changes: 6 additions & 96 deletions server/templates/static/about.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#
Copyright 2020 Google LLC
Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -20,103 +20,13 @@
{% set title = 'About Us' %}

{% block head %}
<link rel="stylesheet" href={{url_for('static', filename='css/static.min.css', t=config['VERSION'])}}>
<link rel="stylesheet" href={{url_for('static', filename='css/about.min.css', t=config['VERSION'])}}>
<script src={{url_for('static', filename='about.js', t=config['VERSION'])}} async></script>
{% endblock %}

{% block content %}
<div class="container">
<h1>About Data Commons</h1>
<section class="text-center">
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/O6iVsS-RDYI?si=IDm6OhBRr6i5nZsM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</section>
<section>
<h2>Why Data Commons</h2>
<p>
Many of the big challenges we face — climate change, increasing
inequities, epidemics of diabetes and other health conditions — will
need deep insights to solve. These insights will need to be firmly
grounded in data. Fortunately, a lot of this data is already publicly
available. Unfortunately, there is a difference between data being public
and data being easily usable by those who need access to it. It is this
gap that we are trying to bridge.
</p>
<p>
Google has organized and made easily accessible many kinds of information
— web pages, images, maps, videos and so on. Now we are doing this for
publicly available data. We have organized the core of this data from a
wide range of sources, ranging from governmental statistical organizations
like census bureaus to organizations like the World Bank and the United
Nations.
</p>
<p>
And recent advances in AI have enabled us to go much farther than we had
thought possible in making this data easily accessible - now you can use
natural language to access the data. Still early days, but we are very
bullish on it.
</p>
<p>
Data Commons synthesizes a single graph from
these different data sources. It links references to the same entities
(such
as cities, counties, organizations, etc.) across different datasets to
nodes
on the graph, so that users can access data about a particular entity
aggregated from different sources without data cleaning or joining. We
hope the data
contained within Data Commons will be useful to students, researchers, and
enthusiasts across different disciplines.
</p>
</section>
<section>
<h2>Who can use it?</h2>
<p>
Data Commons can be accessed by anyone at <a
href="https://datacommons.org" target="_blank">Datacommons.org</a>! There
are tools available for students, researchers, journalists, non profits,
policymakers, and private enterprises that allow you to manipulate and
make decisions based on data without the need to know how to code.
Software developers can use the <a
href="https://docs.datacommons.org/api/" target="_blank">REST, Python and
Google Sheets APIs</a>, all of which are free for educational, academic
and journalistic research purposes.
</p>
</section>
<section>
<h2>Collaborations</h2>
<p>
Data Commons has benefited greatly from many collaborations. In addition
to help from US Department of Commerce (notably the Census Bureau), we
have received help from our many academic collaborations, including,
University of California San Francisco, Stanford University, University of
California Berkeley, Harvard University and Indian Institute of Technology
Madras. We have also collaborated with nonprofits such as Techsoup,
Feeding America, and Resources for the Future.
</p>
<p>
We are looking for more collaborators, both for adding new data to Data
Commons and for building new and interesting applications of Data Commons.
Please <a
href="https://docs.google.com/forms/d/e/1FAIpQLSeVCR95YOZ56ABsPwdH1tPAjjIeVDtisLF-8oDYlOxYmNZ7LQ/viewform?usp=published_options"
target="_blank">fill out this form</a> if you are interested in working
with us.
</p>
</section>
<section>
<h2>Stay in touch</h2>
<p>
Sign up for our announcement mailing list to stay up to date with our
latest developments. Join the list by <a
href="https://groups.google.com/g/datacommons-announce"
target="_blank">clicking here</a>, then clicking the “Join group” button.
</p>
</section>

<section>
<h3>See also</h3>
<ul>
<li><a href="https://docs.datacommons.org/datasets/">Data Sources</a>
<li><a href="{{ url_for('static.disclaimers') }}">Disclaimers</a>
<li><a href="{{ url_for('static.faq') }}">Frequently Asked Questions</a>
</ul>
</section>
<div id="app-container">
</div>

{% endblock %}
32 changes: 32 additions & 0 deletions server/templates/static/build.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{#
Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
{%- extends BASE_HTML -%}

{% set main_id = 'build' %}
{% set page_id = 'page-build' %}
{% set title = 'Build your own Data Commons' %}

{% block head %}
<link rel="stylesheet" href={{url_for('static', filename='css/build.min.css', t=config['VERSION'])}}>
<script src={{url_for('static', filename='build.js', t=config['VERSION'])}} async></script>
{% endblock %}

{% block content %}

<div id="app-container">
</div>

{% endblock %}
18 changes: 18 additions & 0 deletions static/css/about.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright 2023 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: 2024

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* Styles for the about page */
@import "base";
18 changes: 18 additions & 0 deletions static/css/build.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright 2023 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: 2024

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* Styles for the about page */
@import "base";
40 changes: 40 additions & 0 deletions static/js/apps/about/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Main component for the about page
*/

import React, { ReactElement } from "react";

import { Routes } from "../../shared/types/base";
import SplashQuote from "./components/splash_quote";

interface AppProps {
//the routes dictionary - this is used to convert routes to resolved urls
routes: Routes;
}

/**
* Application container
*/
export function App({ routes }: AppProps): ReactElement {
return (
<>
<SplashQuote />
</>
);
}
40 changes: 40 additions & 0 deletions static/js/apps/about/components/splash_quote.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React, { ReactElement } from "react";

/**
* A component to render the splash quote of the about page.
*/

const SplashQuote = (): ReactElement => {
return (
<div>
<p>
“Every moment around the world people and organizations are generating
data that can be extraordinary useful and I think we have to find the
way to harness that to solve problems. The challenge is that a lot of
this data is very fragmented.”
</p>
<p className="byline">
James Manyika, Senior Vice President, Research, Technology & Society at
Google
</p>
</div>
);
};

export default SplashQuote;
45 changes: 45 additions & 0 deletions static/js/apps/about/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Entry point for the about page.
*/

import React from "react";
import ReactDOM from "react-dom";

import { loadLocaleData } from "../../i18n/i18n";
import { extractRoutes } from "../base/utilities/utilities";
import { App } from "./app";

window.addEventListener("load", (): void => {
loadLocaleData("en", [import("../../i18n/compiled-lang/en/units.json")]).then(
() => {
renderPage();
}
);
});

function renderPage(): void {
const routes = extractRoutes();

ReactDOM.render(
React.createElement(App, {
routes,
}),
document.getElementById("app-container")
);
}
40 changes: 40 additions & 0 deletions static/js/apps/build/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Main component for the build your own Data Commons page
*/

import React, { ReactElement } from "react";

import { Routes } from "../../shared/types/base";
import Hero from "./components/hero";

interface AppProps {
//the routes dictionary - this is used to convert routes to resolved urls
routes: Routes;
}

/**
* Application container
*/
export function App({ routes }: AppProps): ReactElement {
return (
<>
<Hero />
</>
);
}
Loading