-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a8ccdb
commit 868e66d
Showing
6 changed files
with
169 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="style.css"> | ||
<title>Adobe Photoshop API Demo</title> | ||
</head> | ||
<body> | ||
<header> | ||
<h1>Adobe Photoshop API</h1> | ||
</header> | ||
<main> | ||
<div class="upload-section"> | ||
<h2>Upload an Image</h2> | ||
<input type="file" id="imageUpload" accept="image/*"> | ||
<button id="applyEffectButton">Apply Effect</button> | ||
</div> | ||
<div class="result-section"> | ||
<h2>Processed Image</h2> | ||
<img id="resultImage" src="" alt="Processed Image"> | ||
</div> | ||
</main> | ||
<script src="index.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
document.getElementById('applyEffectButton').addEventListener('click', applyEffect); | ||
|
||
const apiKey = 'YOUR_ADOBE_API_KEY'; // Replace with your Adobe Photoshop API key | ||
|
||
async function applyEffect() { | ||
const imageUpload = document.getElementById('imageUpload').files[0]; | ||
|
||
if (!imageUpload) { | ||
alert('Please upload an image.'); | ||
return; | ||
} | ||
|
||
const formData = new FormData(); | ||
formData.append('image', imageUpload); | ||
|
||
try { | ||
const response = await fetch('https://image.adobe.io/pie/psdService/photoshop?job=simple-filter-job', { | ||
method: 'POST', | ||
headers: { | ||
'Authorization': `Bearer ${apiKey}`, | ||
'x-api-key': apiKey | ||
}, | ||
body: formData | ||
}); | ||
|
||
if (response.ok) { | ||
const result = await response.json(); | ||
document.getElementById('resultImage').src = result.output.imageUrl; // Assuming the API returns the processed image URL | ||
} else { | ||
alert('Failed to process the image.'); | ||
} | ||
} catch (error) { | ||
console.error('Error:', error); | ||
alert('Error processing the image.'); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "adobe-photoshop-api-demo", | ||
"version": "1.0.0", | ||
"description": "A simple app to demonstrate the Adobe Photoshop API", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"author": "Your Name", | ||
"license": "ISC", | ||
"dependencies": { | ||
"adobe-photoshop-api-demo": "file:", | ||
"express": "^4.17.1" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
|
||
app.use(express.static('public')); | ||
|
||
app.listen(3000, () => { | ||
console.log('Server is running on port 3000'); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
body { | ||
font-family: 'Arial', sans-serif; | ||
background: linear-gradient(135deg, #6a11cb, #de3434); | ||
color: #fff; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
header { | ||
text-align: center; | ||
margin-bottom: 20px; | ||
} | ||
|
||
header h1 { | ||
font-size: 3em; | ||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
main { | ||
width: 90%; | ||
max-width: 600px; | ||
background: rgba(255, 255, 255, 0.1); | ||
border-radius: 10px; | ||
padding: 20px; | ||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); | ||
} | ||
|
||
.upload-section, | ||
.result-section { | ||
margin-bottom: 20px; | ||
text-align: center; | ||
} | ||
|
||
input[type="file"] { | ||
display: block; | ||
margin: 0 auto 15px auto; | ||
font-size: 1em; | ||
border: none; | ||
border-radius: 5px; | ||
outline: none; | ||
padding: 10px; | ||
width: 80%; | ||
max-width: 400px; | ||
} | ||
|
||
button { | ||
padding: 10px 20px; | ||
font-size: 1em; | ||
background-color: #444; | ||
color: #fff; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
button:hover { | ||
background-color: #666; | ||
} | ||
|
||
.result-section img { | ||
width: 100%; | ||
max-width: 500px; | ||
border-radius: 10px; | ||
margin-top: 15px; | ||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); | ||
} |