Skip to content

Commit

Permalink
Merge pull request #117 from ruucm/framer-plugin
Browse files Browse the repository at this point in the history
remove unused packages / update favicon
  • Loading branch information
ruucm authored Dec 1, 2024
2 parents 8785ef2 + 393c64b commit defa796
Show file tree
Hide file tree
Showing 8 changed files with 12,403 additions and 9,964 deletions.
2 changes: 1 addition & 1 deletion apps/framer-plugin/framer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"id": "ab22de",
"name": "ShaderGradient",
"modes": ["canvas"],
"icon": "/icon.svg"
"icon": "/icon.png"
}
2 changes: 1 addition & 1 deletion apps/framer-plugin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<link rel="icon" type="image/png" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ShaderGradient</title>
</head>
Expand Down
5 changes: 1 addition & 4 deletions apps/framer-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"vite-plugin-mkcert": "^1"
},
"devDependencies": {
"@react-three/fiber": "^8.17.10",
"@react-spring/three": "^9.7.3",
"three": "^0.169.0",
"@shadergradient/react": "workspace:*",

"@eslint/js": "^9",
"@types/react-dom": "^18",
"@types/react": "^18",
Expand Down
Binary file added apps/framer-plugin/public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions apps/framer-plugin/public/icon.svg

This file was deleted.

8 changes: 8 additions & 0 deletions apps/framer-plugin/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ main {
gap: 15px;
overflow: hidden;
}

[data-framer-theme='dark'] #light-iframe {
display: none;
}

[data-framer-theme='light'] #dark-iframe {
display: none;
}
30 changes: 22 additions & 8 deletions apps/framer-plugin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,45 @@ const handleAddShaderGradient = async (controls: { message: string }) => {
})
}

function handleMessage(event: { origin: string; data: { message: string } }) {
if (event.origin === framerPluginURLOrigin) {
console.log(event)
export function App() {
function handleMessage(event: { origin: string; data: { message: string } }) {
if (event.origin === framerPluginURLOrigin) {
console.log(event)

if (event.data.message === 'ADD_TO_CANVAS') {
handleAddShaderGradient(event.data)
if (event.data.message === 'ADD_TO_CANVAS') {
handleAddShaderGradient(event.data)
}
}
}
}
export function App() {

useEffect(() => {
window.addEventListener('message', handleMessage, false)
}, [])

return (
<main>
<iframe
id='framer-plugin-site'
id='light-iframe'
src={framerPluginURLOrigin + '/framer-plugin'}
style={{
outline: 'none',
border: 'none',
width: 300,
height: 446,
overflow: 'hidden',
position: 'absolute',
}}
/>
<iframe
id='dark-iframe'
src={framerPluginURLOrigin + '/framer-plugin-dark'}
style={{
outline: 'none',
border: 'none',
width: 300,
height: 446,
overflow: 'hidden',
position: 'absolute',
}}
/>
</main>
Expand Down
Loading

0 comments on commit defa796

Please sign in to comment.