-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve image alignment and responsiveness in portfolio items
Enhance PortfolioItem styling and layout for improved image display and alignment Applied Prettier to reformat the code for better readability and maintainability. Details: Refactored .portfolio__img to center images using flexbox. Ensured consistent image aspect ratio with object-fit: contain and fixed container height at 340px. Refined keyword styles and hover effects for improved user experience. Improved responsiveness with media query updates for smaller screens. Applied Prettier to reformat the code for better readability and maintainability.
- Loading branch information
Showing
4 changed files
with
50 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import { GoogleSpreadsheet } from 'google-spreadsheet'; | ||
import { GoogleSpreadsheet } from "google-spreadsheet"; | ||
// Initialize the Google Sheets API | ||
|
||
const doc = new GoogleSpreadsheet(process.env.SPREAD_SHEET_ID); | ||
|
||
doc.useServiceAccountAuth({ | ||
client_email: process.env.CLIENT_EMAIL, | ||
private_key: process.env.PRIVATE_KEY, | ||
client_email: process.env.CLIENT_EMAIL, | ||
private_key: process.env.PRIVATE_KEY, | ||
}); | ||
|
||
export default async function handler(req, res) { | ||
if (req.method === 'POST') { | ||
try { | ||
// Extract the form data from the request body | ||
const { name, email, message } = req.body; | ||
if (req.method === "POST") { | ||
try { | ||
// Extract the form data from the request body | ||
const { name, email, message } = req.body; | ||
|
||
// Load the Google Sheets document | ||
await doc.loadInfo(); | ||
// Load the Google Sheets document | ||
await doc.loadInfo(); | ||
|
||
// Select the first sheet | ||
const sheet = doc.sheetsByIndex[0]; | ||
// Select the first sheet | ||
const sheet = doc.sheetsByIndex[0]; | ||
|
||
// Append the form data as a new row in the sheet | ||
await sheet.addRow({ Name: name, Email: email, Message: message }); | ||
// Append the form data as a new row in the sheet | ||
await sheet.addRow({ Name: name, Email: email, Message: message }); | ||
|
||
res.status(200).json({ message: 'success' }); | ||
} catch (error) { | ||
console.error('Error:', error); | ||
res.status(500).json({ message: 'An error occurred' }); | ||
} | ||
} else { | ||
res.status(405).json({ message: 'Method Not Allowed' }); | ||
res.status(200).json({ message: "success" }); | ||
} catch (error) { | ||
console.error("Error:", error); | ||
res.status(500).json({ message: "An error occurred" }); | ||
} | ||
} else { | ||
res.status(405).json({ message: "Method Not Allowed" }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters