PageSourceSearch

https://www.turquieeuropeenne.eu/plugins/auto/tagsphere/v0.4.0/js/jquery.tagSphere.js

js turquieeuropeenne.eu collected 2026-10-02 11:43:06 UTC 6,156 bytes, 176 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opener = _____WB$wombat$assign$function_____("opener");
10(function(){
11    var tags;
12    var defaults = {
13        height: 400,
14        width: 400,
15        radius: 150,
16        speed: 3,
17        slower: 0.99,
18        timer: 5,
19        fontMultiplier: 15,
20        tagCSSOver: {
21            border: 'solid 1px blue',
22            color: 'blue'
23        },
24        tagCSSOut: {
25            border: '',
26            color: ''
27        }
28    }
29    var forCalcs = {
30        halfHeight: null,
31        halfWidth: null,
32        hwratio: null,
33        dtr: null,
34        diametr: null,
35        speedX: null,
36        speedY: null,
37        tLength: null
38    }
39    var curState = {
40        mouseOver: null,
41        lastFy: null,
42        lastFx: null,
43        sy: null,
44        cy: null,
45        sx: null,
46        cx: null,
47        mouseX: null,
48        mouseY: null
49    }
50    var options = {};
51    jQuery.fn.tagSphere = function(opt){
52        options = jQuery.extend(defaults, opt);
53        initContainer(this);
54        initTags(this);
55        initCalcs();
56        deployTags();
57        setInterval(updateTags, options.timer);
58        return this;
59    };
60    
61    function initCalcs(){
62        forCalcs.halfHeight = options.height / 2;
63        forCalcs.halfWidth = options.width / 2;
64        forCalcs.speedX = options.speed / forCalcs.halfWidth;
65        forCalcs.speedY = options.speed / forCalcs.halfHeight;
66        forCalcs.dtr = Math.PI / 180;
67        forCalcs.diametr = options.radius * 2;
68        forCalcs.hwratio = options.height / options.width;
69        forCalcs.whratio = options.width / options.height;
70        forCalcs.tLength = tags.length - 1;
71        curState.mouseOver = false;
72        curState.lastFx = options.speed;
73        curState.lastFy = options.speed;
74    }
75    
76    function initContainer(tagCont){
77        tagCont.height(options.height);
78        tagCont.width(options.width);
79        tagCont.css({
80            'overflow': 'hidden',
81            'position': 'relative'
82        });
83        tagCont.mousemove(function(e){
84            curState.mouseX = e.pageX - this.offsetLeft;
85            curState.mouseY = e.pageY - this.offsetTop;
86        });
87        tagCont.hover(function(){
88            curState.mouseOver = true;
89        }, function(){
90            curState.mouseOver = false;
91        });
92    }
93    
94    function initTags(tagCont){
95        tags = tagCont.children('ul').children();
96        tags.css({
97            'position': 'absolute',
98            'list-style-type': 'none',
99            'list-style-position': 'outside',
100            'list-style-image': 'none'
101        });
102        for (var i = 0; i < tags.length; i++) {
103            var jTag = jQuery(tags[i]);
104            tags[i] = jTag;
105            jTag.hover(function(){
106                jQuery(this).css(options.tagCSSOver);
107            }, function(){
108                jQuery(this).css(options.tagCSSOut);
109            })
110        }
111    }
112    
113    function deployTags(){
114        var phi = 0;
115        var theta = 0;
116        var max = forCalcs.tLength + 1;
117        var i = 0;
118        while (i++ < max) {
119            phi = Math.acos(-1 + (2 * i - 1) / max);
120            theta = Math.sqrt(max * Math.PI) * phi;
121            tags[i - 1].cx = options.radius * Math.cos(theta) * Math.sin(phi);
122            tags[i - 1].cy = options.radius * Math.sin(theta) * Math.sin(phi);
123            tags[i - 1].cz = options.radius * Math.cos(phi);
124            tags[i - 1].h = jQuery(tags[i - 1]).height() / 4;
125            tags[i - 1].w = jQuery(tags[i - 1]).width() / 4;
126        }
127    }
128    
129    function calcRotation(fy, fx){
130        curState.sy = Math.sin(fy * forCalcs.dtr);
131        curState.cy = Math.cos(fy * forCalcs.dtr);
132        curState.sx = Math.sin(fx * forCalcs.dtr);
133        curState.cx = Math.cos(fx * forCalcs.dtr);
134    }
135    
136    function updateTags(){
137        var fy;
138        var fx;
139		// Pour inverser le comportement, arret si over, rotation si out ...
140		if (curState.mouseOver) {
141		 fy = curState.lastFy * options.slower;
142		 fx = curState.lastFx * options.slower;
143		}  
144		else {
145		 fy = options.speed - forCalcs.speedY * curState.mouseY;
146		 fx = forCalcs.speedX * curState.mouseX - options.speed;
147		}
148        curState.lastFy = fy;
149        curState.lastFx = fx;
150        if (Math.abs(fy) > 0.01 || Math.abs(fx) > 0.01) {
151            calcRotation(fy, fx);
152            j = -1;
153            while (j++ < forCalcs.tLength) {
154                rx1 = tags[j].cx;
155                ry1 = tags[j].cy * curState.cy + tags[j].cz * -curState.sy;
156                rz1 = tags[j].cy * curState.sy + tags[j].cz * curState.cy;
157                tags[j].cx = rx1 * curState.cx + rz1 * curState.sx;
158                tags[j].cy = tags[j].cy * curState.cy + tags[j].cz * -curState.sy;
159                tags[j].cz = rx1 * -curState.sx + rz1 * curState.cx;
160                var per = forCalcs.diametr / (forCalcs.diametr + tags[j].cz);
161                tags[j].x = tags[j].cx * per;
162                tags[j].y = tags[j].cy * per;
163                tags[j].alpha = per / 2;
164                tags[j].css({
165                    'left': forCalcs.whratio * (tags[j].x - tags[j].w * per) + forCalcs.halfWidth,
166                    'top': forCalcs.hwratio * (tags[j].y - tags[j].h * per) + forCalcs.halfHeight,
167                    'opacity': tags[j].alpha,
168                    'font-size': options.fontMultiplier * tags[j].alpha + 'px',
169                    'z-index': Math.round(-tags[j].cz)
170                });
171            }
172        }
173    }
174})()
175
176}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.