-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
76 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,81 @@ | ||
// To see this message, add the following to the `<head>` section in your | ||
// views/layouts/application.html.erb | ||
// | ||
// <%= vite_client_tag %> | ||
// <%= vite_javascript_tag 'application' %> | ||
import Rails from "@rails/ujs"; | ||
import "chartkick/chart.js" | ||
import "chartkick/chart.js"; | ||
import "flowbite"; | ||
|
||
Rails.start(); | ||
|
||
console.log('Vite ⚡️ Rails') | ||
|
||
// If using a TypeScript entrypoint file: | ||
// <%= vite_typescript_tag 'application' %> | ||
// | ||
// If you want to use .jsx or .tsx, add the extension: | ||
// <%= vite_javascript_tag 'application.jsx' %> | ||
|
||
console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails') | ||
|
||
// Example: Load Rails libraries in Vite. | ||
// | ||
// import * as Turbo from '@hotwired/turbo' | ||
// Turbo.start() | ||
// | ||
// import ActiveStorage from '@rails/activestorage' | ||
// ActiveStorage.start() | ||
// | ||
// // Import all channels. | ||
// const channels = import.meta.globEager('./**/*_channel.js') | ||
|
||
// Example: Import a stylesheet in app/frontend/index.css | ||
// import '~/index.css' | ||
console.log('Vite ⚡️ Rails'); | ||
console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails'); | ||
|
||
// Linkarooie console messages | ||
console.log('Linkarooie 🌐 Your ultimate link management tool'); | ||
console.log('Simplify your online presence with a single link.'); | ||
console.log('© 2024 Linkarooie. All rights reserved.'); | ||
|
||
// Easter egg for "iddqd" | ||
(function () { | ||
let inputBuffer = ''; | ||
|
||
// Listen for keypress events in the browser | ||
window.addEventListener('keydown', function (event) { | ||
inputBuffer += event.key; | ||
|
||
// Check if 'iddqd' was typed | ||
if (inputBuffer.toLowerCase().includes('iddqd')) { | ||
activateGodMode(); | ||
inputBuffer = ''; // Reset buffer after activation | ||
} | ||
|
||
// Clear the buffer if it gets too long | ||
if (inputBuffer.length > 10) inputBuffer = inputBuffer.slice(-10); | ||
}); | ||
|
||
function activateGodMode() { | ||
console.log('%c God Mode Activated! You are now invincible! ', 'background: #222; color: #bada55; font-size: 16px;'); | ||
|
||
// ASCII art | ||
const asciiArt = ` | ||
+-----------------------------------------------------------------------------+ | ||
| | |\\ -~ / \\ / | | ||
|~~__ | \\ | \\/ /\\ /| | ||
| -- | \\ | / \\ / \\ / | | ||
| |~_| \\ \\___|/ \\/ / | | ||
|--__ | -- |\\________________________________/~~\\~~| / \\ / \\ | | ||
| |~~--__ |~_|____|____|____|____|____|____|/ / \\/|\\ / \\/ \\/| | ||
| | |~--_|__|____|____|____|____|____|_/ /| |/ \\ / \\ / | | ||
|___|______|__|_||____|____|____|____|____|__[]/_|----| \\/ \\ / | | ||
| \\mmmm : | _|___|____|____|____|____|____|___| /\\| / \\ / \\ | | ||
| B :_--~~ |_|____|____|____|____|____|____| | |\\/ \\ / \\ | | ||
| __--P : | / / / | \\ / \\ /\\| | ||
|~~ | : | / ~~~ | \\ / \\ / | | ||
| | |/ .-. | /\\ \\ / | | ||
| | / | | |/ \\ /\\ | | ||
| | / | | -_ \\ / \\ | | ||
+-----------------------------------------------------------------------------+ | ||
| | /| | | 2 3 4 | /~~~~~\\ | /| |_| .... ......... | | ||
| | ~|~ | % | | | ~J~ | | ~|~ % |_| .... ......... | | ||
| AMMO | HEALTH | 5 6 7 | \\===/ | ARMOR |#| .... ......... | | ||
+-----------------------------------------------------------------------------+ | ||
`; | ||
|
||
console.log(asciiArt); | ||
|
||
// Create a div to display Doom information | ||
const infoDiv = document.createElement('div'); | ||
infoDiv.innerHTML = ` | ||
<div style="position: fixed; bottom: 20px; right: 20px; background-color: #111; color: #fff; padding: 20px; border-radius: 10px; max-width: 300px; z-index: 1000;"> | ||
<h3 style="margin: 0 0 10px 0;">You've unlocked a secret!</h3> | ||
<p>Doom is a 1993 first-person shooter game developed by id Software. It was created by John Carmack and John Romero, among others. The game is considered one of the most significant titles in video game history, pioneering immersive 3D graphics, networked multiplayer gaming, and support for custom mods and expansions.</p> | ||
<p>The "iddqd" command is a famous cheat code that grants invulnerability, often referred to as "God Mode".</p> | ||
<p>Fun Fact: The name "Doom" was inspired by a line from the movie "The Color of Money" starring Tom Cruise.</p> | ||
<button id="closeInfo" style="margin-top: 10px; padding: 5px 10px; background-color: #555; color: #fff; border: none; cursor: pointer;">Close</button> | ||
</div> | ||
`; | ||
document.body.appendChild(infoDiv); | ||
|
||
// Add event listener to the close button to remove the div | ||
document.getElementById('closeInfo').addEventListener('click', function() { | ||
document.body.removeChild(infoDiv); | ||
}); | ||
} | ||
})(); |