diff --git a/api/app.js b/api/app.js deleted file mode 100644 index 95c8da6..0000000 --- a/api/app.js +++ /dev/null @@ -1,56 +0,0 @@ -const cron = require('node-cron'); -const nodemailer = require('nodemailer'); -const mongoose = require('mongoose'); -const fetch = require('node-fetch'); - -const transporter = nodemailer.createTransport({ - service: 'gmail', - auth: { - user: 'anacarolinarodriguesoares@gmail.com', - pass: 'topmot-7koGcy-quqsap' - } -}); - - - -// substituir "news-articles" pelo nome real do seu banco de dados -mongoose.connect(process.env.MONGO_URL + "/news-articles", { useNewUrlParser: true, useUnifiedTopology: true }); - -const db = mongoose.connection; -// db.on('error', console.error.bind(console, 'connection error:')); -// db.once('open', function() { -// cron.schedule('* * * * 7', () => { - // const Subscription = mongoose.model('Subscription', new mongoose.Schema({}, { strict: false }), 'subscriptions'); - // Subscription.find({}, (err, docs) => { - // if (err) throw err; - - // docs.forEach(async doc => { - // const { email, preferences } = doc; - - // const articles = []; - // for (let pref of preferences) { - // const res = await fetch(`https://api.nytimes.com/svc/search/v2/articlesearch.json?q=${pref}&api-key=${process.env.REACT_APP_NYT_API_KEY}`); - // const data = await res.json(); - // articles.push(...data.response.docs); - // } - // }) - // }) - -// const mailOptions = { -// from: 'anacarolinarodriguesoares@gmail.com', -// to: email, -// subject: 'Sua newsletter semanal', -// text: articles.map(article => article.web_url).join('\n') -// }; - -// transporter.sendMail(mailOptions, (error, info) => { -// if (error) { -// console.log(error); -// } else { -// console.log('Email sent: ' + info.response); -// } -// }); -// }); -// }); -// }); -// }); diff --git a/api/server.js b/api/server.js new file mode 100644 index 0000000..bfee692 --- /dev/null +++ b/api/server.js @@ -0,0 +1,25 @@ +const express = require('express'); +const axios = require('axios'); +const cors = require('cors'); +const app = express(); +const port = 3001; + +app.use(cors()); + +app.get('/events', (req, res) => { + axios.get('https://eonet.gsfc.nasa.gov/api/v3/events?status=open&limit=20') + .then(response => { + console.log("Data from API:", response.data); + res.json(response.data.events); + }) + .catch(error => { + console.error("Error:", error); + res.status(500).send(error); + }); +}); + +app.listen(port, () => { + console.log(`Server running on http://localhost:${port}`); +}); + + diff --git a/package.json b/package.json index 9585528..2b921bb 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "mongodb": "^5.6.0", "node-cron": "^3.0.2", "nodemailer": "^6.9.3", + "ol": "^7.4.0", + "ol-mapbox-style": "^10.6.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.9.0", diff --git a/src/AboutModal.js b/src/AboutModal.js index 0f217bb..a042d98 100644 --- a/src/AboutModal.js +++ b/src/AboutModal.js @@ -17,24 +17,24 @@ const AboutModal = ({ onClose }) => (

- Our APOD feature allows you to discover a new celestial wonder every + APOD feature allows you to discover a new celestial wonder every day. Accompanied by detailed explanations, you can learn about our universe in a visually striking way.

-
+

- The NEO feature provides you with real-time data about objects that - have recently passed close to Earth. With information like the close - approach date and the estimated diameter, this feature helps you - comprehend the activity that occurs in our planet's vicinity. + The Earth Observatory Natural Event Tracker (EONET) is a repository of + metadata about natural events around the world. It's maintained by + NASA's Earth Science Division. EONET events are categorized into + several types such as wildfires, severe storms, floods, and more.

-
+

- Powerful search tool taps into NASA's vast image database, enabling + Powerful search tool taps into NASA's vast video database, enabling you to find stunning visuals of distant galaxies, nebulae, planets, - and more. Click on an image to view it in greater detail within a + and more. Click on a video to view it in greater detail within a dedicated modal.

diff --git a/src/index.css b/src/index.css index 6bd3655..78f0679 100644 --- a/src/index.css +++ b/src/index.css @@ -36,23 +36,13 @@ video { top: 100vh; } 70% { - top: -500vh; /* Adjust this value based on the length of your content */ + top: -500vh; } 100% { - top: -500vh; /* Adjust this value based on the length of your content */ + top: -500vh; } } - - -/* .no-results{ - color: rgb(239, 238, 238); - font-size: 20px; - font-weight: bold; - text-align: center; - margin-top: 20px; -} */ - .about { padding: 20px; border-radius: 10px; @@ -71,17 +61,10 @@ video { text-align: center; } -.star-wars { - margin-top: 20px; -} - .star-wars .crawl { text-align: justify; color: #fdfcfc; - font-size: 20px; - - - + font-size: 20px; } .section { @@ -185,7 +168,7 @@ header h2 { .container-child p, .container-child h4{ display: inline; - background-color: #3B0A38; + background-color: #2a314b; max-height: 200px; overflow: hidden; text-overflow: ellipsis; @@ -246,3 +229,37 @@ header h2 { } } +.apod{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin-top: 50px; +} +.loading-apod{ + color: #fdfcfc; +} +.apod-text{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + color: rgb(0, 0, 0); + font:bold 15px 'Roboto', sans-serif; + font-family: 'Open Sans', sans-serif; + margin-top: 5px; + opacity: 0.8; +} + +.apod-title { + font-size: 25px; + font-weight: bold; + margin-bottom: 15px; + color: rgb(207, 221, 245); + display: flex; + +} +.title-astronomy{ + color: rgb(85, 170, 239); + display: flex; +} \ No newline at end of file