Skip to content

Commit

Permalink
♻️ (untested) Merge remote-tracking branch 'kinoko2k/test' into develop
Browse files Browse the repository at this point in the history
resolved #21
  • Loading branch information
HidemaruOwO committed May 28, 2024
2 parents 642724a + e828488 commit 720e6ae
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 104 deletions.
77 changes: 32 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![image](https://user-images.githubusercontent.com/69241694/196036027-e052d55c-f43c-4a25-85bd-1fbedd458302.png)
# **Monot by monochrome.** <span style="font-size: .5em">v.1.1.0 (Build 8)</span>
![image](https://github.com/mncrp/monot/assets/69241694/7dc9e84b-1469-4b23-96fa-ea877707b184)
# **Monot by monochrome.** <span style="font-size: .5em">v.2.0.0 (Build 12)</span>

monochrome.による、「オシャレ、高機能、そして使いやすい」を目指しているウェブブラウザです。

Expand All @@ -9,12 +9,13 @@ monochrome.による、「オシャレ、高機能、そして使いやすい」
|Monot|について|
|:--|:--|
|名前|Monot|
|正式名称|Monot by monochrome. v.2.0.0 Beta 1 (Build 10)|
|バージョン|v.2.0.0 Beta 1|
|正式名称|Monot by monochrome. v.2.0.0 (Build 12)|
|バージョン|v.2.0.0|
|ビルド番号|10|
|公開日|2023年1月23日(木曜日)|
|公開日|2023年7月16日(日曜日)|
|ライセンス|[monochrome. License](./LICENSE)|
|言語|日本語, JavaScript, HTML, CSS|
|言語|JavaScript, HTML, CSS|
|対応言語|日本語、英語|

[技術仕様](https://mncrp.github.io/project/monot/technical)

Expand All @@ -25,56 +26,42 @@ monochrome.による、「オシャレ、高機能、そして使いやすい」

---

![アップデート内容](https://user-images.githubusercontent.com/69241694/196036134-737d5eba-baaf-4520-982e-4f2448cae3f4.jpg)
![アップデート内容](https://github.com/mncrp/monot/assets/69241694/7dc9e84b-1469-4b23-96fa-ea877707b184)
## アップデート内容
詳細:https://mncrp.github.io/news/2

- タブの移動を実装
- タブの固定を実装
- 検索候補(サジェスト)の実装
- 壁紙を実装
- UIに"Thin"を実装
- 設定ウィンドウの項目の追加とデザイン等の修正
- 主にタブ関連のバグを修正
- 読み込み関連のバグの修正
- 検索エンジンに"Frea Search"を追加
- タブのファビコンを表示
- ブックマーク重複防止
- Homeを履歴に残さないように変更
- Homeでブックマークを表示できるように変更
- ブックマーク削除時にイベントが親要素に伝播しないように修正
- コンテキストメニューの変更
- アプリメニューの内容の変更・追加
- オーバーフローメニューの挙動を変更
- オーバーフローメニューの項目を追加
- ユーザーエージェントを変更
- ダークモード時でもWebページに明るい背景を使用する(White In Dark)を実験的に実装
- 設定ウィンドウにバージョン情報などを記載
- 細かいデザインの修正
- ブックマークウィンドウでブックマークの削除を実装
- 内部の細かな変更
- 改行コードをLFに統一
詳細:https://mncrp.github.io/news/3

- Homeのデザインの大幅変更
- 日本語以外の多言語に対応(現段階では英語のみ)
- 信号機マークのネイティブ化
- 検索エンジンの追加を実装
- オーバーフローメニューで、階層化されているものに矢印を表示
- ウィンドウがない時にアプリを終了するときのバグの修正
- サジェストのバグを解消
- タブ周りのバグを修正
- その他バグの修正
- 内部のアップデート

## スクリーンショット
### Default - ライトモード
![起動直後](https://user-images.githubusercontent.com/69241694/172031044-0d6f360a-d4d7-45c2-9f86-05b7d888001c.png)
![オプションを表示](https://user-images.githubusercontent.com/69241694/172031053-1ceb19d5-a65f-4f83-b003-d1d8ed40e85c.png)
![起動直後](https://github.com/mncrp/monot/assets/69241694/f0793a02-66f6-44e1-89cd-fcc5f25634f7)
![オプションを表示](https://github.com/mncrp/monot/assets/69241694/972948b1-a0a9-4c4d-b928-4e84ff90ad94)

### Default - ダークモード
![起動直後](https://user-images.githubusercontent.com/69241694/172031064-1bb8539d-5d86-47b1-8381-e25e06456c58.png)
![オプションを表示](https://user-images.githubusercontent.com/69241694/172031075-8d154f01-e8fa-45f8-bd08-33ad9c4ff921.png)
![起動直後](https://github.com/mncrp/monot/assets/69241694/9af17584-2834-4b82-9677-a0c8b6092889)
![オプションを表示](https://github.com/mncrp/monot/assets/69241694/fec3c14f-fe93-4463-9c66-b6a91c159d74)

### Thin - ライトモード
![起動直後](https://user-images.githubusercontent.com/69241694/172031090-cd5bb654-1299-45b0-bb2a-b470f9f976a1.png)
![オプションを表示](https://user-images.githubusercontent.com/69241694/172031096-28a2ad85-f053-464e-97b1-d10e095587bc.png)
![起動直後](https://github.com/mncrp/monot/assets/69241694/294b2884-776f-4722-881c-f26e0047f542)
![オプションを表示](https://github.com/mncrp/monot/assets/69241694/73795550-3d14-408e-a0a1-844b03f1a46f)


### Thin - ダークモード
![起動直後](https://user-images.githubusercontent.com/69241694/172031195-dac7c557-2243-47aa-b310-11612a273f83.png)
![オプションを表示](https://user-images.githubusercontent.com/69241694/172031197-158d4080-ee3b-4e38-8299-b6113c7bf760.png)
![起動直後](https://github.com/mncrp/monot/assets/69241694/d3eb9598-a82c-4983-85f8-f4a78f8b6e27)
![オプションを表示](https://github.com/mncrp/monot/assets/69241694/6e820af9-517a-4478-9e99-0812d1c0682c)

### 設定ウィンドウ
![ライトモード](https://user-images.githubusercontent.com/69241694/172031236-92e917c6-ca25-4d52-bd3e-4541381e215b.png)
![ダークモード](https://user-images.githubusercontent.com/69241694/172031258-cd24b39d-6f94-4136-b13c-ac4247c44fe4.png)
![ライトモード](https://github.com/mncrp/monot/assets/69241694/afc2aed0-fff7-4778-a55f-0697f82e8fa8)
![ダークモード](https://github.com/mncrp/monot/assets/69241694/f56ec4ee-aac0-474f-b28b-4e47e2b9a221)

### 履歴
![ライトモード](https://user-images.githubusercontent.com/69241694/172031277-1d75b3d0-3b39-41c4-be37-a3d3da5acf35.png)
Expand Down Expand Up @@ -113,5 +100,5 @@ monochrome.による、「オシャレ、高機能、そして使いやすい」
その他のショートカットキーは[こちら](https://mncrp.github.io/docs/monot/menu)をご覧ください。

---
Copyright &copy; 2021-2022 monochrome Project.
Copyright &copy; 2021-2023 monochrome Project.
Licensed by [monochrome. License](./LICENSE)
2 changes: 1 addition & 1 deletion src/browser/blank.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<html>
<head></head>
<body></body>
</html
</html>
8 changes: 5 additions & 3 deletions src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ main {
height: 100%;
}
main * {
text-shadow: 0 0 7px var(--text-color);
text-shadow: 0 0 7px var(--shadow-color);
}
#clock {
top: 50%;
Expand All @@ -58,11 +58,13 @@ main * {
.one-bookmark {
display: flex;
flex-direction: row;
width: 50%;
width: 100%;
height: 50px;
box-sizing: border-box;
text-overflow: hidden;
background-color: var(--main-background);
margin: 1px;
background-color: var(--shadow-color);
backdrop-filter: blur(15px);
border-radius: 15px;
transition: all .5s ease-in-out;
border: 1px solid var(--border-color);
Expand Down
29 changes: 19 additions & 10 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function nw() {
global.win = new BrowserWindow({
width: monotConfig.get('width'),
height: monotConfig.get('height'),
minWidth: 400,
minHeight: 400,
minWidth: 450,
minHeight: 450,
show: false,
titleBarStyle: 'hidden',
titleBarOverlay: true,
Expand Down Expand Up @@ -336,7 +336,7 @@ app.on('ready', () => {
showHistory();
});
ipcMain.handle('updateHistory', () => {
const histories = history.getAll();
const histories = history.get(0, 20);
let html = '';
// eslint-disable-next-line
for (const [key, value] of Object.entries(histories)) {
Expand Down Expand Up @@ -684,7 +684,7 @@ function showSetting() {
);
fileDialog.then((path) => {
monotConfig.update()
.set('wallpaper', path.filePaths[0])
.set('wallpaper', path.filePaths[0].replace(/\\/g, '/'))
.save();
if (path.filePaths[0] !== '') {
setting.webContents.send('updateWallpaper', (monotConfig.get('wallpaper')));
Expand All @@ -693,6 +693,11 @@ function showSetting() {
--wallpaper: url('file://${monotConfig.get('wallpaper')}')!important;
}
`);
console.log(`
:root {
--wallpaper: url('file://${monotConfig.get('wallpaper')}')!important;
}
`);
}
});
});
Expand All @@ -709,26 +714,30 @@ function showHistory() {
scrollBounce: true
}
});
historyWin.webContents.loadFile(`${directory}/renderer/history/index.html`);

// Convert object to html
const histories = history.getAll();
let html = '';
// eslint-disable-next-line
for (const [key, value] of Object.entries(histories)) {
html = `
${html}
<div onclick="node.open('${value.pageUrl}');">
<div class="history-favicon" style="background-image: url('${value.pageIcon}');"></div>
<div onclick="node.open('${value.pageUrl.replace(/{/g, '&lbrace;').replace(/}/g, '&rbrace;')}');">
<div class="history-favicon" style="background-image: url('${value.pageIcon.replace(/{/g, '&lbrace;').replace(/}/g, '&rbrace;')}');"></div>
<div class="history-details">
<p>${value.pageTitle.replace(/{/g, '&lbrace;').replace(/}/g, '&rbrace;')}</p>
</div>
</div>
`;
}
historyWin.webContents.executeJavaScript(`
document.getElementById('histories').innerHTML = \`${html}\`;
document.head.innerHTML += '<link rel="stylesheet" href="${monotConfig.get('cssTheme')}">';
ipcMain.removeHandler('update.History');
ipcMain.handle('update.History', () => {
historyWin.webContents.executeJavaScript(`
document.getElementById('histories').innerHTML = \`${html}\`;
document.head.innerHTML += '<link rel="stylesheet" href="${monotConfig.get('cssTheme')}">';
`);
});
historyWin.webContents.loadFile(`${directory}/renderer/history/index.html`);
}
function showBookmark() {
const bookmarkWin = new BrowserWindow({
Expand Down
10 changes: 7 additions & 3 deletions src/main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const aboutContent = {
icon: isMac ? './src/image/logo-mac.png' : './src/image/logo.png',
title: lang.getAbout('title'),
message: lang.getAbout('title'),
detail: `Monot by monochrome. v.2.0.0 Beta 2 (Build 12)
${lang.getAbout('version')}: 2.0.0 Beta 2
detail: `Monot by monochrome. v.2.0.0 (Build 12)
${lang.getAbout('version')}: 2.0.0
${lang.getAbout('build_no')}: 12
${lang.getAbout('developer')}: monochrome Project.
Expand Down Expand Up @@ -98,7 +98,11 @@ const menuTemplate = [
},
{
role: 'hide',
label: lang.get('hide')
label: lang.get('hide'),
accelerator: 'H',
click: () => {
global.win.hide();
}
},
{
type: 'separator'
Expand Down
10 changes: 6 additions & 4 deletions src/main/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class TabManager {
global.win.webContents.executeJavaScript(`
document.getElementsByTagName('yomikomi-bar')[0]
.removeAttribute('id');
document.getElementsByTagName('span')[${index}].remove();
document.getElementsByTagName('tab-el')[0].getElementsByTagName('span')[${index}].remove();
`);
this.tabs[index] = null;
this.tabs.splice(index, 1);
Expand Down Expand Up @@ -236,7 +236,9 @@ class Tab {
`file://${directory}/browser/server-notfound.html`
);
browserView.webContents.executeJavaScript(`
document.getElementsByTagName('span')[0].innerText='${browserView.webContents.getURL().toLowerCase()}';
window.translated = () => {
document.getElementsByTagName('span')[0].innerText='${browserView.webContents.getURL().toLowerCase()}';
};
`);
});
// dom-ready
Expand Down Expand Up @@ -291,7 +293,7 @@ class Tab {
// favicon-updated
browserView.webContents.on('page-favicon-updated', (e, favicons) => {
global.win.webContents.executeJavaScript(`
document.getElementsByTagName('span')[${this.number()}]
document.getElementsByTagName('tab-el')[0].getElementsByTagName('span')[${this.number()}]
.getElementsByTagName('img')[0]
.src = '${favicons[0]}';
`);
Expand Down Expand Up @@ -448,7 +450,7 @@ class Tab {
setTabTitle() {
try {
global.win.webContents.executeJavaScript(`
document.getElementsByTagName('span')[${this.number()}]
document.getElementsByTagName('tab-el')[0].getElementsByTagName('span')[${this.number()}]
.getElementsByTagName('p')[0]
.innerText='${this.entity.webContents.getTitle()}';
`);
Expand Down
3 changes: 3 additions & 0 deletions src/preload/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ contextBridge.exposeInMainWorld('node', {
open: (url) => {
ipcRenderer.invoke('openPage', url);
},
updateHistory: () => {
ipcRenderer.invoke('update.History');
},
translate: (inEn) => {
return ipcRenderer.invoke('translate.get', inEn);
}
Expand Down
10 changes: 2 additions & 8 deletions src/proprietary/lib/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@ class History {
let data;
history.update();
try {
data = history.slice(arrayStart, arrayBegin);
data = history.data.slice(arrayStart, arrayBegin);
} catch (e) {
return (
console.error(
`historyに${arrayBegin}番目の要素はありません。
historyの最後の要素は${history.length - 1}です。`
),
-1
);
data = history.data;
}
return data;
}
Expand Down
50 changes: 28 additions & 22 deletions src/proprietary/renderer/lang.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
[...(
(
document.head.innerHTML +
document.body.innerHTML
)
.matchAll(/\$\{[0-9a-zA-Z_].+\}/g)
)].forEach(async(el) => {
const res = await node.translate(el[0].substring(2, el[0].length - 1));
document.body.innerHTML = document.body.innerHTML.replace(el, res);
document.head.innerHTML = document.head.innerHTML.replace(el, res);
});
if (window.translated !== undefined) {
window.translated();
}

[...(
(
document.head.innerHTML +
document.body.innerHTML
)
.matchAll(/\$\[[0-9a-zA-Z_].+\]/g)
)].forEach(async(el) => {
const res = await node.translateAbout(el[0].substring(2, el[0].length - 1));
document.body.innerHTML = document.body.innerHTML.replace(el, res);
document.head.innerHTML = document.head.innerHTML.replace(el, res);
});
!async function() {
[...(
(
document.head.innerHTML +
document.body.innerHTML
)
.matchAll(/\$\{[0-9a-zA-Z_].+\}/g)
)].forEach(async(el) => {
const res = await node.translate(el[0].substring(2, el[0].length - 1));
document.body.innerHTML = document.body.innerHTML.replace(el, res);
document.head.innerHTML = document.head.innerHTML.replace(el, res);
});

[...(
(
document.head.innerHTML +
document.body.innerHTML
)
.matchAll(/\$\[[0-9a-zA-Z_].+\]/g)
)].forEach(async(el) => {
const res = await node.translateAbout(el[0].substring(2, el[0].length - 1));
document.body.innerHTML = document.body.innerHTML.replace(el, res);
document.head.innerHTML = document.head.innerHTML.replace(el, res);
});
}();
3 changes: 3 additions & 0 deletions src/renderer/history/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
</main>
<script>
window.scrollTo(0, 1);
window.translated = () => {
node.updateHistory();
};
</script>
<script src="../../proprietary/renderer/lang.js"></script>
</body>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/history/style/history.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ h1 {
box-shadow: 5px 5px 5px #bfbfbf00;
height: 25px;
display: flex;
cursor: default;
}

.history-favicon {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/navigation/navigation-mac.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a href="javascript:node.reloadBrowser()" title="${reload}" id="reload"></a>
<a href="javascript:node.backBrowser()" title="${go_back}" id="prev"></a>
<a href="javascript:node.goBrowser()" title="${go_forward}" id="next"></a>
<input type="text" placeholder="${enter_url_word}" id="textbox" onkeyup="textKey(arguments[0])" onblur="node.suggestClose()">
<input type="text" placeholder="${enter_url_word}" id="textbox" onkeypress="textKey(arguments[0])" onblur="node.suggestClose()">
<a href="javascript:moveBrowser()" title="${go}" id="move"></a>
<a href="javascript:node.showMenu()" title="${view_menu}" id="menu" class="window"></a>
</nav>
Expand Down
Loading

0 comments on commit 720e6ae

Please sign in to comment.