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

homepage added #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
3,239 changes: 1,933 additions & 1,306 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "woc2021",
"name": "woc",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"antd": "^4.16.13",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
Binary file added public/favicon.ico
Binary file not shown.
40 changes: 14 additions & 26 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -2,42 +2,30 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/org-logo.png" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Winter of Code is a program aimed to increase participation for the Google Summer of Code program among students in colleges and universities."
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/org-logo.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Winter of Code</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css"
/>
<!-- google font cdn -->
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap"
rel="stylesheet"
/>
<title>Winter Of Code</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"short_name": "Winter of Code",
"name": "Winter of Code",
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "org-logo.png",
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "org-logo.png",
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "org-logo.png",
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
19 changes: 15 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import './App.css';
import React from "react";
import "antd/dist/antd.css";
import AppHeader from "./components/pages/header/header";
import AppHome from "./views/home";

import { Layout } from "antd";
const { Header, Content } = Layout;

function App() {
return (
<div className="App">
<h1>Hello World !</h1>
</div>
<Layout className="Layout">
<Header>
<AppHeader />
</Header>
<Content>
<AppHome />
</Content>
</Layout>
);
}

7 changes: 4 additions & 3 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { render, screen } from '@testing-library/react';
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
271 changes: 271 additions & 0 deletions src/components/pages/header/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
body {
font-size: 16px;
line-height: 1.6;
color: #333;
overflow-x: hidden;
}

.container-fluid {
margin: 0 auto;
max-width: 1200px;
padding: 0 15px;
}

.ant-layout {
background: #fff !important;
}

.Layout .ant-layout-header {
background: #f8f8f8;
padding: 0;
height: auto;
line-height: 1.6;
}

p {
font-size: 16px;
line-height: 1.6;
}

.bgGray {
background: #fafafa;
}

.titleHolder {
text-align: center;
position: relative;
padding: 0 0 20px;
margin: 0 0 40px;
}

.titleHolder:after {
transform: translateX(-50%);
content: '';
background: #1890ff;
position: absolute;
bottom: 0;
left: 50%;
height: 3px;
width: 50px;
}

.titleHolder h2 {
font-size: 28px;
margin: 0;
}

.ant-layout-header {
position: fixed;
left: 0;
right: 0;
z-index: 999;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
}

.header .logo {
font-size: 22px;
text-transform: uppercase;
font-weight: 400;
}

.header .logo .fas {
color: #1890ff;
margin: 0 5px 0 0;
font-size: 28px;
}

.header .logo a {
color: #333;
}

.header .ant-anchor-wrapper {
background: none;
}

.header .ant-anchor {
display: flex;
}

.header .ant-anchor-ink {
display: none;
}

.header .ant-anchor-link {
padding: 0 20px;
line-height: 1.4;
position: relative;
}

.header .ant-anchor-link:before,
.header .ant-anchor-link:after {
content: '';
background: #1890ff;
width: 1px;
position: absolute;
top: 2px;
bottom: 2px;
left: 30%;
opacity: 0;
transition: all 0.3s linear;
}

.header .ant-anchor-link:after {
left: auto;
right: 30%;
}

.header .ant-anchor-link.ant-anchor-link-active:before,
.header .ant-anchor-link:hover:before {
left: 5%;
opacity: 1;
}

.header .ant-anchor-link.ant-anchor-link-active:after,
.header .ant-anchor-link:hover:after {
right: 5%;
opacity: 1;
}


.header .ant-menu {
border: 0;
background: none !important;
}

.header .ant-menu li.ant-menu-item {
position: relative;
color: #333;
}

.header .ant-menu li.ant-menu-item:before,
.header .ant-menu li.ant-menu-item:after {
content: '';
background: #1890ff;
width: 1px;
position: absolute;
top: 2px;
bottom: 2px;
left: 30%;
opacity: 0;
transition: all 0.3s linear;
}

.header .ant-menu li.ant-menu-item:after {
left: auto;
right: 30%;
}

.header .ant-menu li.ant-menu-item,
.header .ant-menu li.ant-menu-item-selected {
border: 0 !important;
}

.header .ant-menu li.ant-menu-item-selected,
.header .ant-menu li.ant-menu-item:hover {
color: #1890ff;
background: none;
}

.header .ant-menu li.ant-menu-item-selected:before,
.header .ant-menu li.ant-menu-item:hover:before {
left: 5%;
opacity: 1;
}

.header .ant-menu li.ant-menu-item-selected:after,
.header .ant-menu li.ant-menu-item:hover:after {
right: 5%;
opacity: 1;
}

.heroBlock {
background: url('https://cdn.pixabay.com/photo/2021/09/01/08/23/winter-6590863__480.png') no-repeat;
background-position: 50% 100%;
background-size: cover;
height: 100vh;
opacity: 2;
}

.heroBlock .container-fluid {
display: block !important;
}

.heroBlock .ant-carousel,
.heroBlock .ant-carousel div {
height: 100%;
}

.heroBlock .slick-dots li button {
background: #000 !important;
}

.heroBlock .slick-dots li.slick-active button {
background: #1890ff !important;
}

.heroBlock .content {
max-width: 640px;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 0 70px;
}

.heroBlock h3 {
font-size: 30px;
line-height: 1.2;
margin: 0 0 30px;
}

.heroBlock p {
margin: 0 0 30px;
}

.heroBlock .btnHolder {
height: auto !important;
}

.heroBlock .btnHolder button,
.heroBlock .btnHolder .fas {
margin: 0 10px 0 0;
}

.block {
padding: 60px 0;
border-bottom: 1px solid #d9d9d9;
}


.mobileVisible {
display: none;
}

.mobileHidden {
display: block;
}

@media only screen and (max-width: 991px) {
.pricingBlock .ant-row > div:nth-child(2) .ant-list-item {
transform: scale(1.14);
}
}

@media only screen and (max-width: 767px) {
.pricingBlock .ant-row > div:nth-child(2) .ant-list-item {
transform: scale(1);
}

.mobileVisible {
display: block;
}

.mobileHidden {
display: none;
}
}
67 changes: 67 additions & 0 deletions src/components/pages/header/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React, { useState } from "react";

import { Anchor, Drawer, Button } from "antd";

import './header.css';
const { Link } = Anchor;
function AppHeader() {
const [visible, setVisible] = useState(false);

const showDrawer = () => {
setVisible(true);
};

const onClose = () => {
setVisible(false);
};

return (
<div className="container-fluid">

<div className="header">
<div className="logo">
<img
src="https://raw.githubusercontent.com/winterofcode/winterofcode2020/master/src/Assets/org-logo.png"
style={{ height: 40, width: 40 }}
alt=""
/>
<a href="https://winterofcode.com">Winter Of Code</a>
</div>
<div className="mobileHidden">
<Anchor targetOffset="65">
<Link href="https://dscnsec.com" title="DSC NSEC" />
<Link href="#about" title="About" />
<Link href="#organisations" title="Organisations" />
<Link href="#organisers" title="Organisers" />
<Link href="#faq" title="FAQ" />
<Link href="#reports" title="Student Reports" />
<Link href="#contact" title="Contact" />
</Anchor>
</div>
<div className="mobileVisible">
<Button type="primary" onClick={showDrawer}>
<i className="fas fa-bars"></i>
</Button>
<Drawer
placement="right"
closable={false}
onClose={onClose}
visible={visible}
>
<Anchor targetOffset="65">
<Link href="https://dscnsec.com" title="DSC NSEC" />
<Link href="#about" title="About" />
<Link href="#organisations" title="Organisations" />
<Link href="#organisers" title="Organisers" />
<Link href="#faq" title="FAQ" />
<Link href="#reports" title="Student Reports" />
<Link href="#contact" title="Contact" />
</Anchor>
</Drawer>
</div>
</div>
</div>
);
}

export default AppHeader;
57 changes: 57 additions & 0 deletions src/components/pages/home/homepage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from "react";
import { Button } from "antd";

import { Carousel } from "antd";

const items = [
{
key: "1",
title:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, rem!",
content:
"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Officia unde excepturi, id cumque tempora molestiae numquam natus ducimus itaque voluptatum.",
},
{
key: "2",
title:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, rem!",
content:
"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Officia unde excepturi, id cumque tempora molestiae numquam natus ducimus itaque voluptatum.",
},
{
key: "3",
title:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, rem!",
content:
"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Officia unde excepturi, id cumque tempora molestiae numquam natus ducimus itaque voluptatum.",
},
];

function AppHero() {
return (
<div id="hero" className="heroBlock">
<Carousel>
{items.map((item) => {
return (
<div key={item.key} className="container-fluid">
<div className="content">
<h3>{item.title}</h3>
<p>{item.content}</p>
<div className="btnHolder">
<Button type="primary" size="large">
Get Started
</Button>
<Button size="large">
<i className="fas fa-video"></i> Watch a Demo
</Button>
</div>
</div>
</div>
);
})}
</Carousel>
</div>
);
}

export default AppHero;
14 changes: 6 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -2,16 +2,14 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
<App />,
document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
7 changes: 7 additions & 0 deletions src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
141 changes: 141 additions & 0 deletions src/serviceWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// This optional code is used to register a service worker.
// register() is not called by default.

// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.

// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA

const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);

export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}

window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;

if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);

// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}

function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);

// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');

// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}

function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' },
})
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}

export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then(registration => {
registration.unregister();
})
.catch(error => {
console.error(error.message);
});
}
}
2 changes: 1 addition & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/extend-expect';
270 changes: 270 additions & 0 deletions src/views/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
body {
font-size: 16px;
line-height: 1.6;
color: #333;
overflow-x: hidden;
}

.container-fluid {
margin: 0 auto;
max-width: 1200px;
padding: 0 15px;
}

.ant-layout {
background: #fff !important;
}

.mainLayout .ant-layout-header {
background: #f8f8f8;
padding: 0;
height: auto;
line-height: 1.6;
}

p {
font-size: 16px;
line-height: 1.6;
}

.bgGray {
background: #fafafa;
}

.titleHolder {
text-align: center;
position: relative;
padding: 0 0 20px;
margin: 0 0 40px;
}

.titleHolder:after {
transform: translateX(-50%);
content: "";
background: #1890ff;
position: absolute;
bottom: 0;
left: 50%;
height: 3px;
width: 50px;
}

.titleHolder h2 {
font-size: 28px;
margin: 0;
}

.ant-layout-header {
position: fixed;
left: 0;
right: 0;
z-index: 999;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
}

.header .logo {
font-size: 22px;
text-transform: uppercase;
font-weight: 400;
}

.header .logo .fas {
color: #1890ff;
margin: 0 5px 0 0;
font-size: 28px;
}

.header .logo a {
color: #333;
}

.header .ant-anchor-wrapper {
background: none;
}

.header .ant-anchor {
display: flex;
}

.header .ant-anchor-ink {
display: none;
}

.header .ant-anchor-link {
padding: 0 20px;
line-height: 1.4;
position: relative;
}

.header .ant-anchor-link:before,
.header .ant-anchor-link:after {
content: "";
background: #1890ff;
width: 1px;
position: absolute;
top: 2px;
bottom: 2px;
left: 30%;
opacity: 0;
transition: all 0.3s linear;
}

.header .ant-anchor-link:after {
left: auto;
right: 30%;
}

.header .ant-anchor-link.ant-anchor-link-active:before,
.header .ant-anchor-link:hover:before {
left: 5%;
opacity: 1;
}

.header .ant-anchor-link.ant-anchor-link-active:after,
.header .ant-anchor-link:hover:after {
right: 5%;
opacity: 1;
}

.header .ant-menu {
border: 0;
background: none !important;
}

.header .ant-menu li.ant-menu-item {
position: relative;
color: #333;
}

.header .ant-menu li.ant-menu-item:before,
.header .ant-menu li.ant-menu-item:after {
content: "";
background: #1890ff;
width: 1px;
position: absolute;
top: 2px;
bottom: 2px;
left: 30%;
opacity: 0;
transition: all 0.3s linear;
}

.header .ant-menu li.ant-menu-item:after {
left: auto;
right: 30%;
}

.header .ant-menu li.ant-menu-item,
.header .ant-menu li.ant-menu-item-selected {
border: 0 !important;
}

.header .ant-menu li.ant-menu-item-selected,
.header .ant-menu li.ant-menu-item:hover {
color: #1890ff;
background: none;
}

.header .ant-menu li.ant-menu-item-selected:before,
.header .ant-menu li.ant-menu-item:hover:before {
left: 5%;
opacity: 1;
}

.header .ant-menu li.ant-menu-item-selected:after,
.header .ant-menu li.ant-menu-item:hover:after {
right: 5%;
opacity: 1;
}

.heroBlock {
background: url("https://cdn.pixabay.com/photo/2021/09/01/08/23/winter-6590863__480.png")
no-repeat;
background-position: 50% 100%;
background-size: cover;
height: 100vh;
opacity: 2;
}

.heroBlock .container-fluid {
display: block !important;
}

.heroBlock .ant-carousel,
.heroBlock .ant-carousel div {
height: 100%;
}

.heroBlock .slick-dots li button {
background: #000 !important;
}

.heroBlock .slick-dots li.slick-active button {
background: #1890ff !important;
}

.heroBlock .content {
max-width: 640px;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 0 70px;
}

.heroBlock h3 {
font-size: 30px;
line-height: 1.2;
margin: 0 0 30px;
}

.heroBlock p {
margin: 0 0 30px;
}

.heroBlock .btnHolder {
height: auto !important;
}

.heroBlock .btnHolder button,
.heroBlock .btnHolder .fas {
margin: 0 10px 0 0;
}

.block {
padding: 60px 0;
border-bottom: 1px solid #d9d9d9;
}

.mobileVisible {
display: none;
}

.mobileHidden {
display: block;
}

@media only screen and (max-width: 991px) {
.pricingBlock .ant-row > div:nth-child(2) .ant-list-item {
transform: scale(1.14);
}
}

@media only screen and (max-width: 767px) {
.pricingBlock .ant-row > div:nth-child(2) .ant-list-item {
transform: scale(1);
}

.mobileVisible {
display: block;
}

.mobileHidden {
display: none;
}
}
12 changes: 12 additions & 0 deletions src/views/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import AppHero from "../components/pages/home/homepage";
import './home.css'
function AppHome() {
return (
<div className="main">
<AppHero />
</div>
);
}

export default AppHome;