Skip to content

Commit

Permalink
Add welcome message for loading scene.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed May 26, 2024
1 parent 92d7188 commit 452b55f
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 3 deletions.
27 changes: 24 additions & 3 deletions simulator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<canvas id="canvas1"></canvas>
</div>
<div id="welcome" style="position:absolute; top: calc(50% + 34px); left: 0; width: 100%; transform: translate(0%, -50%); z-index:-3; color:rgba(255,255,255,0.5); font-size:12pt; text-align:center; line-height:2; font-family: initial !important">
<span style="font-size:22pt">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href="https://phydemo.app/ray-optics/gallery/">go to the Gallery page</a>.<br><span style="font-size:8pt">Not working properly? <a href="https://phydemo-ray-optics-v3-archive.vercel.app/simulator/" rel="nofollow">Click here</a> to go back to the old version.</span>
<span style="font-size:22pt">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href="https://phydemo.app/ray-optics/gallery/">go to the Gallery page</a>.</span>
</div>
<script>
// The strings for the welcome message is handled separately here, rather than in locales/.
Expand All @@ -55,6 +55,23 @@
"es": '<span style="font-size:22pt">Bienvenido al simulador de rayos ópticos</span><br>Para añadir un componente óptico, seleccione una herramienta y clique sobre un espacio en blanco.<br>Para cargar un ejemplo, por favor <a href="https://phydemo.app/ray-optics/gallery/">vaya a la página de la galería</a>.',
"pt-BR": "<span style=\"font-size:22pt\">Bem-vindo à Simulação de Óptica de Raios</span><br>Para adicionar um componente ótico, selecione uma ferramenta e clique no espaço vazio.<br>Para carregar um exemplo, por favor <a href=\"https://phydemo.app/ray-optics/gallery/\">visite a página da Galeria</a>."
}

var loading_msgs = {
"en": '<span style="font-size:22pt">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait.',
"zh-TW": '<span style="font-size:22pt">歡迎使用「線光學模擬」</span><br>正在從網址載入場景... 請稍候。',
"zh-CN": '<span style="font-size:22pt">欢迎使用“射线光学模拟”</span><br>正在从网址载入场景... 请稍候。',
"ru": '<span style="font-size:22pt">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait.',
"nl": '<span style="font-size:22pt">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait.',
"fr": '<span style="font-size:22pt">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait.',
"de": "<span style=\"font-size:22pt\">Willkommen bei der Strahlenoptik-Simulation</span><br>Loading scene from URL...",
"pl": '<span style="font-size:22pt">Witamy w symulacji promieni optycznych</span><br>Loading scene from URL... Please wait.',
"ja": '<span style=\"font-size:22pt\">光学シミュレーションの世界へようこそ</span><br>Loading scene from URL... Please wait.',
"si": '<span style="font-size:22pt">Ray Optics Simulation වෙත සාදරයෙන් පිළිගනිමු</span><br>Loading scene from URL... Please wait.',
"ko": '<span style=\"font-size:22pt\">광선 광학 시뮬레이션에 오신 것을 환영합니다.</span><br>Loading scene from URL... Please wait.',
"es": '<span style="font-size:22pt">Bienvenido al simulador de rayos ópticos</span><br>Loading scene from URL... Please wait.',
"pt-BR": "<span style=\"font-size:22pt\">Bem-vindo à Simulação de Óptica de Raios</span><br>Loading scene from URL... Please wait."
}

var lang = 'en';
if (navigator.language) {
var browser_lang = navigator.language.toLowerCase();
Expand Down Expand Up @@ -89,8 +106,12 @@
if (url_lang && welcome_msgs[url_lang]) {
lang = url_lang;
}

document.getElementById("welcome").innerHTML = welcome_msgs[lang];

if (location.hash) {
document.getElementById("welcome").innerHTML = loading_msgs[lang];
} else {
document.getElementById("welcome").innerHTML = welcome_msgs[lang];
}

</script>

Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ locales["de"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">Willkommen bei der Strahlenoptik-Simulation</span><br>Um eine optische Komponente hinzuzufügen, wählen Sie ein Werkzeug aus und klicken Sie auf das leere Feld.<br>Um ein Beispiel zu laden, <a href=\"https://phydemo.app/ray-optics/gallery/\">wechseln Sie bitte zur Galerie</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Werkzeug:&nbsp;"
},
Expand Down
3 changes: 3 additions & 0 deletions simulator/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ locales["en"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href=\"https://phydemo.app/ray-optics/gallery/\">go to the Gallery page</a>."
},
"loading_msg": {
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Tool:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ locales["es"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">Bienvenido a la simulación de Óptica de rayos</span><br>Para añadir un componente óptico, seleccione una herramienta y presione el espacio en blanco.<br>Para cargar un ejemplo, por favor, <a href=\"https://phydemo.app/ray-optics/gallery/\">diríjase a la página de la galería</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Herramienta:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ locales["fr"] = {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href=\"https://phydemo.app/ray-optics/gallery/\">go to the Gallery page</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Outils:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ locales["ja"] = {
"incomplete": false,
"message": "<span style=\"font-size:22pt\">光学シミュレーションの世界へようこそ</span><br>光学部品を追加するには、ツールを選択し、空白部分をクリックします。<br>例を読み込むには <a href=\"https://phydemo.app/ray-optics/gallery/\">ギャラリーページに移動してください。</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"incomplete": false,
"message": "ツール:&nbsp;"
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ locales["ko"] = {
"incomplete": false,
"message": "<span style=\"font-size:22pt\">광선 광학 시뮬레이션에 오신 것을 환영합니다.</span><br>광학 요소를 추가하려면 도구를 선택한 후 빈 공간을 클릭하십시오.<br>예제를 불러오려면 <a href=\"https://phydemo.app/ray-optics/gallery/\"> 갤러리 페이지</a>로 이동하십시오."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"incomplete": false,
"message": "도구:&nbsp;"
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ locales["nl"] = {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href=\"https://phydemo.app/ray-optics/gallery/\">go to the Gallery page</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"incomplete": true,
"message": "Tool:&nbsp;"
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ locales["pl"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">Witamy w symulacji promieni optycznych</span><br>Aby dodać komponent optyczny, zaznacz narzędzie i kliknij puste miejsce.<br>Aby załadować przykład, <a href=\"https://phydemo.app/ray-optics/gallery/\">przejdź do strony Galerii</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Narzędzie:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/pt_BR.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ locales["pt-BR"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">Bem-vindo à Simulação de Óptica de Raios</span><br>Para adicionar um componente ótico, selecione uma ferramenta e clique no espaço vazio.<br>Para carregar um exemplo, por favor <a href=\"https://phydemo.app/ray-optics/gallery/\">visite a página da Galeria</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Ferramenta:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ locales["ru"] = {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href=\"https://phydemo.app/ray-optics/gallery/\">go to the Gallery page</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Инструмент:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/si.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ locales["si"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">Ray Optics Simulation වෙත සාදරයෙන් පිළිගනිමු</span><br>optical component එක් කිරීමට tool තෝරා හිස් අවකාශය මත click කරන්න.<br>උදාහරණ සඳහා <a href=\"https://phydemo.app/ray-optics/gallery/\">Gallery page වෙත යන්න</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"message": "Tool:&nbsp;"
},
Expand Down
4 changes: 4 additions & 0 deletions simulator/locales/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ locales["LOCALE_ID"] = {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>To add an optical component, select a tool and click the blank space.<br>To load an example, please <a href=\"https://phydemo.app/ray-optics/gallery/\">go to the Gallery page</a>."
},
"loading_msg": {
"incomplete": true,
"message": "<span style=\"font-size:22pt\">Welcome to Ray Optics Simulation</span><br>Loading scene from URL... Please wait."
},
"toolbar_title": {
"incomplete": true,
"message": "Tool:&nbsp;"
Expand Down
3 changes: 3 additions & 0 deletions simulator/locales/zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ locales["zh-CN"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">欢迎使用“射线光学模拟”</span><br>若要加入光学元件,请选择工具并点击空白处。<br>若要载入示例,<a href=\"https://phydemo.app/ray-optics/cn/gallery/\">请前往“作品集”页面</a>。"
},
"loading_msg": {
"message": "<span style=\"font-size:22pt\">欢迎使用“射线光学模拟”</span><br>正在从网址载入场景... 请稍候。"
},
"toolbar_title": {
"message": "工具:"
},
Expand Down
3 changes: 3 additions & 0 deletions simulator/locales/zh_TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ locales["zh-TW"] = {
"welcome": {
"message": "<span style=\"font-size:22pt\">歡迎使用「線光學模擬」</span><br>若要加入光學元件,請選擇工具並點擊空白處。<br>若要載入範例,<a href=\"https://phydemo.app/ray-optics/gallery/\">請前往「作品集」頁面</a>。"
},
"loading_msg": {
"message": "<span style=\"font-size:22pt\">歡迎使用「線光學模擬」</span><br>正在從網址載入場景... 請稍候。"
},
"toolbar_title": {
"message": "工具:"
},
Expand Down

0 comments on commit 452b55f

Please sign in to comment.