Skip to content

Commit 4e9e37a

Browse files
committed
fix: rainbow theme overlapping solve
1 parent 7cbad78 commit 4e9e37a

10 files changed

Lines changed: 135 additions & 19 deletions

css/style_bluescreen.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,11 @@ html {
192192
opacity: 0.8;
193193
pointer-events: none;
194194
}
195+
196+
/* Generator link highlight */
197+
.terminal-generator-link {
198+
position: relative;
199+
color: #ffffff;
200+
text-shadow: 0 0 6px #ffffff;
201+
animation: blinker 1s linear infinite;
202+
}

css/style_chocolate.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,12 @@ html {
200200
color: #FBF2C0;
201201
opacity: 0.8;
202202
pointer-events: none;
203+
}
204+
205+
/* Generator link highlight */
206+
.terminal-generator-link {
207+
position: relative;
208+
color: #688E26;
209+
text-shadow: 0 0 6px #688E26;
210+
animation: blinker 1s linear infinite;
203211
}

css/style_lila.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,12 @@ html {
203203
color: #e7d0ff;
204204
opacity: 0.7;
205205
pointer-events: none;
206+
}
207+
208+
/* Generator link highlight */
209+
.terminal-generator-link {
210+
position: relative;
211+
color: #c992f6;
212+
text-shadow: 0 0 6px #c992f6;
213+
animation: blinker 1s linear infinite;
206214
}

css/style_midnight.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,12 @@ html {
199199
color: #FE938C;
200200
opacity: 0.8;
201201
pointer-events: none;
202+
}
203+
204+
/* Generator link highlight */
205+
.terminal-generator-link {
206+
position: relative;
207+
color: #F34213;
208+
text-shadow: 0 0 6px #F34213;
209+
animation: blinker 1s linear infinite;
202210
}

css/style_og.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,12 @@ body {
160160
color: #9C8394;
161161
opacity: 0.8;
162162
pointer-events: none;
163+
}
164+
165+
/* Generator link highlight */
166+
.terminal-generator-link {
167+
position: relative;
168+
color: #73ABAD;
169+
text-shadow: 0 0 6px #73ABAD;
170+
animation: blinker 1s linear infinite;
163171
}

css/style_olive.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,11 @@ html {
193193
opacity: 0.8;
194194
pointer-events: none;
195195
}
196+
197+
/* Generator link highlight */
198+
.terminal-generator-link {
199+
position: relative;
200+
color: #8fbc4a;
201+
text-shadow: 0 0 6px #8fbc4a;
202+
animation: blinker 1s linear infinite;
203+
}

css/style_orange.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,11 @@ html {
193193
opacity: 0.8;
194194
pointer-events: none;
195195
}
196+
197+
/* Generator link highlight */
198+
.terminal-generator-link {
199+
position: relative;
200+
color: #f97316;
201+
text-shadow: 0 0 6px #f97316;
202+
animation: blinker 1s linear infinite;
203+
}

css/style_rainbow.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,11 @@ html {
195195
opacity: 0.8;
196196
pointer-events: none;
197197
}
198+
199+
/* Generator link highlight */
200+
.terminal-generator-link {
201+
position: relative;
202+
color: #fbbf24;
203+
text-shadow: 0 0 6px #fbbf24;
204+
animation: blinker 1s linear infinite;
205+
}

js/commands.js

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,27 @@ var about = (function () {
4848

4949
links = (function () {
5050
var rows = [];
51-
if (linkedin) {
52-
rows.push("<tr><td>linkedin</td><td><a href=\"" + linkedin + "\" target=\"_blank\">" + linkedin + "</a></td></tr>");
53-
}
54-
rows.push("<tr><td>github</td><td><a href=\"" + github + "\" target=\"_blank\">" + github + "</a></td></tr>");
55-
if (blog) {
56-
rows.push("<tr><td>blog</td><td><a href=\"" + blog + "\" target=\"_blank\">" + blog + "</a></td></tr>");
51+
var fullName = (TERMINAL_CONFIG.profile && TERMINAL_CONFIG.profile.name) || "Taey";
52+
53+
// If this is Taey's own page, always show fixed links
54+
if (fullName === "Taey") {
55+
var taeyGithub = "https://github.com/PythonToGo";
56+
var taeyLinkedin = "https://linkedin.com/in/taeyoungkimtaey";
57+
var taeyBlog = "https://pythontogo.github.io/";
58+
59+
rows.push("<tr><td>linkedin</td><td><a href=\"" + taeyLinkedin + "\" target=\"_blank\">" + taeyLinkedin + "</a></td></tr>");
60+
rows.push("<tr><td>github</td><td><a href=\"" + taeyGithub + "\" target=\"_blank\">" + taeyGithub + "</a></td></tr>");
61+
rows.push("<tr><td>blog</td><td><a href=\"" + taeyBlog + "\" target=\"_blank\">" + taeyBlog + "</a></td></tr>");
62+
} else {
63+
if (linkedin) {
64+
rows.push("<tr><td>linkedin</td><td><a href=\"" + linkedin + "\" target=\"_blank\">" + linkedin + "</a></td></tr>");
65+
}
66+
rows.push("<tr><td>github</td><td><a href=\"" + github + "\" target=\"_blank\">" + github + "</a></td></tr>");
67+
if (blog) {
68+
rows.push("<tr><td>blog</td><td><a href=\"" + blog + "\" target=\"_blank\">" + blog + "</a></td></tr>");
69+
}
5770
}
71+
5872
for (var k in linksOthers) {
5973
var o = linksOthers[k];
6074
rows.push("<tr><td>" + o.name + "</td><td><a href=\"" + o.url + "\" target=\"_blank\">" + o.url + "</a></td></tr>");
@@ -85,6 +99,7 @@ help = [
8599
<tr><td><span class="command">history</span></td><td>View command history</td></tr>
86100
<tr><td><span class="command">help</span></td><td>You obviously already know what this does</td></tr>
87101
<tr><td><span class="command">email</span></td><td>Do not email me</td></tr>
102+
<tr><td><span class="command">home</span></td><td>Return to the home screen</td></tr>
88103
<tr><td><span class="command">clear</span></td><td>Clear terminal</td></tr>
89104
<tr><td><span class="command">banner</span></td><td>Display the banner</td></tr>
90105
<tr><td><span class="command">theme</span></td><td>Change the theme</td></tr>
@@ -101,15 +116,29 @@ var bannerText = (TERMINAL_CONFIG.theme && TERMINAL_CONFIG.theme.bannerText) ||
101116
var bannerFontStyle = (TERMINAL_CONFIG.theme && TERMINAL_CONFIG.theme.bannerFont) || "block";
102117
banner = createAsciiBanner(bannerText, bannerFontStyle);
103118

104-
welcomeMsg = [
105-
'<span class="color2 terminal-welcome-msg">Welcome to my personal terminal-like website!</span>',
106-
"<span class=\"color2 terminal-welcome-msg\">Type </span> <span class=\"command terminal-welcome-msg\">'help'</span><span class=\"color2 terminal-welcome-msg\"> to see a list of available commands!</span>",
107-
'<span class="terminal-welcome-msg" style="font-size: 0.8em;">This terminal template was made by <a class="command" href="https://github.com/PythonToGo" target="_blank">PythonToGo</a>.</span>',
108-
"<br>",
109-
];
119+
welcomeMsg = (function () {
120+
var msgs = [
121+
'<span class="color2 terminal-welcome-msg">Welcome to my personal terminal-like website!</span>',
122+
"<span class=\"color2 terminal-welcome-msg\">Type </span> <span class=\"command terminal-welcome-msg\">'help'</span><span class=\"color2 terminal-welcome-msg\"> to see a list of available commands!</span>",
123+
];
124+
125+
var fullName = (TERMINAL_CONFIG.profile && TERMINAL_CONFIG.profile.name) || "Taey";
126+
if (fullName === "Taey") {
127+
msgs.push(
128+
'<span class="terminal-welcome-msg">Want to build your own terminal-style portfolio? Visit the <a class="command terminal-welcome-msg terminal-generator-link" href="./generator/" target="_blank">config generator</a>.</span>'
129+
);
130+
}
131+
132+
msgs.push(
133+
'<span class="terminal-welcome-msg" style="font-size: 0.8em;">This terminal template was made by <a class="command" href="https://github.com/PythonToGo" target="_blank">PythonToGo</a>.</span>'
134+
);
135+
136+
msgs.push("<br>");
137+
return msgs;
138+
})();
110139

111140
allCommands = [
112-
"help", "about", "links", "projects", "email", "linkedin", "github", "history", "clear", "banner", "theme",
141+
"help", "about", "links", "projects", "email", "linkedin", "github", "history", "home", "clear", "banner", "theme",
113142
"echo", "ping", "ls", "cd",
114143
"explain", "run", "edit",
115144
"vi", "vim", "nvim", "emacs",

js/main.js

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ function commander(cmd) {
169169
loopLines(commandsLog, "color2", 20);
170170
addLine("<br>", "command", 80 * commandsLog.length + 50);
171171
break;
172+
case "home":
173+
addLine("Returning to home screen...", "inherit no-animation", 0);
174+
setTimeout(function() {
175+
document.location.reload(true);
176+
}, 150);
177+
break;
172178
case "clear":
173179
setTimeout(function() {
174180
terminal.innerHTML = '<a id="before"></a>';
@@ -333,12 +339,29 @@ async function loopLines(name, style, time) {
333339
}
334340

335341
function setThemeCSS(theme) {
336-
// Selects other CSS theme
337-
var lnk = document.createElement('link');
338-
lnk.href = themes[theme];
339-
lnk.rel = 'stylesheet';
340-
lnk.type = 'text/css';
341-
(document.head||document.documentElement).appendChild(lnk);
342+
// Switch the active CSS theme by reusing (or creating) a single theme stylesheet link
343+
if (!themes || !themes[theme]) return;
344+
345+
var href = themes[theme];
346+
var head = document.head || document.documentElement;
347+
348+
// Prefer an existing explicitly tagged theme link
349+
var link =
350+
document.querySelector('link[rel="stylesheet"][data-terminal-theme="true"]') ||
351+
// Fallback: first stylesheet that looks like one of our theme files
352+
document.querySelector('link[rel="stylesheet"][href^="css/style_"]');
353+
354+
if (link) {
355+
link.setAttribute('href', href);
356+
link.setAttribute('data-terminal-theme', 'true');
357+
} else {
358+
link = document.createElement('link');
359+
link.rel = 'stylesheet';
360+
link.type = 'text/css';
361+
link.href = href;
362+
link.setAttribute('data-terminal-theme', 'true');
363+
head.appendChild(link);
364+
}
342365
}
343366

344367
function completeQuery(arr, query) {

0 commit comments

Comments
 (0)