/    Sign up×
Community /Pin to ProfileBookmark

Can you create smooth animations for browser windows in electron?

I’ve been on about 3 forums so far, and no ones really replied back to me. Does anyone here know if you can animate browser windows in electron? I’m creating an application and what i would like to do is slide a frameless window from the left of the screen.

Below is the code i have so far for my frameless window.

`function horizontalWindow()
{
sidebar = new BrowserWindow({height:0, width:0, transparent:true, frame:false, titleBarStyle: ‘none’, resizable: false, webPreferences: { nodeIntegration: true,
contextIsolation: false, enableRemoteModule: true}})
sidebar.loadFile(‘sidebar.html’)
sidebar.setPosition(0, 100, true)
sidebar.setSize(1300, 80, true)
sidebar.setMenuBarVisibility(false)
sidebar.setAlwaysOnTop(true, ‘floating’)
}
`

if this is possible does anyone know which methods will need to be used? at the moment the window just “pops up” on screen

Thankyou!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ZorgJan 22.2022 — It is possible but it has to be a custom solution. You'll have to animate the windows yourself.

Check out this issue thread from the electron github.

iLeonidze comments how he achieved something similar to what you're looking for.

[Electron Github Issue 2407](https://github.com/electron/electron/issues/2407)
×

Success!

Help @aaron360 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...