Git Product home page Git Product logo

Comments (12)

leilarrossi avatar leilarrossi commented on August 22, 2024 4

So, I have it working but can't make electron window transparent. It might be something specific to my application.
The idea is to hide electron window and create your own with css and add a border to a body ( please see myarrow:before class which makes an arrow)
@urre see if this helps you:
global css:
.myarrow {
position: relative;
padding: 12px 0;
}

html,
body {
margin: 0 auto;
overflow: hidden;
}

/**

  • Set box-sizing to border-box for all elements by default. This makes it
  • easier to ensure widths when adding padding and borders.
    */
    html {
    box-sizing: border-box;
    font-family: sans-serif;
    -webkit-text-size-adjust: 100%;
    }

*, *::before, *::after {
box-sizing: inherit;
}

.myarrow:before {
content: "";
height: 0;
width: 0;
border-width: 0 8px 12px 8px;
border-style: solid;
border-color: transparent transparent white transparent;
position: absolute;
top: 0px;
left: 50%;
transform: translateX(-50%);
}

.page {
background: #222332;
display: flex;
flex-direction: column;
width: 340px;
height: 540px;
margin: 0 auto;
}

.darwin.page {
border-radius: 5px;
box-shadow: 0 5px 24px rgba(0, 0, 0, 0.7);
overflow: hidden;
}

and html:
add myarrow class on body
and class="page darwin" on the div inside the body

<script> (function() { const script = document.createElement('script'); script.src = (process.env.HOT) ? 'http://localhost:3000/dist/bundle.js' : '../dist/bundle.js'; document.write(script.outerHTML); }()); </script>

from menubar.

jenslind avatar jenslind commented on August 22, 2024 3

The options passed to menubar is also used when creating the browser-window.
So, to make the window transparent:

var mb = menubar({transparent: true})

from menubar.

urre avatar urre commented on August 22, 2024 1

yes, i meant like this. A arrow on top of the menubar app window.

arrow

from menubar.

jenslind avatar jenslind commented on August 22, 2024

Make the window transparent and add the arrow with css.

from menubar.

urre avatar urre commented on August 22, 2024

thanks @jenslind, any examples out there using this with electron?

from menubar.

urre avatar urre commented on August 22, 2024

thanks!

from menubar.

leilarrossi avatar leilarrossi commented on August 22, 2024

Could you, please, be a bit more specific about adding an arrow with css?
Thanks!

from menubar.

leilarrossi avatar leilarrossi commented on August 22, 2024

Do you mean it's an image or css class? If css class, on which element?
Thank you!

from menubar.

urre avatar urre commented on August 22, 2024

css. What's the simplest solution?

from menubar.

leilarrossi avatar leilarrossi commented on August 22, 2024

Oh, I am asking you how to add an arrow, I was hoping someone will post the code ;)

from menubar.

urre avatar urre commented on August 22, 2024

Ah, And I'm the one who opened this issue/question :) #78 (comment)

from menubar.

leilarrossi avatar leilarrossi commented on August 22, 2024

I am new to css and electron for that matter. I'll post the solution if I find one. Thank you for quick response!

from menubar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.