Skip to content

Instantly share code, notes, and snippets.

@jrw254
Created July 20, 2020 04:10
Show Gist options
  • Select an option

  • Save jrw254/6d777e3ddb3e9dbe0723f59d071ed6cc to your computer and use it in GitHub Desktop.

Select an option

Save jrw254/6d777e3ddb3e9dbe0723f59d071ed6cc to your computer and use it in GitHub Desktop.
This is just me messing around with Neutron. However, feel free to just use the code. Nothing is named well and that was on purpose cause I was lazy. I think I have five working buttons as examples. All of them open Windows Clipboard Manager. Again, if you've randomly stumbled across this it is just a rough draft example thingy. It's 100% an exa…
;
; Created on: 7/19/2020
; Created by: JRW254/Sabedth
;
; Dependencies: https://github.com/G33kDude/Neutron.ahk
; Forum Post for Neutron: https://www.autohotkey.com/boards/viewtopic.php?t=76865&p=337668
;
#NoTrayIcon
#NoEnv
#MaxThreadsPerHotkey 2
#SingleInstance Force
SetBatchLines, -1
#Include Neutron.ahk
css =
( ; css
/* Make the title bar dark with light text */
header {
background: #333;
color: white;
display: none;
}
/* Make the content area dark with light text */
.main {
background: #444;
color: white;
}
.oneluv {
display: flex;
align-content: flex-start;
flex-direction: row;
flex-wrap: wrap;
float: left;
flex-flow: row wrap;
justify-content: space-between;
padding: 0;
margin: 4px;
top: 2px;
position: absolute;
border-radius: 4em;
background: blue;
}
.twoluv {
display: flex;
align-content: flex-start;
flex-direction: row;
flex-wrap: wrap;
float: left;
flex-flow: row wrap;
justify-content: space-between;
padding: 0;
margin: 4px;
top: 2px;
left: 350px;
position: absolute;
border-radius: 4em;
background: orange;
}
.luv {
display: flex;
align-content: flex-start;
flex-direction: row;
flex-wrap: wrap;
float: left;
flex-flow: row wrap;
justify-content: space-between;
padding: 0;
margin: 4px;
top: 2px;
left: 180px;
position: absolute;
border-radius: 4em;
background: orange;
}
.threeluv {
display: flex;
align-content: flex-start;
flex-direction: row;
flex-wrap: wrap;
float: left;
flex-flow: row wrap;
justify-content: space-between;
padding: 0;
margin: 4px;
top: 2px;
left: 520px;
position: absolute;
border-radius: 4em;
background: pink;
}
.fluv {
display: flex;
align-content: flex-start;
flex-direction: row;
justify-content: space-between;
margin: 1px;
top: 4px;
left: 690px;
position: absolute;
border-radius: 1em;
background: white;
}
.fluvv {
display: flex;
align-content: flex-start;
flex-direction: row;
justify-content: space-between;
margin: 1px;
top: 4px;
left: 746px;
position: absolute;
border-radius: 1em;
background: purple;
}
.fluvvA {
display: flex;
align-content: flex-start;
flex-direction: row;
justify-content: space-between;
margin: 1px;
top: 4px;
left: 810px;
position: absolute;
border-radius: 1em;
padding: 0.1em 0.1em;
background: #444;
opacity: 0.5;
}
.fluvvB {
display: flex;
align-content: flex-start;
flex-direction: row;
justify-content: space-between;
margin: 1px;
top: 4px;
left: 810px;
position: absolute;
border-radius: 1em;
padding: 0.1em 0.1em;
background: #444;
opacity: 0.5;
}
.alta {
background: red;
border-radius: 4em;
margin: 2px;
width: 50px;
height: 15px;
font-size: 10px;
text-weight: bold;
text-align: center;
color: black;
line-height: 1px;
font-family: Orbitron;
}
button1 {
background: slategray;
display: block;
border: block;
float: left;
position: fixed;
color: white;
font-size: 11px;
padding: 0.3em 0.3em;
border-radius: 50`%;
font-family:Arial Black;
cursor: pointer;
}
button2 {
background: #841B2D;
display: block;
border: Black;
float: left;
position: fixed
color: white;
font-size: 10px;
padding: 0.3em 0.3em;
margin: 0.1em;
border-radius: 50`%;
font-family: Arial Black;
cursor: pointer;
}
button3 {
background: #3355FF;
display: block;
border: Black;
float: left;
position: fixed
color: white;
font-size: 10px;
padding: 0.3em 0.3em;
margin: 0.1em;
border-radius: 50`%;
font-family:Arial Black;
cursor: pointer;
}
)
html =
( ; html
<html>
<body>
<div class="oneluv">
<button class="alta">One</button>
<button class="alta">One</button>
<button class="alta">One</button>
</div>
<div class="twoluv">
<button class="alta">Two</button>
<button class="alta">Two</button>
<button class="alta">Two</button>
</div>
<div class="luv">
<button class="alta">Three</button>
<button class="alta">Three</button>
<button class="alta">Three</button>
</div>
<div class="threeluv">
<button class="alta">Three</button>
<button class="alta" onclick="ahk.something(event)">Three</button>
<button class="alta">Three</button>
</div>
<div class="fluv">
<button2 onclick="ahk.Vids(event)">SX</button2>
<button2 onclick="ahk.Vids(event)">AD</button2>
</div>
<div class="fluvv">
<button3 onclick="ahk.something(event)">A1</button3>
<button3 onclick="ahk.something(event)">B2</button3>
</div>
<div style="display: flex; justify-content: flex-end">
<div id="MCD" onload="showTime()">
</div>
<div class="fluvvA">
<div style="display: flex; justify-content: flex-end">
<div id="date">
</div>
</body>
</html>
)
js =
( ; js
function showTime(){
var date = new Date();
var h = date.getHours(); // 0 - 23
var m = date.getMinutes(); // 0 - 59
var s = date.getSeconds(); // 0 - 59
var session = "AM";
var blank = "";
if(h == 0){
h = 12;
}
if(h > 12){
h = h - 12;
session = "PM";
}
h = (h < 10) ? "0" + h : h;
m = (m < 10) ? "0" + m : m;
s = (s < 10) ? "0" + s : s;
var time = h + ":" + m + ":" + s + " " + session;
document.getElementById("MCD").innerText = time;
document.getElementById("MCD").textContent = time;
setTimeout(showTime, 1000);
}
showTime();
var d = new Date();
document.getElementById("date").innerHTML = d.toDateString();
)
title = Bottom Bar v.1
neutron := new NeutronWindow(html, css, js, title)
neutron.Gui("+AlwaysOnTop +Owner -Sysmenu")
neutron.Show("NoActivate" "x168 y740 h39 w1033")
return
; ################################################################
; ################################################################
; ################################################################
vids(This,event)
{
SendInput, #v
}
return
something(This,event)
{
SendInput, #v
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment