25 |
26 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/demo/scary-sound.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tholman/console-fright-night/abfec0eb1a015ae940b6250645adea2f3cbe952b/demo/scary-sound.mp3
--------------------------------------------------------------------------------
/demo/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: monospace;
3 | text-align: center;
4 | }
5 |
6 | span {
7 | font-family: helvetica;
8 | text-align: center;
9 | text-transform: uppercase;
10 | padding-left: 10px;
11 | padding-right: 10px;
12 | padding-top: 10px;
13 | padding-bottom: 10px;
14 | border: 2px solid #f5f5f5;
15 | border-radius: 6px;
16 | min-width: 22px;
17 | display: inline-block;
18 | letter-spacing: 1px;
19 | background: black;
20 | color: #f5f5f5;
21 | box-shadow: 0px 5px 0px 0px rgba(0, 0, 0, 1);
22 | }
23 |
24 | .wrap {
25 | position: absolute;
26 | font-size: 20px;
27 | left: 50%;
28 | top: 50%;
29 | width: 900px;
30 | transform: translate(-50%, -50%);
31 | margin-top: -30px;
32 | }
33 |
34 | .links {
35 | margin-top: 60px;
36 | font-size: 16px;
37 | }
38 |
39 | iframe {
40 | margin-bottom: -5px;
41 | }
42 |
43 | a, iframe {
44 | margin-left: 5px;
45 | margin-right: 5px;
46 | }
47 |
48 | .mini-wrap {
49 | display: inline-block;
50 | margin-left: 10px;
51 | margin-right: 10px;
52 | }
53 |
54 | @media (max-width: 900px) {
55 |
56 | .wrap {
57 | max-width: 900px;
58 | width: 100%;
59 | min-width: 600px;
60 | }
61 |
62 | .mini-wrap {
63 | display: block;
64 | margin-bottom: 30px;
65 | }
66 |
67 | .links a, .links iframe{
68 | display: block;
69 | }
70 |
71 | iframe {
72 | margin: auto;
73 | }
74 | }
75 |
76 | @media (max-width: 450px) {
77 | h1 {
78 | font-size: 20px;
79 | margin-bottom: 30px;
80 | }
81 |
82 | .wrap {
83 | font-size: 10px;
84 | }
85 | }
--------------------------------------------------------------------------------
/license.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Tim Holman
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | ## Console Fright Night
2 |
3 | Give someone an audio fright... or welcome, when they open the web inspector/console on your website (using Safari/Chrome... sorry!)
4 |
5 | #### Instructions
6 |
7 | `Console Fright Night` is a stand alone library (no jQuery, or the likes) so usage is pretty straight forward. You'll need to include `CFN.js` to your page, and create a new instance of `CFN`.
8 |
9 | #### Usage
10 |
11 | `Console Fright Night (CFN)` lives entirely within the JS realm, which makes things fairly simple to use.
12 |
13 | ```html
14 |
23 | ```
24 |
25 | #### But How?
26 | `CFN` defines a custom "getter" to an audio element, which is then constantly logged to the console. When the browser is actually open, this getter will be triggered, allowing us to detect that the console is open. This happens on lines 31 - 33 of `cfn.js`.
27 |
28 | Because of these console checks, it will look like your console is being spammed, but that's how it works. Not much else we can do there.
29 |
30 | #### License
31 |
32 | Console Fright Night is covered by the MIT License.
33 |
34 | Copyright (C) ~ [Tim Holman](http://tholman.com) ~ timothy.w.holman@gmail.com
35 |
--------------------------------------------------------------------------------